mirror of
https://github.com/Myzel394/config-lsp.git
synced 2025-06-18 23:15:26 +02:00
962 lines
23 KiB
Go
962 lines
23 KiB
Go
// Code generated from Match.g4 by ANTLR 4.13.0. DO NOT EDIT.
|
|
|
|
package parser // Match
|
|
|
|
import (
|
|
"fmt"
|
|
"strconv"
|
|
"sync"
|
|
|
|
"github.com/antlr4-go/antlr/v4"
|
|
)
|
|
|
|
// Suppress unused import errors
|
|
var _ = fmt.Printf
|
|
var _ = strconv.Itoa
|
|
var _ = sync.Once{}
|
|
|
|
type MatchParser struct {
|
|
*antlr.BaseParser
|
|
}
|
|
|
|
var MatchParserStaticData struct {
|
|
once sync.Once
|
|
serializedATN []int32
|
|
LiteralNames []string
|
|
SymbolicNames []string
|
|
RuleNames []string
|
|
PredictionContextCache *antlr.PredictionContextCache
|
|
atn *antlr.ATN
|
|
decisionToDFA []*antlr.DFA
|
|
}
|
|
|
|
func matchParserInit() {
|
|
staticData := &MatchParserStaticData
|
|
staticData.LiteralNames = []string{
|
|
"", "','",
|
|
}
|
|
staticData.SymbolicNames = []string{
|
|
"", "COMMA", "STRING", "WHITESPACE",
|
|
}
|
|
staticData.RuleNames = []string{
|
|
"root", "matchEntry", "separator", "criteria", "values", "value",
|
|
}
|
|
staticData.PredictionContextCache = antlr.NewPredictionContextCache()
|
|
staticData.serializedATN = []int32{
|
|
4, 1, 3, 52, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4,
|
|
2, 5, 7, 5, 1, 0, 3, 0, 14, 8, 0, 1, 0, 1, 0, 3, 0, 18, 8, 0, 5, 0, 20,
|
|
8, 0, 10, 0, 12, 0, 23, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 29, 8, 1, 1,
|
|
1, 3, 1, 32, 8, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 3, 4, 39, 8, 4, 1, 4,
|
|
1, 4, 3, 4, 43, 8, 4, 5, 4, 45, 8, 4, 10, 4, 12, 4, 48, 9, 4, 1, 5, 1,
|
|
5, 1, 5, 0, 0, 6, 0, 2, 4, 6, 8, 10, 0, 0, 53, 0, 13, 1, 0, 0, 0, 2, 26,
|
|
1, 0, 0, 0, 4, 33, 1, 0, 0, 0, 6, 35, 1, 0, 0, 0, 8, 38, 1, 0, 0, 0, 10,
|
|
49, 1, 0, 0, 0, 12, 14, 3, 2, 1, 0, 13, 12, 1, 0, 0, 0, 13, 14, 1, 0, 0,
|
|
0, 14, 21, 1, 0, 0, 0, 15, 17, 5, 3, 0, 0, 16, 18, 3, 2, 1, 0, 17, 16,
|
|
1, 0, 0, 0, 17, 18, 1, 0, 0, 0, 18, 20, 1, 0, 0, 0, 19, 15, 1, 0, 0, 0,
|
|
20, 23, 1, 0, 0, 0, 21, 19, 1, 0, 0, 0, 21, 22, 1, 0, 0, 0, 22, 24, 1,
|
|
0, 0, 0, 23, 21, 1, 0, 0, 0, 24, 25, 5, 0, 0, 1, 25, 1, 1, 0, 0, 0, 26,
|
|
28, 3, 6, 3, 0, 27, 29, 3, 4, 2, 0, 28, 27, 1, 0, 0, 0, 28, 29, 1, 0, 0,
|
|
0, 29, 31, 1, 0, 0, 0, 30, 32, 3, 8, 4, 0, 31, 30, 1, 0, 0, 0, 31, 32,
|
|
1, 0, 0, 0, 32, 3, 1, 0, 0, 0, 33, 34, 5, 3, 0, 0, 34, 5, 1, 0, 0, 0, 35,
|
|
36, 5, 2, 0, 0, 36, 7, 1, 0, 0, 0, 37, 39, 3, 10, 5, 0, 38, 37, 1, 0, 0,
|
|
0, 38, 39, 1, 0, 0, 0, 39, 46, 1, 0, 0, 0, 40, 42, 5, 1, 0, 0, 41, 43,
|
|
3, 10, 5, 0, 42, 41, 1, 0, 0, 0, 42, 43, 1, 0, 0, 0, 43, 45, 1, 0, 0, 0,
|
|
44, 40, 1, 0, 0, 0, 45, 48, 1, 0, 0, 0, 46, 44, 1, 0, 0, 0, 46, 47, 1,
|
|
0, 0, 0, 47, 9, 1, 0, 0, 0, 48, 46, 1, 0, 0, 0, 49, 50, 5, 2, 0, 0, 50,
|
|
11, 1, 0, 0, 0, 8, 13, 17, 21, 28, 31, 38, 42, 46,
|
|
}
|
|
deserializer := antlr.NewATNDeserializer(nil)
|
|
staticData.atn = deserializer.Deserialize(staticData.serializedATN)
|
|
atn := staticData.atn
|
|
staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState))
|
|
decisionToDFA := staticData.decisionToDFA
|
|
for index, state := range atn.DecisionToState {
|
|
decisionToDFA[index] = antlr.NewDFA(state, index)
|
|
}
|
|
}
|
|
|
|
// MatchParserInit initializes any static state used to implement MatchParser. By default the
|
|
// static state used to implement the parser is lazily initialized during the first call to
|
|
// NewMatchParser(). You can call this function if you wish to initialize the static state ahead
|
|
// of time.
|
|
func MatchParserInit() {
|
|
staticData := &MatchParserStaticData
|
|
staticData.once.Do(matchParserInit)
|
|
}
|
|
|
|
// NewMatchParser produces a new parser instance for the optional input antlr.TokenStream.
|
|
func NewMatchParser(input antlr.TokenStream) *MatchParser {
|
|
MatchParserInit()
|
|
this := new(MatchParser)
|
|
this.BaseParser = antlr.NewBaseParser(input)
|
|
staticData := &MatchParserStaticData
|
|
this.Interpreter = antlr.NewParserATNSimulator(this, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache)
|
|
this.RuleNames = staticData.RuleNames
|
|
this.LiteralNames = staticData.LiteralNames
|
|
this.SymbolicNames = staticData.SymbolicNames
|
|
this.GrammarFileName = "Match.g4"
|
|
|
|
return this
|
|
}
|
|
|
|
// MatchParser tokens.
|
|
const (
|
|
MatchParserEOF = antlr.TokenEOF
|
|
MatchParserCOMMA = 1
|
|
MatchParserSTRING = 2
|
|
MatchParserWHITESPACE = 3
|
|
)
|
|
|
|
// MatchParser rules.
|
|
const (
|
|
MatchParserRULE_root = 0
|
|
MatchParserRULE_matchEntry = 1
|
|
MatchParserRULE_separator = 2
|
|
MatchParserRULE_criteria = 3
|
|
MatchParserRULE_values = 4
|
|
MatchParserRULE_value = 5
|
|
)
|
|
|
|
// IRootContext is an interface to support dynamic dispatch.
|
|
type IRootContext interface {
|
|
antlr.ParserRuleContext
|
|
|
|
// GetParser returns the parser.
|
|
GetParser() antlr.Parser
|
|
|
|
// Getter signatures
|
|
EOF() antlr.TerminalNode
|
|
AllMatchEntry() []IMatchEntryContext
|
|
MatchEntry(i int) IMatchEntryContext
|
|
AllWHITESPACE() []antlr.TerminalNode
|
|
WHITESPACE(i int) antlr.TerminalNode
|
|
|
|
// IsRootContext differentiates from other interfaces.
|
|
IsRootContext()
|
|
}
|
|
|
|
type RootContext struct {
|
|
antlr.BaseParserRuleContext
|
|
parser antlr.Parser
|
|
}
|
|
|
|
func NewEmptyRootContext() *RootContext {
|
|
var p = new(RootContext)
|
|
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
|
|
p.RuleIndex = MatchParserRULE_root
|
|
return p
|
|
}
|
|
|
|
func InitEmptyRootContext(p *RootContext) {
|
|
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
|
|
p.RuleIndex = MatchParserRULE_root
|
|
}
|
|
|
|
func (*RootContext) IsRootContext() {}
|
|
|
|
func NewRootContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RootContext {
|
|
var p = new(RootContext)
|
|
|
|
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
|
|
|
|
p.parser = parser
|
|
p.RuleIndex = MatchParserRULE_root
|
|
|
|
return p
|
|
}
|
|
|
|
func (s *RootContext) GetParser() antlr.Parser { return s.parser }
|
|
|
|
func (s *RootContext) EOF() antlr.TerminalNode {
|
|
return s.GetToken(MatchParserEOF, 0)
|
|
}
|
|
|
|
func (s *RootContext) AllMatchEntry() []IMatchEntryContext {
|
|
children := s.GetChildren()
|
|
len := 0
|
|
for _, ctx := range children {
|
|
if _, ok := ctx.(IMatchEntryContext); ok {
|
|
len++
|
|
}
|
|
}
|
|
|
|
tst := make([]IMatchEntryContext, len)
|
|
i := 0
|
|
for _, ctx := range children {
|
|
if t, ok := ctx.(IMatchEntryContext); ok {
|
|
tst[i] = t.(IMatchEntryContext)
|
|
i++
|
|
}
|
|
}
|
|
|
|
return tst
|
|
}
|
|
|
|
func (s *RootContext) MatchEntry(i int) IMatchEntryContext {
|
|
var t antlr.RuleContext
|
|
j := 0
|
|
for _, ctx := range s.GetChildren() {
|
|
if _, ok := ctx.(IMatchEntryContext); ok {
|
|
if j == i {
|
|
t = ctx.(antlr.RuleContext)
|
|
break
|
|
}
|
|
j++
|
|
}
|
|
}
|
|
|
|
if t == nil {
|
|
return nil
|
|
}
|
|
|
|
return t.(IMatchEntryContext)
|
|
}
|
|
|
|
func (s *RootContext) AllWHITESPACE() []antlr.TerminalNode {
|
|
return s.GetTokens(MatchParserWHITESPACE)
|
|
}
|
|
|
|
func (s *RootContext) WHITESPACE(i int) antlr.TerminalNode {
|
|
return s.GetToken(MatchParserWHITESPACE, i)
|
|
}
|
|
|
|
func (s *RootContext) GetRuleContext() antlr.RuleContext {
|
|
return s
|
|
}
|
|
|
|
func (s *RootContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
|
|
return antlr.TreesStringTree(s, ruleNames, recog)
|
|
}
|
|
|
|
func (s *RootContext) EnterRule(listener antlr.ParseTreeListener) {
|
|
if listenerT, ok := listener.(MatchListener); ok {
|
|
listenerT.EnterRoot(s)
|
|
}
|
|
}
|
|
|
|
func (s *RootContext) ExitRule(listener antlr.ParseTreeListener) {
|
|
if listenerT, ok := listener.(MatchListener); ok {
|
|
listenerT.ExitRoot(s)
|
|
}
|
|
}
|
|
|
|
func (p *MatchParser) Root() (localctx IRootContext) {
|
|
localctx = NewRootContext(p, p.GetParserRuleContext(), p.GetState())
|
|
p.EnterRule(localctx, 0, MatchParserRULE_root)
|
|
var _la int
|
|
|
|
p.EnterOuterAlt(localctx, 1)
|
|
p.SetState(13)
|
|
p.GetErrorHandler().Sync(p)
|
|
if p.HasError() {
|
|
goto errorExit
|
|
}
|
|
_la = p.GetTokenStream().LA(1)
|
|
|
|
if _la == MatchParserSTRING {
|
|
{
|
|
p.SetState(12)
|
|
p.MatchEntry()
|
|
}
|
|
|
|
}
|
|
p.SetState(21)
|
|
p.GetErrorHandler().Sync(p)
|
|
if p.HasError() {
|
|
goto errorExit
|
|
}
|
|
_la = p.GetTokenStream().LA(1)
|
|
|
|
for _la == MatchParserWHITESPACE {
|
|
{
|
|
p.SetState(15)
|
|
p.Match(MatchParserWHITESPACE)
|
|
if p.HasError() {
|
|
// Recognition error - abort rule
|
|
goto errorExit
|
|
}
|
|
}
|
|
p.SetState(17)
|
|
p.GetErrorHandler().Sync(p)
|
|
if p.HasError() {
|
|
goto errorExit
|
|
}
|
|
_la = p.GetTokenStream().LA(1)
|
|
|
|
if _la == MatchParserSTRING {
|
|
{
|
|
p.SetState(16)
|
|
p.MatchEntry()
|
|
}
|
|
|
|
}
|
|
|
|
p.SetState(23)
|
|
p.GetErrorHandler().Sync(p)
|
|
if p.HasError() {
|
|
goto errorExit
|
|
}
|
|
_la = p.GetTokenStream().LA(1)
|
|
}
|
|
{
|
|
p.SetState(24)
|
|
p.Match(MatchParserEOF)
|
|
if p.HasError() {
|
|
// Recognition error - abort rule
|
|
goto errorExit
|
|
}
|
|
}
|
|
|
|
errorExit:
|
|
if p.HasError() {
|
|
v := p.GetError()
|
|
localctx.SetException(v)
|
|
p.GetErrorHandler().ReportError(p, v)
|
|
p.GetErrorHandler().Recover(p, v)
|
|
p.SetError(nil)
|
|
}
|
|
p.ExitRule()
|
|
return localctx
|
|
goto errorExit // Trick to prevent compiler error if the label is not used
|
|
}
|
|
|
|
// IMatchEntryContext is an interface to support dynamic dispatch.
|
|
type IMatchEntryContext interface {
|
|
antlr.ParserRuleContext
|
|
|
|
// GetParser returns the parser.
|
|
GetParser() antlr.Parser
|
|
|
|
// Getter signatures
|
|
Criteria() ICriteriaContext
|
|
Separator() ISeparatorContext
|
|
Values() IValuesContext
|
|
|
|
// IsMatchEntryContext differentiates from other interfaces.
|
|
IsMatchEntryContext()
|
|
}
|
|
|
|
type MatchEntryContext struct {
|
|
antlr.BaseParserRuleContext
|
|
parser antlr.Parser
|
|
}
|
|
|
|
func NewEmptyMatchEntryContext() *MatchEntryContext {
|
|
var p = new(MatchEntryContext)
|
|
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
|
|
p.RuleIndex = MatchParserRULE_matchEntry
|
|
return p
|
|
}
|
|
|
|
func InitEmptyMatchEntryContext(p *MatchEntryContext) {
|
|
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
|
|
p.RuleIndex = MatchParserRULE_matchEntry
|
|
}
|
|
|
|
func (*MatchEntryContext) IsMatchEntryContext() {}
|
|
|
|
func NewMatchEntryContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MatchEntryContext {
|
|
var p = new(MatchEntryContext)
|
|
|
|
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
|
|
|
|
p.parser = parser
|
|
p.RuleIndex = MatchParserRULE_matchEntry
|
|
|
|
return p
|
|
}
|
|
|
|
func (s *MatchEntryContext) GetParser() antlr.Parser { return s.parser }
|
|
|
|
func (s *MatchEntryContext) Criteria() ICriteriaContext {
|
|
var t antlr.RuleContext
|
|
for _, ctx := range s.GetChildren() {
|
|
if _, ok := ctx.(ICriteriaContext); ok {
|
|
t = ctx.(antlr.RuleContext)
|
|
break
|
|
}
|
|
}
|
|
|
|
if t == nil {
|
|
return nil
|
|
}
|
|
|
|
return t.(ICriteriaContext)
|
|
}
|
|
|
|
func (s *MatchEntryContext) Separator() ISeparatorContext {
|
|
var t antlr.RuleContext
|
|
for _, ctx := range s.GetChildren() {
|
|
if _, ok := ctx.(ISeparatorContext); ok {
|
|
t = ctx.(antlr.RuleContext)
|
|
break
|
|
}
|
|
}
|
|
|
|
if t == nil {
|
|
return nil
|
|
}
|
|
|
|
return t.(ISeparatorContext)
|
|
}
|
|
|
|
func (s *MatchEntryContext) Values() IValuesContext {
|
|
var t antlr.RuleContext
|
|
for _, ctx := range s.GetChildren() {
|
|
if _, ok := ctx.(IValuesContext); ok {
|
|
t = ctx.(antlr.RuleContext)
|
|
break
|
|
}
|
|
}
|
|
|
|
if t == nil {
|
|
return nil
|
|
}
|
|
|
|
return t.(IValuesContext)
|
|
}
|
|
|
|
func (s *MatchEntryContext) GetRuleContext() antlr.RuleContext {
|
|
return s
|
|
}
|
|
|
|
func (s *MatchEntryContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
|
|
return antlr.TreesStringTree(s, ruleNames, recog)
|
|
}
|
|
|
|
func (s *MatchEntryContext) EnterRule(listener antlr.ParseTreeListener) {
|
|
if listenerT, ok := listener.(MatchListener); ok {
|
|
listenerT.EnterMatchEntry(s)
|
|
}
|
|
}
|
|
|
|
func (s *MatchEntryContext) ExitRule(listener antlr.ParseTreeListener) {
|
|
if listenerT, ok := listener.(MatchListener); ok {
|
|
listenerT.ExitMatchEntry(s)
|
|
}
|
|
}
|
|
|
|
func (p *MatchParser) MatchEntry() (localctx IMatchEntryContext) {
|
|
localctx = NewMatchEntryContext(p, p.GetParserRuleContext(), p.GetState())
|
|
p.EnterRule(localctx, 2, MatchParserRULE_matchEntry)
|
|
p.EnterOuterAlt(localctx, 1)
|
|
{
|
|
p.SetState(26)
|
|
p.Criteria()
|
|
}
|
|
p.SetState(28)
|
|
p.GetErrorHandler().Sync(p)
|
|
|
|
if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 3, p.GetParserRuleContext()) == 1 {
|
|
{
|
|
p.SetState(27)
|
|
p.Separator()
|
|
}
|
|
|
|
} else if p.HasError() { // JIM
|
|
goto errorExit
|
|
}
|
|
p.SetState(31)
|
|
p.GetErrorHandler().Sync(p)
|
|
|
|
if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 4, p.GetParserRuleContext()) == 1 {
|
|
{
|
|
p.SetState(30)
|
|
p.Values()
|
|
}
|
|
|
|
} else if p.HasError() { // JIM
|
|
goto errorExit
|
|
}
|
|
|
|
errorExit:
|
|
if p.HasError() {
|
|
v := p.GetError()
|
|
localctx.SetException(v)
|
|
p.GetErrorHandler().ReportError(p, v)
|
|
p.GetErrorHandler().Recover(p, v)
|
|
p.SetError(nil)
|
|
}
|
|
p.ExitRule()
|
|
return localctx
|
|
goto errorExit // Trick to prevent compiler error if the label is not used
|
|
}
|
|
|
|
// ISeparatorContext is an interface to support dynamic dispatch.
|
|
type ISeparatorContext interface {
|
|
antlr.ParserRuleContext
|
|
|
|
// GetParser returns the parser.
|
|
GetParser() antlr.Parser
|
|
|
|
// Getter signatures
|
|
WHITESPACE() antlr.TerminalNode
|
|
|
|
// IsSeparatorContext differentiates from other interfaces.
|
|
IsSeparatorContext()
|
|
}
|
|
|
|
type SeparatorContext struct {
|
|
antlr.BaseParserRuleContext
|
|
parser antlr.Parser
|
|
}
|
|
|
|
func NewEmptySeparatorContext() *SeparatorContext {
|
|
var p = new(SeparatorContext)
|
|
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
|
|
p.RuleIndex = MatchParserRULE_separator
|
|
return p
|
|
}
|
|
|
|
func InitEmptySeparatorContext(p *SeparatorContext) {
|
|
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
|
|
p.RuleIndex = MatchParserRULE_separator
|
|
}
|
|
|
|
func (*SeparatorContext) IsSeparatorContext() {}
|
|
|
|
func NewSeparatorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SeparatorContext {
|
|
var p = new(SeparatorContext)
|
|
|
|
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
|
|
|
|
p.parser = parser
|
|
p.RuleIndex = MatchParserRULE_separator
|
|
|
|
return p
|
|
}
|
|
|
|
func (s *SeparatorContext) GetParser() antlr.Parser { return s.parser }
|
|
|
|
func (s *SeparatorContext) WHITESPACE() antlr.TerminalNode {
|
|
return s.GetToken(MatchParserWHITESPACE, 0)
|
|
}
|
|
|
|
func (s *SeparatorContext) GetRuleContext() antlr.RuleContext {
|
|
return s
|
|
}
|
|
|
|
func (s *SeparatorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
|
|
return antlr.TreesStringTree(s, ruleNames, recog)
|
|
}
|
|
|
|
func (s *SeparatorContext) EnterRule(listener antlr.ParseTreeListener) {
|
|
if listenerT, ok := listener.(MatchListener); ok {
|
|
listenerT.EnterSeparator(s)
|
|
}
|
|
}
|
|
|
|
func (s *SeparatorContext) ExitRule(listener antlr.ParseTreeListener) {
|
|
if listenerT, ok := listener.(MatchListener); ok {
|
|
listenerT.ExitSeparator(s)
|
|
}
|
|
}
|
|
|
|
func (p *MatchParser) Separator() (localctx ISeparatorContext) {
|
|
localctx = NewSeparatorContext(p, p.GetParserRuleContext(), p.GetState())
|
|
p.EnterRule(localctx, 4, MatchParserRULE_separator)
|
|
p.EnterOuterAlt(localctx, 1)
|
|
{
|
|
p.SetState(33)
|
|
p.Match(MatchParserWHITESPACE)
|
|
if p.HasError() {
|
|
// Recognition error - abort rule
|
|
goto errorExit
|
|
}
|
|
}
|
|
|
|
errorExit:
|
|
if p.HasError() {
|
|
v := p.GetError()
|
|
localctx.SetException(v)
|
|
p.GetErrorHandler().ReportError(p, v)
|
|
p.GetErrorHandler().Recover(p, v)
|
|
p.SetError(nil)
|
|
}
|
|
p.ExitRule()
|
|
return localctx
|
|
goto errorExit // Trick to prevent compiler error if the label is not used
|
|
}
|
|
|
|
// ICriteriaContext is an interface to support dynamic dispatch.
|
|
type ICriteriaContext interface {
|
|
antlr.ParserRuleContext
|
|
|
|
// GetParser returns the parser.
|
|
GetParser() antlr.Parser
|
|
|
|
// Getter signatures
|
|
STRING() antlr.TerminalNode
|
|
|
|
// IsCriteriaContext differentiates from other interfaces.
|
|
IsCriteriaContext()
|
|
}
|
|
|
|
type CriteriaContext struct {
|
|
antlr.BaseParserRuleContext
|
|
parser antlr.Parser
|
|
}
|
|
|
|
func NewEmptyCriteriaContext() *CriteriaContext {
|
|
var p = new(CriteriaContext)
|
|
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
|
|
p.RuleIndex = MatchParserRULE_criteria
|
|
return p
|
|
}
|
|
|
|
func InitEmptyCriteriaContext(p *CriteriaContext) {
|
|
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
|
|
p.RuleIndex = MatchParserRULE_criteria
|
|
}
|
|
|
|
func (*CriteriaContext) IsCriteriaContext() {}
|
|
|
|
func NewCriteriaContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CriteriaContext {
|
|
var p = new(CriteriaContext)
|
|
|
|
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
|
|
|
|
p.parser = parser
|
|
p.RuleIndex = MatchParserRULE_criteria
|
|
|
|
return p
|
|
}
|
|
|
|
func (s *CriteriaContext) GetParser() antlr.Parser { return s.parser }
|
|
|
|
func (s *CriteriaContext) STRING() antlr.TerminalNode {
|
|
return s.GetToken(MatchParserSTRING, 0)
|
|
}
|
|
|
|
func (s *CriteriaContext) GetRuleContext() antlr.RuleContext {
|
|
return s
|
|
}
|
|
|
|
func (s *CriteriaContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
|
|
return antlr.TreesStringTree(s, ruleNames, recog)
|
|
}
|
|
|
|
func (s *CriteriaContext) EnterRule(listener antlr.ParseTreeListener) {
|
|
if listenerT, ok := listener.(MatchListener); ok {
|
|
listenerT.EnterCriteria(s)
|
|
}
|
|
}
|
|
|
|
func (s *CriteriaContext) ExitRule(listener antlr.ParseTreeListener) {
|
|
if listenerT, ok := listener.(MatchListener); ok {
|
|
listenerT.ExitCriteria(s)
|
|
}
|
|
}
|
|
|
|
func (p *MatchParser) Criteria() (localctx ICriteriaContext) {
|
|
localctx = NewCriteriaContext(p, p.GetParserRuleContext(), p.GetState())
|
|
p.EnterRule(localctx, 6, MatchParserRULE_criteria)
|
|
p.EnterOuterAlt(localctx, 1)
|
|
{
|
|
p.SetState(35)
|
|
p.Match(MatchParserSTRING)
|
|
if p.HasError() {
|
|
// Recognition error - abort rule
|
|
goto errorExit
|
|
}
|
|
}
|
|
|
|
errorExit:
|
|
if p.HasError() {
|
|
v := p.GetError()
|
|
localctx.SetException(v)
|
|
p.GetErrorHandler().ReportError(p, v)
|
|
p.GetErrorHandler().Recover(p, v)
|
|
p.SetError(nil)
|
|
}
|
|
p.ExitRule()
|
|
return localctx
|
|
goto errorExit // Trick to prevent compiler error if the label is not used
|
|
}
|
|
|
|
// IValuesContext is an interface to support dynamic dispatch.
|
|
type IValuesContext interface {
|
|
antlr.ParserRuleContext
|
|
|
|
// GetParser returns the parser.
|
|
GetParser() antlr.Parser
|
|
|
|
// Getter signatures
|
|
AllValue() []IValueContext
|
|
Value(i int) IValueContext
|
|
AllCOMMA() []antlr.TerminalNode
|
|
COMMA(i int) antlr.TerminalNode
|
|
|
|
// IsValuesContext differentiates from other interfaces.
|
|
IsValuesContext()
|
|
}
|
|
|
|
type ValuesContext struct {
|
|
antlr.BaseParserRuleContext
|
|
parser antlr.Parser
|
|
}
|
|
|
|
func NewEmptyValuesContext() *ValuesContext {
|
|
var p = new(ValuesContext)
|
|
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
|
|
p.RuleIndex = MatchParserRULE_values
|
|
return p
|
|
}
|
|
|
|
func InitEmptyValuesContext(p *ValuesContext) {
|
|
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
|
|
p.RuleIndex = MatchParserRULE_values
|
|
}
|
|
|
|
func (*ValuesContext) IsValuesContext() {}
|
|
|
|
func NewValuesContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ValuesContext {
|
|
var p = new(ValuesContext)
|
|
|
|
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
|
|
|
|
p.parser = parser
|
|
p.RuleIndex = MatchParserRULE_values
|
|
|
|
return p
|
|
}
|
|
|
|
func (s *ValuesContext) GetParser() antlr.Parser { return s.parser }
|
|
|
|
func (s *ValuesContext) AllValue() []IValueContext {
|
|
children := s.GetChildren()
|
|
len := 0
|
|
for _, ctx := range children {
|
|
if _, ok := ctx.(IValueContext); ok {
|
|
len++
|
|
}
|
|
}
|
|
|
|
tst := make([]IValueContext, len)
|
|
i := 0
|
|
for _, ctx := range children {
|
|
if t, ok := ctx.(IValueContext); ok {
|
|
tst[i] = t.(IValueContext)
|
|
i++
|
|
}
|
|
}
|
|
|
|
return tst
|
|
}
|
|
|
|
func (s *ValuesContext) Value(i int) IValueContext {
|
|
var t antlr.RuleContext
|
|
j := 0
|
|
for _, ctx := range s.GetChildren() {
|
|
if _, ok := ctx.(IValueContext); ok {
|
|
if j == i {
|
|
t = ctx.(antlr.RuleContext)
|
|
break
|
|
}
|
|
j++
|
|
}
|
|
}
|
|
|
|
if t == nil {
|
|
return nil
|
|
}
|
|
|
|
return t.(IValueContext)
|
|
}
|
|
|
|
func (s *ValuesContext) AllCOMMA() []antlr.TerminalNode {
|
|
return s.GetTokens(MatchParserCOMMA)
|
|
}
|
|
|
|
func (s *ValuesContext) COMMA(i int) antlr.TerminalNode {
|
|
return s.GetToken(MatchParserCOMMA, i)
|
|
}
|
|
|
|
func (s *ValuesContext) GetRuleContext() antlr.RuleContext {
|
|
return s
|
|
}
|
|
|
|
func (s *ValuesContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
|
|
return antlr.TreesStringTree(s, ruleNames, recog)
|
|
}
|
|
|
|
func (s *ValuesContext) EnterRule(listener antlr.ParseTreeListener) {
|
|
if listenerT, ok := listener.(MatchListener); ok {
|
|
listenerT.EnterValues(s)
|
|
}
|
|
}
|
|
|
|
func (s *ValuesContext) ExitRule(listener antlr.ParseTreeListener) {
|
|
if listenerT, ok := listener.(MatchListener); ok {
|
|
listenerT.ExitValues(s)
|
|
}
|
|
}
|
|
|
|
func (p *MatchParser) Values() (localctx IValuesContext) {
|
|
localctx = NewValuesContext(p, p.GetParserRuleContext(), p.GetState())
|
|
p.EnterRule(localctx, 8, MatchParserRULE_values)
|
|
var _la int
|
|
|
|
p.EnterOuterAlt(localctx, 1)
|
|
p.SetState(38)
|
|
p.GetErrorHandler().Sync(p)
|
|
if p.HasError() {
|
|
goto errorExit
|
|
}
|
|
_la = p.GetTokenStream().LA(1)
|
|
|
|
if _la == MatchParserSTRING {
|
|
{
|
|
p.SetState(37)
|
|
p.Value()
|
|
}
|
|
|
|
}
|
|
p.SetState(46)
|
|
p.GetErrorHandler().Sync(p)
|
|
if p.HasError() {
|
|
goto errorExit
|
|
}
|
|
_la = p.GetTokenStream().LA(1)
|
|
|
|
for _la == MatchParserCOMMA {
|
|
{
|
|
p.SetState(40)
|
|
p.Match(MatchParserCOMMA)
|
|
if p.HasError() {
|
|
// Recognition error - abort rule
|
|
goto errorExit
|
|
}
|
|
}
|
|
p.SetState(42)
|
|
p.GetErrorHandler().Sync(p)
|
|
if p.HasError() {
|
|
goto errorExit
|
|
}
|
|
_la = p.GetTokenStream().LA(1)
|
|
|
|
if _la == MatchParserSTRING {
|
|
{
|
|
p.SetState(41)
|
|
p.Value()
|
|
}
|
|
|
|
}
|
|
|
|
p.SetState(48)
|
|
p.GetErrorHandler().Sync(p)
|
|
if p.HasError() {
|
|
goto errorExit
|
|
}
|
|
_la = p.GetTokenStream().LA(1)
|
|
}
|
|
|
|
errorExit:
|
|
if p.HasError() {
|
|
v := p.GetError()
|
|
localctx.SetException(v)
|
|
p.GetErrorHandler().ReportError(p, v)
|
|
p.GetErrorHandler().Recover(p, v)
|
|
p.SetError(nil)
|
|
}
|
|
p.ExitRule()
|
|
return localctx
|
|
goto errorExit // Trick to prevent compiler error if the label is not used
|
|
}
|
|
|
|
// IValueContext is an interface to support dynamic dispatch.
|
|
type IValueContext interface {
|
|
antlr.ParserRuleContext
|
|
|
|
// GetParser returns the parser.
|
|
GetParser() antlr.Parser
|
|
|
|
// Getter signatures
|
|
STRING() antlr.TerminalNode
|
|
|
|
// IsValueContext differentiates from other interfaces.
|
|
IsValueContext()
|
|
}
|
|
|
|
type ValueContext struct {
|
|
antlr.BaseParserRuleContext
|
|
parser antlr.Parser
|
|
}
|
|
|
|
func NewEmptyValueContext() *ValueContext {
|
|
var p = new(ValueContext)
|
|
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
|
|
p.RuleIndex = MatchParserRULE_value
|
|
return p
|
|
}
|
|
|
|
func InitEmptyValueContext(p *ValueContext) {
|
|
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1)
|
|
p.RuleIndex = MatchParserRULE_value
|
|
}
|
|
|
|
func (*ValueContext) IsValueContext() {}
|
|
|
|
func NewValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ValueContext {
|
|
var p = new(ValueContext)
|
|
|
|
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState)
|
|
|
|
p.parser = parser
|
|
p.RuleIndex = MatchParserRULE_value
|
|
|
|
return p
|
|
}
|
|
|
|
func (s *ValueContext) GetParser() antlr.Parser { return s.parser }
|
|
|
|
func (s *ValueContext) STRING() antlr.TerminalNode {
|
|
return s.GetToken(MatchParserSTRING, 0)
|
|
}
|
|
|
|
func (s *ValueContext) GetRuleContext() antlr.RuleContext {
|
|
return s
|
|
}
|
|
|
|
func (s *ValueContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
|
|
return antlr.TreesStringTree(s, ruleNames, recog)
|
|
}
|
|
|
|
func (s *ValueContext) EnterRule(listener antlr.ParseTreeListener) {
|
|
if listenerT, ok := listener.(MatchListener); ok {
|
|
listenerT.EnterValue(s)
|
|
}
|
|
}
|
|
|
|
func (s *ValueContext) ExitRule(listener antlr.ParseTreeListener) {
|
|
if listenerT, ok := listener.(MatchListener); ok {
|
|
listenerT.ExitValue(s)
|
|
}
|
|
}
|
|
|
|
func (p *MatchParser) Value() (localctx IValueContext) {
|
|
localctx = NewValueContext(p, p.GetParserRuleContext(), p.GetState())
|
|
p.EnterRule(localctx, 10, MatchParserRULE_value)
|
|
p.EnterOuterAlt(localctx, 1)
|
|
{
|
|
p.SetState(49)
|
|
p.Match(MatchParserSTRING)
|
|
if p.HasError() {
|
|
// Recognition error - abort rule
|
|
goto errorExit
|
|
}
|
|
}
|
|
|
|
errorExit:
|
|
if p.HasError() {
|
|
v := p.GetError()
|
|
localctx.SetException(v)
|
|
p.GetErrorHandler().ReportError(p, v)
|
|
p.GetErrorHandler().Recover(p, v)
|
|
p.SetError(nil)
|
|
}
|
|
p.ExitRule()
|
|
return localctx
|
|
goto errorExit // Trick to prevent compiler error if the label is not used
|
|
}
|