Documentation ¶
Index ¶
- Constants
- Variables
- type ASTNode
- type AssertNode
- type AssignNode
- type BinaryNode
- type BlockNode
- type BreakNode
- type BuiltinFunctionNode
- type ChanRecv
- type ChanSend
- type CompileContext
- func (c *CompileContext) AddBuiltType(dtb *common.DataTypeBuilder)
- func (c *CompileContext) AddEnum(name string, e map[string]int32)
- func (c *CompileContext) AddType(name string, dType *common.DataType)
- func (c *CompileContext) CurrentFunctionMeta() *common.FunctionMeta
- func (c *CompileContext) FindFuncType(meta *common.FunctionMeta) *common.DataType
- func (c *CompileContext) FindMapType(key, value string) *common.DataType
- func (c *CompileContext) FindSliceType(name string) *common.DataType
- func (c *CompileContext) FindType(name string) *common.DataType
- func (c *CompileContext) GetEnums(name string) interface{}
- func (c *CompileContext) GetREnums(name string) map[int32]string
- func (c *CompileContext) Include(libName string)
- func (c *CompileContext) MakeChildScope()
- func (c *CompileContext) MakeFunctionScope()
- func (c *CompileContext) PopFunctionMeta()
- func (c *CompileContext) PushFunctionMeta(meta *common.FunctionMeta)
- func (c *CompileContext) ReturnParentScope()
- type ConstructorNode
- type ContinueNode
- type ConvertNode
- type EnumNode
- type FetchSymbolNode
- type ForMapNode
- type ForNode
- type ForSliceNode
- type FunctionAssignNode
- type FunctionCallNode
- type FunctionDefNode
- type IfNode
- type IndexNode
- type IndicesNode
- type InitializationKVNode
- type InitializationSliceNode
- type LeftUnaryNode
- type MapMultiIndexNode
- type MessageFieldDef
- type MessageTypeDef
- type Node
- func (n *Node) AppendInstruction(instruction ...common.Instruction)
- func (n *Node) CheckIsConstant()
- func (n *Node) Compile(_ *CompileContext)
- func (n *Node) ErrorWithSource(message string) string
- func (n *Node) GetConstantValue() interface{}
- func (n *Node) GetDataType() *common.DataType
- func (n *Node) GetInstructions() []common.Instruction
- func (n *Node) GetStackIncrement() int
- func (n *Node) GetText() string
- func (n *Node) IsStackPtr() bool
- func (n *Node) IsVariadic() bool
- func (n *Node) PostProcess()
- func (n *Node) SetDataType(dt *common.DataType)
- func (n *Node) SetLhs()
- func (n *Node) SetRequiredType(dt *common.DataType)
- func (n *Node) SetSource(ctx antlr.ParserRuleContext)
- func (n *Node) SetStackPtr()
- type OneofFieldDef
- type ParamNode
- type ProgramRoot
- type RestoreStackNode
- type ReturnNode
- type RightUnaryNode
- type SelectorNode
- type SliceFilterNode
- type SliceIterator
- type SliceMultiIndexNode
- type SwitchNode
- type SymbolNode
- type TypeDefNode
- type TypeNode
- type TypeNodeType
- type ValueNode
Constants ¶
View Source
const ( SimpleType = iota SliceType MapType ChanType FuncType )
Variables ¶
View Source
var BreakPlaceHolder = func(m *common.Memory, stk *common.Stack) {}
View Source
var ContinuePlaceHolder = func(m *common.Memory, stk *common.Stack) {}
Functions ¶
This section is empty.
Types ¶
type ASTNode ¶
type ASTNode interface { Compile(c *CompileContext) SetLhs() SetRequiredType(dt *common.DataType) GetDataType() *common.DataType SetDataType(*common.DataType) IsVariadic() bool GetInstructions() []common.Instruction AppendInstruction(instruction ...common.Instruction) GetConstantValue() interface{} CheckIsConstant() PostProcess() SetSource(ctx antlr.ParserRuleContext) GetText() string ErrorWithSource(string) string SetStackPtr() IsStackPtr() bool GetStackIncrement() int }
type AssertNode ¶
func (*AssertNode) CheckIsConstant ¶
func (a *AssertNode) CheckIsConstant()
func (*AssertNode) Compile ¶
func (a *AssertNode) Compile(c *CompileContext)
type AssignNode ¶
func (*AssignNode) Compile ¶
func (n *AssignNode) Compile(c *CompileContext)
type BinaryNode ¶
func (*BinaryNode) CheckIsConstant ¶
func (n *BinaryNode) CheckIsConstant()
func (*BinaryNode) Compile ¶
func (n *BinaryNode) Compile(c *CompileContext)
type BreakNode ¶
type BreakNode struct {
Node
}
func (*BreakNode) Compile ¶
func (b *BreakNode) Compile(_ *CompileContext)
type BuiltinFunctionNode ¶
func (*BuiltinFunctionNode) Compile ¶
func (b *BuiltinFunctionNode) Compile(c *CompileContext)
type CompileContext ¶
type CompileContext struct { TypeRegistry *common.TypeRegistry Scope *common.Scope FunctionInfo []*common.FunctionMeta }
func (*CompileContext) AddBuiltType ¶
func (c *CompileContext) AddBuiltType(dtb *common.DataTypeBuilder)
func (*CompileContext) AddType ¶
func (c *CompileContext) AddType(name string, dType *common.DataType)
func (*CompileContext) CurrentFunctionMeta ¶
func (c *CompileContext) CurrentFunctionMeta() *common.FunctionMeta
func (*CompileContext) FindFuncType ¶
func (c *CompileContext) FindFuncType(meta *common.FunctionMeta) *common.DataType
func (*CompileContext) FindMapType ¶
func (c *CompileContext) FindMapType(key, value string) *common.DataType
func (*CompileContext) FindSliceType ¶
func (c *CompileContext) FindSliceType(name string) *common.DataType
func (*CompileContext) GetEnums ¶
func (c *CompileContext) GetEnums(name string) interface{}
func (*CompileContext) Include ¶
func (c *CompileContext) Include(libName string)
func (*CompileContext) MakeChildScope ¶
func (c *CompileContext) MakeChildScope()
func (*CompileContext) MakeFunctionScope ¶
func (c *CompileContext) MakeFunctionScope()
func (*CompileContext) PopFunctionMeta ¶
func (c *CompileContext) PopFunctionMeta()
func (*CompileContext) PushFunctionMeta ¶
func (c *CompileContext) PushFunctionMeta(meta *common.FunctionMeta)
func (*CompileContext) ReturnParentScope ¶
func (c *CompileContext) ReturnParentScope()
type ConstructorNode ¶
func (*ConstructorNode) Compile ¶
func (n *ConstructorNode) Compile(c *CompileContext)
type ContinueNode ¶
type ContinueNode struct {
Node
}
func (*ContinueNode) Compile ¶
func (c *ContinueNode) Compile(_ *CompileContext)
type ConvertNode ¶
func (*ConvertNode) CheckIsConstant ¶
func (b *ConvertNode) CheckIsConstant()
func (*ConvertNode) Compile ¶
func (b *ConvertNode) Compile(c *CompileContext)
type FetchSymbolNode ¶
func (*FetchSymbolNode) CheckIsConstant ¶
func (v *FetchSymbolNode) CheckIsConstant()
func (*FetchSymbolNode) Compile ¶
func (v *FetchSymbolNode) Compile(c *CompileContext)
type ForMapNode ¶
func (*ForMapNode) Compile ¶
func (f *ForMapNode) Compile(c *CompileContext)
type ForSliceNode ¶
func (*ForSliceNode) Compile ¶
func (f *ForSliceNode) Compile(c *CompileContext)
type FunctionAssignNode ¶
func (*FunctionAssignNode) Compile ¶
func (f *FunctionAssignNode) Compile(c *CompileContext)
type FunctionCallNode ¶
type FunctionCallNode struct { Node Function ASTNode Params []ASTNode Meta *common.FunctionMeta }
func (*FunctionCallNode) Compile ¶
func (f *FunctionCallNode) Compile(c *CompileContext)
type FunctionDefNode ¶
type FunctionDefNode struct { Node FuncName string Block ASTNode InParam []ASTNode OutParam []ASTNode TailArray bool Function *common.Instruction }
func (*FunctionDefNode) Compile ¶
func (f *FunctionDefNode) Compile(c *CompileContext)
type IndexNode ¶
func (*IndexNode) CheckIsConstant ¶
func (i *IndexNode) CheckIsConstant()
func (*IndexNode) Compile ¶
func (i *IndexNode) Compile(c *CompileContext)
type IndicesNode ¶
func (*IndicesNode) CheckIsConstant ¶
func (i *IndicesNode) CheckIsConstant()
func (*IndicesNode) Compile ¶
func (i *IndicesNode) Compile(c *CompileContext)
type InitializationKVNode ¶
func (*InitializationKVNode) Compile ¶
func (i *InitializationKVNode) Compile(c *CompileContext)
type InitializationSliceNode ¶
func (*InitializationSliceNode) Compile ¶
func (i *InitializationSliceNode) Compile(c *CompileContext)
type LeftUnaryNode ¶
func (*LeftUnaryNode) CheckIsConstant ¶
func (u *LeftUnaryNode) CheckIsConstant()
func (*LeftUnaryNode) Compile ¶
func (u *LeftUnaryNode) Compile(c *CompileContext)
type MapMultiIndexNode ¶
func (*MapMultiIndexNode) CheckIsConstant ¶
func (m *MapMultiIndexNode) CheckIsConstant()
func (*MapMultiIndexNode) Compile ¶
func (m *MapMultiIndexNode) Compile(c *CompileContext)
type MessageFieldDef ¶
type MessageTypeDef ¶
type MessageTypeDef struct { Node Name string Field map[string]ASTNode OneOfGroup map[string][]string }
func (*MessageTypeDef) Compile ¶
func (t *MessageTypeDef) Compile(c *CompileContext)
type Node ¶
type Node struct { LineNumber int Text string Instructions []common.Instruction DataType *common.DataType RequiredType *common.DataType StackPtr bool LhsFlag bool Variadic bool StackIncrement int ConstantValue interface{} }
func (*Node) AppendInstruction ¶
func (n *Node) AppendInstruction(instruction ...common.Instruction)
func (*Node) CheckIsConstant ¶
func (n *Node) CheckIsConstant()
func (*Node) Compile ¶
func (n *Node) Compile(_ *CompileContext)
func (*Node) ErrorWithSource ¶
func (*Node) GetConstantValue ¶
func (n *Node) GetConstantValue() interface{}
func (*Node) GetDataType ¶
func (*Node) GetInstructions ¶
func (n *Node) GetInstructions() []common.Instruction
func (*Node) GetStackIncrement ¶
func (*Node) IsStackPtr ¶
func (*Node) IsVariadic ¶
func (*Node) PostProcess ¶
func (n *Node) PostProcess()
func (*Node) SetDataType ¶
func (*Node) SetRequiredType ¶
func (*Node) SetSource ¶
func (n *Node) SetSource(ctx antlr.ParserRuleContext)
func (*Node) SetStackPtr ¶
func (n *Node) SetStackPtr()
type OneofFieldDef ¶
type OneofFieldDef struct { Node Name string Choices []*MessageFieldDef }
type ProgramRoot ¶
func (*ProgramRoot) Compile ¶
func (p *ProgramRoot) Compile(c *CompileContext)
type RestoreStackNode ¶
func (*RestoreStackNode) Compile ¶
func (b *RestoreStackNode) Compile(c *CompileContext)
type ReturnNode ¶
func (*ReturnNode) Compile ¶
func (r *ReturnNode) Compile(c *CompileContext)
type RightUnaryNode ¶
func (*RightUnaryNode) Compile ¶
func (u *RightUnaryNode) Compile(c *CompileContext)
type SelectorNode ¶
func (*SelectorNode) CheckIsConstant ¶
func (s *SelectorNode) CheckIsConstant()
func (*SelectorNode) Compile ¶
func (s *SelectorNode) Compile(c *CompileContext)
type SliceFilterNode ¶
func (*SliceFilterNode) CheckIsConstant ¶
func (s *SliceFilterNode) CheckIsConstant()
func (*SliceFilterNode) Compile ¶
func (s *SliceFilterNode) Compile(c *CompileContext)
type SliceIterator ¶
type SliceIterator struct {
// contains filtered or unexported fields
}
func InitSliceIterator ¶
func InitSliceIterator(s []interface{}) *SliceIterator
func (*SliceIterator) Item ¶
func (i *SliceIterator) Item() interface{}
func (*SliceIterator) Next ¶
func (i *SliceIterator) Next() bool
type SliceMultiIndexNode ¶
func (*SliceMultiIndexNode) CheckIsConstant ¶
func (s *SliceMultiIndexNode) CheckIsConstant()
func (*SliceMultiIndexNode) Compile ¶
func (s *SliceMultiIndexNode) Compile(c *CompileContext)
type SwitchNode ¶
func (*SwitchNode) Compile ¶
func (s *SwitchNode) Compile(c *CompileContext)
type SymbolNode ¶
type SymbolNode struct { Node SymbolName string SymbolType common.SymbolType DataTypeNode ASTNode ValueToAssign ASTNode }
func (*SymbolNode) Compile ¶
func (t *SymbolNode) Compile(c *CompileContext)
type TypeDefNode ¶
type TypeDefNode struct { Node SimpleTypeName string TypeNodeType TypeNodeType Key *common.DataType // map Value ASTNode // map slice chan InParam []ASTNode // func OutParam []ASTNode // func TailArray bool }
func (*TypeDefNode) Compile ¶
func (t *TypeDefNode) Compile(c *CompileContext)
type TypeNode ¶
type TypeNode struct { Node SimpleTypeName string TypeNodeType TypeNodeType Key *common.DataType // map Value ASTNode // map slice chan InParam []ASTNode // func OutParam []ASTNode // func TailArray bool }
func (*TypeNode) Compile ¶
func (t *TypeNode) Compile(c *CompileContext)
type TypeNodeType ¶
type TypeNodeType int
Click to show internal directories.
Click to hide internal directories.