parser

package
v0.0.0-...-db55557 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	JSONLexerT__0       = 1
	JSONLexerT__1       = 2
	JSONLexerT__2       = 3
	JSONLexerT__3       = 4
	JSONLexerT__4       = 5
	JSONLexerT__5       = 6
	JSONLexerT__6       = 7
	JSONLexerT__7       = 8
	JSONLexerT__8       = 9
	JSONLexerSTRING     = 10
	JSONLexerNUMBER     = 11
	JSONLexerWHITESPACE = 12
)

JSONLexer tokens.

View Source
const (
	JSONParserEOF        = antlr.TokenEOF
	JSONParserT__0       = 1
	JSONParserT__1       = 2
	JSONParserT__2       = 3
	JSONParserT__3       = 4
	JSONParserT__4       = 5
	JSONParserT__5       = 6
	JSONParserT__6       = 7
	JSONParserT__7       = 8
	JSONParserT__8       = 9
	JSONParserSTRING     = 10
	JSONParserNUMBER     = 11
	JSONParserWHITESPACE = 12
)

JSONParser tokens.

View Source
const (
	JSONParserRULE_json   = 0
	JSONParserRULE_object = 1
	JSONParserRULE_pair   = 2
	JSONParserRULE_array  = 3
	JSONParserRULE_value  = 4
)

JSONParser rules.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayContext

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

func NewArrayContext

func NewArrayContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArrayContext

func NewEmptyArrayContext

func NewEmptyArrayContext() *ArrayContext

func (*ArrayContext) AllValue

func (s *ArrayContext) AllValue() []IValueContext

func (*ArrayContext) EnterRule

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

func (*ArrayContext) ExitRule

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

func (*ArrayContext) GetParser

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

func (*ArrayContext) GetRuleContext

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

func (*ArrayContext) IsArrayContext

func (*ArrayContext) IsArrayContext()

func (*ArrayContext) ToStringTree

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

func (*ArrayContext) Value

func (s *ArrayContext) Value(i int) IValueContext

type BaseJSONListener

type BaseJSONListener struct{}

BaseJSONListener is a complete listener for a parse tree produced by JSONParser.

func (*BaseJSONListener) EnterArray

func (s *BaseJSONListener) EnterArray(ctx *ArrayContext)

EnterArray is called when production array is entered.

func (*BaseJSONListener) EnterEveryRule

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

EnterEveryRule is called when any rule is entered.

func (*BaseJSONListener) EnterJson

func (s *BaseJSONListener) EnterJson(ctx *JsonContext)

EnterJson is called when production json is entered.

func (*BaseJSONListener) EnterObject

func (s *BaseJSONListener) EnterObject(ctx *ObjectContext)

EnterObject is called when production object is entered.

func (*BaseJSONListener) EnterPair

func (s *BaseJSONListener) EnterPair(ctx *PairContext)

EnterPair is called when production pair is entered.

func (*BaseJSONListener) EnterValue

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

EnterValue is called when production value is entered.

func (*BaseJSONListener) ExitArray

func (s *BaseJSONListener) ExitArray(ctx *ArrayContext)

ExitArray is called when production array is exited.

func (*BaseJSONListener) ExitEveryRule

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

ExitEveryRule is called when any rule is exited.

func (*BaseJSONListener) ExitJson

func (s *BaseJSONListener) ExitJson(ctx *JsonContext)

ExitJson is called when production json is exited.

func (*BaseJSONListener) ExitObject

func (s *BaseJSONListener) ExitObject(ctx *ObjectContext)

ExitObject is called when production object is exited.

func (*BaseJSONListener) ExitPair

func (s *BaseJSONListener) ExitPair(ctx *PairContext)

ExitPair is called when production pair is exited.

func (*BaseJSONListener) ExitValue

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

ExitValue is called when production value is exited.

func (*BaseJSONListener) VisitErrorNode

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

VisitErrorNode is called when an error node is visited.

func (*BaseJSONListener) VisitTerminal

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

VisitTerminal is called when a terminal node is visited.

type IArrayContext

type IArrayContext interface {
	antlr.ParserRuleContext

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

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

IArrayContext is an interface to support dynamic dispatch.

type IJsonContext

type IJsonContext interface {
	antlr.ParserRuleContext

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

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

IJsonContext is an interface to support dynamic dispatch.

type IObjectContext

type IObjectContext interface {
	antlr.ParserRuleContext

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

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

IObjectContext is an interface to support dynamic dispatch.

type IPairContext

type IPairContext interface {
	antlr.ParserRuleContext

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

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

IPairContext is an interface to support dynamic dispatch.

type IValueContext

type IValueContext interface {
	antlr.ParserRuleContext

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

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

IValueContext is an interface to support dynamic dispatch.

type JSONLexer

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

func NewJSONLexer

func NewJSONLexer(input antlr.CharStream) *JSONLexer

type JSONListener

type JSONListener interface {
	antlr.ParseTreeListener

	// EnterJson is called when entering the json production.
	EnterJson(c *JsonContext)

	// EnterObject is called when entering the object production.
	EnterObject(c *ObjectContext)

	// EnterPair is called when entering the pair production.
	EnterPair(c *PairContext)

	// EnterArray is called when entering the array production.
	EnterArray(c *ArrayContext)

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

	// ExitJson is called when exiting the json production.
	ExitJson(c *JsonContext)

	// ExitObject is called when exiting the object production.
	ExitObject(c *ObjectContext)

	// ExitPair is called when exiting the pair production.
	ExitPair(c *PairContext)

	// ExitArray is called when exiting the array production.
	ExitArray(c *ArrayContext)

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

JSONListener is a complete listener for a parse tree produced by JSONParser.

type JSONParser

type JSONParser struct {
	*antlr.BaseParser
}

func NewJSONParser

func NewJSONParser(input antlr.TokenStream) *JSONParser

func (*JSONParser) Array

func (p *JSONParser) Array() (localctx IArrayContext)

func (*JSONParser) Json

func (p *JSONParser) Json() (localctx IJsonContext)

func (*JSONParser) Object

func (p *JSONParser) Object() (localctx IObjectContext)

func (*JSONParser) Pair

func (p *JSONParser) Pair() (localctx IPairContext)

func (*JSONParser) Value

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

type JsonContext

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

func NewEmptyJsonContext

func NewEmptyJsonContext() *JsonContext

func NewJsonContext

func NewJsonContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *JsonContext

func (*JsonContext) EnterRule

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

func (*JsonContext) ExitRule

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

func (*JsonContext) GetParser

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

func (*JsonContext) GetRuleContext

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

func (*JsonContext) IsJsonContext

func (*JsonContext) IsJsonContext()

func (*JsonContext) ToStringTree

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

func (*JsonContext) Value

func (s *JsonContext) Value() IValueContext

type ObjectContext

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

func NewEmptyObjectContext

func NewEmptyObjectContext() *ObjectContext

func NewObjectContext

func NewObjectContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ObjectContext

func (*ObjectContext) AllPair

func (s *ObjectContext) AllPair() []IPairContext

func (*ObjectContext) EnterRule

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

func (*ObjectContext) ExitRule

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

func (*ObjectContext) GetParser

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

func (*ObjectContext) GetRuleContext

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

func (*ObjectContext) IsObjectContext

func (*ObjectContext) IsObjectContext()

func (*ObjectContext) Pair

func (s *ObjectContext) Pair(i int) IPairContext

func (*ObjectContext) ToStringTree

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

type PairContext

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

func NewEmptyPairContext

func NewEmptyPairContext() *PairContext

func NewPairContext

func NewPairContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PairContext

func (*PairContext) EnterRule

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

func (*PairContext) ExitRule

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

func (*PairContext) GetParser

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

func (*PairContext) GetRuleContext

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

func (*PairContext) IsPairContext

func (*PairContext) IsPairContext()

func (*PairContext) STRING

func (s *PairContext) STRING() antlr.TerminalNode

func (*PairContext) ToStringTree

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

func (*PairContext) Value

func (s *PairContext) Value() IValueContext

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

func (s *ValueContext) Array() IArrayContext

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

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

func (*ValueContext) Object

func (s *ValueContext) Object() IObjectContext

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