parser

package
v0.0.0-...-48b9d42 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HelloLexerT__0 = 1
	HelloLexerID   = 2
	HelloLexerWS   = 3
)

HelloLexer tokens.

View Source
const (
	HelloParserEOF  = antlr.TokenEOF
	HelloParserT__0 = 1
	HelloParserID   = 2
	HelloParserWS   = 3
)

HelloParser tokens.

View Source
const HelloParserRULE_r = 0

HelloParserRULE_r is the HelloParser rule.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseHelloListener

type BaseHelloListener struct{}

BaseHelloListener is a complete listener for a parse tree produced by HelloParser.

func (*BaseHelloListener) EnterEveryRule

func (s *BaseHelloListener) EnterEveryRule(ctx antlr.ParserRuleContext)

EnterEveryRule is called when any rule is entered.

func (*BaseHelloListener) EnterR

func (s *BaseHelloListener) EnterR(ctx *RContext)

EnterR is called when production r is entered.

func (*BaseHelloListener) ExitEveryRule

func (s *BaseHelloListener) ExitEveryRule(ctx antlr.ParserRuleContext)

ExitEveryRule is called when any rule is exited.

func (*BaseHelloListener) ExitR

func (s *BaseHelloListener) ExitR(ctx *RContext)

ExitR is called when production r is exited.

func (*BaseHelloListener) VisitErrorNode

func (s *BaseHelloListener) VisitErrorNode(node antlr.ErrorNode)

VisitErrorNode is called when an error node is visited.

func (*BaseHelloListener) VisitTerminal

func (s *BaseHelloListener) VisitTerminal(node antlr.TerminalNode)

VisitTerminal is called when a terminal node is visited.

type HelloLexer

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

func NewHelloLexer

func NewHelloLexer(input antlr.CharStream) *HelloLexer

NewHelloLexer produces a new lexer instance for the optional input antlr.CharStream.

The *HelloLexer 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 HelloListener

type HelloListener interface {
	antlr.ParseTreeListener

	// EnterR is called when entering the r production.
	EnterR(c *RContext)

	// ExitR is called when exiting the r production.
	ExitR(c *RContext)
}

HelloListener is a complete listener for a parse tree produced by HelloParser.

type HelloParser

type HelloParser struct {
	*antlr.BaseParser
}

func NewHelloParser

func NewHelloParser(input antlr.TokenStream) *HelloParser

NewHelloParser produces a new parser instance for the optional input antlr.TokenStream.

The *HelloParser 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 (*HelloParser) R

func (p *HelloParser) R() (localctx IRContext)

type IRContext

type IRContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsRContext differentiates from other interfaces.
	IsRContext()
}

IRContext is an interface to support dynamic dispatch.

type RContext

type RContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyRContext

func NewEmptyRContext() *RContext

func NewRContext

func NewRContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RContext

func (*RContext) EnterRule

func (s *RContext) EnterRule(listener antlr.ParseTreeListener)

func (*RContext) ExitRule

func (s *RContext) ExitRule(listener antlr.ParseTreeListener)

func (*RContext) GetParser

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

func (*RContext) GetRuleContext

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

func (*RContext) ID

func (s *RContext) ID() antlr.TerminalNode

func (*RContext) IsRContext

func (*RContext) IsRContext()

func (*RContext) ToStringTree

func (s *RContext) 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