parser

package
v0.0.0-...-5ac4cdb Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandLexerT__0       = 1
	CommandLexerKey        = 2
	CommandLexerWhitespace = 3
	CommandLexerString_    = 4
)

CommandLexer tokens.

View Source
const (
	CommandParserEOF        = antlr.TokenEOF
	CommandParserT__0       = 1
	CommandParserKey        = 2
	CommandParserWhitespace = 3
	CommandParserString_    = 4
)

CommandParser tokens.

View Source
const (
	CommandParserRULE_command = 0
	CommandParserRULE_bin     = 1
	CommandParserRULE_file    = 2
	CommandParserRULE_arg     = 3
	CommandParserRULE_value   = 4
)

CommandParser rules.

Variables

View Source
var CommandLexerLexerStaticData struct {
	ChannelNames           []string
	ModeNames              []string
	LiteralNames           []string
	SymbolicNames          []string
	RuleNames              []string
	PredictionContextCache *antlr.PredictionContextCache
	// contains filtered or unexported fields
}
View Source
var CommandParserStaticData struct {
	LiteralNames           []string
	SymbolicNames          []string
	RuleNames              []string
	PredictionContextCache *antlr.PredictionContextCache
	// contains filtered or unexported fields
}

Functions

func CommandLexerInit

func CommandLexerInit()

CommandLexerInit initializes any static state used to implement CommandLexer. By default the static state used to implement the lexer is lazily initialized during the first call to NewCommandLexer(). You can call this function if you wish to initialize the static state ahead of time.

func CommandParserInit

func CommandParserInit()

CommandParserInit initializes any static state used to implement CommandParser. By default the static state used to implement the parser is lazily initialized during the first call to NewCommandParser(). You can call this function if you wish to initialize the static state ahead of time.

func InitEmptyArgContext

func InitEmptyArgContext(p *ArgContext)

func InitEmptyBinContext

func InitEmptyBinContext(p *BinContext)

func InitEmptyCommandContext

func InitEmptyCommandContext(p *CommandContext)

func InitEmptyFileContext

func InitEmptyFileContext(p *FileContext)

func InitEmptyValueContext

func InitEmptyValueContext(p *ValueContext)

Types

type ArgContext

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

func NewArgContext

func NewArgContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArgContext

func NewEmptyArgContext

func NewEmptyArgContext() *ArgContext

func (*ArgContext) EnterRule

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

func (*ArgContext) ExitRule

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

func (*ArgContext) GetParser

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

func (*ArgContext) GetRuleContext

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

func (*ArgContext) IsArgContext

func (*ArgContext) IsArgContext()

func (*ArgContext) Key

func (s *ArgContext) Key() antlr.TerminalNode

func (*ArgContext) ToStringTree

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

func (*ArgContext) Value

func (s *ArgContext) Value() IValueContext

type BaseCommandListener

type BaseCommandListener struct{}

BaseCommandListener is a complete listener for a parse tree produced by CommandParser.

func (*BaseCommandListener) EnterArg

func (s *BaseCommandListener) EnterArg(ctx *ArgContext)

EnterArg is called when production arg is entered.

func (*BaseCommandListener) EnterBin

func (s *BaseCommandListener) EnterBin(ctx *BinContext)

EnterBin is called when production bin is entered.

func (*BaseCommandListener) EnterCommand

func (s *BaseCommandListener) EnterCommand(ctx *CommandContext)

EnterCommand is called when production command is entered.

func (*BaseCommandListener) EnterEveryRule

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

EnterEveryRule is called when any rule is entered.

func (*BaseCommandListener) EnterFile

func (s *BaseCommandListener) EnterFile(ctx *FileContext)

EnterFile is called when production file is entered.

func (*BaseCommandListener) EnterValue

func (s *BaseCommandListener) EnterValue(ctx *ValueContext)

EnterValue is called when production value is entered.

func (*BaseCommandListener) ExitArg

func (s *BaseCommandListener) ExitArg(ctx *ArgContext)

ExitArg is called when production arg is exited.

func (*BaseCommandListener) ExitBin

func (s *BaseCommandListener) ExitBin(ctx *BinContext)

ExitBin is called when production bin is exited.

func (*BaseCommandListener) ExitCommand

func (s *BaseCommandListener) ExitCommand(ctx *CommandContext)

ExitCommand is called when production command is exited.

func (*BaseCommandListener) ExitEveryRule

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

ExitEveryRule is called when any rule is exited.

func (*BaseCommandListener) ExitFile

func (s *BaseCommandListener) ExitFile(ctx *FileContext)

ExitFile is called when production file is exited.

func (*BaseCommandListener) ExitValue

func (s *BaseCommandListener) ExitValue(ctx *ValueContext)

ExitValue is called when production value is exited.

func (*BaseCommandListener) VisitErrorNode

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

VisitErrorNode is called when an error node is visited.

func (*BaseCommandListener) VisitTerminal

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

VisitTerminal is called when a terminal node is visited.

type BinContext

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

func NewBinContext

func NewBinContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BinContext

func NewEmptyBinContext

func NewEmptyBinContext() *BinContext

func (*BinContext) EnterRule

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

func (*BinContext) ExitRule

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

func (*BinContext) GetParser

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

func (*BinContext) GetRuleContext

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

func (*BinContext) IsBinContext

func (*BinContext) IsBinContext()

func (*BinContext) String_

func (s *BinContext) String_() antlr.TerminalNode

func (*BinContext) ToStringTree

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

type CommandContext

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

func NewCommandContext

func NewCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CommandContext

func NewEmptyCommandContext

func NewEmptyCommandContext() *CommandContext

func (*CommandContext) AllArg

func (s *CommandContext) AllArg() []IArgContext

func (*CommandContext) Arg

func (s *CommandContext) Arg(i int) IArgContext

func (*CommandContext) Bin

func (s *CommandContext) Bin() IBinContext

func (*CommandContext) EnterRule

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

func (*CommandContext) ExitRule

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

func (*CommandContext) File

func (s *CommandContext) File() IFileContext

func (*CommandContext) GetParser

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

func (*CommandContext) GetRuleContext

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

func (*CommandContext) IsCommandContext

func (*CommandContext) IsCommandContext()

func (*CommandContext) ToStringTree

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

type CommandLexer

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

func NewCommandLexer

func NewCommandLexer(input antlr.CharStream) *CommandLexer

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

type CommandListener

type CommandListener interface {
	antlr.ParseTreeListener

	// EnterCommand is called when entering the command production.
	EnterCommand(c *CommandContext)

	// EnterBin is called when entering the bin production.
	EnterBin(c *BinContext)

	// EnterFile is called when entering the file production.
	EnterFile(c *FileContext)

	// EnterArg is called when entering the arg production.
	EnterArg(c *ArgContext)

	// EnterValue is called when entering the value production.
	EnterValue(c *ValueContext)

	// ExitCommand is called when exiting the command production.
	ExitCommand(c *CommandContext)

	// ExitBin is called when exiting the bin production.
	ExitBin(c *BinContext)

	// ExitFile is called when exiting the file production.
	ExitFile(c *FileContext)

	// ExitArg is called when exiting the arg production.
	ExitArg(c *ArgContext)

	// ExitValue is called when exiting the value production.
	ExitValue(c *ValueContext)
}

CommandListener is a complete listener for a parse tree produced by CommandParser.

type CommandParser

type CommandParser struct {
	*antlr.BaseParser
}

func NewCommandParser

func NewCommandParser(input antlr.TokenStream) *CommandParser

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

func (*CommandParser) Arg

func (p *CommandParser) Arg() (localctx IArgContext)

func (*CommandParser) Bin

func (p *CommandParser) Bin() (localctx IBinContext)

func (*CommandParser) Command

func (p *CommandParser) Command() (localctx ICommandContext)

func (*CommandParser) File

func (p *CommandParser) File() (localctx IFileContext)

func (*CommandParser) Value

func (p *CommandParser) Value() (localctx IValueContext)

type FileContext

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

func NewEmptyFileContext

func NewEmptyFileContext() *FileContext

func NewFileContext

func NewFileContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FileContext

func (*FileContext) EnterRule

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

func (*FileContext) ExitRule

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

func (*FileContext) GetParser

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

func (*FileContext) GetRuleContext

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

func (*FileContext) IsFileContext

func (*FileContext) IsFileContext()

func (*FileContext) String_

func (s *FileContext) String_() antlr.TerminalNode

func (*FileContext) ToStringTree

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

type IArgContext

type IArgContext interface {
	antlr.ParserRuleContext

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

	// Getter signatures
	Key() antlr.TerminalNode
	Value() IValueContext

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

IArgContext is an interface to support dynamic dispatch.

type IBinContext

type IBinContext interface {
	antlr.ParserRuleContext

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

	// Getter signatures
	String_() antlr.TerminalNode

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

IBinContext is an interface to support dynamic dispatch.

type ICommandContext

type ICommandContext interface {
	antlr.ParserRuleContext

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

	// Getter signatures
	Bin() IBinContext
	File() IFileContext
	AllArg() []IArgContext
	Arg(i int) IArgContext

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

ICommandContext is an interface to support dynamic dispatch.

type IFileContext

type IFileContext interface {
	antlr.ParserRuleContext

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

	// Getter signatures
	String_() antlr.TerminalNode

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

IFileContext is an interface to support dynamic dispatch.

type IValueContext

type IValueContext interface {
	antlr.ParserRuleContext

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

	// Getter signatures
	String_() antlr.TerminalNode

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

IValueContext is an interface to support dynamic dispatch.

type ValueContext

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

func NewEmptyValueContext

func NewEmptyValueContext() *ValueContext

func NewValueContext

func NewValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ValueContext

func (*ValueContext) EnterRule

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

func (*ValueContext) ExitRule

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

func (*ValueContext) GetParser

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

func (*ValueContext) GetRuleContext

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

func (*ValueContext) IsValueContext

func (*ValueContext) IsValueContext()

func (*ValueContext) String_

func (s *ValueContext) String_() antlr.TerminalNode

func (*ValueContext) ToStringTree

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