From 2b7133406d98f3bfcecd3e99fccb917b4eaf54a9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 18:21:03 +0000 Subject: [PATCH 1/2] fix(deps): update module github.com/antlr/antlr4/runtime/go/antlr/v4 to v4.0.0-20260101203826-8e6fd9147b3c --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 048a3ab118..99896d8373 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( git.sr.ht/~nelsam/hel v0.6.6 github.com/adrg/xdg v0.5.3 github.com/alexcb/binarystream v0.0.0-20231130184431-f2f7a7543c6d - github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230219212500-1f9a474cc2dc + github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20260101203826-8e6fd9147b3c github.com/aws/aws-sdk-go-v2 v1.41.1 github.com/aws/aws-sdk-go-v2/config v1.32.7 github.com/containerd/go-runc v1.1.0 From 971da1de32bc5e2a6caffc6a0c4b94bf29ba1ae6 Mon Sep 17 00:00:00 2001 From: Janis Horsts Date: Sat, 31 Jan 2026 08:59:54 +0000 Subject: [PATCH 2/2] fix: antlr --- ast/antlrhandler/error_listener.go | 2 +- ast/antlrhandler/error_strategy.go | 2 +- ast/ast.go | 2 +- ast/lexer.go | 2 +- ast/listener.go | 2 +- ast/parser/Earthfile | 2 +- ast/parser/earth_lexer.go | 49 +- ast/parser/earth_parser.go | 4392 +++++++++++++---------- ast/parser/earthparser_base_listener.go | 4 +- ast/parser/earthparser_listener.go | 4 +- ast/parser/export.go | 9 +- go.mod | 4 +- go.sum | 10 +- 13 files changed, 2494 insertions(+), 1990 deletions(-) diff --git a/ast/antlrhandler/error_listener.go b/ast/antlrhandler/error_listener.go index 68735d9bbc..89082254f9 100644 --- a/ast/antlrhandler/error_listener.go +++ b/ast/antlrhandler/error_listener.go @@ -6,7 +6,7 @@ import ( "github.com/EarthBuild/earthbuild/ast/parser" "github.com/EarthBuild/earthbuild/util/hint" - "github.com/antlr/antlr4/runtime/Go/antlr/v4" + "github.com/antlr4-go/antlr/v4" "github.com/pkg/errors" ) diff --git a/ast/antlrhandler/error_strategy.go b/ast/antlrhandler/error_strategy.go index 9b7d1b8185..7262037627 100644 --- a/ast/antlrhandler/error_strategy.go +++ b/ast/antlrhandler/error_strategy.go @@ -3,7 +3,7 @@ package antlrhandler import ( "fmt" - "github.com/antlr/antlr4/runtime/Go/antlr/v4" + "github.com/antlr4-go/antlr/v4" "github.com/pkg/errors" ) diff --git a/ast/ast.go b/ast/ast.go index 15cfdbc5b6..26c76a3b79 100644 --- a/ast/ast.go +++ b/ast/ast.go @@ -8,7 +8,7 @@ import ( "github.com/EarthBuild/earthbuild/ast/parser" "github.com/EarthBuild/earthbuild/ast/spec" "github.com/EarthBuild/earthbuild/util/hint" - "github.com/antlr/antlr4/runtime/Go/antlr/v4" + "github.com/antlr4-go/antlr/v4" "github.com/pkg/errors" ) diff --git a/ast/lexer.go b/ast/lexer.go index ac82c155c4..5e87c2ff7a 100644 --- a/ast/lexer.go +++ b/ast/lexer.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/EarthBuild/earthbuild/ast/parser" - "github.com/antlr/antlr4/runtime/Go/antlr/v4" + "github.com/antlr4-go/antlr/v4" ) const ( diff --git a/ast/listener.go b/ast/listener.go index 251ce61439..2657ae51bd 100644 --- a/ast/listener.go +++ b/ast/listener.go @@ -9,7 +9,7 @@ import ( "github.com/EarthBuild/earthbuild/ast/parser" "github.com/EarthBuild/earthbuild/ast/spec" - "github.com/antlr/antlr4/runtime/Go/antlr/v4" + "github.com/antlr4-go/antlr/v4" "github.com/pkg/errors" ) diff --git a/ast/parser/Earthfile b/ast/parser/Earthfile index fd6b39650e..78b9d9a50c 100644 --- a/ast/parser/Earthfile +++ b/ast/parser/Earthfile @@ -8,7 +8,7 @@ RUN apk add --no-cache ca-certificates curl openssl go && \ # Install antlr. WORKDIR /usr/local/lib # renovate: datasource=github-releases packageName=antlr/antlr4 -ARG --global ANTLR_VERSION=4.12.0 +ARG --global ANTLR_VERSION=4.13.1 RUN echo curl -O https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar RUN curl -O https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar WORKDIR /earthly diff --git a/ast/parser/earth_lexer.go b/ast/parser/earth_lexer.go index 02d4f5f866..bbc2f81a05 100644 --- a/ast/parser/earth_lexer.go +++ b/ast/parser/earth_lexer.go @@ -1,13 +1,12 @@ -// Code generated from ast/parser/EarthLexer.g4 by ANTLR 4.12.0. DO NOT EDIT. +// Code generated from ast/parser/EarthLexer.g4 by ANTLR 4.13.1. DO NOT EDIT. package parser import ( "fmt" + "github.com/antlr4-go/antlr/v4" "sync" "unicode" - - "github.com/antlr/antlr4/runtime/Go/antlr/v4" ) // Suppress unused import error @@ -22,29 +21,29 @@ type EarthLexer struct { // TODO: EOF string } -var earthlexerLexerStaticData struct { +var EarthLexerLexerStaticData struct { once sync.Once serializedATN []int32 - channelNames []string - modeNames []string - literalNames []string - symbolicNames []string - ruleNames []string - predictionContextCache *antlr.PredictionContextCache + ChannelNames []string + ModeNames []string + LiteralNames []string + SymbolicNames []string + RuleNames []string + PredictionContextCache *antlr.PredictionContextCache atn *antlr.ATN decisionToDFA []*antlr.DFA } func earthlexerLexerInit() { - staticData := &earthlexerLexerStaticData - staticData.channelNames = []string{ + staticData := &EarthLexerLexerStaticData + staticData.ChannelNames = []string{ "DEFAULT_TOKEN_CHANNEL", "HIDDEN", "WHITESPACE_CHANNEL", "COMMENTS_CHANNEL", } - staticData.modeNames = []string{ + staticData.ModeNames = []string{ "DEFAULT_MODE", "RECIPE", "BLOCK", "COMMAND_ARGS", "COMMAND_ARGS_KEY_VALUE", "COMMAND_ARGS_KEY_VALUE_ASSIGNMENT", "COMMAND_ARGS_KEY_VALUE_LABEL", } - staticData.literalNames = []string{ + staticData.LiteralNames = []string{ "", "", "", "", "", "", "'FROM'", "'FROM DOCKERFILE'", "'LOCALLY'", "'COPY'", "'SAVE ARTIFACT'", "'SAVE IMAGE'", "'RUN'", "'EXPOSE'", "'VOLUME'", "'ENV'", "'ARG'", "'SET'", "'LET'", "'LABEL'", "'BUILD'", "'WORKDIR'", @@ -54,7 +53,7 @@ func earthlexerLexerInit() { "", "", "", "", "", "", "", "", "'ELSE'", "'ELSE IF'", "'CATCH'", "'FINALLY'", "'END'", } - staticData.symbolicNames = []string{ + staticData.SymbolicNames = []string{ "", "INDENT", "DEDENT", "Target", "UserCommand", "Function", "FROM", "FROM_DOCKERFILE", "LOCALLY", "COPY", "SAVE_ARTIFACT", "SAVE_IMAGE", "RUN", "EXPOSE", "VOLUME", "ENV", "ARG", "SET", "LET", "LABEL", "BUILD", @@ -64,7 +63,7 @@ func earthlexerLexerInit() { "FOR", "WAIT", "NL", "WS", "COMMENT", "ELSE", "ELSE_IF", "CATCH", "FINALLY", "END", "Atom", "EQUALS", } - staticData.ruleNames = []string{ + staticData.RuleNames = []string{ "Target", "UserCommand", "Function", "FROM", "FROM_DOCKERFILE", "LOCALLY", "COPY", "SAVE_ARTIFACT", "SAVE_IMAGE", "RUN", "EXPOSE", "VOLUME", "ENV", "ARG", "SET", "LET", "LABEL", "BUILD", "WORKDIR", "USER", "CMD", "ENTRYPOINT", @@ -91,7 +90,7 @@ func earthlexerLexerInit() { "WS_CAKV", "COMMENT_CAKV", "Atom_CAKVA", "NL_CAKVA", "WS_CAKVA", "COMMENT_CAKVA", "EQUALS_L", "Atom_CAKVL", "NL_CAKVL", "WS_CAKVL", "COMMENT_CAKVL", } - staticData.predictionContextCache = antlr.NewPredictionContextCache() + staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ 4, 0, 54, 1379, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, @@ -726,7 +725,7 @@ func earthlexerLexerInit() { // NewEarthLexer(). You can call this function if you wish to initialize the static state ahead // of time. func EarthLexerInit() { - staticData := &earthlexerLexerStaticData + staticData := &EarthLexerLexerStaticData staticData.once.Do(earthlexerLexerInit) } @@ -735,13 +734,13 @@ func NewEarthLexer(input antlr.CharStream) *EarthLexer { EarthLexerInit() l := new(EarthLexer) l.BaseLexer = antlr.NewBaseLexer(input) - staticData := &earthlexerLexerStaticData - l.Interpreter = antlr.NewLexerATNSimulator(l, staticData.atn, staticData.decisionToDFA, staticData.predictionContextCache) - l.channelNames = staticData.channelNames - l.modeNames = staticData.modeNames - l.RuleNames = staticData.ruleNames - l.LiteralNames = staticData.literalNames - l.SymbolicNames = staticData.symbolicNames + staticData := &EarthLexerLexerStaticData + l.Interpreter = antlr.NewLexerATNSimulator(l, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache) + l.channelNames = staticData.ChannelNames + l.modeNames = staticData.ModeNames + l.RuleNames = staticData.RuleNames + l.LiteralNames = staticData.LiteralNames + l.SymbolicNames = staticData.SymbolicNames l.GrammarFileName = "EarthLexer.g4" // TODO: l.EOF = antlr.TokenEOF diff --git a/ast/parser/earth_parser.go b/ast/parser/earth_parser.go index 0be305a2e4..cddde7bb30 100644 --- a/ast/parser/earth_parser.go +++ b/ast/parser/earth_parser.go @@ -1,4 +1,4 @@ -// Code generated from ast/parser/EarthParser.g4 by ANTLR 4.12.0. DO NOT EDIT. +// Code generated from ast/parser/EarthParser.g4 by ANTLR 4.13.1. DO NOT EDIT. package parser // EarthParser @@ -7,7 +7,7 @@ import ( "strconv" "sync" - "github.com/antlr/antlr4/runtime/Go/antlr/v4" + "github.com/antlr4-go/antlr/v4" ) // Suppress unused import errors @@ -19,20 +19,20 @@ type EarthParser struct { *antlr.BaseParser } -var earthparserParserStaticData struct { +var EarthParserParserStaticData struct { once sync.Once serializedATN []int32 - literalNames []string - symbolicNames []string - ruleNames []string - predictionContextCache *antlr.PredictionContextCache + LiteralNames []string + SymbolicNames []string + RuleNames []string + PredictionContextCache *antlr.PredictionContextCache atn *antlr.ATN decisionToDFA []*antlr.DFA } func earthparserParserInit() { - staticData := &earthparserParserStaticData - staticData.literalNames = []string{ + staticData := &EarthParserParserStaticData + staticData.LiteralNames = []string{ "", "", "", "", "", "", "'FROM'", "'FROM DOCKERFILE'", "'LOCALLY'", "'COPY'", "'SAVE ARTIFACT'", "'SAVE IMAGE'", "'RUN'", "'EXPOSE'", "'VOLUME'", "'ENV'", "'ARG'", "'SET'", "'LET'", "'LABEL'", "'BUILD'", "'WORKDIR'", @@ -42,7 +42,7 @@ func earthparserParserInit() { "", "", "", "", "", "", "", "", "'ELSE'", "'ELSE IF'", "'CATCH'", "'FINALLY'", "'END'", } - staticData.symbolicNames = []string{ + staticData.SymbolicNames = []string{ "", "INDENT", "DEDENT", "Target", "UserCommand", "Function", "FROM", "FROM_DOCKERFILE", "LOCALLY", "COPY", "SAVE_ARTIFACT", "SAVE_IMAGE", "RUN", "EXPOSE", "VOLUME", "ENV", "ARG", "SET", "LET", "LABEL", "BUILD", @@ -52,7 +52,7 @@ func earthparserParserInit() { "FOR", "WAIT", "NL", "WS", "COMMENT", "ELSE", "ELSE_IF", "CATCH", "FINALLY", "END", "Atom", "EQUALS", } - staticData.ruleNames = []string{ + staticData.RuleNames = []string{ "earthFile", "targets", "targetOrUserCommand", "target", "targetHeader", "userCommand", "userCommandHeader", "function", "functionHeader", "stmts", "stmt", "commandStmt", "version", "withStmt", "withBlock", "withExpr", @@ -70,7 +70,7 @@ func earthparserParserInit() { "importStmt", "cacheStmt", "hostStmt", "projectStmt", "expr", "stmtWordsMaybeJSON", "stmtWords", "stmtWord", } - staticData.predictionContextCache = antlr.NewPredictionContextCache() + staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ 4, 1, 54, 741, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, @@ -424,7 +424,7 @@ func earthparserParserInit() { // NewEarthParser(). You can call this function if you wish to initialize the static state ahead // of time. func EarthParserInit() { - staticData := &earthparserParserStaticData + staticData := &EarthParserParserStaticData staticData.once.Do(earthparserParserInit) } @@ -433,11 +433,11 @@ func NewEarthParser(input antlr.TokenStream) *EarthParser { EarthParserInit() this := new(EarthParser) this.BaseParser = antlr.NewBaseParser(input) - staticData := &earthparserParserStaticData - this.Interpreter = antlr.NewParserATNSimulator(this, staticData.atn, staticData.decisionToDFA, staticData.predictionContextCache) - this.RuleNames = staticData.ruleNames - this.LiteralNames = staticData.literalNames - this.SymbolicNames = staticData.symbolicNames + staticData := &EarthParserParserStaticData + 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 = "EarthParser.g4" return this @@ -610,23 +610,28 @@ type IEarthFileContext interface { } type EarthFileContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyEarthFileContext() *EarthFileContext { var p = new(EarthFileContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_earthFile return p } +func InitEmptyEarthFileContext(p *EarthFileContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_earthFile +} + func (*EarthFileContext) IsEarthFileContext() {} func NewEarthFileContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EarthFileContext { var p = new(EarthFileContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_earthFile @@ -717,50 +722,49 @@ func (s *EarthFileContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) EarthFile() (localctx IEarthFileContext) { - this := p - _ = this - localctx = NewEarthFileContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 0, EarthParserRULE_earthFile) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - var _alt int p.EnterOuterAlt(localctx, 1) p.SetState(171) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 0, p.GetParserRuleContext()) - + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 0, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { { p.SetState(168) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } } p.SetState(173) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 0, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 0, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } } p.SetState(175) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserVERSION { @@ -772,6 +776,9 @@ func (p *EarthParser) EarthFile() (localctx IEarthFileContext) { } p.SetState(180) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&34050500722624) != 0 { @@ -782,27 +789,49 @@ func (p *EarthParser) EarthFile() (localctx IEarthFileContext) { { p.SetState(178) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } } p.SetState(185) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 3, p.GetParserRuleContext()) - + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 3, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { { p.SetState(182) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } } p.SetState(187) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 3, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 3, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } } p.SetState(189) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserTarget || _la == EarthParserUserCommand { @@ -814,24 +843,48 @@ func (p *EarthParser) EarthFile() (localctx IEarthFileContext) { } p.SetState(194) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for _la == EarthParserNL { { p.SetState(191) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(196) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { p.SetState(197) p.Match(EarthParserEOF) + 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 } // ITargetsContext is an interface to support dynamic dispatch. @@ -852,23 +905,28 @@ type ITargetsContext interface { } type TargetsContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyTargetsContext() *TargetsContext { var p = new(TargetsContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_targets return p } +func InitEmptyTargetsContext(p *TargetsContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_targets +} + func (*TargetsContext) IsTargetsContext() {} func NewTargetsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TargetsContext { var p = new(TargetsContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_targets @@ -948,29 +1006,10 @@ func (s *TargetsContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) Targets() (localctx ITargetsContext) { - this := p - _ = this - localctx = NewTargetsContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 2, EarthParserRULE_targets) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - var _alt int p.EnterOuterAlt(localctx, 1) @@ -980,22 +1019,37 @@ func (p *EarthParser) Targets() (localctx ITargetsContext) { } p.SetState(209) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 7, p.GetParserRuleContext()) - + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 7, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { p.SetState(203) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for _la == EarthParserNL { { p.SetState(200) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(205) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { @@ -1006,10 +1060,26 @@ func (p *EarthParser) Targets() (localctx ITargetsContext) { } p.SetState(211) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 7, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 7, p.GetParserRuleContext()) + if p.HasError() { + 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 } // ITargetOrUserCommandContext is an interface to support dynamic dispatch. @@ -1028,23 +1098,28 @@ type ITargetOrUserCommandContext interface { } type TargetOrUserCommandContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyTargetOrUserCommandContext() *TargetOrUserCommandContext { var p = new(TargetOrUserCommandContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_targetOrUserCommand return p } +func InitEmptyTargetOrUserCommandContext(p *TargetOrUserCommandContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_targetOrUserCommand +} + func (*TargetOrUserCommandContext) IsTargetOrUserCommandContext() {} func NewTargetOrUserCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TargetOrUserCommandContext { var p = new(TargetOrUserCommandContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_targetOrUserCommand @@ -1107,30 +1182,13 @@ func (s *TargetOrUserCommandContext) ExitRule(listener antlr.ParseTreeListener) } func (p *EarthParser) TargetOrUserCommand() (localctx ITargetOrUserCommandContext) { - this := p - _ = this - localctx = NewTargetOrUserCommandContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 4, EarthParserRULE_targetOrUserCommand) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.SetState(214) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } switch p.GetTokenStream().LA(1) { case EarthParserTarget: @@ -1148,10 +1206,21 @@ func (p *EarthParser) TargetOrUserCommand() (localctx ITargetOrUserCommandContex } default: - panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + 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 } // ITargetContext is an interface to support dynamic dispatch. @@ -1174,23 +1243,28 @@ type ITargetContext interface { } type TargetContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyTargetContext() *TargetContext { var p = new(TargetContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_target return p } +func InitEmptyTargetContext(p *TargetContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_target +} + func (*TargetContext) IsTargetContext() {} func NewTargetContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TargetContext { var p = new(TargetContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_target @@ -1269,29 +1343,10 @@ func (s *TargetContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) Target() (localctx ITargetContext) { - this := p - _ = this - localctx = NewTargetContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 6, EarthParserRULE_target) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - var _alt int p.EnterOuterAlt(localctx, 1) @@ -1301,6 +1356,9 @@ func (p *EarthParser) Target() (localctx ITargetContext) { } p.SetState(218) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _alt = 1 for ok := true; ok; ok = _alt != 2 && _alt != antlr.ATNInvalidAltNumber { switch _alt { @@ -1308,43 +1366,76 @@ func (p *EarthParser) Target() (localctx ITargetContext) { { p.SetState(217) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } default: - panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit } p.SetState(220) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 9, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 9, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } } p.SetState(238) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserINDENT { { p.SetState(222) p.Match(EarthParserINDENT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(226) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 10, p.GetParserRuleContext()) - + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 10, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { { p.SetState(223) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } } p.SetState(228) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 10, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 10, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } } p.SetState(230) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&34050500722624) != 0 { @@ -1356,26 +1447,50 @@ func (p *EarthParser) Target() (localctx ITargetContext) { } p.SetState(233) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(232) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(235) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { p.SetState(237) p.Match(EarthParserDEDENT) + 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 } // ITargetHeaderContext is an interface to support dynamic dispatch. @@ -1393,23 +1508,28 @@ type ITargetHeaderContext interface { } type TargetHeaderContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyTargetHeaderContext() *TargetHeaderContext { var p = new(TargetHeaderContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_targetHeader return p } +func InitEmptyTargetHeaderContext(p *TargetHeaderContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_targetHeader +} + func (*TargetHeaderContext) IsTargetHeaderContext() {} func NewTargetHeaderContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TargetHeaderContext { var p = new(TargetHeaderContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_targetHeader @@ -1444,35 +1564,29 @@ func (s *TargetHeaderContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) TargetHeader() (localctx ITargetHeaderContext) { - this := p - _ = this - localctx = NewTargetHeaderContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 8, EarthParserRULE_targetHeader) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(240) p.Match(EarthParserTarget) + 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 } // IUserCommandContext is an interface to support dynamic dispatch. @@ -1495,23 +1609,28 @@ type IUserCommandContext interface { } type UserCommandContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyUserCommandContext() *UserCommandContext { var p = new(UserCommandContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_userCommand return p } +func InitEmptyUserCommandContext(p *UserCommandContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_userCommand +} + func (*UserCommandContext) IsUserCommandContext() {} func NewUserCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *UserCommandContext { var p = new(UserCommandContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_userCommand @@ -1590,29 +1709,10 @@ func (s *UserCommandContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) UserCommand() (localctx IUserCommandContext) { - this := p - _ = this - localctx = NewUserCommandContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 10, EarthParserRULE_userCommand) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - var _alt int p.EnterOuterAlt(localctx, 1) @@ -1622,6 +1722,9 @@ func (p *EarthParser) UserCommand() (localctx IUserCommandContext) { } p.SetState(244) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _alt = 1 for ok := true; ok; ok = _alt != 2 && _alt != antlr.ATNInvalidAltNumber { switch _alt { @@ -1629,37 +1732,62 @@ func (p *EarthParser) UserCommand() (localctx IUserCommandContext) { { p.SetState(243) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } default: - panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit } p.SetState(246) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 14, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 14, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } } p.SetState(263) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserINDENT { { p.SetState(248) p.Match(EarthParserINDENT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(252) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for _la == EarthParserNL { { p.SetState(249) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(254) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { @@ -1668,26 +1796,50 @@ func (p *EarthParser) UserCommand() (localctx IUserCommandContext) { } p.SetState(257) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(256) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(259) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { p.SetState(261) p.Match(EarthParserDEDENT) + 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 } // IUserCommandHeaderContext is an interface to support dynamic dispatch. @@ -1705,23 +1857,28 @@ type IUserCommandHeaderContext interface { } type UserCommandHeaderContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyUserCommandHeaderContext() *UserCommandHeaderContext { var p = new(UserCommandHeaderContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_userCommandHeader return p } +func InitEmptyUserCommandHeaderContext(p *UserCommandHeaderContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_userCommandHeader +} + func (*UserCommandHeaderContext) IsUserCommandHeaderContext() {} func NewUserCommandHeaderContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *UserCommandHeaderContext { var p = new(UserCommandHeaderContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_userCommandHeader @@ -1756,35 +1913,29 @@ func (s *UserCommandHeaderContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) UserCommandHeader() (localctx IUserCommandHeaderContext) { - this := p - _ = this - localctx = NewUserCommandHeaderContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 12, EarthParserRULE_userCommandHeader) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(265) p.Match(EarthParserUserCommand) + 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 } // IFunctionContext is an interface to support dynamic dispatch. @@ -1807,23 +1958,28 @@ type IFunctionContext interface { } type FunctionContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyFunctionContext() *FunctionContext { var p = new(FunctionContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_function return p } +func InitEmptyFunctionContext(p *FunctionContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_function +} + func (*FunctionContext) IsFunctionContext() {} func NewFunctionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FunctionContext { var p = new(FunctionContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_function @@ -1902,29 +2058,10 @@ func (s *FunctionContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) Function() (localctx IFunctionContext) { - this := p - _ = this - localctx = NewFunctionContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 14, EarthParserRULE_function) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(267) @@ -1932,39 +2069,66 @@ func (p *EarthParser) Function() (localctx IFunctionContext) { } p.SetState(269) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(268) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(271) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } p.SetState(288) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserINDENT { { p.SetState(273) p.Match(EarthParserINDENT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(277) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for _la == EarthParserNL { { p.SetState(274) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(279) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { @@ -1973,26 +2137,50 @@ func (p *EarthParser) Function() (localctx IFunctionContext) { } p.SetState(282) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(281) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(284) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { p.SetState(286) p.Match(EarthParserDEDENT) + 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 } // IFunctionHeaderContext is an interface to support dynamic dispatch. @@ -2010,23 +2198,28 @@ type IFunctionHeaderContext interface { } type FunctionHeaderContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyFunctionHeaderContext() *FunctionHeaderContext { var p = new(FunctionHeaderContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_functionHeader return p } +func InitEmptyFunctionHeaderContext(p *FunctionHeaderContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_functionHeader +} + func (*FunctionHeaderContext) IsFunctionHeaderContext() {} func NewFunctionHeaderContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FunctionHeaderContext { var p = new(FunctionHeaderContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_functionHeader @@ -2061,35 +2254,29 @@ func (s *FunctionHeaderContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) FunctionHeader() (localctx IFunctionHeaderContext) { - this := p - _ = this - localctx = NewFunctionHeaderContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 16, EarthParserRULE_functionHeader) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(290) p.Match(EarthParserFunction) + 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 } // IStmtsContext is an interface to support dynamic dispatch. @@ -2110,23 +2297,28 @@ type IStmtsContext interface { } type StmtsContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyStmtsContext() *StmtsContext { var p = new(StmtsContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_stmts return p } +func InitEmptyStmtsContext(p *StmtsContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_stmts +} + func (*StmtsContext) IsStmtsContext() {} func NewStmtsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StmtsContext { var p = new(StmtsContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_stmts @@ -2206,29 +2398,10 @@ func (s *StmtsContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) Stmts() (localctx IStmtsContext) { - this := p - _ = this - localctx = NewStmtsContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 18, EarthParserRULE_stmts) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - var _alt int p.EnterOuterAlt(localctx, 1) @@ -2238,22 +2411,37 @@ func (p *EarthParser) Stmts() (localctx IStmtsContext) { } p.SetState(301) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 23, p.GetParserRuleContext()) - + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 23, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { p.SetState(294) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(293) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(296) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { @@ -2264,10 +2452,26 @@ func (p *EarthParser) Stmts() (localctx IStmtsContext) { } p.SetState(303) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 23, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 23, p.GetParserRuleContext()) + if p.HasError() { + 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 } // IStmtContext is an interface to support dynamic dispatch. @@ -2290,23 +2494,28 @@ type IStmtContext interface { } type StmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyStmtContext() *StmtContext { var p = new(StmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_stmt return p } +func InitEmptyStmtContext(p *StmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_stmt +} + func (*StmtContext) IsStmtContext() {} func NewStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StmtContext { var p = new(StmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_stmt @@ -2433,30 +2642,13 @@ func (s *StmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) Stmt() (localctx IStmtContext) { - this := p - _ = this - localctx = NewStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 20, EarthParserRULE_stmt) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.SetState(310) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } switch p.GetTokenStream().LA(1) { case EarthParserFROM, EarthParserFROM_DOCKERFILE, EarthParserLOCALLY, EarthParserCOPY, EarthParserSAVE_ARTIFACT, EarthParserSAVE_IMAGE, EarthParserRUN, EarthParserEXPOSE, EarthParserVOLUME, EarthParserENV, EarthParserARG, EarthParserSET, EarthParserLET, EarthParserLABEL, EarthParserBUILD, EarthParserWORKDIR, EarthParserUSER, EarthParserCMD, EarthParserENTRYPOINT, EarthParserGIT_CLONE, EarthParserADD, EarthParserSTOPSIGNAL, EarthParserONBUILD, EarthParserHEALTHCHECK, EarthParserSHELL, EarthParserDO, EarthParserCOMMAND, EarthParserFUNCTION, EarthParserIMPORT, EarthParserCACHE, EarthParserHOST, EarthParserPROJECT: @@ -2502,10 +2694,21 @@ func (p *EarthParser) Stmt() (localctx IStmtContext) { } default: - panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + 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 } // ICommandStmtContext is an interface to support dynamic dispatch. @@ -2553,23 +2756,28 @@ type ICommandStmtContext interface { } type CommandStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyCommandStmtContext() *CommandStmtContext { var p = new(CommandStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_commandStmt return p } +func InitEmptyCommandStmtContext(p *CommandStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_commandStmt +} + func (*CommandStmtContext) IsCommandStmtContext() {} func NewCommandStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CommandStmtContext { var p = new(CommandStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_commandStmt @@ -3096,30 +3304,13 @@ func (s *CommandStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) CommandStmt() (localctx ICommandStmtContext) { - this := p - _ = this - localctx = NewCommandStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 22, EarthParserRULE_commandStmt) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.SetState(343) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } switch p.GetTokenStream().LA(1) { case EarthParserFROM: @@ -3340,10 +3531,21 @@ func (p *EarthParser) CommandStmt() (localctx ICommandStmtContext) { } default: - panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + 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 } // IVersionContext is an interface to support dynamic dispatch. @@ -3364,23 +3566,28 @@ type IVersionContext interface { } type VersionContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyVersionContext() *VersionContext { var p = new(VersionContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_version return p } +func InitEmptyVersionContext(p *VersionContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_version +} + func (*VersionContext) IsVersionContext() {} func NewVersionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *VersionContext { var p = new(VersionContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_version @@ -3439,34 +3646,18 @@ func (s *VersionContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) Version() (localctx IVersionContext) { - this := p - _ = this - localctx = NewVersionContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 24, EarthParserRULE_version) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - var _alt int p.EnterOuterAlt(localctx, 1) { p.SetState(345) p.Match(EarthParserVERSION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(346) @@ -3474,6 +3665,9 @@ func (p *EarthParser) Version() (localctx IVersionContext) { } p.SetState(348) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _alt = 1 for ok := true; ok; ok = _alt != 2 && _alt != antlr.ATNInvalidAltNumber { switch _alt { @@ -3481,18 +3675,36 @@ func (p *EarthParser) Version() (localctx IVersionContext) { { p.SetState(347) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } default: - panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit } p.SetState(350) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 26, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 26, p.GetParserRuleContext()) + if p.HasError() { + 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 } // IWithStmtContext is an interface to support dynamic dispatch. @@ -3514,23 +3726,28 @@ type IWithStmtContext interface { } type WithStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyWithStmtContext() *WithStmtContext { var p = new(WithStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_withStmt return p } +func InitEmptyWithStmtContext(p *WithStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_withStmt +} + func (*WithStmtContext) IsWithStmtContext() {} func NewWithStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WithStmtContext { var p = new(WithStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_withStmt @@ -3605,29 +3822,10 @@ func (s *WithStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) WithStmt() (localctx IWithStmtContext) { - this := p - _ = this - localctx = NewWithStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 26, EarthParserRULE_withStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(352) @@ -3636,19 +3834,29 @@ func (p *EarthParser) WithStmt() (localctx IWithStmtContext) { p.SetState(359) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 28, p.GetParserRuleContext()) == 1 { + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 28, p.GetParserRuleContext()) == 1 { p.SetState(354) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(353) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(356) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { @@ -3656,27 +3864,53 @@ func (p *EarthParser) WithStmt() (localctx IWithStmtContext) { p.WithBlock() } + } else if p.HasError() { // JIM + goto errorExit } p.SetState(362) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(361) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(364) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { p.SetState(366) p.Match(EarthParserEND) + 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 } // IWithBlockContext is an interface to support dynamic dispatch. @@ -3694,23 +3928,28 @@ type IWithBlockContext interface { } type WithBlockContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyWithBlockContext() *WithBlockContext { var p = new(WithBlockContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_withBlock return p } +func InitEmptyWithBlockContext(p *WithBlockContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_withBlock +} + func (*WithBlockContext) IsWithBlockContext() {} func NewWithBlockContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WithBlockContext { var p = new(WithBlockContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_withBlock @@ -3757,35 +3996,25 @@ func (s *WithBlockContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) WithBlock() (localctx IWithBlockContext) { - this := p - _ = this - localctx = NewWithBlockContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 28, EarthParserRULE_withBlock) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(368) p.Stmts() } +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 } // IWithExprContext is an interface to support dynamic dispatch. @@ -3804,23 +4033,28 @@ type IWithExprContext interface { } type WithExprContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyWithExprContext() *WithExprContext { var p = new(WithExprContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_withExpr return p } +func InitEmptyWithExprContext(p *WithExprContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_withExpr +} + func (*WithExprContext) IsWithExprContext() {} func NewWithExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WithExprContext { var p = new(WithExprContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_withExpr @@ -3871,39 +4105,33 @@ func (s *WithExprContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) WithExpr() (localctx IWithExprContext) { - this := p - _ = this - localctx = NewWithExprContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 30, EarthParserRULE_withExpr) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(370) p.Match(EarthParserWITH) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(371) p.WithCommand() } +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 } // IWithCommandContext is an interface to support dynamic dispatch. @@ -3921,23 +4149,28 @@ type IWithCommandContext interface { } type WithCommandContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyWithCommandContext() *WithCommandContext { var p = new(WithCommandContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_withCommand return p } +func InitEmptyWithCommandContext(p *WithCommandContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_withCommand +} + func (*WithCommandContext) IsWithCommandContext() {} func NewWithCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WithCommandContext { var p = new(WithCommandContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_withCommand @@ -3984,35 +4217,25 @@ func (s *WithCommandContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) WithCommand() (localctx IWithCommandContext) { - this := p - _ = this - localctx = NewWithCommandContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 32, EarthParserRULE_withCommand) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(373) p.DockerCommand() } +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 } // IDockerCommandContext is an interface to support dynamic dispatch. @@ -4031,23 +4254,28 @@ type IDockerCommandContext interface { } type DockerCommandContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyDockerCommandContext() *DockerCommandContext { var p = new(DockerCommandContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_dockerCommand return p } +func InitEmptyDockerCommandContext(p *DockerCommandContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_dockerCommand +} + func (*DockerCommandContext) IsDockerCommandContext() {} func NewDockerCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DockerCommandContext { var p = new(DockerCommandContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_dockerCommand @@ -4098,36 +4326,24 @@ func (s *DockerCommandContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) DockerCommand() (localctx IDockerCommandContext) { - this := p - _ = this - localctx = NewDockerCommandContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 34, EarthParserRULE_dockerCommand) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(375) p.Match(EarthParserDOCKER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(377) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -4138,7 +4354,17 @@ func (p *EarthParser) DockerCommand() (localctx IDockerCommandContext) { } +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 } // IIfStmtContext is an interface to support dynamic dispatch. @@ -4162,23 +4388,28 @@ type IIfStmtContext interface { } type IfStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyIfStmtContext() *IfStmtContext { var p = new(IfStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_ifStmt return p } +func InitEmptyIfStmtContext(p *IfStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_ifStmt +} + func (*IfStmtContext) IsIfStmtContext() {} func NewIfStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IfStmtContext { var p = new(IfStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_ifStmt @@ -4294,29 +4525,10 @@ func (s *IfStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) IfStmt() (localctx IIfStmtContext) { - this := p - _ = this - localctx = NewIfStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 36, EarthParserRULE_ifStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - var _alt int p.EnterOuterAlt(localctx, 1) @@ -4326,22 +4538,37 @@ func (p *EarthParser) IfStmt() (localctx IIfStmtContext) { } p.SetState(388) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 32, p.GetParserRuleContext()) - - for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 32, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { p.SetState(381) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(380) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(383) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { @@ -4352,24 +4579,40 @@ func (p *EarthParser) IfStmt() (localctx IIfStmtContext) { } p.SetState(390) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 32, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 32, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } } p.SetState(397) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 34, p.GetParserRuleContext()) == 1 { + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 34, p.GetParserRuleContext()) == 1 { p.SetState(392) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(391) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(394) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { @@ -4377,27 +4620,53 @@ func (p *EarthParser) IfStmt() (localctx IIfStmtContext) { p.ElseClause() } + } else if p.HasError() { // JIM + goto errorExit } p.SetState(400) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(399) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(402) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { p.SetState(404) p.Match(EarthParserEND) + 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 } // IIfClauseContext is an interface to support dynamic dispatch. @@ -4419,23 +4688,28 @@ type IIfClauseContext interface { } type IfClauseContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyIfClauseContext() *IfClauseContext { var p = new(IfClauseContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_ifClause return p } +func InitEmptyIfClauseContext(p *IfClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_ifClause +} + func (*IfClauseContext) IsIfClauseContext() {} func NewIfClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IfClauseContext { var p = new(IfClauseContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_ifClause @@ -4510,33 +4784,18 @@ func (s *IfClauseContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) IfClause() (localctx IIfClauseContext) { - this := p - _ = this - localctx = NewIfClauseContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 38, EarthParserRULE_ifClause) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(406) p.Match(EarthParserIF) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(407) @@ -4545,19 +4804,29 @@ func (p *EarthParser) IfClause() (localctx IIfClauseContext) { p.SetState(414) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 37, p.GetParserRuleContext()) == 1 { + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 37, p.GetParserRuleContext()) == 1 { p.SetState(409) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(408) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(411) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { @@ -4565,9 +4834,21 @@ func (p *EarthParser) IfClause() (localctx IIfClauseContext) { p.IfBlock() } + } 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 } // IIfBlockContext is an interface to support dynamic dispatch. @@ -4585,23 +4866,28 @@ type IIfBlockContext interface { } type IfBlockContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyIfBlockContext() *IfBlockContext { var p = new(IfBlockContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_ifBlock return p } +func InitEmptyIfBlockContext(p *IfBlockContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_ifBlock +} + func (*IfBlockContext) IsIfBlockContext() {} func NewIfBlockContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IfBlockContext { var p = new(IfBlockContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_ifBlock @@ -4648,35 +4934,25 @@ func (s *IfBlockContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) IfBlock() (localctx IIfBlockContext) { - this := p - _ = this - localctx = NewIfBlockContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 40, EarthParserRULE_ifBlock) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(416) p.Stmts() } +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 } // IElseIfClauseContext is an interface to support dynamic dispatch. @@ -4698,23 +4974,28 @@ type IElseIfClauseContext interface { } type ElseIfClauseContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyElseIfClauseContext() *ElseIfClauseContext { var p = new(ElseIfClauseContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_elseIfClause return p } +func InitEmptyElseIfClauseContext(p *ElseIfClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_elseIfClause +} + func (*ElseIfClauseContext) IsElseIfClauseContext() {} func NewElseIfClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ElseIfClauseContext { var p = new(ElseIfClauseContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_elseIfClause @@ -4789,33 +5070,18 @@ func (s *ElseIfClauseContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) ElseIfClause() (localctx IElseIfClauseContext) { - this := p - _ = this - localctx = NewElseIfClauseContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 42, EarthParserRULE_elseIfClause) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(418) p.Match(EarthParserELSE_IF) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(419) @@ -4824,19 +5090,29 @@ func (p *EarthParser) ElseIfClause() (localctx IElseIfClauseContext) { p.SetState(426) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 39, p.GetParserRuleContext()) == 1 { + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 39, p.GetParserRuleContext()) == 1 { p.SetState(421) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(420) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(423) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { @@ -4844,9 +5120,21 @@ func (p *EarthParser) ElseIfClause() (localctx IElseIfClauseContext) { p.ElseIfBlock() } + } 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 } // IElseIfBlockContext is an interface to support dynamic dispatch. @@ -4864,23 +5152,28 @@ type IElseIfBlockContext interface { } type ElseIfBlockContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyElseIfBlockContext() *ElseIfBlockContext { var p = new(ElseIfBlockContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_elseIfBlock return p } +func InitEmptyElseIfBlockContext(p *ElseIfBlockContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_elseIfBlock +} + func (*ElseIfBlockContext) IsElseIfBlockContext() {} func NewElseIfBlockContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ElseIfBlockContext { var p = new(ElseIfBlockContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_elseIfBlock @@ -4927,35 +5220,25 @@ func (s *ElseIfBlockContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) ElseIfBlock() (localctx IElseIfBlockContext) { - this := p - _ = this - localctx = NewElseIfBlockContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 44, EarthParserRULE_elseIfBlock) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(428) p.Stmts() } +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 } // IElseClauseContext is an interface to support dynamic dispatch. @@ -4976,23 +5259,28 @@ type IElseClauseContext interface { } type ElseClauseContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyElseClauseContext() *ElseClauseContext { var p = new(ElseClauseContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_elseClause return p } +func InitEmptyElseClauseContext(p *ElseClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_elseClause +} + func (*ElseClauseContext) IsElseClauseContext() {} func NewElseClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ElseClauseContext { var p = new(ElseClauseContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_elseClause @@ -5051,50 +5339,45 @@ func (s *ElseClauseContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) ElseClause() (localctx IElseClauseContext) { - this := p - _ = this - localctx = NewElseClauseContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 46, EarthParserRULE_elseClause) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(430) p.Match(EarthParserELSE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(437) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 41, p.GetParserRuleContext()) == 1 { + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 41, p.GetParserRuleContext()) == 1 { p.SetState(432) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(431) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(434) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { @@ -5102,9 +5385,21 @@ func (p *EarthParser) ElseClause() (localctx IElseClauseContext) { p.ElseBlock() } + } 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 } // IElseBlockContext is an interface to support dynamic dispatch. @@ -5122,23 +5417,28 @@ type IElseBlockContext interface { } type ElseBlockContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyElseBlockContext() *ElseBlockContext { var p = new(ElseBlockContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_elseBlock return p } +func InitEmptyElseBlockContext(p *ElseBlockContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_elseBlock +} + func (*ElseBlockContext) IsElseBlockContext() {} func NewElseBlockContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ElseBlockContext { var p = new(ElseBlockContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_elseBlock @@ -5185,35 +5485,25 @@ func (s *ElseBlockContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) ElseBlock() (localctx IElseBlockContext) { - this := p - _ = this - localctx = NewElseBlockContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 48, EarthParserRULE_elseBlock) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(439) p.Stmts() } +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 } // IIfExprContext is an interface to support dynamic dispatch. @@ -5231,23 +5521,28 @@ type IIfExprContext interface { } type IfExprContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyIfExprContext() *IfExprContext { var p = new(IfExprContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_ifExpr return p } +func InitEmptyIfExprContext(p *IfExprContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_ifExpr +} + func (*IfExprContext) IsIfExprContext() {} func NewIfExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IfExprContext { var p = new(IfExprContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_ifExpr @@ -5294,35 +5589,25 @@ func (s *IfExprContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) IfExpr() (localctx IIfExprContext) { - this := p - _ = this - localctx = NewIfExprContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 50, EarthParserRULE_ifExpr) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(441) p.Expr() } +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 } // IElseIfExprContext is an interface to support dynamic dispatch. @@ -5340,23 +5625,28 @@ type IElseIfExprContext interface { } type ElseIfExprContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyElseIfExprContext() *ElseIfExprContext { var p = new(ElseIfExprContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_elseIfExpr return p } +func InitEmptyElseIfExprContext(p *ElseIfExprContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_elseIfExpr +} + func (*ElseIfExprContext) IsElseIfExprContext() {} func NewElseIfExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ElseIfExprContext { var p = new(ElseIfExprContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_elseIfExpr @@ -5403,35 +5693,25 @@ func (s *ElseIfExprContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) ElseIfExpr() (localctx IElseIfExprContext) { - this := p - _ = this - localctx = NewElseIfExprContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 52, EarthParserRULE_elseIfExpr) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(443) p.Expr() } +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 } // ITryStmtContext is an interface to support dynamic dispatch. @@ -5454,23 +5734,28 @@ type ITryStmtContext interface { } type TryStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyTryStmtContext() *TryStmtContext { var p = new(TryStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_tryStmt return p } +func InitEmptyTryStmtContext(p *TryStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_tryStmt +} + func (*TryStmtContext) IsTryStmtContext() {} func NewTryStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TryStmtContext { var p = new(TryStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_tryStmt @@ -5561,29 +5846,10 @@ func (s *TryStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) TryStmt() (localctx ITryStmtContext) { - this := p - _ = this - localctx = NewTryStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 54, EarthParserRULE_tryStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(445) @@ -5592,19 +5858,29 @@ func (p *EarthParser) TryStmt() (localctx ITryStmtContext) { p.SetState(452) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 43, p.GetParserRuleContext()) == 1 { + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 43, p.GetParserRuleContext()) == 1 { p.SetState(447) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(446) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(449) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { @@ -5612,23 +5888,35 @@ func (p *EarthParser) TryStmt() (localctx ITryStmtContext) { p.CatchClause() } + } else if p.HasError() { // JIM + goto errorExit } p.SetState(460) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 45, p.GetParserRuleContext()) == 1 { + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 45, p.GetParserRuleContext()) == 1 { p.SetState(455) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(454) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(457) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { @@ -5636,27 +5924,53 @@ func (p *EarthParser) TryStmt() (localctx ITryStmtContext) { p.FinallyClause() } + } else if p.HasError() { // JIM + goto errorExit } p.SetState(463) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(462) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(465) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { p.SetState(467) p.Match(EarthParserEND) + 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 } // ITryClauseContext is an interface to support dynamic dispatch. @@ -5677,23 +5991,28 @@ type ITryClauseContext interface { } type TryClauseContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyTryClauseContext() *TryClauseContext { var p = new(TryClauseContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_tryClause return p } +func InitEmptyTryClauseContext(p *TryClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_tryClause +} + func (*TryClauseContext) IsTryClauseContext() {} func NewTryClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TryClauseContext { var p = new(TryClauseContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_tryClause @@ -5752,50 +6071,45 @@ func (s *TryClauseContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) TryClause() (localctx ITryClauseContext) { - this := p - _ = this - localctx = NewTryClauseContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 56, EarthParserRULE_tryClause) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(469) p.Match(EarthParserTRY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(476) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 48, p.GetParserRuleContext()) == 1 { + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 48, p.GetParserRuleContext()) == 1 { p.SetState(471) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(470) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(473) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { @@ -5803,9 +6117,21 @@ func (p *EarthParser) TryClause() (localctx ITryClauseContext) { p.TryBlock() } + } 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 } // ITryBlockContext is an interface to support dynamic dispatch. @@ -5823,23 +6149,28 @@ type ITryBlockContext interface { } type TryBlockContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyTryBlockContext() *TryBlockContext { var p = new(TryBlockContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_tryBlock return p } +func InitEmptyTryBlockContext(p *TryBlockContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_tryBlock +} + func (*TryBlockContext) IsTryBlockContext() {} func NewTryBlockContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TryBlockContext { var p = new(TryBlockContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_tryBlock @@ -5886,35 +6217,25 @@ func (s *TryBlockContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) TryBlock() (localctx ITryBlockContext) { - this := p - _ = this - localctx = NewTryBlockContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 58, EarthParserRULE_tryBlock) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(478) p.Stmts() } +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 } // ICatchClauseContext is an interface to support dynamic dispatch. @@ -5935,23 +6256,28 @@ type ICatchClauseContext interface { } type CatchClauseContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyCatchClauseContext() *CatchClauseContext { var p = new(CatchClauseContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_catchClause return p } +func InitEmptyCatchClauseContext(p *CatchClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_catchClause +} + func (*CatchClauseContext) IsCatchClauseContext() {} func NewCatchClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CatchClauseContext { var p = new(CatchClauseContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_catchClause @@ -6010,50 +6336,45 @@ func (s *CatchClauseContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) CatchClause() (localctx ICatchClauseContext) { - this := p - _ = this - localctx = NewCatchClauseContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 60, EarthParserRULE_catchClause) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(480) p.Match(EarthParserCATCH) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(487) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 50, p.GetParserRuleContext()) == 1 { + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 50, p.GetParserRuleContext()) == 1 { p.SetState(482) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(481) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(484) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { @@ -6061,9 +6382,21 @@ func (p *EarthParser) CatchClause() (localctx ICatchClauseContext) { p.CatchBlock() } + } 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 } // ICatchBlockContext is an interface to support dynamic dispatch. @@ -6081,23 +6414,28 @@ type ICatchBlockContext interface { } type CatchBlockContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyCatchBlockContext() *CatchBlockContext { var p = new(CatchBlockContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_catchBlock return p } +func InitEmptyCatchBlockContext(p *CatchBlockContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_catchBlock +} + func (*CatchBlockContext) IsCatchBlockContext() {} func NewCatchBlockContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CatchBlockContext { var p = new(CatchBlockContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_catchBlock @@ -6144,35 +6482,25 @@ func (s *CatchBlockContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) CatchBlock() (localctx ICatchBlockContext) { - this := p - _ = this - localctx = NewCatchBlockContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 62, EarthParserRULE_catchBlock) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(489) p.Stmts() } +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 } // IFinallyClauseContext is an interface to support dynamic dispatch. @@ -6193,23 +6521,28 @@ type IFinallyClauseContext interface { } type FinallyClauseContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyFinallyClauseContext() *FinallyClauseContext { var p = new(FinallyClauseContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_finallyClause return p } +func InitEmptyFinallyClauseContext(p *FinallyClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_finallyClause +} + func (*FinallyClauseContext) IsFinallyClauseContext() {} func NewFinallyClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FinallyClauseContext { var p = new(FinallyClauseContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_finallyClause @@ -6268,50 +6601,45 @@ func (s *FinallyClauseContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) FinallyClause() (localctx IFinallyClauseContext) { - this := p - _ = this - localctx = NewFinallyClauseContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 64, EarthParserRULE_finallyClause) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(491) p.Match(EarthParserFINALLY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(498) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 52, p.GetParserRuleContext()) == 1 { + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 52, p.GetParserRuleContext()) == 1 { p.SetState(493) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(492) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(495) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { @@ -6319,9 +6647,21 @@ func (p *EarthParser) FinallyClause() (localctx IFinallyClauseContext) { p.FinallyBlock() } + } 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 } // IFinallyBlockContext is an interface to support dynamic dispatch. @@ -6339,23 +6679,28 @@ type IFinallyBlockContext interface { } type FinallyBlockContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyFinallyBlockContext() *FinallyBlockContext { var p = new(FinallyBlockContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_finallyBlock return p } +func InitEmptyFinallyBlockContext(p *FinallyBlockContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_finallyBlock +} + func (*FinallyBlockContext) IsFinallyBlockContext() {} func NewFinallyBlockContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FinallyBlockContext { var p = new(FinallyBlockContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_finallyBlock @@ -6402,35 +6747,25 @@ func (s *FinallyBlockContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) FinallyBlock() (localctx IFinallyBlockContext) { - this := p - _ = this - localctx = NewFinallyBlockContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 66, EarthParserRULE_finallyBlock) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(500) p.Stmts() } +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 } // IForStmtContext is an interface to support dynamic dispatch. @@ -6451,23 +6786,28 @@ type IForStmtContext interface { } type ForStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyForStmtContext() *ForStmtContext { var p = new(ForStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_forStmt return p } +func InitEmptyForStmtContext(p *ForStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_forStmt +} + func (*ForStmtContext) IsForStmtContext() {} func NewForStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ForStmtContext { var p = new(ForStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_forStmt @@ -6526,29 +6866,10 @@ func (s *ForStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) ForStmt() (localctx IForStmtContext) { - this := p - _ = this - localctx = NewForStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 68, EarthParserRULE_forStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(502) @@ -6556,24 +6877,48 @@ func (p *EarthParser) ForStmt() (localctx IForStmtContext) { } p.SetState(504) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(503) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(506) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { p.SetState(508) p.Match(EarthParserEND) + 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 } // IForClauseContext is an interface to support dynamic dispatch. @@ -6595,23 +6940,28 @@ type IForClauseContext interface { } type ForClauseContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyForClauseContext() *ForClauseContext { var p = new(ForClauseContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_forClause return p } +func InitEmptyForClauseContext(p *ForClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_forClause +} + func (*ForClauseContext) IsForClauseContext() {} func NewForClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ForClauseContext { var p = new(ForClauseContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_forClause @@ -6686,33 +7036,18 @@ func (s *ForClauseContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) ForClause() (localctx IForClauseContext) { - this := p - _ = this - localctx = NewForClauseContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 70, EarthParserRULE_forClause) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(510) p.Match(EarthParserFOR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(511) @@ -6721,19 +7056,29 @@ func (p *EarthParser) ForClause() (localctx IForClauseContext) { p.SetState(518) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 55, p.GetParserRuleContext()) == 1 { + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 55, p.GetParserRuleContext()) == 1 { p.SetState(513) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(512) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(515) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { @@ -6741,9 +7086,21 @@ func (p *EarthParser) ForClause() (localctx IForClauseContext) { p.ForBlock() } + } 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 } // IForBlockContext is an interface to support dynamic dispatch. @@ -6761,23 +7118,28 @@ type IForBlockContext interface { } type ForBlockContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyForBlockContext() *ForBlockContext { var p = new(ForBlockContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_forBlock return p } +func InitEmptyForBlockContext(p *ForBlockContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_forBlock +} + func (*ForBlockContext) IsForBlockContext() {} func NewForBlockContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ForBlockContext { var p = new(ForBlockContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_forBlock @@ -6824,35 +7186,25 @@ func (s *ForBlockContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) ForBlock() (localctx IForBlockContext) { - this := p - _ = this - localctx = NewForBlockContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 72, EarthParserRULE_forBlock) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(520) p.Stmts() } +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 } // IForExprContext is an interface to support dynamic dispatch. @@ -6870,23 +7222,28 @@ type IForExprContext interface { } type ForExprContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyForExprContext() *ForExprContext { var p = new(ForExprContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_forExpr return p } +func InitEmptyForExprContext(p *ForExprContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_forExpr +} + func (*ForExprContext) IsForExprContext() {} func NewForExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ForExprContext { var p = new(ForExprContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_forExpr @@ -6933,35 +7290,25 @@ func (s *ForExprContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) ForExpr() (localctx IForExprContext) { - this := p - _ = this - localctx = NewForExprContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 74, EarthParserRULE_forExpr) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(522) p.StmtWords() } +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 } // IWaitStmtContext is an interface to support dynamic dispatch. @@ -6982,23 +7329,28 @@ type IWaitStmtContext interface { } type WaitStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyWaitStmtContext() *WaitStmtContext { var p = new(WaitStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_waitStmt return p } +func InitEmptyWaitStmtContext(p *WaitStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_waitStmt +} + func (*WaitStmtContext) IsWaitStmtContext() {} func NewWaitStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WaitStmtContext { var p = new(WaitStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_waitStmt @@ -7057,29 +7409,10 @@ func (s *WaitStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) WaitStmt() (localctx IWaitStmtContext) { - this := p - _ = this - localctx = NewWaitStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 76, EarthParserRULE_waitStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(524) @@ -7087,24 +7420,48 @@ func (p *EarthParser) WaitStmt() (localctx IWaitStmtContext) { } p.SetState(526) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(525) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(528) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { p.SetState(530) p.Match(EarthParserEND) + 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 } // IWaitClauseContext is an interface to support dynamic dispatch. @@ -7126,23 +7483,28 @@ type IWaitClauseContext interface { } type WaitClauseContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyWaitClauseContext() *WaitClauseContext { var p = new(WaitClauseContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_waitClause return p } +func InitEmptyWaitClauseContext(p *WaitClauseContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_waitClause +} + func (*WaitClauseContext) IsWaitClauseContext() {} func NewWaitClauseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WaitClauseContext { var p = new(WaitClauseContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_waitClause @@ -7217,36 +7579,24 @@ func (s *WaitClauseContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) WaitClause() (localctx IWaitClauseContext) { - this := p - _ = this - localctx = NewWaitClauseContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 78, EarthParserRULE_waitClause) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(532) p.Match(EarthParserWAIT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(534) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -7259,19 +7609,29 @@ func (p *EarthParser) WaitClause() (localctx IWaitClauseContext) { p.SetState(542) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 59, p.GetParserRuleContext()) == 1 { + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 59, p.GetParserRuleContext()) == 1 { p.SetState(537) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for ok := true; ok; ok = _la == EarthParserNL { { p.SetState(536) p.Match(EarthParserNL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(539) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { @@ -7279,9 +7639,21 @@ func (p *EarthParser) WaitClause() (localctx IWaitClauseContext) { p.WaitBlock() } + } 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 } // IWaitBlockContext is an interface to support dynamic dispatch. @@ -7299,23 +7671,28 @@ type IWaitBlockContext interface { } type WaitBlockContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyWaitBlockContext() *WaitBlockContext { var p = new(WaitBlockContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_waitBlock return p } +func InitEmptyWaitBlockContext(p *WaitBlockContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_waitBlock +} + func (*WaitBlockContext) IsWaitBlockContext() {} func NewWaitBlockContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WaitBlockContext { var p = new(WaitBlockContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_waitBlock @@ -7362,35 +7739,25 @@ func (s *WaitBlockContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) WaitBlock() (localctx IWaitBlockContext) { - this := p - _ = this - localctx = NewWaitBlockContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 80, EarthParserRULE_waitBlock) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(544) p.Stmts() } +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 } // IWaitExprContext is an interface to support dynamic dispatch. @@ -7408,23 +7775,28 @@ type IWaitExprContext interface { } type WaitExprContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyWaitExprContext() *WaitExprContext { var p = new(WaitExprContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_waitExpr return p } +func InitEmptyWaitExprContext(p *WaitExprContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_waitExpr +} + func (*WaitExprContext) IsWaitExprContext() {} func NewWaitExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WaitExprContext { var p = new(WaitExprContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_waitExpr @@ -7471,35 +7843,25 @@ func (s *WaitExprContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) WaitExpr() (localctx IWaitExprContext) { - this := p - _ = this - localctx = NewWaitExprContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 82, EarthParserRULE_waitExpr) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(546) p.StmtWords() } +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 } // IFromStmtContext is an interface to support dynamic dispatch. @@ -7518,23 +7880,28 @@ type IFromStmtContext interface { } type FromStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyFromStmtContext() *FromStmtContext { var p = new(FromStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_fromStmt return p } +func InitEmptyFromStmtContext(p *FromStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_fromStmt +} + func (*FromStmtContext) IsFromStmtContext() {} func NewFromStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FromStmtContext { var p = new(FromStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_fromStmt @@ -7585,36 +7952,24 @@ func (s *FromStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) FromStmt() (localctx IFromStmtContext) { - this := p - _ = this - localctx = NewFromStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 84, EarthParserRULE_fromStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(548) p.Match(EarthParserFROM) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(550) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -7625,7 +7980,17 @@ func (p *EarthParser) FromStmt() (localctx IFromStmtContext) { } +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 } // IFromDockerfileStmtContext is an interface to support dynamic dispatch. @@ -7644,23 +8009,28 @@ type IFromDockerfileStmtContext interface { } type FromDockerfileStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyFromDockerfileStmtContext() *FromDockerfileStmtContext { var p = new(FromDockerfileStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_fromDockerfileStmt return p } +func InitEmptyFromDockerfileStmtContext(p *FromDockerfileStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_fromDockerfileStmt +} + func (*FromDockerfileStmtContext) IsFromDockerfileStmtContext() {} func NewFromDockerfileStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FromDockerfileStmtContext { var p = new(FromDockerfileStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_fromDockerfileStmt @@ -7711,36 +8081,24 @@ func (s *FromDockerfileStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) FromDockerfileStmt() (localctx IFromDockerfileStmtContext) { - this := p - _ = this - localctx = NewFromDockerfileStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 86, EarthParserRULE_fromDockerfileStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(552) p.Match(EarthParserFROM_DOCKERFILE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(554) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -7751,7 +8109,17 @@ func (p *EarthParser) FromDockerfileStmt() (localctx IFromDockerfileStmtContext) } +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 } // ILocallyStmtContext is an interface to support dynamic dispatch. @@ -7770,23 +8138,28 @@ type ILocallyStmtContext interface { } type LocallyStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyLocallyStmtContext() *LocallyStmtContext { var p = new(LocallyStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_locallyStmt return p } +func InitEmptyLocallyStmtContext(p *LocallyStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_locallyStmt +} + func (*LocallyStmtContext) IsLocallyStmtContext() {} func NewLocallyStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LocallyStmtContext { var p = new(LocallyStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_locallyStmt @@ -7837,36 +8210,24 @@ func (s *LocallyStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) LocallyStmt() (localctx ILocallyStmtContext) { - this := p - _ = this - localctx = NewLocallyStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 88, EarthParserRULE_locallyStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(556) p.Match(EarthParserLOCALLY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(558) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -7877,7 +8238,17 @@ func (p *EarthParser) LocallyStmt() (localctx ILocallyStmtContext) { } +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 } // ICopyStmtContext is an interface to support dynamic dispatch. @@ -7896,23 +8267,28 @@ type ICopyStmtContext interface { } type CopyStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyCopyStmtContext() *CopyStmtContext { var p = new(CopyStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_copyStmt return p } +func InitEmptyCopyStmtContext(p *CopyStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_copyStmt +} + func (*CopyStmtContext) IsCopyStmtContext() {} func NewCopyStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CopyStmtContext { var p = new(CopyStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_copyStmt @@ -7963,36 +8339,24 @@ func (s *CopyStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) CopyStmt() (localctx ICopyStmtContext) { - this := p - _ = this - localctx = NewCopyStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 90, EarthParserRULE_copyStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(560) p.Match(EarthParserCOPY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(562) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -8003,7 +8367,17 @@ func (p *EarthParser) CopyStmt() (localctx ICopyStmtContext) { } +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 } // ISaveStmtContext is an interface to support dynamic dispatch. @@ -8022,23 +8396,28 @@ type ISaveStmtContext interface { } type SaveStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptySaveStmtContext() *SaveStmtContext { var p = new(SaveStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_saveStmt return p } +func InitEmptySaveStmtContext(p *SaveStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_saveStmt +} + func (*SaveStmtContext) IsSaveStmtContext() {} func NewSaveStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SaveStmtContext { var p = new(SaveStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_saveStmt @@ -8101,30 +8480,13 @@ func (s *SaveStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) SaveStmt() (localctx ISaveStmtContext) { - this := p - _ = this - localctx = NewSaveStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 92, EarthParserRULE_saveStmt) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.SetState(566) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } switch p.GetTokenStream().LA(1) { case EarthParserSAVE_ARTIFACT: @@ -8142,10 +8504,21 @@ func (p *EarthParser) SaveStmt() (localctx ISaveStmtContext) { } default: - panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + 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 } // ISaveImageContext is an interface to support dynamic dispatch. @@ -8164,23 +8537,28 @@ type ISaveImageContext interface { } type SaveImageContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptySaveImageContext() *SaveImageContext { var p = new(SaveImageContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_saveImage return p } +func InitEmptySaveImageContext(p *SaveImageContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_saveImage +} + func (*SaveImageContext) IsSaveImageContext() {} func NewSaveImageContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SaveImageContext { var p = new(SaveImageContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_saveImage @@ -8231,36 +8609,24 @@ func (s *SaveImageContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) SaveImage() (localctx ISaveImageContext) { - this := p - _ = this - localctx = NewSaveImageContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 94, EarthParserRULE_saveImage) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(568) p.Match(EarthParserSAVE_IMAGE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(570) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -8271,7 +8637,17 @@ func (p *EarthParser) SaveImage() (localctx ISaveImageContext) { } +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 } // ISaveArtifactContext is an interface to support dynamic dispatch. @@ -8290,23 +8666,28 @@ type ISaveArtifactContext interface { } type SaveArtifactContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptySaveArtifactContext() *SaveArtifactContext { var p = new(SaveArtifactContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_saveArtifact return p } +func InitEmptySaveArtifactContext(p *SaveArtifactContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_saveArtifact +} + func (*SaveArtifactContext) IsSaveArtifactContext() {} func NewSaveArtifactContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SaveArtifactContext { var p = new(SaveArtifactContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_saveArtifact @@ -8357,36 +8738,24 @@ func (s *SaveArtifactContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) SaveArtifact() (localctx ISaveArtifactContext) { - this := p - _ = this - localctx = NewSaveArtifactContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 96, EarthParserRULE_saveArtifact) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(572) p.Match(EarthParserSAVE_ARTIFACT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(574) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -8397,7 +8766,17 @@ func (p *EarthParser) SaveArtifact() (localctx ISaveArtifactContext) { } +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 } // IRunStmtContext is an interface to support dynamic dispatch. @@ -8416,23 +8795,28 @@ type IRunStmtContext interface { } type RunStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyRunStmtContext() *RunStmtContext { var p = new(RunStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_runStmt return p } +func InitEmptyRunStmtContext(p *RunStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_runStmt +} + func (*RunStmtContext) IsRunStmtContext() {} func NewRunStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RunStmtContext { var p = new(RunStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_runStmt @@ -8483,36 +8867,24 @@ func (s *RunStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) RunStmt() (localctx IRunStmtContext) { - this := p - _ = this - localctx = NewRunStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 98, EarthParserRULE_runStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(576) p.Match(EarthParserRUN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(578) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -8523,7 +8895,17 @@ func (p *EarthParser) RunStmt() (localctx IRunStmtContext) { } +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 } // IBuildStmtContext is an interface to support dynamic dispatch. @@ -8542,23 +8924,28 @@ type IBuildStmtContext interface { } type BuildStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyBuildStmtContext() *BuildStmtContext { var p = new(BuildStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_buildStmt return p } +func InitEmptyBuildStmtContext(p *BuildStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_buildStmt +} + func (*BuildStmtContext) IsBuildStmtContext() {} func NewBuildStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BuildStmtContext { var p = new(BuildStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_buildStmt @@ -8609,36 +8996,24 @@ func (s *BuildStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) BuildStmt() (localctx IBuildStmtContext) { - this := p - _ = this - localctx = NewBuildStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 100, EarthParserRULE_buildStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(580) p.Match(EarthParserBUILD) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(582) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -8649,7 +9024,17 @@ func (p *EarthParser) BuildStmt() (localctx IBuildStmtContext) { } +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 } // IWorkdirStmtContext is an interface to support dynamic dispatch. @@ -8668,23 +9053,28 @@ type IWorkdirStmtContext interface { } type WorkdirStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyWorkdirStmtContext() *WorkdirStmtContext { var p = new(WorkdirStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_workdirStmt return p } +func InitEmptyWorkdirStmtContext(p *WorkdirStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_workdirStmt +} + func (*WorkdirStmtContext) IsWorkdirStmtContext() {} func NewWorkdirStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *WorkdirStmtContext { var p = new(WorkdirStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_workdirStmt @@ -8735,36 +9125,24 @@ func (s *WorkdirStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) WorkdirStmt() (localctx IWorkdirStmtContext) { - this := p - _ = this - localctx = NewWorkdirStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 102, EarthParserRULE_workdirStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(584) p.Match(EarthParserWORKDIR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(586) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -8775,7 +9153,17 @@ func (p *EarthParser) WorkdirStmt() (localctx IWorkdirStmtContext) { } +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 } // IUserStmtContext is an interface to support dynamic dispatch. @@ -8794,23 +9182,28 @@ type IUserStmtContext interface { } type UserStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyUserStmtContext() *UserStmtContext { var p = new(UserStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_userStmt return p } +func InitEmptyUserStmtContext(p *UserStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_userStmt +} + func (*UserStmtContext) IsUserStmtContext() {} func NewUserStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *UserStmtContext { var p = new(UserStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_userStmt @@ -8861,36 +9254,24 @@ func (s *UserStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) UserStmt() (localctx IUserStmtContext) { - this := p - _ = this - localctx = NewUserStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 104, EarthParserRULE_userStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(588) p.Match(EarthParserUSER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(590) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -8901,7 +9282,17 @@ func (p *EarthParser) UserStmt() (localctx IUserStmtContext) { } +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 } // ICmdStmtContext is an interface to support dynamic dispatch. @@ -8920,23 +9311,28 @@ type ICmdStmtContext interface { } type CmdStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyCmdStmtContext() *CmdStmtContext { var p = new(CmdStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_cmdStmt return p } +func InitEmptyCmdStmtContext(p *CmdStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_cmdStmt +} + func (*CmdStmtContext) IsCmdStmtContext() {} func NewCmdStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CmdStmtContext { var p = new(CmdStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_cmdStmt @@ -8987,36 +9383,24 @@ func (s *CmdStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) CmdStmt() (localctx ICmdStmtContext) { - this := p - _ = this - localctx = NewCmdStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 106, EarthParserRULE_cmdStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(592) p.Match(EarthParserCMD) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(594) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -9027,7 +9411,17 @@ func (p *EarthParser) CmdStmt() (localctx ICmdStmtContext) { } +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 } // IEntrypointStmtContext is an interface to support dynamic dispatch. @@ -9046,23 +9440,28 @@ type IEntrypointStmtContext interface { } type EntrypointStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyEntrypointStmtContext() *EntrypointStmtContext { var p = new(EntrypointStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_entrypointStmt return p } +func InitEmptyEntrypointStmtContext(p *EntrypointStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_entrypointStmt +} + func (*EntrypointStmtContext) IsEntrypointStmtContext() {} func NewEntrypointStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EntrypointStmtContext { var p = new(EntrypointStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_entrypointStmt @@ -9113,36 +9512,24 @@ func (s *EntrypointStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) EntrypointStmt() (localctx IEntrypointStmtContext) { - this := p - _ = this - localctx = NewEntrypointStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 108, EarthParserRULE_entrypointStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(596) p.Match(EarthParserENTRYPOINT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(598) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -9153,7 +9540,17 @@ func (p *EarthParser) EntrypointStmt() (localctx IEntrypointStmtContext) { } +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 } // IExposeStmtContext is an interface to support dynamic dispatch. @@ -9172,23 +9569,28 @@ type IExposeStmtContext interface { } type ExposeStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyExposeStmtContext() *ExposeStmtContext { var p = new(ExposeStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_exposeStmt return p } +func InitEmptyExposeStmtContext(p *ExposeStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_exposeStmt +} + func (*ExposeStmtContext) IsExposeStmtContext() {} func NewExposeStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExposeStmtContext { var p = new(ExposeStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_exposeStmt @@ -9239,36 +9641,24 @@ func (s *ExposeStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) ExposeStmt() (localctx IExposeStmtContext) { - this := p - _ = this - localctx = NewExposeStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 110, EarthParserRULE_exposeStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(600) p.Match(EarthParserEXPOSE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(602) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -9279,7 +9669,17 @@ func (p *EarthParser) ExposeStmt() (localctx IExposeStmtContext) { } +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 } // IVolumeStmtContext is an interface to support dynamic dispatch. @@ -9298,23 +9698,28 @@ type IVolumeStmtContext interface { } type VolumeStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyVolumeStmtContext() *VolumeStmtContext { var p = new(VolumeStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_volumeStmt return p } +func InitEmptyVolumeStmtContext(p *VolumeStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_volumeStmt +} + func (*VolumeStmtContext) IsVolumeStmtContext() {} func NewVolumeStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *VolumeStmtContext { var p = new(VolumeStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_volumeStmt @@ -9365,36 +9770,24 @@ func (s *VolumeStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) VolumeStmt() (localctx IVolumeStmtContext) { - this := p - _ = this - localctx = NewVolumeStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 112, EarthParserRULE_volumeStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(604) p.Match(EarthParserVOLUME) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(606) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -9405,7 +9798,17 @@ func (p *EarthParser) VolumeStmt() (localctx IVolumeStmtContext) { } +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 } // IEnvStmtContext is an interface to support dynamic dispatch. @@ -9427,23 +9830,28 @@ type IEnvStmtContext interface { } type EnvStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyEnvStmtContext() *EnvStmtContext { var p = new(EnvStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_envStmt return p } +func InitEmptyEnvStmtContext(p *EnvStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_envStmt +} + func (*EnvStmtContext) IsEnvStmtContext() {} func NewEnvStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EnvStmtContext { var p = new(EnvStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_envStmt @@ -9518,33 +9926,18 @@ func (s *EnvStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) EnvStmt() (localctx IEnvStmtContext) { - this := p - _ = this - localctx = NewEnvStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 114, EarthParserRULE_envStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(608) p.Match(EarthParserENV) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(609) @@ -9552,28 +9945,45 @@ func (p *EarthParser) EnvStmt() (localctx IEnvStmtContext) { } p.SetState(611) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserEQUALS { { p.SetState(610) p.Match(EarthParserEQUALS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } } p.SetState(617) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserWS || _la == EarthParserAtom { p.SetState(614) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserWS { { p.SetState(613) p.Match(EarthParserWS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } } @@ -9584,7 +9994,17 @@ func (p *EarthParser) EnvStmt() (localctx IEnvStmtContext) { } +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 } // IArgStmtContext is an interface to support dynamic dispatch. @@ -9607,23 +10027,28 @@ type IArgStmtContext interface { } type ArgStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyArgStmtContext() *ArgStmtContext { var p = new(ArgStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_argStmt return p } +func InitEmptyArgStmtContext(p *ArgStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_argStmt +} + func (*ArgStmtContext) IsArgStmtContext() {} func NewArgStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArgStmtContext { var p = new(ArgStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_argStmt @@ -9714,33 +10139,18 @@ func (s *ArgStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) ArgStmt() (localctx IArgStmtContext) { - this := p - _ = this - localctx = NewArgStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 116, EarthParserRULE_argStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(619) p.Match(EarthParserARG) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(620) @@ -9752,26 +10162,43 @@ func (p *EarthParser) ArgStmt() (localctx IArgStmtContext) { } p.SetState(629) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserEQUALS { { p.SetState(622) p.Match(EarthParserEQUALS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(627) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserWS || _la == EarthParserAtom { p.SetState(624) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserWS { { p.SetState(623) p.Match(EarthParserWS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } } @@ -9784,7 +10211,17 @@ func (p *EarthParser) ArgStmt() (localctx IArgStmtContext) { } +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 } // ISetStmtContext is an interface to support dynamic dispatch. @@ -9806,23 +10243,28 @@ type ISetStmtContext interface { } type SetStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptySetStmtContext() *SetStmtContext { var p = new(SetStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_setStmt return p } +func InitEmptySetStmtContext(p *SetStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_setStmt +} + func (*SetStmtContext) IsSetStmtContext() {} func NewSetStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SetStmtContext { var p = new(SetStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_setStmt @@ -9897,33 +10339,18 @@ func (s *SetStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) SetStmt() (localctx ISetStmtContext) { - this := p - _ = this - localctx = NewSetStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 118, EarthParserRULE_setStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(631) p.Match(EarthParserSET) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(632) @@ -9932,15 +10359,26 @@ func (p *EarthParser) SetStmt() (localctx ISetStmtContext) { { p.SetState(633) p.Match(EarthParserEQUALS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(635) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserWS { { p.SetState(634) p.Match(EarthParserWS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } } @@ -9949,7 +10387,17 @@ func (p *EarthParser) SetStmt() (localctx ISetStmtContext) { p.EnvArgValue() } +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 } // ILetStmtContext is an interface to support dynamic dispatch. @@ -9972,23 +10420,28 @@ type ILetStmtContext interface { } type LetStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyLetStmtContext() *LetStmtContext { var p = new(LetStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_letStmt return p } +func InitEmptyLetStmtContext(p *LetStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_letStmt +} + func (*LetStmtContext) IsLetStmtContext() {} func NewLetStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LetStmtContext { var p = new(LetStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_letStmt @@ -10079,33 +10532,18 @@ func (s *LetStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) LetStmt() (localctx ILetStmtContext) { - this := p - _ = this - localctx = NewLetStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 120, EarthParserRULE_letStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(639) p.Match(EarthParserLET) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(640) @@ -10118,15 +10556,26 @@ func (p *EarthParser) LetStmt() (localctx ILetStmtContext) { { p.SetState(642) p.Match(EarthParserEQUALS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(644) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserWS { { p.SetState(643) p.Match(EarthParserWS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } } @@ -10135,7 +10584,17 @@ func (p *EarthParser) LetStmt() (localctx ILetStmtContext) { p.EnvArgValue() } +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 } // IOptionalFlagContext is an interface to support dynamic dispatch. @@ -10153,23 +10612,28 @@ type IOptionalFlagContext interface { } type OptionalFlagContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyOptionalFlagContext() *OptionalFlagContext { var p = new(OptionalFlagContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_optionalFlag return p } +func InitEmptyOptionalFlagContext(p *OptionalFlagContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_optionalFlag +} + func (*OptionalFlagContext) IsOptionalFlagContext() {} func NewOptionalFlagContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OptionalFlagContext { var p = new(OptionalFlagContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_optionalFlag @@ -10216,41 +10680,33 @@ func (s *OptionalFlagContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) OptionalFlag() (localctx IOptionalFlagContext) { - this := p - _ = this - localctx = NewOptionalFlagContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 122, EarthParserRULE_optionalFlag) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) p.SetState(649) p.GetErrorHandler().Sync(p) - if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 83, p.GetParserRuleContext()) == 1 { + if p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 83, p.GetParserRuleContext()) == 1 { { p.SetState(648) p.StmtWords() } + } 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 } // IEnvArgKeyContext is an interface to support dynamic dispatch. @@ -10268,23 +10724,28 @@ type IEnvArgKeyContext interface { } type EnvArgKeyContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyEnvArgKeyContext() *EnvArgKeyContext { var p = new(EnvArgKeyContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_envArgKey return p } +func InitEmptyEnvArgKeyContext(p *EnvArgKeyContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_envArgKey +} + func (*EnvArgKeyContext) IsEnvArgKeyContext() {} func NewEnvArgKeyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EnvArgKeyContext { var p = new(EnvArgKeyContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_envArgKey @@ -10319,35 +10780,29 @@ func (s *EnvArgKeyContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) EnvArgKey() (localctx IEnvArgKeyContext) { - this := p - _ = this - localctx = NewEnvArgKeyContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 124, EarthParserRULE_envArgKey) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(651) p.Match(EarthParserAtom) + 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 } // IEnvArgValueContext is an interface to support dynamic dispatch. @@ -10368,23 +10823,28 @@ type IEnvArgValueContext interface { } type EnvArgValueContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyEnvArgValueContext() *EnvArgValueContext { var p = new(EnvArgValueContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_envArgValue return p } +func InitEmptyEnvArgValueContext(p *EnvArgValueContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_envArgValue +} + func (*EnvArgValueContext) IsEnvArgValueContext() {} func NewEnvArgValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EnvArgValueContext { var p = new(EnvArgValueContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_envArgValue @@ -10431,61 +10891,73 @@ func (s *EnvArgValueContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) EnvArgValue() (localctx IEnvArgValueContext) { - this := p - _ = this - localctx = NewEnvArgValueContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 126, EarthParserRULE_envArgValue) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(653) p.Match(EarthParserAtom) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(660) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for _la == EarthParserWS || _la == EarthParserAtom { p.SetState(655) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserWS { { p.SetState(654) p.Match(EarthParserWS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } } { p.SetState(657) p.Match(EarthParserAtom) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(662) 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 } // ILabelStmtContext is an interface to support dynamic dispatch. @@ -10509,23 +10981,28 @@ type ILabelStmtContext interface { } type LabelStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyLabelStmtContext() *LabelStmtContext { var p = new(LabelStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_labelStmt return p } +func InitEmptyLabelStmtContext(p *LabelStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_labelStmt +} + func (*LabelStmtContext) IsLabelStmtContext() {} func NewLabelStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LabelStmtContext { var p = new(LabelStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_labelStmt @@ -10650,36 +11127,24 @@ func (s *LabelStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) LabelStmt() (localctx ILabelStmtContext) { - this := p - _ = this - localctx = NewLabelStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 128, EarthParserRULE_labelStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(663) p.Match(EarthParserLABEL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(670) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for _la == EarthParserAtom { @@ -10690,6 +11155,10 @@ func (p *EarthParser) LabelStmt() (localctx ILabelStmtContext) { { p.SetState(665) p.Match(EarthParserEQUALS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(666) @@ -10698,10 +11167,23 @@ func (p *EarthParser) LabelStmt() (localctx ILabelStmtContext) { p.SetState(672) 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 } // ILabelKeyContext is an interface to support dynamic dispatch. @@ -10719,23 +11201,28 @@ type ILabelKeyContext interface { } type LabelKeyContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyLabelKeyContext() *LabelKeyContext { var p = new(LabelKeyContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_labelKey return p } +func InitEmptyLabelKeyContext(p *LabelKeyContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_labelKey +} + func (*LabelKeyContext) IsLabelKeyContext() {} func NewLabelKeyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LabelKeyContext { var p = new(LabelKeyContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_labelKey @@ -10770,35 +11257,29 @@ func (s *LabelKeyContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) LabelKey() (localctx ILabelKeyContext) { - this := p - _ = this - localctx = NewLabelKeyContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 130, EarthParserRULE_labelKey) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(673) p.Match(EarthParserAtom) + 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 } // ILabelValueContext is an interface to support dynamic dispatch. @@ -10816,23 +11297,28 @@ type ILabelValueContext interface { } type LabelValueContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyLabelValueContext() *LabelValueContext { var p = new(LabelValueContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_labelValue return p } +func InitEmptyLabelValueContext(p *LabelValueContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_labelValue +} + func (*LabelValueContext) IsLabelValueContext() {} func NewLabelValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LabelValueContext { var p = new(LabelValueContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_labelValue @@ -10867,35 +11353,29 @@ func (s *LabelValueContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) LabelValue() (localctx ILabelValueContext) { - this := p - _ = this - localctx = NewLabelValueContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 132, EarthParserRULE_labelValue) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(675) p.Match(EarthParserAtom) + 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 } // IGitCloneStmtContext is an interface to support dynamic dispatch. @@ -10914,23 +11394,28 @@ type IGitCloneStmtContext interface { } type GitCloneStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyGitCloneStmtContext() *GitCloneStmtContext { var p = new(GitCloneStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_gitCloneStmt return p } +func InitEmptyGitCloneStmtContext(p *GitCloneStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_gitCloneStmt +} + func (*GitCloneStmtContext) IsGitCloneStmtContext() {} func NewGitCloneStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GitCloneStmtContext { var p = new(GitCloneStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_gitCloneStmt @@ -10981,36 +11466,24 @@ func (s *GitCloneStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) GitCloneStmt() (localctx IGitCloneStmtContext) { - this := p - _ = this - localctx = NewGitCloneStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 134, EarthParserRULE_gitCloneStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(677) p.Match(EarthParserGIT_CLONE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(679) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -11021,7 +11494,17 @@ func (p *EarthParser) GitCloneStmt() (localctx IGitCloneStmtContext) { } +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 } // IAddStmtContext is an interface to support dynamic dispatch. @@ -11040,23 +11523,28 @@ type IAddStmtContext interface { } type AddStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyAddStmtContext() *AddStmtContext { var p = new(AddStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_addStmt return p } +func InitEmptyAddStmtContext(p *AddStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_addStmt +} + func (*AddStmtContext) IsAddStmtContext() {} func NewAddStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AddStmtContext { var p = new(AddStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_addStmt @@ -11107,36 +11595,24 @@ func (s *AddStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) AddStmt() (localctx IAddStmtContext) { - this := p - _ = this - localctx = NewAddStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 136, EarthParserRULE_addStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(681) p.Match(EarthParserADD) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(683) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -11147,7 +11623,17 @@ func (p *EarthParser) AddStmt() (localctx IAddStmtContext) { } +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 } // IStopsignalStmtContext is an interface to support dynamic dispatch. @@ -11166,23 +11652,28 @@ type IStopsignalStmtContext interface { } type StopsignalStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyStopsignalStmtContext() *StopsignalStmtContext { var p = new(StopsignalStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_stopsignalStmt return p } +func InitEmptyStopsignalStmtContext(p *StopsignalStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_stopsignalStmt +} + func (*StopsignalStmtContext) IsStopsignalStmtContext() {} func NewStopsignalStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StopsignalStmtContext { var p = new(StopsignalStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_stopsignalStmt @@ -11233,36 +11724,24 @@ func (s *StopsignalStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) StopsignalStmt() (localctx IStopsignalStmtContext) { - this := p - _ = this - localctx = NewStopsignalStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 138, EarthParserRULE_stopsignalStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(685) p.Match(EarthParserSTOPSIGNAL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(687) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -11273,7 +11752,17 @@ func (p *EarthParser) StopsignalStmt() (localctx IStopsignalStmtContext) { } +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 } // IOnbuildStmtContext is an interface to support dynamic dispatch. @@ -11292,23 +11781,28 @@ type IOnbuildStmtContext interface { } type OnbuildStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyOnbuildStmtContext() *OnbuildStmtContext { var p = new(OnbuildStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_onbuildStmt return p } +func InitEmptyOnbuildStmtContext(p *OnbuildStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_onbuildStmt +} + func (*OnbuildStmtContext) IsOnbuildStmtContext() {} func NewOnbuildStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OnbuildStmtContext { var p = new(OnbuildStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_onbuildStmt @@ -11359,36 +11853,24 @@ func (s *OnbuildStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) OnbuildStmt() (localctx IOnbuildStmtContext) { - this := p - _ = this - localctx = NewOnbuildStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 140, EarthParserRULE_onbuildStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(689) p.Match(EarthParserONBUILD) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(691) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -11399,7 +11881,17 @@ func (p *EarthParser) OnbuildStmt() (localctx IOnbuildStmtContext) { } +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 } // IHealthcheckStmtContext is an interface to support dynamic dispatch. @@ -11418,23 +11910,28 @@ type IHealthcheckStmtContext interface { } type HealthcheckStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyHealthcheckStmtContext() *HealthcheckStmtContext { var p = new(HealthcheckStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_healthcheckStmt return p } +func InitEmptyHealthcheckStmtContext(p *HealthcheckStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_healthcheckStmt +} + func (*HealthcheckStmtContext) IsHealthcheckStmtContext() {} func NewHealthcheckStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *HealthcheckStmtContext { var p = new(HealthcheckStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_healthcheckStmt @@ -11485,36 +11982,24 @@ func (s *HealthcheckStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) HealthcheckStmt() (localctx IHealthcheckStmtContext) { - this := p - _ = this - localctx = NewHealthcheckStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 142, EarthParserRULE_healthcheckStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(693) p.Match(EarthParserHEALTHCHECK) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(695) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -11525,7 +12010,17 @@ func (p *EarthParser) HealthcheckStmt() (localctx IHealthcheckStmtContext) { } +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 } // IShellStmtContext is an interface to support dynamic dispatch. @@ -11544,23 +12039,28 @@ type IShellStmtContext interface { } type ShellStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyShellStmtContext() *ShellStmtContext { var p = new(ShellStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_shellStmt return p } +func InitEmptyShellStmtContext(p *ShellStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_shellStmt +} + func (*ShellStmtContext) IsShellStmtContext() {} func NewShellStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ShellStmtContext { var p = new(ShellStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_shellStmt @@ -11611,36 +12111,24 @@ func (s *ShellStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) ShellStmt() (localctx IShellStmtContext) { - this := p - _ = this - localctx = NewShellStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 144, EarthParserRULE_shellStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(697) p.Match(EarthParserSHELL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(699) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -11651,7 +12139,17 @@ func (p *EarthParser) ShellStmt() (localctx IShellStmtContext) { } +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 } // IUserCommandStmtContext is an interface to support dynamic dispatch. @@ -11670,23 +12168,28 @@ type IUserCommandStmtContext interface { } type UserCommandStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyUserCommandStmtContext() *UserCommandStmtContext { var p = new(UserCommandStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_userCommandStmt return p } +func InitEmptyUserCommandStmtContext(p *UserCommandStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_userCommandStmt +} + func (*UserCommandStmtContext) IsUserCommandStmtContext() {} func NewUserCommandStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *UserCommandStmtContext { var p = new(UserCommandStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_userCommandStmt @@ -11737,36 +12240,24 @@ func (s *UserCommandStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) UserCommandStmt() (localctx IUserCommandStmtContext) { - this := p - _ = this - localctx = NewUserCommandStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 146, EarthParserRULE_userCommandStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(701) p.Match(EarthParserCOMMAND) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(703) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -11777,7 +12268,17 @@ func (p *EarthParser) UserCommandStmt() (localctx IUserCommandStmtContext) { } +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 } // IFunctionStmtContext is an interface to support dynamic dispatch. @@ -11796,23 +12297,28 @@ type IFunctionStmtContext interface { } type FunctionStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyFunctionStmtContext() *FunctionStmtContext { var p = new(FunctionStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_functionStmt return p } +func InitEmptyFunctionStmtContext(p *FunctionStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_functionStmt +} + func (*FunctionStmtContext) IsFunctionStmtContext() {} func NewFunctionStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FunctionStmtContext { var p = new(FunctionStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_functionStmt @@ -11863,36 +12369,24 @@ func (s *FunctionStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) FunctionStmt() (localctx IFunctionStmtContext) { - this := p - _ = this - localctx = NewFunctionStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 148, EarthParserRULE_functionStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(705) p.Match(EarthParserFUNCTION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(707) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -11903,7 +12397,17 @@ func (p *EarthParser) FunctionStmt() (localctx IFunctionStmtContext) { } +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 } // IDoStmtContext is an interface to support dynamic dispatch. @@ -11922,23 +12426,28 @@ type IDoStmtContext interface { } type DoStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyDoStmtContext() *DoStmtContext { var p = new(DoStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_doStmt return p } +func InitEmptyDoStmtContext(p *DoStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_doStmt +} + func (*DoStmtContext) IsDoStmtContext() {} func NewDoStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DoStmtContext { var p = new(DoStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_doStmt @@ -11989,36 +12498,24 @@ func (s *DoStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) DoStmt() (localctx IDoStmtContext) { - this := p - _ = this - localctx = NewDoStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 150, EarthParserRULE_doStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(709) p.Match(EarthParserDO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(711) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -12029,7 +12526,17 @@ func (p *EarthParser) DoStmt() (localctx IDoStmtContext) { } +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 } // IImportStmtContext is an interface to support dynamic dispatch. @@ -12048,23 +12555,28 @@ type IImportStmtContext interface { } type ImportStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyImportStmtContext() *ImportStmtContext { var p = new(ImportStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_importStmt return p } +func InitEmptyImportStmtContext(p *ImportStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_importStmt +} + func (*ImportStmtContext) IsImportStmtContext() {} func NewImportStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ImportStmtContext { var p = new(ImportStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_importStmt @@ -12115,36 +12627,24 @@ func (s *ImportStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) ImportStmt() (localctx IImportStmtContext) { - this := p - _ = this - localctx = NewImportStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 152, EarthParserRULE_importStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(713) p.Match(EarthParserIMPORT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(715) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -12155,7 +12655,17 @@ func (p *EarthParser) ImportStmt() (localctx IImportStmtContext) { } +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 } // ICacheStmtContext is an interface to support dynamic dispatch. @@ -12174,23 +12684,28 @@ type ICacheStmtContext interface { } type CacheStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyCacheStmtContext() *CacheStmtContext { var p = new(CacheStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_cacheStmt return p } +func InitEmptyCacheStmtContext(p *CacheStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_cacheStmt +} + func (*CacheStmtContext) IsCacheStmtContext() {} func NewCacheStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CacheStmtContext { var p = new(CacheStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_cacheStmt @@ -12241,36 +12756,24 @@ func (s *CacheStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) CacheStmt() (localctx ICacheStmtContext) { - this := p - _ = this - localctx = NewCacheStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 154, EarthParserRULE_cacheStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(717) p.Match(EarthParserCACHE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(719) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -12281,7 +12784,17 @@ func (p *EarthParser) CacheStmt() (localctx ICacheStmtContext) { } +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 } // IHostStmtContext is an interface to support dynamic dispatch. @@ -12300,23 +12813,28 @@ type IHostStmtContext interface { } type HostStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyHostStmtContext() *HostStmtContext { var p = new(HostStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_hostStmt return p } +func InitEmptyHostStmtContext(p *HostStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_hostStmt +} + func (*HostStmtContext) IsHostStmtContext() {} func NewHostStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *HostStmtContext { var p = new(HostStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_hostStmt @@ -12367,36 +12885,24 @@ func (s *HostStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) HostStmt() (localctx IHostStmtContext) { - this := p - _ = this - localctx = NewHostStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 156, EarthParserRULE_hostStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(721) p.Match(EarthParserHOST) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(723) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -12407,7 +12913,17 @@ func (p *EarthParser) HostStmt() (localctx IHostStmtContext) { } +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 } // IProjectStmtContext is an interface to support dynamic dispatch. @@ -12426,23 +12942,28 @@ type IProjectStmtContext interface { } type ProjectStmtContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyProjectStmtContext() *ProjectStmtContext { var p = new(ProjectStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_projectStmt return p } +func InitEmptyProjectStmtContext(p *ProjectStmtContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_projectStmt +} + func (*ProjectStmtContext) IsProjectStmtContext() {} func NewProjectStmtContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ProjectStmtContext { var p = new(ProjectStmtContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_projectStmt @@ -12493,36 +13014,24 @@ func (s *ProjectStmtContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) ProjectStmt() (localctx IProjectStmtContext) { - this := p - _ = this - localctx = NewProjectStmtContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 158, EarthParserRULE_projectStmt) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(725) p.Match(EarthParserPROJECT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(727) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == EarthParserAtom { @@ -12533,7 +13042,17 @@ func (p *EarthParser) ProjectStmt() (localctx IProjectStmtContext) { } +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 } // IExprContext is an interface to support dynamic dispatch. @@ -12551,23 +13070,28 @@ type IExprContext interface { } type ExprContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyExprContext() *ExprContext { var p = new(ExprContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_expr return p } +func InitEmptyExprContext(p *ExprContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_expr +} + func (*ExprContext) IsExprContext() {} func NewExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprContext { var p = new(ExprContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_expr @@ -12614,35 +13138,25 @@ func (s *ExprContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) Expr() (localctx IExprContext) { - this := p - _ = this - localctx = NewExprContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 160, EarthParserRULE_expr) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(729) p.StmtWordsMaybeJSON() } +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 } // IStmtWordsMaybeJSONContext is an interface to support dynamic dispatch. @@ -12660,23 +13174,28 @@ type IStmtWordsMaybeJSONContext interface { } type StmtWordsMaybeJSONContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyStmtWordsMaybeJSONContext() *StmtWordsMaybeJSONContext { var p = new(StmtWordsMaybeJSONContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_stmtWordsMaybeJSON return p } +func InitEmptyStmtWordsMaybeJSONContext(p *StmtWordsMaybeJSONContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_stmtWordsMaybeJSON +} + func (*StmtWordsMaybeJSONContext) IsStmtWordsMaybeJSONContext() {} func NewStmtWordsMaybeJSONContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StmtWordsMaybeJSONContext { var p = new(StmtWordsMaybeJSONContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_stmtWordsMaybeJSON @@ -12723,35 +13242,25 @@ func (s *StmtWordsMaybeJSONContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) StmtWordsMaybeJSON() (localctx IStmtWordsMaybeJSONContext) { - this := p - _ = this - localctx = NewStmtWordsMaybeJSONContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 162, EarthParserRULE_stmtWordsMaybeJSON) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(731) p.StmtWords() } +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 } // IStmtWordsContext is an interface to support dynamic dispatch. @@ -12770,23 +13279,28 @@ type IStmtWordsContext interface { } type StmtWordsContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyStmtWordsContext() *StmtWordsContext { var p = new(StmtWordsContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_stmtWords return p } +func InitEmptyStmtWordsContext(p *StmtWordsContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_stmtWords +} + func (*StmtWordsContext) IsStmtWordsContext() {} func NewStmtWordsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StmtWordsContext { var p = new(StmtWordsContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_stmtWords @@ -12858,33 +13372,16 @@ func (s *StmtWordsContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) StmtWords() (localctx IStmtWordsContext) { - this := p - _ = this - localctx = NewStmtWordsContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 164, EarthParserRULE_stmtWords) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - var _alt int p.EnterOuterAlt(localctx, 1) p.SetState(734) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _alt = 1 for ok := true; ok; ok = _alt != 2 && _alt != antlr.ATNInvalidAltNumber { switch _alt { @@ -12895,15 +13392,29 @@ func (p *EarthParser) StmtWords() (localctx IStmtWordsContext) { } default: - panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit } p.SetState(736) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 100, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 100, p.GetParserRuleContext()) + if p.HasError() { + 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 } // IStmtWordContext is an interface to support dynamic dispatch. @@ -12921,23 +13432,28 @@ type IStmtWordContext interface { } type StmtWordContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyStmtWordContext() *StmtWordContext { var p = new(StmtWordContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EarthParserRULE_stmtWord return p } +func InitEmptyStmtWordContext(p *StmtWordContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EarthParserRULE_stmtWord +} + func (*StmtWordContext) IsStmtWordContext() {} func NewStmtWordContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StmtWordContext { var p = new(StmtWordContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EarthParserRULE_stmtWord @@ -12972,33 +13488,27 @@ func (s *StmtWordContext) ExitRule(listener antlr.ParseTreeListener) { } func (p *EarthParser) StmtWord() (localctx IStmtWordContext) { - this := p - _ = this - localctx = NewStmtWordContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 166, EarthParserRULE_stmtWord) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(738) p.Match(EarthParserAtom) + 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 } diff --git a/ast/parser/earthparser_base_listener.go b/ast/parser/earthparser_base_listener.go index 33d2579242..9e22e3f1dd 100644 --- a/ast/parser/earthparser_base_listener.go +++ b/ast/parser/earthparser_base_listener.go @@ -1,8 +1,8 @@ -// Code generated from ast/parser/EarthParser.g4 by ANTLR 4.12.0. DO NOT EDIT. +// Code generated from ast/parser/EarthParser.g4 by ANTLR 4.13.1. DO NOT EDIT. package parser // EarthParser -import "github.com/antlr/antlr4/runtime/Go/antlr/v4" +import "github.com/antlr4-go/antlr/v4" // BaseEarthParserListener is a complete listener for a parse tree produced by EarthParser. type BaseEarthParserListener struct{} diff --git a/ast/parser/earthparser_listener.go b/ast/parser/earthparser_listener.go index e40a998f43..a75c3e4861 100644 --- a/ast/parser/earthparser_listener.go +++ b/ast/parser/earthparser_listener.go @@ -1,8 +1,8 @@ -// Code generated from ast/parser/EarthParser.g4 by ANTLR 4.12.0. DO NOT EDIT. +// Code generated from ast/parser/EarthParser.g4 by ANTLR 4.13.1. DO NOT EDIT. package parser // EarthParser -import "github.com/antlr/antlr4/runtime/Go/antlr/v4" +import "github.com/antlr4-go/antlr/v4" // EarthParserListener is a complete listener for a parse tree produced by EarthParser. type EarthParserListener interface { diff --git a/ast/parser/export.go b/ast/parser/export.go index a7c1c74c73..fe7177c962 100644 --- a/ast/parser/export.go +++ b/ast/parser/export.go @@ -2,18 +2,15 @@ package parser // GetLexerModeNames returns the generated mode names. func GetLexerModeNames() []string { - EarthLexerInit() - return earthlexerLexerStaticData.modeNames + return NewEarthLexer(nil).modeNames } // GetLexerSymbolicNames returns the generated token names. func GetLexerSymbolicNames() []string { - EarthLexerInit() - return earthlexerLexerStaticData.symbolicNames + return NewEarthLexer(nil).SymbolicNames } // GetLexerLiteralNames returns the generated literal names. func GetLexerLiteralNames() []string { - EarthLexerInit() - return earthlexerLexerStaticData.literalNames + return NewEarthLexer(nil).LiteralNames } diff --git a/go.mod b/go.mod index 99896d8373..294dd6c007 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( git.sr.ht/~nelsam/hel v0.6.6 github.com/adrg/xdg v0.5.3 github.com/alexcb/binarystream v0.0.0-20231130184431-f2f7a7543c6d - github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20260101203826-8e6fd9147b3c + github.com/antlr4-go/antlr/v4 v4.13.1 github.com/aws/aws-sdk-go-v2 v1.41.1 github.com/aws/aws-sdk-go-v2/config v1.32.7 github.com/containerd/go-runc v1.1.0 @@ -123,7 +123,7 @@ require ( go.opentelemetry.io/otel/sdk v1.38.0 // indirect go.opentelemetry.io/otel/trace v1.38.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect - golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect + golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect golang.org/x/net v0.48.0 // indirect golang.org/x/oauth2 v0.32.0 // indirect golang.org/x/sys v0.40.0 // indirect diff --git a/go.sum b/go.sum index 3df1c85b11..57424eb34e 100644 --- a/go.sum +++ b/go.sum @@ -31,8 +31,8 @@ github.com/alexcb/go-flags v0.0.0-20210722203016-f11d7ecb5ee5 h1:im0niQRZXdxO8F1 github.com/alexcb/go-flags v0.0.0-20210722203016-f11d7ecb5ee5/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 h1:aM1rlcoLz8y5B2r4tTLMiVTrMtpfY0O8EScKJxaSaEc= github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092/go.mod h1:rYqSE9HbjzpHTI74vwPvae4ZVYZd1lue2ta6xHPdblA= -github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230219212500-1f9a474cc2dc h1:ikxgKfnYm4kXCOohe1uCkVFwZcABDZbVsqginko+GY8= -github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230219212500-1f9a474cc2dc/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= github.com/aws/aws-sdk-go-v2 v1.41.1 h1:ABlyEARCDLN034NhxlRUSZr4l71mh+T5KAeGh6cerhU= github.com/aws/aws-sdk-go-v2 v1.41.1/go.mod h1:MayyLB8y+buD9hZqkCW3kX1AKq07Y5pXxtgB+rRFhz0= github.com/aws/aws-sdk-go-v2/config v1.32.7 h1:vxUyWGUwmkQ2g19n7JY/9YL8MfAIl7bTesIUykECXmY= @@ -108,8 +108,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/cli v29.1.5+incompatible h1:GckbANUt3j+lsnQ6eCcQd70mNSOismSHWt8vk2AX8ao= -github.com/docker/cli v29.1.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v29.2.0+incompatible h1:9oBd9+YM7rxjZLfyMGxjraKBKE4/nVyvVfN4qNl9XRM= github.com/docker/cli v29.2.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/docker v24.0.0-rc.2.0.20230905130451-032797ea4bcb+incompatible h1:1UUPAB9PAPUbM10+qIKPL5tKZ+VAddWgbQUf+x1QBfI= @@ -339,8 +337,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 h1:aAcj0Da7eBAtrTp03QXWvm88pSyOt+UgdZw2BFZ+lEw= -golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=