parser

package
v0.0.0-...-b8e1501 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExprLexerMUL     = 1
	ExprLexerDIV     = 2
	ExprLexerADD     = 3
	ExprLexerSUB     = 4
	ExprLexerID      = 5
	ExprLexerINT     = 6
	ExprLexerNEWLINE = 7
	ExprLexerWS      = 8
)

ExprLexer tokens.

View Source
const (
	ExprParserEOF     = antlr.TokenEOF
	ExprParserMUL     = 1
	ExprParserDIV     = 2
	ExprParserADD     = 3
	ExprParserSUB     = 4
	ExprParserID      = 5
	ExprParserINT     = 6
	ExprParserNEWLINE = 7
	ExprParserWS      = 8
)

ExprParser tokens.

View Source
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 NewEContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EContext

func NewEmptyEContext

func NewEmptyEContext() *EContext

func (*EContext) ADD

func (s *EContext) ADD() antlr.TerminalNode

func (*EContext) AllE

func (s *EContext) AllE() []IEContext

func (*EContext) DIV

func (s *EContext) DIV() antlr.TerminalNode

func (*EContext) E

func (s *EContext) E(i int) IEContext

func (*EContext) GetA

func (s *EContext) GetA() IEContext

func (*EContext) GetB

func (s *EContext) GetB() IEContext

func (*EContext) GetOp

func (s *EContext) GetOp() antlr.Token

func (*EContext) GetParser

func (s *EContext) GetParser() antlr.Parser

func (*EContext) GetRuleContext

func (s *EContext) GetRuleContext() antlr.RuleContext

func (*EContext) GetV

func (s *EContext) GetV() int

func (*EContext) Get_INT

func (s *EContext) Get_INT() antlr.Token

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) SetA

func (s *EContext) SetA(v IEContext)

func (*EContext) SetB

func (s *EContext) SetB(v IEContext)

func (*EContext) SetOp

func (s *EContext) SetOp(v antlr.Token)

func (*EContext) SetV

func (s *EContext) SetV(v int)

func (*EContext) Set_INT

func (s *EContext) Set_INT(v antlr.Token)

func (*EContext) ToStringTree

func (s *EContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

type ExprLexer

type ExprLexer struct {
	*antlr.BaseLexer
	// contains filtered or unexported fields
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL