Documentation
¶
Index ¶
- Constants
- func StatementsString(statements []Statement, funcCtx *class_context.ClassContext) string
- type AssignStatement
- type CaseItem
- type ConditionStatement
- type CustomStatement
- type DoWhileStatement
- type ExpressionStatement
- type ForStatement
- type GOTOStatement
- type IfStatement
- type MiddleStatement
- type NewStatement
- type ReturnStatement
- type StackAssignStatement
- type Statement
- type SwitchStatement
- type SynchronizedStatement
- type TryCatchStatement
- type WhileStatement
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 ¶
func NewCaseItem ¶
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 ¶
func (r *ConditionStatement) String(funcCtx *class_context.ClassContext) 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 ¶
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 ¶
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 ¶
func (a *ExpressionStatement) String(funcCtx *class_context.ClassContext) 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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
func (a *StackAssignStatement) String(funcCtx *class_context.ClassContext) string
type Statement ¶
type Statement interface { String(funcCtx *class_context.ClassContext) string ReplaceVar(oldId *utils.VariableId, newId *utils.VariableId) }
type SwitchStatement ¶
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 ¶
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 ¶
func (s *SynchronizedStatement) String(funcCtx *class_context.ClassContext) 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 ¶
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
Click to show internal directories.
Click to hide internal directories.