statements

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: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MiddleSwitch   = "switch"
	MiddleTryStart = "tryStart"
)

Variables

This section is empty.

Functions

func StatementsString

func StatementsString(statements []Statement, funcCtx *class_context.ClassContext) string

Types

type AssignStatement

type AssignStatement struct {
	LeftValue   values.JavaValue
	ArrayMember *values.JavaArrayMember
	JavaValue   values.JavaValue
	IsDeclare   bool
	IsFirst     bool
}

func NewArrayMemberAssignStatement

func NewArrayMemberAssignStatement(m *values.JavaArrayMember, value values.JavaValue) *AssignStatement

func NewAssignStatement

func NewAssignStatement(leftVal, value values.JavaValue, isFirst bool) *AssignStatement

func NewDeclareStatement

func NewDeclareStatement(leftVal values.JavaValue) *AssignStatement

func (*AssignStatement) ReplaceVar

func (a *AssignStatement) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)

ReplaceVar implements Statement.

func (*AssignStatement) String

func (a *AssignStatement) String(funcCtx *class_context.ClassContext) string

type CaseItem

type CaseItem struct {
	IsDefault bool
	IntValue  int
	Body      []Statement
}

func NewCaseItem

func NewCaseItem(v int, body []Statement) *CaseItem

type ConditionStatement

type ConditionStatement struct {
	Condition values.JavaValue
	Neg       bool
	Callback  func(values.JavaValue)
}

func NewConditionStatement

func NewConditionStatement(cmp values.JavaValue, op string) *ConditionStatement

func (*ConditionStatement) ReplaceVar

func (r *ConditionStatement) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)

ReplaceVar implements Statement.

func (*ConditionStatement) String

type CustomStatement

type CustomStatement struct {
	Name       string
	Info       any
	StringFunc func(funcCtx *class_context.ClassContext) string
	// contains filtered or unexported fields
}

func NewCustomStatement

func NewCustomStatement(stringFun func(funcCtx *class_context.ClassContext) string, replaceVar func(oldId *utils.VariableId, newId *utils.VariableId)) *CustomStatement

func (*CustomStatement) ReplaceVar

func (v *CustomStatement) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)

ReplaceVar implements Statement.

func (*CustomStatement) String

func (v *CustomStatement) String(funcCtx *class_context.ClassContext) string

type DoWhileStatement

type DoWhileStatement struct {
	Label          string
	ConditionValue values.JavaValue
	Body           []Statement
}

func NewDoWhileStatement

func NewDoWhileStatement(condition values.JavaValue, body []Statement) *DoWhileStatement

func (*DoWhileStatement) ReplaceVar

func (w *DoWhileStatement) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)

ReplaceVar implements Statement.

func (*DoWhileStatement) String

func (w *DoWhileStatement) String(funcCtx *class_context.ClassContext) string

type ExpressionStatement

type ExpressionStatement struct {
	Expression values.JavaValue
}

func NewExpressionStatement

func NewExpressionStatement(v values.JavaValue) *ExpressionStatement

func (*ExpressionStatement) ReplaceVar

func (a *ExpressionStatement) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)

ReplaceVar implements Statement.

func (*ExpressionStatement) String

type ForStatement

type ForStatement struct {
	InitVar       Statement
	Condition     *ConditionStatement
	EndExp        Statement
	SubStatements []Statement
}

func NewForStatement

func NewForStatement(subStatements []Statement) *ForStatement

func (*ForStatement) ReplaceVar

func (f *ForStatement) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)

ReplaceVar implements Statement.

func (*ForStatement) String

func (f *ForStatement) String(funcCtx *class_context.ClassContext) string

type GOTOStatement

type GOTOStatement struct {
	ToStatement int
}

func NewGOTOStatement

func NewGOTOStatement() *GOTOStatement

func (*GOTOStatement) ReplaceVar

func (g *GOTOStatement) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)

ReplaceVar implements Statement.

func (*GOTOStatement) String

func (g *GOTOStatement) String(funcCtx *class_context.ClassContext) string

type IfStatement

type IfStatement struct {
	Condition values.JavaValue
	IfBody    []Statement
	ElseBody  []Statement
}

func NewIfStatement

func NewIfStatement(condition values.JavaValue, ifBody, elseBody []Statement) *IfStatement

func (*IfStatement) ReplaceVar

func (g *IfStatement) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)

func (*IfStatement) String

func (g *IfStatement) String(funcCtx *class_context.ClassContext) string

type MiddleStatement

type MiddleStatement struct {
	Data any
	Flag string
}

func NewMiddleStatement

func NewMiddleStatement(flag string, d any) *MiddleStatement

func (*MiddleStatement) ReplaceVar

func (a *MiddleStatement) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)

ReplaceVar implements Statement.

func (*MiddleStatement) String

func (a *MiddleStatement) String(funcCtx *class_context.ClassContext) string

type NewStatement

type NewStatement struct {
	Class *types.JavaClass
}

func NewNewStatement

func NewNewStatement(class *types.JavaClass) *NewStatement

func (*NewStatement) ReplaceVar

func (a *NewStatement) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)

ReplaceVar implements Statement.

func (*NewStatement) String

func (a *NewStatement) String(funcCtx *class_context.ClassContext) string

type ReturnStatement

type ReturnStatement struct {
	JavaValue values.JavaValue
}

func NewReturnStatement

func NewReturnStatement(value values.JavaValue) *ReturnStatement

func (*ReturnStatement) ReplaceVar

func (r *ReturnStatement) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)

ReplaceVar implements Statement.

func (*ReturnStatement) String

func (r *ReturnStatement) String(funcCtx *class_context.ClassContext) string

type StackAssignStatement

type StackAssignStatement struct {
	Id        int
	JavaValue *values.JavaRef
}

func NewStackAssignStatement

func NewStackAssignStatement(id int, value *values.JavaRef) *StackAssignStatement

func (*StackAssignStatement) ReplaceVar

func (a *StackAssignStatement) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)

ReplaceVar implements Statement.

func (*StackAssignStatement) String

type Statement

type Statement interface {
	String(funcCtx *class_context.ClassContext) string
	ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)
}

type SwitchStatement

type SwitchStatement struct {
	Value values.JavaValue
	Cases []*CaseItem
}

func NewSwitchStatement

func NewSwitchStatement(value values.JavaValue, cases []*CaseItem) *SwitchStatement

func (*SwitchStatement) ReplaceVar

func (a *SwitchStatement) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)

ReplaceVar implements Statement.

func (*SwitchStatement) String

func (a *SwitchStatement) String(funcCtx *class_context.ClassContext) string

type SynchronizedStatement

type SynchronizedStatement struct {
	Argument values.JavaValue
	Body     []Statement
}

func NewSynchronizedStatement

func NewSynchronizedStatement(val values.JavaValue, body []Statement) *SynchronizedStatement

func (*SynchronizedStatement) ReplaceVar

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

ReplaceVar implements Statement.

func (*SynchronizedStatement) String

type TryCatchStatement

type TryCatchStatement struct {
	Exception   []*values.JavaRef
	TryBody     []Statement
	CatchBodies [][]Statement
}

func NewTryCatchStatement

func NewTryCatchStatement(body1 []Statement, body2 [][]Statement) *TryCatchStatement

func (*TryCatchStatement) ReplaceVar

func (w *TryCatchStatement) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)

ReplaceVar implements Statement.

func (*TryCatchStatement) String

func (w *TryCatchStatement) String(funcCtx *class_context.ClassContext) string

type WhileStatement

type WhileStatement struct {
	ConditionValue values.JavaValue
	Body           []Statement
}

func NewWhileStatement

func NewWhileStatement(condition values.JavaValue, body []Statement) *WhileStatement

func (*WhileStatement) ReplaceVar

func (w *WhileStatement) ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId)

ReplaceVar implements Statement.

func (*WhileStatement) String

func (w *WhileStatement) String(funcCtx *class_context.ClassContext) string

Jump to

Keyboard shortcuts

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