values

package
v1.4.5-alpha0926 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

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 GetNotOp

func GetNotOp(op string) string

func GetNotOpWithError

func GetNotOpWithError(op string) (string, error)

func IsLogicalOperator

func IsLogicalOperator(op string) bool

func JavaStringToLiteral

func JavaStringToLiteral(i any) string

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 (*FunctionCallExpression) Type

type JavaArray

type JavaArray struct {
	Class    *types.JavaClass
	Length   JavaValue
	JavaType types.JavaType
}

func NewJavaArray

func NewJavaArray(class *types.JavaClass, length JavaValue) *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

func (*JavaArray) Type

func (j *JavaArray) Type() types.JavaType

type JavaArrayMember

type JavaArrayMember struct {
	Object JavaValue
	Index  JavaValue
}

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

type JavaClassValue struct {
	types.JavaType
}

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

type JavaExpression struct {
	Values []JavaValue
	Op     string
	Typ    types.JavaType
}

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

type JavaLiteral struct {
	JavaType types.JavaType
	Data     any
}

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 NewJavaRef(id *utils.VariableId, val JavaValue, typ types.JavaType) *JavaRef

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

func (*JavaRef) Type

func (j *JavaRef) Type() types.JavaType

type JavaValue

type JavaValue interface {
	String(funcCtx *class_context.ClassContext) string
	Type() types.JavaType
	ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)
}

func SimplifyConditionValue

func SimplifyConditionValue(condition JavaValue) JavaValue

func UnpackSoltValue

func UnpackSoltValue(value JavaValue) JavaValue

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

type RefMember struct {
	Member   string
	Object   JavaValue
	JavaType types.JavaType
}

func NewRefMember

func NewRefMember(object JavaValue, member string, typ types.JavaType) *RefMember

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

func (*RefMember) Type

func (j *RefMember) Type() types.JavaType

type SlotValue

type SlotValue struct {
	TmpType types.JavaType
	// contains filtered or unexported fields
}

func NewSlotValue

func NewSlotValue(val JavaValue, typ types.JavaType) *SlotValue

func (*SlotValue) GetValue

func (s *SlotValue) GetValue() JavaValue

func (*SlotValue) ReplaceVar

func (s *SlotValue) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)

ReplaceVar implements JavaValue.

func (*SlotValue) ResetValue

func (s *SlotValue) ResetValue(val JavaValue)

func (*SlotValue) String

func (s *SlotValue) String(funcCtx *class_context.ClassContext) string

func (*SlotValue) Type

func (s *SlotValue) Type() types.JavaType

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL