Documentation
¶
Index ¶
- Constants
- Variables
- func GetNotOp(op string) string
- func GetNotOpWithError(op string) (string, error)
- func IsLogicalOperator(op string) bool
- func JavaStringToLiteral(i any) string
- type CustomValue
- type FunctionCallExpression
- func (f *FunctionCallExpression) IsSupperConstructorInvoke(funcCtx *class_context.ClassContext) bool
- func (f *FunctionCallExpression) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)
- func (f *FunctionCallExpression) String(funcCtx *class_context.ClassContext) string
- func (f *FunctionCallExpression) Type() types.JavaType
- type JavaArray
- type JavaArrayMember
- type JavaClassMember
- type JavaClassValue
- type JavaCompare
- type JavaExpression
- type JavaLiteral
- type JavaRef
- type JavaValue
- type LambdaFuncRef
- type NewExpression
- type RefMember
- type SlotValue
- type TernaryExpression
Constants ¶
View Source
const ( ADD = "add" INC = "inc" New = "new" NEQ = "!=" EQ = "==" LT = "<" GTE = ">=" GT = ">" NE = "!=" Not = "!" LTE = "<=" SUB = "-" REM = "%" DIV = "/" MUL = "*" AND = "&" OR = "|" XOR = "^" SHL = "<<" SHR = ">>" USHR = ">>>" LOGICAL_AND = "&&" LOGICAL_OR = "||" )
Variables ¶
View Source
var JavaNull = javaNull{}
Functions ¶
func GetNotOpWithError ¶
func IsLogicalOperator ¶
func JavaStringToLiteral ¶
Types ¶
type CustomValue ¶
type CustomValue struct { Flag string StringFunc func(funcCtx *class_context.ClassContext) string TypeFunc func() types.JavaType }
func NewCustomValue ¶
func NewCustomValue(stringFun func(funcCtx *class_context.ClassContext) string, typeFunc func() types.JavaType) *CustomValue
func (*CustomValue) ReplaceVar ¶
func (v *CustomValue) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)
ReplaceVar implements JavaValue.
func (*CustomValue) String ¶
func (v *CustomValue) String(funcCtx *class_context.ClassContext) string
func (*CustomValue) Type ¶
func (v *CustomValue) Type() types.JavaType
type FunctionCallExpression ¶
type FunctionCallExpression struct { IsStatic bool Object JavaValue FunctionName string ClassName string Arguments []JavaValue FuncType *types.JavaFuncType }
func NewFunctionCallExpression ¶
func NewFunctionCallExpression(object JavaValue, methodMember *JavaClassMember, funcType *types.JavaFuncType) *FunctionCallExpression
func (*FunctionCallExpression) IsSupperConstructorInvoke ¶
func (f *FunctionCallExpression) IsSupperConstructorInvoke(funcCtx *class_context.ClassContext) bool
func (*FunctionCallExpression) ReplaceVar ¶
func (f *FunctionCallExpression) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)
ReplaceVar implements JavaValue.
func (*FunctionCallExpression) String ¶
func (f *FunctionCallExpression) String(funcCtx *class_context.ClassContext) string
func (*FunctionCallExpression) Type ¶
func (f *FunctionCallExpression) Type() types.JavaType
type JavaArray ¶
func (*JavaArray) ReplaceVar ¶
func (j *JavaArray) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)
ReplaceVar implements JavaValue.
func (*JavaArray) String ¶
func (j *JavaArray) String(funcCtx *class_context.ClassContext) string
type JavaArrayMember ¶
func NewJavaArrayMember ¶
func NewJavaArrayMember(object JavaValue, index JavaValue) *JavaArrayMember
func (*JavaArrayMember) ReplaceVar ¶
func (j *JavaArrayMember) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)
ReplaceVar implements JavaValue.
func (*JavaArrayMember) String ¶
func (j *JavaArrayMember) String(funcCtx *class_context.ClassContext) string
func (*JavaArrayMember) Type ¶
func (j *JavaArrayMember) Type() types.JavaType
type JavaClassMember ¶
type JavaClassMember struct { Name string Member string Description string JavaType types.JavaType }
func NewJavaClassMember ¶
func NewJavaClassMember(typeName, member string, desc string, typ types.JavaType) *JavaClassMember
func (*JavaClassMember) ReplaceVar ¶
func (j *JavaClassMember) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)
ReplaceVar implements JavaValue.
func (*JavaClassMember) String ¶
func (j *JavaClassMember) String(funcCtx *class_context.ClassContext) string
func (*JavaClassMember) Type ¶
func (j *JavaClassMember) Type() types.JavaType
type JavaClassValue ¶
func NewJavaClassValue ¶
func NewJavaClassValue(typ types.JavaType) *JavaClassValue
func (*JavaClassValue) ReplaceVar ¶
func (j *JavaClassValue) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)
ReplaceVar implements JavaValue.
func (*JavaClassValue) String ¶
func (j *JavaClassValue) String(funcCtx *class_context.ClassContext) string
String implements JavaValue. Subtle: this method shadows the method (JavaType).String of JavaClassValue.JavaType.
func (*JavaClassValue) Type ¶
func (j *JavaClassValue) Type() types.JavaType
type JavaCompare ¶
type JavaCompare struct {
JavaValue1, JavaValue2 JavaValue
}
func NewJavaCompare ¶
func NewJavaCompare(v1, v2 JavaValue) *JavaCompare
func (*JavaCompare) ReplaceVar ¶
func (j *JavaCompare) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)
ReplaceVar implements JavaValue.
func (*JavaCompare) String ¶
func (j *JavaCompare) String(funcCtx *class_context.ClassContext) string
func (*JavaCompare) Type ¶
func (j *JavaCompare) Type() types.JavaType
type JavaExpression ¶
func NewBinaryExpression ¶
func NewBinaryExpression(value1, value2 JavaValue, op string, typ types.JavaType) *JavaExpression
func NewUnaryExpression ¶
func NewUnaryExpression(value1 JavaValue, op string, typ types.JavaType) *JavaExpression
func (*JavaExpression) ReplaceVar ¶
func (j *JavaExpression) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)
ReplaceVar implements JavaValue.
func (*JavaExpression) String ¶
func (j *JavaExpression) String(funcCtx *class_context.ClassContext) string
func (*JavaExpression) Type ¶
func (j *JavaExpression) Type() types.JavaType
type JavaLiteral ¶
func NewJavaLiteral ¶
func NewJavaLiteral(data any, typ types.JavaType) *JavaLiteral
func (*JavaLiteral) ReplaceVar ¶
func (j *JavaLiteral) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)
ReplaceVar implements JavaValue.
func (*JavaLiteral) String ¶
func (j *JavaLiteral) String(funcCtx *class_context.ClassContext) string
func (*JavaLiteral) Type ¶
func (j *JavaLiteral) Type() types.JavaType
type JavaRef ¶
type JavaRef struct { VarUid string Id *utils.VariableId StackVar JavaValue CustomValue *CustomValue IsThis bool Val JavaValue // contains filtered or unexported fields }
func NewJavaRef ¶
func (*JavaRef) ReplaceVar ¶
func (j *JavaRef) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)
ReplaceVar implements JavaValue.
func (*JavaRef) String ¶
func (j *JavaRef) String(funcCtx *class_context.ClassContext) string
type JavaValue ¶
type JavaValue interface { String(funcCtx *class_context.ClassContext) string Type() types.JavaType ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId) }
func SimplifyConditionValue ¶
func UnpackSoltValue ¶
type LambdaFuncRef ¶
type LambdaFuncRef struct { Id int JavaType types.JavaType LambdaRender func(funcCtx *class_context.ClassContext) string Arguments []JavaValue }
func (*LambdaFuncRef) String ¶
func (j *LambdaFuncRef) String(funcCtx *class_context.ClassContext) string
func (*LambdaFuncRef) Type ¶
func (j *LambdaFuncRef) Type() types.JavaType
type NewExpression ¶
type NewExpression struct { types.JavaType Length []JavaValue ArgumentsGetter func() string Initializer []JavaValue }
func NewNewArrayExpression ¶
func NewNewArrayExpression(typ types.JavaType, length ...JavaValue) *NewExpression
func NewNewExpression ¶
func NewNewExpression(typ types.JavaType) *NewExpression
func (*NewExpression) ReplaceVar ¶
func (n *NewExpression) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)
ReplaceVar implements JavaValue.
func (*NewExpression) String ¶
func (n *NewExpression) String(funcCtx *class_context.ClassContext) string
func (*NewExpression) Type ¶
func (n *NewExpression) Type() types.JavaType
type RefMember ¶
func NewRefMember ¶
func (*RefMember) ReplaceVar ¶
func (j *RefMember) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)
ReplaceVar implements JavaValue.
func (*RefMember) String ¶
func (j *RefMember) String(funcCtx *class_context.ClassContext) string
type SlotValue ¶
func (*SlotValue) ReplaceVar ¶
func (s *SlotValue) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)
ReplaceVar implements JavaValue.
func (*SlotValue) ResetValue ¶
func (*SlotValue) String ¶
func (s *SlotValue) String(funcCtx *class_context.ClassContext) string
type TernaryExpression ¶
type TernaryExpression struct { Condition JavaValue ConditionFromOp int TrueValue JavaValue FalseValue JavaValue }
func NewTernaryExpression ¶
func NewTernaryExpression(condition, v1, v2 JavaValue) *TernaryExpression
func (*TernaryExpression) ReplaceVar ¶
func (j *TernaryExpression) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)
ReplaceVar implements JavaValue.
func (*TernaryExpression) String ¶
func (j *TernaryExpression) String(funcCtx *class_context.ClassContext) string
func (*TernaryExpression) Type ¶
func (j *TernaryExpression) Type() types.JavaType
Source Files
¶
Click to show internal directories.
Click to hide internal directories.