parser

package
v0.0.0-...-27647ab Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: BSD-3-Clause 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
	JsonLexerWS     = 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
	JsonParserWS     = 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

func JsonLexerInit

func JsonLexerInit()

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

func JsonParserInit

func JsonParserInit()

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

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

func (s *ArrayContext) Accept(visitor antlr.ParseTreeVisitor) any

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 BaseJsonVisitor

type BaseJsonVisitor struct {
	*antlr.BaseParseTreeVisitor
}

func (*BaseJsonVisitor) VisitArray

func (v *BaseJsonVisitor) VisitArray(ctx *ArrayContext) any

func (*BaseJsonVisitor) VisitJson

func (v *BaseJsonVisitor) VisitJson(ctx *JsonContext) any

func (*BaseJsonVisitor) VisitObject

func (v *BaseJsonVisitor) VisitObject(ctx *ObjectContext) any

func (*BaseJsonVisitor) VisitPair

func (v *BaseJsonVisitor) VisitPair(ctx *PairContext) any

func (*BaseJsonVisitor) VisitValue

func (v *BaseJsonVisitor) VisitValue(ctx *ValueContext) any

type IArrayContext

type IArrayContext interface {
	antlr.ParserRuleContext

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

	// Getter signatures
	AllValue() []IValueContext
	Value(i int) IValueContext

	// 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

	// Getter signatures
	Value() IValueContext

	// 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

	// Getter signatures
	AllPair() []IPairContext
	Pair(i int) IPairContext

	// 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

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

	// 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

	// Getter signatures
	STRING() antlr.TerminalNode
	NUMBER() antlr.TerminalNode
	Object() IObjectContext
	Array() IArrayContext

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

IValueContext is an interface to support dynamic dispatch.

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

func (s *JsonContext) Accept(visitor antlr.ParseTreeVisitor) any

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 JsonLexer

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

func NewJsonLexer

func NewJsonLexer(input antlr.CharStream) *JsonLexer

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

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

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

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 JsonVisitor

type JsonVisitor interface {
	antlr.ParseTreeVisitor

	// Visit a parse tree produced by JsonParser#json.
	VisitJson(ctx *JsonContext) any

	// Visit a parse tree produced by JsonParser#object.
	VisitObject(ctx *ObjectContext) any

	// Visit a parse tree produced by JsonParser#pair.
	VisitPair(ctx *PairContext) any

	// Visit a parse tree produced by JsonParser#array.
	VisitArray(ctx *ArrayContext) any

	// Visit a parse tree produced by JsonParser#value.
	VisitValue(ctx *ValueContext) any
}

A complete Visitor for a parse tree produced by JsonParser.

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

func (s *ObjectContext) Accept(visitor antlr.ParseTreeVisitor) any

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

func (s *PairContext) Accept(visitor antlr.ParseTreeVisitor) any

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

func (s *ValueContext) Accept(visitor antlr.ParseTreeVisitor) any

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