Documentation ¶
Index ¶
- Constants
- func GolangToMLOG(input string, options Options) (string, error)
- func GolangToMLOGBytes(input []byte, options Options) (string, error)
- func GolangToMLOGFile(fileName string, options Options) (string, error)
- func MLOGToString(ctx context.Context, statements [][]Resolvable, statement MLOGAble, ...) [][]string
- func RegisterFuncTranslation(name string, translator Translator)
- func RegisterInlineTranslation(name string, translator InlineTranslator)
- func RegisterSelector(name string, selector string)
- func RegisterValidImport(path string)
- type ContextBlock
- type ContextKey
- type ContextualError
- type DynamicVariable
- type Function
- type FunctionJumpTarget
- type Global
- type InlineTranslator
- type InlineVariable
- type JumpTarget
- type MLOG
- func (m *MLOG) GetComment(int) string
- func (m *MLOG) GetPosition() int
- func (m *MLOG) GetSourcePos(int) ast.Node
- func (m *MLOG) PostProcess(ctx context.Context, global *Global, function *Function) error
- func (m *MLOG) PreProcess(ctx context.Context, global *Global, function *Function) error
- func (m *MLOG) SetPosition(position int) int
- func (m *MLOG) SetSourcePos(pos ast.Node)
- func (m *MLOG) Size() int
- func (m *MLOG) ToMLOG() [][]Resolvable
- type MLOGAble
- type MLOGBranch
- type MLOGCustomFunction
- func (m *MLOGCustomFunction) GetComment(pos int) string
- func (m *MLOGCustomFunction) GetPosition() int
- func (m *MLOGCustomFunction) GetSourcePos(pos int) ast.Node
- func (m *MLOGCustomFunction) PostProcess(ctx context.Context, global *Global, function *Function) error
- func (m *MLOGCustomFunction) PreProcess(ctx context.Context, global *Global, function *Function) error
- func (m *MLOGCustomFunction) SetPosition(position int) int
- func (m *MLOGCustomFunction) SetSourcePos(pos ast.Node)
- func (m *MLOGCustomFunction) Size() int
- func (m *MLOGCustomFunction) ToMLOG() [][]Resolvable
- type MLOGFunc
- func (m *MLOGFunc) GetComment(int) string
- func (m *MLOGFunc) GetPosition() int
- func (m *MLOGFunc) GetSourcePos(int) ast.Node
- func (m *MLOGFunc) PostProcess(ctx context.Context, global *Global, function *Function) error
- func (m *MLOGFunc) PreProcess(ctx context.Context, global *Global, function *Function) error
- func (m *MLOGFunc) SetPosition(position int) int
- func (m *MLOGFunc) SetSourcePos(pos ast.Node)
- func (m *MLOGFunc) Size() int
- func (m *MLOGFunc) ToMLOG() [][]Resolvable
- type MLOGJump
- func (m *MLOGJump) GetComment(int) string
- func (m *MLOGJump) PostProcess(ctx context.Context, global *Global, function *Function) error
- func (m *MLOGJump) PreProcess(ctx context.Context, global *Global, function *Function) error
- func (m *MLOGJump) Size() int
- func (m *MLOGJump) ToMLOG() [][]Resolvable
- type MLOGLabel
- type MLOGStackWriter
- type MLOGStatement
- type MLOGTrampoline
- type MLOGTrampolineBack
- type MutablePosition
- type NormalVariable
- type Options
- type Processable
- type Resolvable
- type StatementJumpTarget
- type TranslateFunc
- type Translator
- type Value
- type VarReference
- type WithPosition
Constants ¶
View Source
const FunctionArgumentPrefix = `@funcArg_`
View Source
const FunctionReturnVariable = `@return`
View Source
const FunctionTrampolinePrefix = `@funcTramp_`
Variables ¶
This section is empty.
Functions ¶
func MLOGToString ¶
func RegisterFuncTranslation ¶
func RegisterFuncTranslation(name string, translator Translator)
func RegisterInlineTranslation ¶ added in v0.0.20
func RegisterInlineTranslation(name string, translator InlineTranslator)
func RegisterSelector ¶
func RegisterValidImport ¶ added in v0.0.9
func RegisterValidImport(path string)
Types ¶
type ContextBlock ¶ added in v0.0.8
type ContextBlock struct { Statements []MLOGStatement Extra []MLOGStatement }
type ContextKey ¶ added in v0.0.23
type ContextKey string
type ContextualError ¶ added in v0.0.8
type ContextualError struct { Context context.Context Pos *ast.Node // contains filtered or unexported fields }
func (ContextualError) Error ¶ added in v0.0.8
func (e ContextualError) Error() string
type DynamicVariable ¶
type DynamicVariable struct {
Name string
}
func (*DynamicVariable) GetValue ¶
func (m *DynamicVariable) GetValue() string
func (*DynamicVariable) PostProcess ¶
func (*DynamicVariable) PreProcess ¶ added in v0.0.10
type Function ¶
type Function struct { Name string Called bool Declaration *ast.FuncDecl Statements []MLOGStatement ArgumentCount int VariableCounter int ScopeVariableCounter map[string]int RootVariables []*VarReference }
type FunctionJumpTarget ¶
type FunctionJumpTarget struct { Statement WithPosition FunctionName string SourcePos ast.Node }
func (*FunctionJumpTarget) GetPosition ¶
func (m *FunctionJumpTarget) GetPosition() int
func (*FunctionJumpTarget) PostProcess ¶
func (*FunctionJumpTarget) PreProcess ¶ added in v0.0.10
func (*FunctionJumpTarget) Size ¶ added in v0.0.7
func (m *FunctionJumpTarget) Size() int
type InlineTranslator ¶ added in v0.0.20
type InlineTranslator func(args []Resolvable) (Resolvable, error)
type InlineVariable ¶ added in v0.0.26
type InlineVariable struct {
Value Resolvable
}
func (*InlineVariable) GetValue ¶ added in v0.0.26
func (m *InlineVariable) GetValue() string
func (*InlineVariable) PostProcess ¶ added in v0.0.26
func (*InlineVariable) PreProcess ¶ added in v0.0.26
type JumpTarget ¶
type JumpTarget interface { Processable WithPosition }
type MLOG ¶
type MLOG struct { Statement [][]Resolvable Position int Comment string SourcePos ast.Node }
func (*MLOG) GetComment ¶
func (*MLOG) GetPosition ¶
func (*MLOG) PostProcess ¶
func (*MLOG) PreProcess ¶ added in v0.0.10
func (*MLOG) SetPosition ¶
func (*MLOG) SetSourcePos ¶ added in v0.0.12
func (*MLOG) ToMLOG ¶
func (m *MLOG) ToMLOG() [][]Resolvable
type MLOGBranch ¶ added in v0.0.10
type MLOGBranch struct { MLOG Block *ContextBlock Token token.Token }
func (*MLOGBranch) GetComment ¶ added in v0.0.10
func (m *MLOGBranch) GetComment(int) string
func (*MLOGBranch) Size ¶ added in v0.0.10
func (m *MLOGBranch) Size() int
func (*MLOGBranch) ToMLOG ¶ added in v0.0.10
func (m *MLOGBranch) ToMLOG() [][]Resolvable
type MLOGCustomFunction ¶ added in v0.0.11
type MLOGCustomFunction struct { Position int Arguments []ast.Expr Variables []Resolvable Unresolved []MLOGStatement FunctionName string Comments map[int]string SourcePositions map[int]ast.Node SourcePos ast.Node Context context.Context }
func (*MLOGCustomFunction) GetComment ¶ added in v0.0.11
func (m *MLOGCustomFunction) GetComment(pos int) string
func (*MLOGCustomFunction) GetPosition ¶ added in v0.0.11
func (m *MLOGCustomFunction) GetPosition() int
func (*MLOGCustomFunction) GetSourcePos ¶ added in v0.0.12
func (m *MLOGCustomFunction) GetSourcePos(pos int) ast.Node
func (*MLOGCustomFunction) PostProcess ¶ added in v0.0.11
func (*MLOGCustomFunction) PreProcess ¶ added in v0.0.11
func (*MLOGCustomFunction) SetPosition ¶ added in v0.0.11
func (m *MLOGCustomFunction) SetPosition(position int) int
func (*MLOGCustomFunction) SetSourcePos ¶ added in v0.0.12
func (m *MLOGCustomFunction) SetSourcePos(pos ast.Node)
func (*MLOGCustomFunction) Size ¶ added in v0.0.11
func (m *MLOGCustomFunction) Size() int
func (*MLOGCustomFunction) ToMLOG ¶ added in v0.0.11
func (m *MLOGCustomFunction) ToMLOG() [][]Resolvable
type MLOGFunc ¶
type MLOGFunc struct { Position int Function Translator Arguments []Resolvable Variables []Resolvable Unresolved []MLOGStatement SourcePos ast.Node }
func (*MLOGFunc) GetComment ¶
func (*MLOGFunc) GetPosition ¶
func (*MLOGFunc) PostProcess ¶
func (*MLOGFunc) PreProcess ¶ added in v0.0.10
func (*MLOGFunc) SetPosition ¶
func (*MLOGFunc) SetSourcePos ¶ added in v0.0.12
func (*MLOGFunc) ToMLOG ¶
func (m *MLOGFunc) ToMLOG() [][]Resolvable
type MLOGJump ¶
type MLOGJump struct { MLOG Condition []Resolvable JumpTarget JumpTarget }
func (*MLOGJump) GetComment ¶
func (*MLOGJump) PostProcess ¶
func (*MLOGJump) PreProcess ¶ added in v0.0.10
func (*MLOGJump) ToMLOG ¶
func (m *MLOGJump) ToMLOG() [][]Resolvable
type MLOGLabel ¶ added in v0.0.23
func (*MLOGLabel) GetComment ¶ added in v0.0.23
func (*MLOGLabel) ToMLOG ¶ added in v0.0.23
func (m *MLOGLabel) ToMLOG() [][]Resolvable
type MLOGStackWriter ¶
func (*MLOGStackWriter) GetComment ¶
func (m *MLOGStackWriter) GetComment(int) string
func (*MLOGStackWriter) Size ¶ added in v0.0.23
func (m *MLOGStackWriter) Size() int
func (*MLOGStackWriter) ToMLOG ¶
func (m *MLOGStackWriter) ToMLOG() [][]Resolvable
type MLOGStatement ¶
type MLOGStatement interface { MLOGAble WithPosition MutablePosition Processable }
type MLOGTrampoline ¶
func (*MLOGTrampoline) GetComment ¶
func (m *MLOGTrampoline) GetComment(int) string
func (*MLOGTrampoline) Size ¶ added in v0.0.23
func (m *MLOGTrampoline) Size() int
func (*MLOGTrampoline) ToMLOG ¶
func (m *MLOGTrampoline) ToMLOG() [][]Resolvable
type MLOGTrampolineBack ¶
func (*MLOGTrampolineBack) GetComment ¶
func (m *MLOGTrampolineBack) GetComment(int) string
func (*MLOGTrampolineBack) PreProcess ¶ added in v0.0.12
type MutablePosition ¶
type NormalVariable ¶
func (*NormalVariable) GetValue ¶
func (m *NormalVariable) GetValue() string
func (*NormalVariable) PostProcess ¶
func (*NormalVariable) PreProcess ¶ added in v0.0.10
type Processable ¶
type Resolvable ¶
type Resolvable interface { Processable GetValue() string }
type StatementJumpTarget ¶
type StatementJumpTarget struct { Statement WithPosition After bool }
func (*StatementJumpTarget) GetPosition ¶
func (m *StatementJumpTarget) GetPosition() int
func (*StatementJumpTarget) PostProcess ¶
func (*StatementJumpTarget) PreProcess ¶ added in v0.0.10
func (*StatementJumpTarget) Size ¶ added in v0.0.7
func (m *StatementJumpTarget) Size() int
type TranslateFunc ¶ added in v0.0.23
type TranslateFunc func(args []Resolvable, vars []Resolvable) ([]MLOGStatement, error)
type Translator ¶
type Translator struct { Count func(args []Resolvable, vars []Resolvable) int Variables int Translate TranslateFunc }
type VarReference ¶ added in v0.0.26
type VarReference struct { Name string Identity Resolvable }
type WithPosition ¶
Source Files ¶
- context.go
- error.go
- expression.go
- imports.go
- inlines.go
- main.go
- operators.go
- options.go
- selectors.go
- statement.go
- translations.go
- translations_native.go
- type_base.go
- type_branch.go
- type_function.go
- type_jump.go
- type_label.go
- type_mlog.go
- type_native.go
- type_reference.go
- type_resolvable.go
- types.go
- utils.go
Click to show internal directories.
Click to hide internal directories.