Documentation ¶
Index ¶
- type AddOp
- type Arguments
- type ArrayExpr
- type Assignment
- type Block
- type BreakStmt
- type Builder
- func (b *Builder) AppendErr(err error)
- func (b *Builder) EnterEveryRule(ctx antlr.ParserRuleContext)
- func (b *Builder) EnterSourceMain(ctx *needle.SourceMainContext)
- func (b *Builder) ExitSourceMain(ctx *needle.SourceMainContext)
- func (b *Builder) GetNextId() int32
- func (b *Builder) GetSourceMain() *SourceMain
- type Comment
- type ContinueStmt
- type ContractCall
- type ContractDef
- type ContractPart
- type DataDef
- type DataPart
- type ElseBody
- type ErrorStmt
- type Expr
- type ExprList
- type FuncDef
- type FuncSignature
- type FuncTail
- type IdentifierList
- type IdentifierVar
- type IfBody
- type IfStmt
- type IncDecStmt
- type IndexExpr
- type Literal
- type LogicalOp
- type MapExpr
- type MulOp
- type NumberLiteral
- type Operand
- type OperatorType
- type Pair
- type PairList
- type Parameter
- type ParameterList
- type PrimaryExpr
- type RelOp
- type ReturnParameters
- type ReturnStmt
- type SettingsDef
- type SimpleStmt
- type SliceExpr
- type SourceMain
- type SrcPos
- type Statement
- type StatementList
- type StringLiteral
- type TreeType
- type UnaryOp
- type VarDef
- type WhileStmt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddOp ¶
type AddOp struct { *Builder Id int32 Src SrcPos TreeType TreeType Op string LeftExpr *Expr RightExpr *Expr }
func (*AddOp) Parse ¶
func (a *AddOp) Parse(exprCtx needle.IExprContext, ctx needle.IAdd_opContext)
type Arguments ¶
type Arguments struct { *Builder Id int32 Src SrcPos TreeType TreeType ExprList *ExprList Ellipsis bool }
func NewArguments ¶
func (*Arguments) Parse ¶
func (a *Arguments) Parse(ctx needle.IArgumentsContext)
type ArrayExpr ¶
type ArrayExpr struct { *Builder Id int32 Src SrcPos TreeType TreeType ExprList *ExprList Comma bool }
func NewArrayExpr ¶
func (*ArrayExpr) Parse ¶
func (a *ArrayExpr) Parse(ctx needle.IArrayExprContext)
type Assignment ¶
type Assignment struct { *Builder Id int32 Src SrcPos TreeType TreeType Op string LeftExpr []*Expr RightExpr []*Expr }
func NewAssignment ¶
func NewAssignment(b *Builder) *Assignment
func (*Assignment) Parse ¶
func (a *Assignment) Parse(ctx needle.IAssignmentContext)
type Block ¶
type Block struct { *Builder Id int32 Src SrcPos TreeType TreeType StatementList *StatementList }
func (*Block) Parse ¶
func (b *Block) Parse(ctx needle.IBlockContext)
type BreakStmt ¶
func NewBreakStmt ¶
func (*BreakStmt) Parse ¶
func (b *BreakStmt) Parse(ctx needle.IBreakStmtContext)
type Builder ¶
type Builder struct { *needle.BaseNeedleParserListener Comments []*Comment Errors []error // contains filtered or unexported fields }
func NewBuilder ¶
func NewBuilder(parser *needle.NeedleParser, input []byte) *Builder
func (*Builder) EnterEveryRule ¶
func (b *Builder) EnterEveryRule(ctx antlr.ParserRuleContext)
func (*Builder) EnterSourceMain ¶
func (b *Builder) EnterSourceMain(ctx *needle.SourceMainContext)
func (*Builder) ExitSourceMain ¶
func (b *Builder) ExitSourceMain(ctx *needle.SourceMainContext)
func (*Builder) GetSourceMain ¶
func (b *Builder) GetSourceMain() *SourceMain
type ContinueStmt ¶
func NewContinueStmt ¶
func NewContinueStmt(b *Builder) *ContinueStmt
func (*ContinueStmt) Parse ¶
func (c *ContinueStmt) Parse(ctx needle.IContinueStmtContext)
type ContractCall ¶
type ContractCall struct { *Builder Id int32 Src SrcPos TreeType TreeType Name string Arguments *Arguments }
func NewContractCall ¶
func NewContractCall(b *Builder) *ContractCall
func (*ContractCall) Parse ¶
func (c *ContractCall) Parse(ctx needle.IContractCallContext)
type ContractDef ¶
type ContractDef struct { *Builder Id int32 Src SrcPos TreeType TreeType Name string NamePos SrcPos ContractParts []*ContractPart }
func NewContractDef ¶
func NewContractDef(b *Builder) *ContractDef
func (*ContractDef) Parse ¶
func (d *ContractDef) Parse(ctx needle.IContractDefContext, main *SourceMain)
type ContractPart ¶
type ContractPart struct { *Builder Id int32 Src SrcPos TreeType TreeType DataDef *DataDef SettingsDef *SettingsDef FuncDef *FuncDef }
func NewContractPart ¶
func NewContractPart(b *Builder) *ContractPart
func (*ContractPart) Parse ¶
func (d *ContractPart) Parse(ctx needle.IContractPartContext)
type DataDef ¶
func NewDataDef ¶
func (*DataDef) Parse ¶
func (d *DataDef) Parse(ctx *needle.DataDefContext)
type DataPart ¶
type DataPart struct { *Builder Id int32 Src SrcPos TreeType TreeType Name string Typename string Tag string }
func NewDataPart ¶
func (*DataPart) Parse ¶
func (l *DataPart) Parse(ctx needle.IDataPartContext)
type ElseBody ¶
func NewElseBody ¶
func (*ElseBody) Parse ¶
func (e *ElseBody) Parse(ctx needle.IElseBodyContext)
type ErrorStmt ¶
type ErrorStmt struct { *Builder Id int32 Src SrcPos Kind TreeType TreeType TreeType Type string Expr *Expr }
func NewErrorStmt ¶
func (*ErrorStmt) Parse ¶
func (e *ErrorStmt) Parse(ctx needle.IErrorStmtContext)
type Expr ¶
type Expr struct { *Builder Id int32 Src SrcPos Kind TreeType TreeType TreeType PrimaryExpr *PrimaryExpr IndexExpr *IndexExpr SliceExpr *SliceExpr MapExpr *MapExpr ArrayExpr *ArrayExpr ContractCall *ContractCall MulOp *MulOp AddOp *AddOp RelOp *RelOp LogicalOp *LogicalOp UnaryOp *UnaryOp }
func (*Expr) Parse ¶
func (e *Expr) Parse(ctx needle.IExprContext)
type ExprList ¶
func NewExprList ¶
func (*ExprList) Parse ¶
func (e *ExprList) Parse(ctx needle.IExprListContext)
type FuncDef ¶
type FuncDef struct { *Builder Id int32 Src SrcPos TreeType TreeType Name string FuncSignature *FuncSignature Body *Block }
func NewFuncDef ¶
func (*FuncDef) Parse ¶
func (d *FuncDef) Parse(ctx needle.IFuncDefContext)
type FuncSignature ¶
type FuncSignature struct { *Builder Id int32 Src SrcPos TreeType TreeType ParameterList *ParameterList FuncTail []*FuncTail ReturnParameters *ReturnParameters }
func NewFuncSignature ¶
func NewFuncSignature(b *Builder) *FuncSignature
func (*FuncSignature) HasTail ¶
func (d *FuncSignature) HasTail() bool
func (*FuncSignature) Parse ¶
func (d *FuncSignature) Parse(ctx needle.IFuncSignatureContext)
type FuncTail ¶
type FuncTail struct { *Builder Id int32 Src SrcPos Name string TreeType TreeType ParameterList *ParameterList }
func NewFuncTail ¶
func (*FuncTail) Parse ¶
func (d *FuncTail) Parse(ctx needle.IFuncTailContext)
type IdentifierList ¶
func NewIdentifierList ¶
func NewIdentifierList(b *Builder) *IdentifierList
func (*IdentifierList) Parse ¶
func (i *IdentifierList) Parse(ctx needle.IIdentifierListContext)
type IdentifierVar ¶
func NewIdentifierVar ¶
func NewIdentifierVar(b *Builder) *IdentifierVar
func (*IdentifierVar) Parse ¶
func (i *IdentifierVar) Parse(ctx needle.IIdentifierVarContext)
type IncDecStmt ¶
type IncDecStmt struct { *Builder Id int32 Src SrcPos TreeType TreeType OpPos SrcPos Operator string Expression *Expr }
func NewIncDecStmt ¶
func NewIncDecStmt(b *Builder) *IncDecStmt
func (*IncDecStmt) Parse ¶
func (i *IncDecStmt) Parse(ctx needle.IIncDecStmtContext)
type IndexExpr ¶
func NewIndexExpr ¶
func (*IndexExpr) Parse ¶
func (i *IndexExpr) Parse(exprCtx needle.IExprContext, ctx needle.IIndexExprContext)
type Literal ¶
type Literal struct { *Builder Id int32 Src SrcPos Kind TreeType TreeType TreeType Value, HexValue string }
func NewLiteral ¶
func (*Literal) Parse ¶
func (d *Literal) Parse(ctx needle.ILiteralContext)
type LogicalOp ¶
type LogicalOp struct { *Builder Id int32 Src SrcPos TreeType TreeType Op string LeftExpr *Expr RightExpr *Expr }
func NewLogicalOp ¶
func (*LogicalOp) Parse ¶
func (l *LogicalOp) Parse(exprCtx needle.IExprContext, ctx needle.ILogical_opContext)
type MapExpr ¶
func NewMapExpr ¶
func (*MapExpr) Parse ¶
func (o *MapExpr) Parse(ctx needle.IMapExprContext)
type MulOp ¶
type MulOp struct { *Builder Id int32 Src SrcPos TreeType TreeType Op string LeftExpr *Expr RightExpr *Expr }
func (*MulOp) Parse ¶
func (m *MulOp) Parse(exprCtx needle.IExprContext, ctx needle.IMul_opContext)
type NumberLiteral ¶
func NewNumberLiteral ¶
func NewNumberLiteral(b *Builder) *NumberLiteral
func (*NumberLiteral) Parse ¶
func (d *NumberLiteral) Parse(ctx needle.INumberLiteralContext)
type Operand ¶
type Operand struct { *Builder Id int32 Src SrcPos TreeType TreeType IdentifierVar *IdentifierVar Literal *Literal Expr *Expr }
func NewOperand ¶
func (*Operand) Parse ¶
func (o *Operand) Parse(ctx needle.IOperandContext)
type OperatorType ¶
type OperatorType int32
const ( OperatorType_None_Default OperatorType = iota OperatorType_NOT OperatorType_MUL OperatorType_ADD OperatorType_SUB OperatorType_QUO OperatorType_LESS OperatorType_GREATER OperatorType_NOT_EQ OperatorType_AND OperatorType_LESS_EQ OperatorType_EQ_EQ OperatorType_GR_EQ OperatorType_OR OperatorType_BIT_AND OperatorType_BIT_OR OperatorType_BIT_XOR OperatorType_MOD OperatorType_LSHIFT OperatorType_RSHIFT OperatorType_ADD_EQ OperatorType_SUB_EQ OperatorType_MUL_EQ OperatorType_DIV_EQ OperatorType_MOD_EQ OperatorType_LSHIFT_EQ OperatorType_RSHIFT_EQ OperatorType_BIT_AND_EQ OperatorType_BIT_OR_EQ OperatorType_BIT_XOR_EQ OperatorType_INC OperatorType_DEC )
func (OperatorType) String ¶
func (i OperatorType) String() string
type PairList ¶
func NewPairList ¶
func (*PairList) Parse ¶
func (l *PairList) Parse(ctx needle.IPairListContext)
type Parameter ¶
type Parameter struct { *Builder Id int32 Src SrcPos TreeType TreeType NameList []*IdentifierList TypeName []string }
func NewParameter ¶
func (*Parameter) Parse ¶
func (p *Parameter) Parse(ctx needle.IParameterContext)
type ParameterList ¶
type ParameterList struct { *Builder Id int32 Src SrcPos TreeType TreeType Parameter *Parameter Variadic bool Identifier string }
func NewParameterList ¶
func NewParameterList(b *Builder) *ParameterList
func (*ParameterList) Parse ¶
func (p *ParameterList) Parse(ctx needle.IParameterListContext)
type PrimaryExpr ¶
type PrimaryExpr struct { *Builder Id int32 Src SrcPos PrimaryExpr *PrimaryExpr TreeType TreeType Operand *Operand Arguments *Arguments }
func NewPrimaryExpr ¶
func NewPrimaryExpr(b *Builder) *PrimaryExpr
func (*PrimaryExpr) Parse ¶
func (p *PrimaryExpr) Parse(ctx needle.IPrimaryExprContext)
type RelOp ¶
type RelOp struct { *Builder Id int32 Src SrcPos TreeType TreeType Op string LeftExpr *Expr RightExpr *Expr }
func (*RelOp) Parse ¶
func (r *RelOp) Parse(exprCtx needle.IExprContext, ctx needle.IRel_opContext)
type ReturnParameters ¶
func NewReturnParameters ¶
func NewReturnParameters(b *Builder) *ReturnParameters
func (*ReturnParameters) Parse ¶
func (r *ReturnParameters) Parse(ctx needle.IReturnParametersContext)
type ReturnStmt ¶
func NewReturnStmt ¶
func NewReturnStmt(b *Builder) *ReturnStmt
func (*ReturnStmt) Parse ¶
func (r *ReturnStmt) Parse(ctx needle.IReturnStmtContext)
type SettingsDef ¶
type SettingsDef struct { *Builder Id int32 Src SrcPos TreeType TreeType SettingValue []*Literal SettingsName []string }
func NewSettingsDef ¶
func NewSettingsDef(b *Builder) *SettingsDef
func (*SettingsDef) Parse ¶
func (d *SettingsDef) Parse(ctx *needle.SettingsDefContext)
type SimpleStmt ¶
type SimpleStmt struct { *Builder Id int32 Src SrcPos Expr *Expr IncDecStmt *IncDecStmt Assignment *Assignment }
func NewSimpleStmt ¶
func NewSimpleStmt(b *Builder) *SimpleStmt
func (*SimpleStmt) Parse ¶
func (s *SimpleStmt) Parse(ctx needle.ISimpleStmtContext)
type SliceExpr ¶
type SliceExpr struct { *Builder Id int32 Src SrcPos TreeType TreeType BaseExpr *Expr LowExpr *Expr HighExpr *Expr }
func NewSliceExpr ¶
func (*SliceExpr) Parse ¶
func (s *SliceExpr) Parse(exprCtx needle.IExprContext, ctx needle.ISliceExprContext)
type SourceMain ¶
type SourceMain struct { Id int32 Src SrcPos TreeType TreeType ContractDefs []*ContractDef FuncDefs []*FuncDef }
func NewSourceMain ¶
func NewSourceMain() *SourceMain
type SrcPos ¶
func NewSrcPosFromSymbol ¶
func NewSrcPosFromSymbol(t antlr.TerminalNode) SrcPos
type Statement ¶
type Statement struct { *Builder Id int32 Src SrcPos Block *Block SimpleStmt *SimpleStmt VarDef *VarDef IfStmt *IfStmt WhileStmt *WhileStmt BreakStmt *BreakStmt ContinueStmt *ContinueStmt ReturnStmt *ReturnStmt ErrorStmt *ErrorStmt }
func NewStatement ¶
func (*Statement) Parse ¶
func (s *Statement) Parse(ctx needle.IStatementContext)
type StatementList ¶
type StatementList struct { *Builder Id int32 Src SrcPos TreeType TreeType Statements []*Statement }
func NewStatementList ¶
func NewStatementList(b *Builder) *StatementList
func (*StatementList) Parse ¶
func (s *StatementList) Parse(ctx needle.IStatementListContext)
type StringLiteral ¶
func NewStringLiteral ¶
func NewStringLiteral(b *Builder) *StringLiteral
func (*StringLiteral) Parse ¶
func (d *StringLiteral) Parse(ctx needle.IStringLiteralContext)
type TreeType ¶
type TreeType int32
const ( TreeType_None_Default TreeType = iota TreeType_SourceMain TreeType_ContractDef TreeType_ContractPart TreeType_FuncDef TreeType_DataDef TreeType_DataPart TreeType_SettingsDef TreeType_Parameter TreeType_ParameterList TreeType_ReturnParameters TreeType_StatementList TreeType_Block TreeType_Assignment TreeType_VarDef TreeType_Kind_ControlStmt TreeType_IfStmt TreeType_ElseStmt TreeType_IncDecStmt TreeType_WhileStmt TreeType_ContinueStmt TreeType_BreakStmt TreeType_ReturnStmt TreeType_FuncSignature TreeType_FuncTail TreeType_Kind_ErrorStmt TreeType_ErrorStmt TreeType_ErrWarningStmt TreeType_ErrInfoStmt TreeType_Kind_Literal TreeType_DecimalLiteral TreeType_BinaryLiteral TreeType_OctalLiteral TreeType_HexLiteral TreeType_FloatLiteral TreeType_InterpretedStringLiteral TreeType_RawStringLiteral TreeType_BooleanLiteral TreeType_NIL TreeType_Identifier TreeType_DollarIdentifier TreeType_AtIdentifier TreeType_Kind_Expr TreeType_PrimaryExpr TreeType_IndexExpr TreeType_SliceExpr TreeType_MapExpr TreeType_ArrayExpr TreeType_ContractCall TreeType_UnaryOpExpr TreeType_MulOpExpr TreeType_RelOpExpr TreeType_LogicalOpExpr TreeType_AddOpExpr TreeType_Operand TreeType_PairList TreeType_Pair TreeType_Arguments TreeType_ArrayList )
type UnaryOp ¶
func NewUnaryOp ¶
func (*UnaryOp) Parse ¶
func (u *UnaryOp) Parse(exprCtx needle.IExprContext, ctx needle.IUnary_opContext)
Source Files ¶
- add_op.go
- arguments.go
- array.go
- assignment.go
- ast.go
- block.go
- break.go
- builder.go
- comments.go
- continue.go
- contract.go
- data.go
- error.go
- expr.go
- function.go
- identifier.go
- if.go
- incdec.go
- index.go
- literal.go
- logical_op.go
- map.go
- mul_op.go
- operand.go
- operator.go
- operator_string.go
- parameter.go
- pos.go
- rel_op.go
- return.go
- settings.go
- slice.go
- source_main.go
- statement.go
- tree.go
- tree_string.go
- typename.go
- unary_op.go
- variable.go
- while.go
Click to show internal directories.
Click to hide internal directories.