Documentation ¶
Index ¶
- Constants
- type EContext
- func (s *EContext) ADD() antlr.TerminalNode
- func (s *EContext) AllE() []IEContext
- func (s *EContext) DIV() antlr.TerminalNode
- func (s *EContext) E(i int) IEContext
- func (s *EContext) GetA() IEContext
- func (s *EContext) GetB() IEContext
- func (s *EContext) GetOp() antlr.Token
- func (s *EContext) GetParser() antlr.Parser
- func (s *EContext) GetRuleContext() antlr.RuleContext
- func (s *EContext) GetV() int
- func (s *EContext) Get_INT() antlr.Token
- func (s *EContext) INT() antlr.TerminalNode
- func (*EContext) IsEContext()
- func (s *EContext) MUL() antlr.TerminalNode
- func (s *EContext) SUB() antlr.TerminalNode
- func (s *EContext) SetA(v IEContext)
- func (s *EContext) SetB(v IEContext)
- func (s *EContext) SetOp(v antlr.Token)
- func (s *EContext) SetV(v int)
- func (s *EContext) Set_INT(v antlr.Token)
- func (s *EContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
- type ExprLexer
- type ExprParser
- type IEContext
- type IStatContext
- type StatContext
- func (s *StatContext) E() IEContext
- func (s *StatContext) GetA() IEContext
- func (s *StatContext) GetParser() antlr.Parser
- func (s *StatContext) GetRuleContext() antlr.RuleContext
- func (s *StatContext) GetV() int
- func (*StatContext) IsStatContext()
- func (s *StatContext) NEWLINE() antlr.TerminalNode
- func (s *StatContext) SetA(v IEContext)
- func (s *StatContext) SetV(v int)
- func (s *StatContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
Constants ¶
const ( ExprLexerMUL = 1 ExprLexerDIV = 2 ExprLexerADD = 3 ExprLexerSUB = 4 ExprLexerID = 5 ExprLexerINT = 6 ExprLexerNEWLINE = 7 ExprLexerWS = 8 )
ExprLexer tokens.
const ( ExprParserEOF = antlr.TokenEOF ExprParserMUL = 1 ExprParserDIV = 2 ExprParserADD = 3 ExprParserSUB = 4 ExprParserID = 5 ExprParserINT = 6 ExprParserNEWLINE = 7 ExprParserWS = 8 )
ExprParser tokens.
const ( ExprParserRULE_stat = 0 ExprParserRULE_e = 1 )
ExprParser rules.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EContext ¶
type EContext struct { *antlr.BaseParserRuleContext // contains filtered or unexported fields }
func NewEContext ¶
func NewEmptyEContext ¶
func NewEmptyEContext() *EContext
func (*EContext) ADD ¶
func (s *EContext) ADD() antlr.TerminalNode
func (*EContext) DIV ¶
func (s *EContext) DIV() antlr.TerminalNode
func (*EContext) GetRuleContext ¶
func (s *EContext) GetRuleContext() antlr.RuleContext
func (*EContext) INT ¶
func (s *EContext) INT() antlr.TerminalNode
func (*EContext) IsEContext ¶
func (*EContext) IsEContext()
func (*EContext) MUL ¶
func (s *EContext) MUL() antlr.TerminalNode
func (*EContext) SUB ¶
func (s *EContext) SUB() antlr.TerminalNode
func (*EContext) ToStringTree ¶
func (s *EContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
type ExprLexer ¶
func NewExprLexer ¶
func NewExprLexer(input antlr.CharStream) *ExprLexer
NewExprLexer produces a new lexer instance for the optional input antlr.CharStream.
The *ExprLexer instance produced may be reused by calling the SetInputStream method. The initial lexer configuration is expensive to construct, and the object is not thread-safe; however, if used within a Golang sync.Pool, the construction cost amortizes well and the objects can be used in a thread-safe manner.
type ExprParser ¶
type ExprParser struct {
*antlr.BaseParser
}
func NewExprParser ¶
func NewExprParser(input antlr.TokenStream) *ExprParser
NewExprParser produces a new parser instance for the optional input antlr.TokenStream.
The *ExprParser instance produced may be reused by calling the SetInputStream method. The initial parser configuration is expensive to construct, and the object is not thread-safe; however, if used within a Golang sync.Pool, the construction cost amortizes well and the objects can be used in a thread-safe manner.
func (*ExprParser) E ¶
func (p *ExprParser) E() (localctx IEContext)
func (*ExprParser) E_Sempred ¶
func (p *ExprParser) E_Sempred(localctx antlr.RuleContext, predIndex int) bool
func (*ExprParser) Sempred ¶
func (p *ExprParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool
func (*ExprParser) Stat ¶
func (p *ExprParser) Stat() (localctx IStatContext)
type IEContext ¶
type IEContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Get_INT returns the _INT token. Get_INT() antlr.Token // GetOp returns the op token. GetOp() antlr.Token // Set_INT sets the _INT token. Set_INT(antlr.Token) // SetOp sets the op token. SetOp(antlr.Token) // GetA returns the a rule contexts. GetA() IEContext // GetB returns the b rule contexts. GetB() IEContext // SetA sets the a rule contexts. SetA(IEContext) // SetB sets the b rule contexts. SetB(IEContext) // GetV returns the v attribute. GetV() int // SetV sets the v attribute. SetV(int) // IsEContext differentiates from other interfaces. IsEContext() }
IEContext is an interface to support dynamic dispatch.
type IStatContext ¶
type IStatContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // GetA returns the a rule contexts. GetA() IEContext // SetA sets the a rule contexts. SetA(IEContext) // GetV returns the v attribute. GetV() int // SetV sets the v attribute. SetV(int) // IsStatContext differentiates from other interfaces. IsStatContext() }
IStatContext is an interface to support dynamic dispatch.
type StatContext ¶
type StatContext struct { *antlr.BaseParserRuleContext // contains filtered or unexported fields }
func NewEmptyStatContext ¶
func NewEmptyStatContext() *StatContext
func NewStatContext ¶
func NewStatContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StatContext
func (*StatContext) E ¶
func (s *StatContext) E() IEContext
func (*StatContext) GetA ¶
func (s *StatContext) GetA() IEContext
func (*StatContext) GetParser ¶
func (s *StatContext) GetParser() antlr.Parser
func (*StatContext) GetRuleContext ¶
func (s *StatContext) GetRuleContext() antlr.RuleContext
func (*StatContext) GetV ¶
func (s *StatContext) GetV() int
func (*StatContext) IsStatContext ¶
func (*StatContext) IsStatContext()
func (*StatContext) NEWLINE ¶
func (s *StatContext) NEWLINE() antlr.TerminalNode
func (*StatContext) SetA ¶
func (s *StatContext) SetA(v IEContext)
func (*StatContext) SetV ¶
func (s *StatContext) SetV(v int)
func (*StatContext) ToStringTree ¶
func (s *StatContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string