style: format code (#1322)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
package api // ApiParser
|
||||
import "github.com/zeromicro/antlr"
|
||||
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"unicode"
|
||||
|
||||
"github.com/zeromicro/antlr"
|
||||
)
|
||||
// Suppress unused import error
|
||||
var _ = fmt.Printf
|
||||
var _ = unicode.IsLetter
|
||||
|
||||
// Suppress unused import error
|
||||
var (
|
||||
_ = fmt.Printf
|
||||
_ = unicode.IsLetter
|
||||
)
|
||||
|
||||
var serializedLexerAtn = []uint16{
|
||||
3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 26, 276,
|
||||
@@ -170,6 +173,7 @@ var lexerRuleNames = []string{
|
||||
"ID", "ExponentPart", "EscapeSequence", "HexDigits", "HexDigit", "Digits",
|
||||
"LetterOrDigit", "Letter",
|
||||
}
|
||||
|
||||
type ApiParserLexer struct {
|
||||
*antlr.BaseLexer
|
||||
channelNames []string
|
||||
@@ -233,8 +237,4 @@ const (
|
||||
ApiParserLexerID = 24
|
||||
)
|
||||
|
||||
|
||||
const COMEMNTS = 88
|
||||
|
||||
|
||||
|
||||
const COMEMNTS = 88
|
||||
|
||||
@@ -8,10 +8,11 @@ import (
|
||||
)
|
||||
|
||||
// Suppress unused import errors
|
||||
var _ = fmt.Printf
|
||||
var _ = reflect.Copy
|
||||
var _ = strconv.Itoa
|
||||
|
||||
var (
|
||||
_ = fmt.Printf
|
||||
_ = reflect.Copy
|
||||
_ = strconv.Itoa
|
||||
)
|
||||
|
||||
var parserATN = []uint16{
|
||||
3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 26, 349,
|
||||
@@ -167,11 +168,13 @@ var parserATN = []uint16{
|
||||
270, 276, 281, 284, 287, 296, 299, 303, 310, 320, 324, 332, 339, 341, 343,
|
||||
346,
|
||||
}
|
||||
|
||||
var literalNames = []string{
|
||||
"", "'='", "'('", "')'", "'{'", "'}'", "'*'", "'time.Time'", "'['", "']'",
|
||||
"'returns'", "'-'", "'/'", "'/:'", "'@doc'", "'@handler'", "'interface{}'",
|
||||
"'@server'",
|
||||
}
|
||||
|
||||
var symbolicNames = []string{
|
||||
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "ATDOC", "ATHANDLER",
|
||||
"INTERFACE", "ATSERVER", "WS", "COMMENT", "LINE_COMMENT", "STRING", "RAW_STRING",
|
||||
@@ -186,6 +189,7 @@ var ruleNames = []string{
|
||||
"arrayType", "serviceSpec", "atServer", "serviceApi", "serviceRoute", "atDoc",
|
||||
"atHandler", "route", "body", "replybody", "kvLit", "serviceName", "path",
|
||||
}
|
||||
|
||||
type ApiParserParser struct {
|
||||
*antlr.BaseParser
|
||||
}
|
||||
@@ -215,7 +219,6 @@ func NewApiParserParser(input antlr.TokenStream) *ApiParserParser {
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
// ApiParserParser tokens.
|
||||
const (
|
||||
ApiParserParserEOF = antlr.TokenEOF
|
||||
@@ -303,7 +306,7 @@ type ApiContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyApiContext() *ApiContext {
|
||||
var p = new(ApiContext)
|
||||
p := new(ApiContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_api
|
||||
return p
|
||||
@@ -312,7 +315,7 @@ func NewEmptyApiContext() *ApiContext {
|
||||
func (*ApiContext) IsApiContext() {}
|
||||
|
||||
func NewApiContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ApiContext {
|
||||
var p = new(ApiContext)
|
||||
p := new(ApiContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -325,8 +328,8 @@ func NewApiContext(parser antlr.Parser, parent antlr.ParserRuleContext, invoking
|
||||
func (s *ApiContext) GetParser() antlr.Parser { return s.parser }
|
||||
|
||||
func (s *ApiContext) AllSpec() []ISpecContext {
|
||||
var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ISpecContext)(nil)).Elem())
|
||||
var tst = make([]ISpecContext, len(ts))
|
||||
ts := s.GetTypedRuleContexts(reflect.TypeOf((*ISpecContext)(nil)).Elem())
|
||||
tst := make([]ISpecContext, len(ts))
|
||||
|
||||
for i, t := range ts {
|
||||
if t != nil {
|
||||
@@ -338,7 +341,7 @@ func (s *ApiContext) AllSpec() []ISpecContext {
|
||||
}
|
||||
|
||||
func (s *ApiContext) Spec(i int) ISpecContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*ISpecContext)(nil)).Elem(), i)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*ISpecContext)(nil)).Elem(), i)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -355,7 +358,6 @@ func (s *ApiContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) st
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *ApiContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -366,15 +368,11 @@ func (s *ApiContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) Api() (localctx IApiContext) {
|
||||
localctx = NewApiContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 0, ApiParserParserRULE_api)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -396,25 +394,20 @@ func (p *ApiParserParser) Api() (localctx IApiContext) {
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
for _la == ApiParserParserATSERVER || _la == ApiParserParserID {
|
||||
{
|
||||
p.SetState(74)
|
||||
p.Spec()
|
||||
}
|
||||
|
||||
|
||||
p.SetState(79)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// ISpecContext is an interface to support dynamic dispatch.
|
||||
type ISpecContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -432,7 +425,7 @@ type SpecContext struct {
|
||||
}
|
||||
|
||||
func NewEmptySpecContext() *SpecContext {
|
||||
var p = new(SpecContext)
|
||||
p := new(SpecContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_spec
|
||||
return p
|
||||
@@ -441,7 +434,7 @@ func NewEmptySpecContext() *SpecContext {
|
||||
func (*SpecContext) IsSpecContext() {}
|
||||
|
||||
func NewSpecContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SpecContext {
|
||||
var p = new(SpecContext)
|
||||
p := new(SpecContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -454,7 +447,7 @@ func NewSpecContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokin
|
||||
func (s *SpecContext) GetParser() antlr.Parser { return s.parser }
|
||||
|
||||
func (s *SpecContext) SyntaxLit() ISyntaxLitContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*ISyntaxLitContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*ISyntaxLitContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -464,7 +457,7 @@ func (s *SpecContext) SyntaxLit() ISyntaxLitContext {
|
||||
}
|
||||
|
||||
func (s *SpecContext) ImportSpec() IImportSpecContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IImportSpecContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IImportSpecContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -474,7 +467,7 @@ func (s *SpecContext) ImportSpec() IImportSpecContext {
|
||||
}
|
||||
|
||||
func (s *SpecContext) InfoSpec() IInfoSpecContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IInfoSpecContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IInfoSpecContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -484,7 +477,7 @@ func (s *SpecContext) InfoSpec() IInfoSpecContext {
|
||||
}
|
||||
|
||||
func (s *SpecContext) TypeSpec() ITypeSpecContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*ITypeSpecContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeSpecContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -494,7 +487,7 @@ func (s *SpecContext) TypeSpec() ITypeSpecContext {
|
||||
}
|
||||
|
||||
func (s *SpecContext) ServiceSpec() IServiceSpecContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IServiceSpecContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IServiceSpecContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -511,7 +504,6 @@ func (s *SpecContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) s
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *SpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -522,9 +514,6 @@ func (s *SpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) Spec() (localctx ISpecContext) {
|
||||
localctx = NewSpecContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 2, ApiParserParserRULE_spec)
|
||||
@@ -555,7 +544,6 @@ func (p *ApiParserParser) Spec() (localctx ISpecContext) {
|
||||
p.SyntaxLit()
|
||||
}
|
||||
|
||||
|
||||
case 2:
|
||||
p.EnterOuterAlt(localctx, 2)
|
||||
{
|
||||
@@ -563,7 +551,6 @@ func (p *ApiParserParser) Spec() (localctx ISpecContext) {
|
||||
p.ImportSpec()
|
||||
}
|
||||
|
||||
|
||||
case 3:
|
||||
p.EnterOuterAlt(localctx, 3)
|
||||
{
|
||||
@@ -571,7 +558,6 @@ func (p *ApiParserParser) Spec() (localctx ISpecContext) {
|
||||
p.InfoSpec()
|
||||
}
|
||||
|
||||
|
||||
case 4:
|
||||
p.EnterOuterAlt(localctx, 4)
|
||||
{
|
||||
@@ -579,7 +565,6 @@ func (p *ApiParserParser) Spec() (localctx ISpecContext) {
|
||||
p.TypeSpec()
|
||||
}
|
||||
|
||||
|
||||
case 5:
|
||||
p.EnterOuterAlt(localctx, 5)
|
||||
{
|
||||
@@ -589,11 +574,9 @@ func (p *ApiParserParser) Spec() (localctx ISpecContext) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// ISyntaxLitContext is an interface to support dynamic dispatch.
|
||||
type ISyntaxLitContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -610,7 +593,6 @@ type ISyntaxLitContext interface {
|
||||
// GetVersion returns the version token.
|
||||
GetVersion() antlr.Token
|
||||
|
||||
|
||||
// SetSyntaxToken sets the syntaxToken token.
|
||||
SetSyntaxToken(antlr.Token)
|
||||
|
||||
@@ -620,7 +602,6 @@ type ISyntaxLitContext interface {
|
||||
// SetVersion sets the version token.
|
||||
SetVersion(antlr.Token)
|
||||
|
||||
|
||||
// IsSyntaxLitContext differentiates from other interfaces.
|
||||
IsSyntaxLitContext()
|
||||
}
|
||||
@@ -634,7 +615,7 @@ type SyntaxLitContext struct {
|
||||
}
|
||||
|
||||
func NewEmptySyntaxLitContext() *SyntaxLitContext {
|
||||
var p = new(SyntaxLitContext)
|
||||
p := new(SyntaxLitContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_syntaxLit
|
||||
return p
|
||||
@@ -643,7 +624,7 @@ func NewEmptySyntaxLitContext() *SyntaxLitContext {
|
||||
func (*SyntaxLitContext) IsSyntaxLitContext() {}
|
||||
|
||||
func NewSyntaxLitContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SyntaxLitContext {
|
||||
var p = new(SyntaxLitContext)
|
||||
p := new(SyntaxLitContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -652,3 +633,4 @@ func NewSyntaxLitContext(parser antlr.Parser, parent antlr.ParserRuleContext, in
|
||||
|
||||
return p
|
||||
}
|
||||
|
||||
|
||||
@@ -18,14 +18,12 @@ func (s *SyntaxLitContext) GetAssign() antlr.Token { return s.assign }
|
||||
|
||||
func (s *SyntaxLitContext) GetVersion() antlr.Token { return s.version }
|
||||
|
||||
|
||||
func (s *SyntaxLitContext) SetSyntaxToken(v antlr.Token) { s.syntaxToken = v }
|
||||
|
||||
func (s *SyntaxLitContext) SetAssign(v antlr.Token) { s.assign = v }
|
||||
|
||||
func (s *SyntaxLitContext) SetVersion(v antlr.Token) { s.version = v }
|
||||
|
||||
|
||||
func (s *SyntaxLitContext) ID() antlr.TerminalNode {
|
||||
return s.GetToken(ApiParserParserID, 0)
|
||||
}
|
||||
@@ -42,7 +40,6 @@ func (s *SyntaxLitContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *SyntaxLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -53,9 +50,6 @@ func (s *SyntaxLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) SyntaxLit() (localctx ISyntaxLitContext) {
|
||||
localctx = NewSyntaxLitContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 4, ApiParserParserRULE_syntaxLit)
|
||||
@@ -77,18 +71,18 @@ func (p *ApiParserParser) SyntaxLit() (localctx ISyntaxLitContext) {
|
||||
}()
|
||||
|
||||
p.EnterOuterAlt(localctx, 1)
|
||||
match(p,"syntax")
|
||||
match(p, "syntax")
|
||||
{
|
||||
p.SetState(88)
|
||||
|
||||
var _m = p.Match(ApiParserParserID)
|
||||
_m := p.Match(ApiParserParserID)
|
||||
|
||||
localctx.(*SyntaxLitContext).syntaxToken = _m
|
||||
}
|
||||
{
|
||||
p.SetState(89)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__0)
|
||||
_m := p.Match(ApiParserParserT__0)
|
||||
|
||||
localctx.(*SyntaxLitContext).assign = _m
|
||||
}
|
||||
@@ -96,17 +90,14 @@ func (p *ApiParserParser) SyntaxLit() (localctx ISyntaxLitContext) {
|
||||
{
|
||||
p.SetState(91)
|
||||
|
||||
var _m = p.Match(ApiParserParserSTRING)
|
||||
_m := p.Match(ApiParserParserSTRING)
|
||||
|
||||
localctx.(*SyntaxLitContext).version = _m
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IImportSpecContext is an interface to support dynamic dispatch.
|
||||
type IImportSpecContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -124,7 +115,7 @@ type ImportSpecContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyImportSpecContext() *ImportSpecContext {
|
||||
var p = new(ImportSpecContext)
|
||||
p := new(ImportSpecContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_importSpec
|
||||
return p
|
||||
@@ -133,7 +124,7 @@ func NewEmptyImportSpecContext() *ImportSpecContext {
|
||||
func (*ImportSpecContext) IsImportSpecContext() {}
|
||||
|
||||
func NewImportSpecContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ImportSpecContext {
|
||||
var p = new(ImportSpecContext)
|
||||
p := new(ImportSpecContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -146,7 +137,7 @@ func NewImportSpecContext(parser antlr.Parser, parent antlr.ParserRuleContext, i
|
||||
func (s *ImportSpecContext) GetParser() antlr.Parser { return s.parser }
|
||||
|
||||
func (s *ImportSpecContext) ImportLit() IImportLitContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IImportLitContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IImportLitContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -156,7 +147,7 @@ func (s *ImportSpecContext) ImportLit() IImportLitContext {
|
||||
}
|
||||
|
||||
func (s *ImportSpecContext) ImportBlock() IImportBlockContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IImportBlockContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IImportBlockContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -173,7 +164,6 @@ func (s *ImportSpecContext) ToStringTree(ruleNames []string, recog antlr.Recogni
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *ImportSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -184,9 +174,6 @@ func (s *ImportSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) ImportSpec() (localctx IImportSpecContext) {
|
||||
localctx = NewImportSpecContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 6, ApiParserParserRULE_importSpec)
|
||||
@@ -217,7 +204,6 @@ func (p *ApiParserParser) ImportSpec() (localctx IImportSpecContext) {
|
||||
p.ImportLit()
|
||||
}
|
||||
|
||||
|
||||
case 2:
|
||||
p.EnterOuterAlt(localctx, 2)
|
||||
{
|
||||
@@ -227,11 +213,9 @@ func (p *ApiParserParser) ImportSpec() (localctx IImportSpecContext) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IImportLitContext is an interface to support dynamic dispatch.
|
||||
type IImportLitContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -242,11 +226,9 @@ type IImportLitContext interface {
|
||||
// GetImportToken returns the importToken token.
|
||||
GetImportToken() antlr.Token
|
||||
|
||||
|
||||
// SetImportToken sets the importToken token.
|
||||
SetImportToken(antlr.Token)
|
||||
|
||||
|
||||
// IsImportLitContext differentiates from other interfaces.
|
||||
IsImportLitContext()
|
||||
}
|
||||
@@ -258,7 +240,7 @@ type ImportLitContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyImportLitContext() *ImportLitContext {
|
||||
var p = new(ImportLitContext)
|
||||
p := new(ImportLitContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_importLit
|
||||
return p
|
||||
@@ -267,7 +249,7 @@ func NewEmptyImportLitContext() *ImportLitContext {
|
||||
func (*ImportLitContext) IsImportLitContext() {}
|
||||
|
||||
func NewImportLitContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ImportLitContext {
|
||||
var p = new(ImportLitContext)
|
||||
p := new(ImportLitContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -281,12 +263,10 @@ func (s *ImportLitContext) GetParser() antlr.Parser { return s.parser }
|
||||
|
||||
func (s *ImportLitContext) GetImportToken() antlr.Token { return s.importToken }
|
||||
|
||||
|
||||
func (s *ImportLitContext) SetImportToken(v antlr.Token) { s.importToken = v }
|
||||
|
||||
|
||||
func (s *ImportLitContext) ImportValue() IImportValueContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IImportValueContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IImportValueContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -307,7 +287,6 @@ func (s *ImportLitContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *ImportLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -318,9 +297,6 @@ func (s *ImportLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) ImportLit() (localctx IImportLitContext) {
|
||||
localctx = NewImportLitContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 8, ApiParserParserRULE_importLit)
|
||||
@@ -342,11 +318,11 @@ func (p *ApiParserParser) ImportLit() (localctx IImportLitContext) {
|
||||
}()
|
||||
|
||||
p.EnterOuterAlt(localctx, 1)
|
||||
match(p,"import")
|
||||
match(p, "import")
|
||||
{
|
||||
p.SetState(98)
|
||||
|
||||
var _m = p.Match(ApiParserParserID)
|
||||
_m := p.Match(ApiParserParserID)
|
||||
|
||||
localctx.(*ImportLitContext).importToken = _m
|
||||
}
|
||||
@@ -355,12 +331,9 @@ func (p *ApiParserParser) ImportLit() (localctx IImportLitContext) {
|
||||
p.ImportValue()
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IImportBlockContext is an interface to support dynamic dispatch.
|
||||
type IImportBlockContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -371,11 +344,9 @@ type IImportBlockContext interface {
|
||||
// GetImportToken returns the importToken token.
|
||||
GetImportToken() antlr.Token
|
||||
|
||||
|
||||
// SetImportToken sets the importToken token.
|
||||
SetImportToken(antlr.Token)
|
||||
|
||||
|
||||
// IsImportBlockContext differentiates from other interfaces.
|
||||
IsImportBlockContext()
|
||||
}
|
||||
@@ -387,7 +358,7 @@ type ImportBlockContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyImportBlockContext() *ImportBlockContext {
|
||||
var p = new(ImportBlockContext)
|
||||
p := new(ImportBlockContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_importBlock
|
||||
return p
|
||||
@@ -396,7 +367,7 @@ func NewEmptyImportBlockContext() *ImportBlockContext {
|
||||
func (*ImportBlockContext) IsImportBlockContext() {}
|
||||
|
||||
func NewImportBlockContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ImportBlockContext {
|
||||
var p = new(ImportBlockContext)
|
||||
p := new(ImportBlockContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -410,17 +381,15 @@ func (s *ImportBlockContext) GetParser() antlr.Parser { return s.parser }
|
||||
|
||||
func (s *ImportBlockContext) GetImportToken() antlr.Token { return s.importToken }
|
||||
|
||||
|
||||
func (s *ImportBlockContext) SetImportToken(v antlr.Token) { s.importToken = v }
|
||||
|
||||
|
||||
func (s *ImportBlockContext) ID() antlr.TerminalNode {
|
||||
return s.GetToken(ApiParserParserID, 0)
|
||||
}
|
||||
|
||||
func (s *ImportBlockContext) AllImportBlockValue() []IImportBlockValueContext {
|
||||
var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IImportBlockValueContext)(nil)).Elem())
|
||||
var tst = make([]IImportBlockValueContext, len(ts))
|
||||
ts := s.GetTypedRuleContexts(reflect.TypeOf((*IImportBlockValueContext)(nil)).Elem())
|
||||
tst := make([]IImportBlockValueContext, len(ts))
|
||||
|
||||
for i, t := range ts {
|
||||
if t != nil {
|
||||
@@ -432,7 +401,7 @@ func (s *ImportBlockContext) AllImportBlockValue() []IImportBlockValueContext {
|
||||
}
|
||||
|
||||
func (s *ImportBlockContext) ImportBlockValue(i int) IImportBlockValueContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IImportBlockValueContext)(nil)).Elem(), i)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IImportBlockValueContext)(nil)).Elem(), i)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -449,7 +418,6 @@ func (s *ImportBlockContext) ToStringTree(ruleNames []string, recog antlr.Recogn
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *ImportBlockContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -460,15 +428,11 @@ func (s *ImportBlockContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) ImportBlock() (localctx IImportBlockContext) {
|
||||
localctx = NewImportBlockContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 10, ApiParserParserRULE_importBlock)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -486,11 +450,11 @@ func (p *ApiParserParser) ImportBlock() (localctx IImportBlockContext) {
|
||||
}()
|
||||
|
||||
p.EnterOuterAlt(localctx, 1)
|
||||
match(p,"import")
|
||||
match(p, "import")
|
||||
{
|
||||
p.SetState(102)
|
||||
|
||||
var _m = p.Match(ApiParserParserID)
|
||||
_m := p.Match(ApiParserParserID)
|
||||
|
||||
localctx.(*ImportBlockContext).importToken = _m
|
||||
}
|
||||
@@ -507,7 +471,6 @@ func (p *ApiParserParser) ImportBlock() (localctx IImportBlockContext) {
|
||||
p.ImportBlockValue()
|
||||
}
|
||||
|
||||
|
||||
p.SetState(107)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
@@ -517,12 +480,9 @@ func (p *ApiParserParser) ImportBlock() (localctx IImportBlockContext) {
|
||||
p.Match(ApiParserParserT__2)
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IImportBlockValueContext is an interface to support dynamic dispatch.
|
||||
type IImportBlockValueContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -540,7 +500,7 @@ type ImportBlockValueContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyImportBlockValueContext() *ImportBlockValueContext {
|
||||
var p = new(ImportBlockValueContext)
|
||||
p := new(ImportBlockValueContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_importBlockValue
|
||||
return p
|
||||
@@ -549,7 +509,7 @@ func NewEmptyImportBlockValueContext() *ImportBlockValueContext {
|
||||
func (*ImportBlockValueContext) IsImportBlockValueContext() {}
|
||||
|
||||
func NewImportBlockValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ImportBlockValueContext {
|
||||
var p = new(ImportBlockValueContext)
|
||||
p := new(ImportBlockValueContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -562,7 +522,7 @@ func NewImportBlockValueContext(parser antlr.Parser, parent antlr.ParserRuleCont
|
||||
func (s *ImportBlockValueContext) GetParser() antlr.Parser { return s.parser }
|
||||
|
||||
func (s *ImportBlockValueContext) ImportValue() IImportValueContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IImportValueContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IImportValueContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -579,7 +539,6 @@ func (s *ImportBlockValueContext) ToStringTree(ruleNames []string, recog antlr.R
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *ImportBlockValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -590,9 +549,6 @@ func (s *ImportBlockValueContext) Accept(visitor antlr.ParseTreeVisitor) interfa
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) ImportBlockValue() (localctx IImportBlockValueContext) {
|
||||
localctx = NewImportBlockValueContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 12, ApiParserParserRULE_importBlockValue)
|
||||
@@ -619,12 +575,9 @@ func (p *ApiParserParser) ImportBlockValue() (localctx IImportBlockValueContext)
|
||||
p.ImportValue()
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IImportValueContext is an interface to support dynamic dispatch.
|
||||
type IImportValueContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -642,7 +595,7 @@ type ImportValueContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyImportValueContext() *ImportValueContext {
|
||||
var p = new(ImportValueContext)
|
||||
p := new(ImportValueContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_importValue
|
||||
return p
|
||||
@@ -651,7 +604,7 @@ func NewEmptyImportValueContext() *ImportValueContext {
|
||||
func (*ImportValueContext) IsImportValueContext() {}
|
||||
|
||||
func NewImportValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ImportValueContext {
|
||||
var p = new(ImportValueContext)
|
||||
p := new(ImportValueContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ func (s *ImportValueContext) ToStringTree(ruleNames []string, recog antlr.Recogn
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *ImportValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -35,9 +34,6 @@ func (s *ImportValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) ImportValue() (localctx IImportValueContext) {
|
||||
localctx = NewImportValueContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 14, ApiParserParserRULE_importValue)
|
||||
@@ -65,12 +61,9 @@ func (p *ApiParserParser) ImportValue() (localctx IImportValueContext) {
|
||||
p.Match(ApiParserParserSTRING)
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IInfoSpecContext is an interface to support dynamic dispatch.
|
||||
type IInfoSpecContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -87,7 +80,6 @@ type IInfoSpecContext interface {
|
||||
// GetRp returns the rp token.
|
||||
GetRp() antlr.Token
|
||||
|
||||
|
||||
// SetInfoToken sets the infoToken token.
|
||||
SetInfoToken(antlr.Token)
|
||||
|
||||
@@ -97,7 +89,6 @@ type IInfoSpecContext interface {
|
||||
// SetRp sets the rp token.
|
||||
SetRp(antlr.Token)
|
||||
|
||||
|
||||
// IsInfoSpecContext differentiates from other interfaces.
|
||||
IsInfoSpecContext()
|
||||
}
|
||||
@@ -111,7 +102,7 @@ type InfoSpecContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyInfoSpecContext() *InfoSpecContext {
|
||||
var p = new(InfoSpecContext)
|
||||
p := new(InfoSpecContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_infoSpec
|
||||
return p
|
||||
@@ -120,7 +111,7 @@ func NewEmptyInfoSpecContext() *InfoSpecContext {
|
||||
func (*InfoSpecContext) IsInfoSpecContext() {}
|
||||
|
||||
func NewInfoSpecContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *InfoSpecContext {
|
||||
var p = new(InfoSpecContext)
|
||||
p := new(InfoSpecContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -138,21 +129,19 @@ func (s *InfoSpecContext) GetLp() antlr.Token { return s.lp }
|
||||
|
||||
func (s *InfoSpecContext) GetRp() antlr.Token { return s.rp }
|
||||
|
||||
|
||||
func (s *InfoSpecContext) SetInfoToken(v antlr.Token) { s.infoToken = v }
|
||||
|
||||
func (s *InfoSpecContext) SetLp(v antlr.Token) { s.lp = v }
|
||||
|
||||
func (s *InfoSpecContext) SetRp(v antlr.Token) { s.rp = v }
|
||||
|
||||
|
||||
func (s *InfoSpecContext) ID() antlr.TerminalNode {
|
||||
return s.GetToken(ApiParserParserID, 0)
|
||||
}
|
||||
|
||||
func (s *InfoSpecContext) AllKvLit() []IKvLitContext {
|
||||
var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IKvLitContext)(nil)).Elem())
|
||||
var tst = make([]IKvLitContext, len(ts))
|
||||
ts := s.GetTypedRuleContexts(reflect.TypeOf((*IKvLitContext)(nil)).Elem())
|
||||
tst := make([]IKvLitContext, len(ts))
|
||||
|
||||
for i, t := range ts {
|
||||
if t != nil {
|
||||
@@ -164,7 +153,7 @@ func (s *InfoSpecContext) AllKvLit() []IKvLitContext {
|
||||
}
|
||||
|
||||
func (s *InfoSpecContext) KvLit(i int) IKvLitContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IKvLitContext)(nil)).Elem(), i)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IKvLitContext)(nil)).Elem(), i)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -181,7 +170,6 @@ func (s *InfoSpecContext) ToStringTree(ruleNames []string, recog antlr.Recognize
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *InfoSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -192,15 +180,11 @@ func (s *InfoSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) InfoSpec() (localctx IInfoSpecContext) {
|
||||
localctx = NewInfoSpecContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 16, ApiParserParserRULE_infoSpec)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -218,18 +202,18 @@ func (p *ApiParserParser) InfoSpec() (localctx IInfoSpecContext) {
|
||||
}()
|
||||
|
||||
p.EnterOuterAlt(localctx, 1)
|
||||
match(p,"info")
|
||||
match(p, "info")
|
||||
{
|
||||
p.SetState(117)
|
||||
|
||||
var _m = p.Match(ApiParserParserID)
|
||||
_m := p.Match(ApiParserParserID)
|
||||
|
||||
localctx.(*InfoSpecContext).infoToken = _m
|
||||
}
|
||||
{
|
||||
p.SetState(118)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__1)
|
||||
_m := p.Match(ApiParserParserT__1)
|
||||
|
||||
localctx.(*InfoSpecContext).lp = _m
|
||||
}
|
||||
@@ -242,7 +226,6 @@ func (p *ApiParserParser) InfoSpec() (localctx IInfoSpecContext) {
|
||||
p.KvLit()
|
||||
}
|
||||
|
||||
|
||||
p.SetState(122)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
@@ -250,17 +233,14 @@ func (p *ApiParserParser) InfoSpec() (localctx IInfoSpecContext) {
|
||||
{
|
||||
p.SetState(124)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__2)
|
||||
_m := p.Match(ApiParserParserT__2)
|
||||
|
||||
localctx.(*InfoSpecContext).rp = _m
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// ITypeSpecContext is an interface to support dynamic dispatch.
|
||||
type ITypeSpecContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -278,7 +258,7 @@ type TypeSpecContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyTypeSpecContext() *TypeSpecContext {
|
||||
var p = new(TypeSpecContext)
|
||||
p := new(TypeSpecContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_typeSpec
|
||||
return p
|
||||
@@ -287,7 +267,7 @@ func NewEmptyTypeSpecContext() *TypeSpecContext {
|
||||
func (*TypeSpecContext) IsTypeSpecContext() {}
|
||||
|
||||
func NewTypeSpecContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeSpecContext {
|
||||
var p = new(TypeSpecContext)
|
||||
p := new(TypeSpecContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -300,7 +280,7 @@ func NewTypeSpecContext(parser antlr.Parser, parent antlr.ParserRuleContext, inv
|
||||
func (s *TypeSpecContext) GetParser() antlr.Parser { return s.parser }
|
||||
|
||||
func (s *TypeSpecContext) TypeLit() ITypeLitContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*ITypeLitContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeLitContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -310,7 +290,7 @@ func (s *TypeSpecContext) TypeLit() ITypeLitContext {
|
||||
}
|
||||
|
||||
func (s *TypeSpecContext) TypeBlock() ITypeBlockContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*ITypeBlockContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeBlockContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -327,7 +307,6 @@ func (s *TypeSpecContext) ToStringTree(ruleNames []string, recog antlr.Recognize
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *TypeSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -338,9 +317,6 @@ func (s *TypeSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) TypeSpec() (localctx ITypeSpecContext) {
|
||||
localctx = NewTypeSpecContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 18, ApiParserParserRULE_typeSpec)
|
||||
@@ -371,7 +347,6 @@ func (p *ApiParserParser) TypeSpec() (localctx ITypeSpecContext) {
|
||||
p.TypeLit()
|
||||
}
|
||||
|
||||
|
||||
case 2:
|
||||
p.EnterOuterAlt(localctx, 2)
|
||||
{
|
||||
@@ -381,11 +356,9 @@ func (p *ApiParserParser) TypeSpec() (localctx ITypeSpecContext) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// ITypeLitContext is an interface to support dynamic dispatch.
|
||||
type ITypeLitContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -396,11 +369,9 @@ type ITypeLitContext interface {
|
||||
// GetTypeToken returns the typeToken token.
|
||||
GetTypeToken() antlr.Token
|
||||
|
||||
|
||||
// SetTypeToken sets the typeToken token.
|
||||
SetTypeToken(antlr.Token)
|
||||
|
||||
|
||||
// IsTypeLitContext differentiates from other interfaces.
|
||||
IsTypeLitContext()
|
||||
}
|
||||
@@ -412,7 +383,7 @@ type TypeLitContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyTypeLitContext() *TypeLitContext {
|
||||
var p = new(TypeLitContext)
|
||||
p := new(TypeLitContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_typeLit
|
||||
return p
|
||||
@@ -421,7 +392,7 @@ func NewEmptyTypeLitContext() *TypeLitContext {
|
||||
func (*TypeLitContext) IsTypeLitContext() {}
|
||||
|
||||
func NewTypeLitContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeLitContext {
|
||||
var p = new(TypeLitContext)
|
||||
p := new(TypeLitContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -435,12 +406,10 @@ func (s *TypeLitContext) GetParser() antlr.Parser { return s.parser }
|
||||
|
||||
func (s *TypeLitContext) GetTypeToken() antlr.Token { return s.typeToken }
|
||||
|
||||
|
||||
func (s *TypeLitContext) SetTypeToken(v antlr.Token) { s.typeToken = v }
|
||||
|
||||
|
||||
func (s *TypeLitContext) TypeLitBody() ITypeLitBodyContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*ITypeLitBodyContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeLitBodyContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -461,7 +430,6 @@ func (s *TypeLitContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *TypeLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -472,9 +440,6 @@ func (s *TypeLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) TypeLit() (localctx ITypeLitContext) {
|
||||
localctx = NewTypeLitContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 20, ApiParserParserRULE_typeLit)
|
||||
@@ -496,11 +461,11 @@ func (p *ApiParserParser) TypeLit() (localctx ITypeLitContext) {
|
||||
}()
|
||||
|
||||
p.EnterOuterAlt(localctx, 1)
|
||||
match(p,"type")
|
||||
match(p, "type")
|
||||
{
|
||||
p.SetState(131)
|
||||
|
||||
var _m = p.Match(ApiParserParserID)
|
||||
_m := p.Match(ApiParserParserID)
|
||||
|
||||
localctx.(*TypeLitContext).typeToken = _m
|
||||
}
|
||||
@@ -509,12 +474,9 @@ func (p *ApiParserParser) TypeLit() (localctx ITypeLitContext) {
|
||||
p.TypeLitBody()
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// ITypeBlockContext is an interface to support dynamic dispatch.
|
||||
type ITypeBlockContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -531,7 +493,6 @@ type ITypeBlockContext interface {
|
||||
// GetRp returns the rp token.
|
||||
GetRp() antlr.Token
|
||||
|
||||
|
||||
// SetTypeToken sets the typeToken token.
|
||||
SetTypeToken(antlr.Token)
|
||||
|
||||
@@ -541,7 +502,6 @@ type ITypeBlockContext interface {
|
||||
// SetRp sets the rp token.
|
||||
SetRp(antlr.Token)
|
||||
|
||||
|
||||
// IsTypeBlockContext differentiates from other interfaces.
|
||||
IsTypeBlockContext()
|
||||
}
|
||||
@@ -555,7 +515,7 @@ type TypeBlockContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyTypeBlockContext() *TypeBlockContext {
|
||||
var p = new(TypeBlockContext)
|
||||
p := new(TypeBlockContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_typeBlock
|
||||
return p
|
||||
@@ -564,7 +524,7 @@ func NewEmptyTypeBlockContext() *TypeBlockContext {
|
||||
func (*TypeBlockContext) IsTypeBlockContext() {}
|
||||
|
||||
func NewTypeBlockContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeBlockContext {
|
||||
var p = new(TypeBlockContext)
|
||||
p := new(TypeBlockContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -582,21 +542,19 @@ func (s *TypeBlockContext) GetLp() antlr.Token { return s.lp }
|
||||
|
||||
func (s *TypeBlockContext) GetRp() antlr.Token { return s.rp }
|
||||
|
||||
|
||||
func (s *TypeBlockContext) SetTypeToken(v antlr.Token) { s.typeToken = v }
|
||||
|
||||
func (s *TypeBlockContext) SetLp(v antlr.Token) { s.lp = v }
|
||||
|
||||
func (s *TypeBlockContext) SetRp(v antlr.Token) { s.rp = v }
|
||||
|
||||
|
||||
func (s *TypeBlockContext) ID() antlr.TerminalNode {
|
||||
return s.GetToken(ApiParserParserID, 0)
|
||||
}
|
||||
|
||||
func (s *TypeBlockContext) AllTypeBlockBody() []ITypeBlockBodyContext {
|
||||
var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ITypeBlockBodyContext)(nil)).Elem())
|
||||
var tst = make([]ITypeBlockBodyContext, len(ts))
|
||||
ts := s.GetTypedRuleContexts(reflect.TypeOf((*ITypeBlockBodyContext)(nil)).Elem())
|
||||
tst := make([]ITypeBlockBodyContext, len(ts))
|
||||
|
||||
for i, t := range ts {
|
||||
if t != nil {
|
||||
@@ -608,7 +566,7 @@ func (s *TypeBlockContext) AllTypeBlockBody() []ITypeBlockBodyContext {
|
||||
}
|
||||
|
||||
func (s *TypeBlockContext) TypeBlockBody(i int) ITypeBlockBodyContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*ITypeBlockBodyContext)(nil)).Elem(), i)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeBlockBodyContext)(nil)).Elem(), i)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -625,7 +583,6 @@ func (s *TypeBlockContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *TypeBlockContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -636,15 +593,11 @@ func (s *TypeBlockContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) TypeBlock() (localctx ITypeBlockContext) {
|
||||
localctx = NewTypeBlockContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 22, ApiParserParserRULE_typeBlock)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -662,18 +615,18 @@ func (p *ApiParserParser) TypeBlock() (localctx ITypeBlockContext) {
|
||||
}()
|
||||
|
||||
p.EnterOuterAlt(localctx, 1)
|
||||
match(p,"type")
|
||||
match(p, "type")
|
||||
{
|
||||
p.SetState(135)
|
||||
|
||||
var _m = p.Match(ApiParserParserID)
|
||||
_m := p.Match(ApiParserParserID)
|
||||
|
||||
localctx.(*TypeBlockContext).typeToken = _m
|
||||
}
|
||||
{
|
||||
p.SetState(136)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__1)
|
||||
_m := p.Match(ApiParserParserT__1)
|
||||
|
||||
localctx.(*TypeBlockContext).lp = _m
|
||||
}
|
||||
@@ -681,14 +634,12 @@ func (p *ApiParserParser) TypeBlock() (localctx ITypeBlockContext) {
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
for _la == ApiParserParserID {
|
||||
{
|
||||
p.SetState(137)
|
||||
p.TypeBlockBody()
|
||||
}
|
||||
|
||||
|
||||
p.SetState(142)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
@@ -696,12 +647,10 @@ func (p *ApiParserParser) TypeBlock() (localctx ITypeBlockContext) {
|
||||
{
|
||||
p.SetState(143)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__2)
|
||||
_m := p.Match(ApiParserParserT__2)
|
||||
|
||||
localctx.(*TypeBlockContext).rp = _m
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
// The apiparser_parser.go file was split into multiple files because it
|
||||
// was too large and caused a possible memory overflow during goctl installation.
|
||||
|
||||
|
||||
// ITypeLitBodyContext is an interface to support dynamic dispatch.
|
||||
type ITypeLitBodyContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -28,7 +27,7 @@ type TypeLitBodyContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyTypeLitBodyContext() *TypeLitBodyContext {
|
||||
var p = new(TypeLitBodyContext)
|
||||
p := new(TypeLitBodyContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_typeLitBody
|
||||
return p
|
||||
@@ -37,7 +36,7 @@ func NewEmptyTypeLitBodyContext() *TypeLitBodyContext {
|
||||
func (*TypeLitBodyContext) IsTypeLitBodyContext() {}
|
||||
|
||||
func NewTypeLitBodyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeLitBodyContext {
|
||||
var p = new(TypeLitBodyContext)
|
||||
p := new(TypeLitBodyContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -50,7 +49,7 @@ func NewTypeLitBodyContext(parser antlr.Parser, parent antlr.ParserRuleContext,
|
||||
func (s *TypeLitBodyContext) GetParser() antlr.Parser { return s.parser }
|
||||
|
||||
func (s *TypeLitBodyContext) TypeStruct() ITypeStructContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*ITypeStructContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeStructContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -60,7 +59,7 @@ func (s *TypeLitBodyContext) TypeStruct() ITypeStructContext {
|
||||
}
|
||||
|
||||
func (s *TypeLitBodyContext) TypeAlias() ITypeAliasContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*ITypeAliasContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeAliasContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -77,7 +76,6 @@ func (s *TypeLitBodyContext) ToStringTree(ruleNames []string, recog antlr.Recogn
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *TypeLitBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -88,9 +86,6 @@ func (s *TypeLitBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) TypeLitBody() (localctx ITypeLitBodyContext) {
|
||||
localctx = NewTypeLitBodyContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 24, ApiParserParserRULE_typeLitBody)
|
||||
@@ -121,7 +116,6 @@ func (p *ApiParserParser) TypeLitBody() (localctx ITypeLitBodyContext) {
|
||||
p.TypeStruct()
|
||||
}
|
||||
|
||||
|
||||
case 2:
|
||||
p.EnterOuterAlt(localctx, 2)
|
||||
{
|
||||
@@ -131,11 +125,9 @@ func (p *ApiParserParser) TypeLitBody() (localctx ITypeLitBodyContext) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// ITypeBlockBodyContext is an interface to support dynamic dispatch.
|
||||
type ITypeBlockBodyContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -153,7 +145,7 @@ type TypeBlockBodyContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyTypeBlockBodyContext() *TypeBlockBodyContext {
|
||||
var p = new(TypeBlockBodyContext)
|
||||
p := new(TypeBlockBodyContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_typeBlockBody
|
||||
return p
|
||||
@@ -162,7 +154,7 @@ func NewEmptyTypeBlockBodyContext() *TypeBlockBodyContext {
|
||||
func (*TypeBlockBodyContext) IsTypeBlockBodyContext() {}
|
||||
|
||||
func NewTypeBlockBodyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeBlockBodyContext {
|
||||
var p = new(TypeBlockBodyContext)
|
||||
p := new(TypeBlockBodyContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -175,7 +167,7 @@ func NewTypeBlockBodyContext(parser antlr.Parser, parent antlr.ParserRuleContext
|
||||
func (s *TypeBlockBodyContext) GetParser() antlr.Parser { return s.parser }
|
||||
|
||||
func (s *TypeBlockBodyContext) TypeBlockStruct() ITypeBlockStructContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*ITypeBlockStructContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeBlockStructContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -185,7 +177,7 @@ func (s *TypeBlockBodyContext) TypeBlockStruct() ITypeBlockStructContext {
|
||||
}
|
||||
|
||||
func (s *TypeBlockBodyContext) TypeBlockAlias() ITypeBlockAliasContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*ITypeBlockAliasContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeBlockAliasContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -202,7 +194,6 @@ func (s *TypeBlockBodyContext) ToStringTree(ruleNames []string, recog antlr.Reco
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *TypeBlockBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -213,9 +204,6 @@ func (s *TypeBlockBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) TypeBlockBody() (localctx ITypeBlockBodyContext) {
|
||||
localctx = NewTypeBlockBodyContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 26, ApiParserParserRULE_typeBlockBody)
|
||||
@@ -246,7 +234,6 @@ func (p *ApiParserParser) TypeBlockBody() (localctx ITypeBlockBodyContext) {
|
||||
p.TypeBlockStruct()
|
||||
}
|
||||
|
||||
|
||||
case 2:
|
||||
p.EnterOuterAlt(localctx, 2)
|
||||
{
|
||||
@@ -256,11 +243,9 @@ func (p *ApiParserParser) TypeBlockBody() (localctx ITypeBlockBodyContext) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// ITypeStructContext is an interface to support dynamic dispatch.
|
||||
type ITypeStructContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -280,7 +265,6 @@ type ITypeStructContext interface {
|
||||
// GetRbrace returns the rbrace token.
|
||||
GetRbrace() antlr.Token
|
||||
|
||||
|
||||
// SetStructName sets the structName token.
|
||||
SetStructName(antlr.Token)
|
||||
|
||||
@@ -293,7 +277,6 @@ type ITypeStructContext interface {
|
||||
// SetRbrace sets the rbrace token.
|
||||
SetRbrace(antlr.Token)
|
||||
|
||||
|
||||
// IsTypeStructContext differentiates from other interfaces.
|
||||
IsTypeStructContext()
|
||||
}
|
||||
@@ -308,7 +291,7 @@ type TypeStructContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyTypeStructContext() *TypeStructContext {
|
||||
var p = new(TypeStructContext)
|
||||
p := new(TypeStructContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_typeStruct
|
||||
return p
|
||||
@@ -317,7 +300,7 @@ func NewEmptyTypeStructContext() *TypeStructContext {
|
||||
func (*TypeStructContext) IsTypeStructContext() {}
|
||||
|
||||
func NewTypeStructContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeStructContext {
|
||||
var p = new(TypeStructContext)
|
||||
p := new(TypeStructContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -337,7 +320,6 @@ func (s *TypeStructContext) GetLbrace() antlr.Token { return s.lbrace }
|
||||
|
||||
func (s *TypeStructContext) GetRbrace() antlr.Token { return s.rbrace }
|
||||
|
||||
|
||||
func (s *TypeStructContext) SetStructName(v antlr.Token) { s.structName = v }
|
||||
|
||||
func (s *TypeStructContext) SetStructToken(v antlr.Token) { s.structToken = v }
|
||||
@@ -346,7 +328,6 @@ func (s *TypeStructContext) SetLbrace(v antlr.Token) { s.lbrace = v }
|
||||
|
||||
func (s *TypeStructContext) SetRbrace(v antlr.Token) { s.rbrace = v }
|
||||
|
||||
|
||||
func (s *TypeStructContext) AllID() []antlr.TerminalNode {
|
||||
return s.GetTokens(ApiParserParserID)
|
||||
}
|
||||
@@ -356,8 +337,8 @@ func (s *TypeStructContext) ID(i int) antlr.TerminalNode {
|
||||
}
|
||||
|
||||
func (s *TypeStructContext) AllField() []IFieldContext {
|
||||
var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IFieldContext)(nil)).Elem())
|
||||
var tst = make([]IFieldContext, len(ts))
|
||||
ts := s.GetTypedRuleContexts(reflect.TypeOf((*IFieldContext)(nil)).Elem())
|
||||
tst := make([]IFieldContext, len(ts))
|
||||
|
||||
for i, t := range ts {
|
||||
if t != nil {
|
||||
@@ -369,7 +350,7 @@ func (s *TypeStructContext) AllField() []IFieldContext {
|
||||
}
|
||||
|
||||
func (s *TypeStructContext) Field(i int) IFieldContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IFieldContext)(nil)).Elem(), i)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IFieldContext)(nil)).Elem(), i)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -386,7 +367,6 @@ func (s *TypeStructContext) ToStringTree(ruleNames []string, recog antlr.Recogni
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *TypeStructContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -397,15 +377,11 @@ func (s *TypeStructContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) TypeStruct() (localctx ITypeStructContext) {
|
||||
localctx = NewTypeStructContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 28, ApiParserParserRULE_typeStruct)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -429,7 +405,7 @@ func (p *ApiParserParser) TypeStruct() (localctx ITypeStructContext) {
|
||||
{
|
||||
p.SetState(154)
|
||||
|
||||
var _m = p.Match(ApiParserParserID)
|
||||
_m := p.Match(ApiParserParserID)
|
||||
|
||||
localctx.(*TypeStructContext).structName = _m
|
||||
}
|
||||
@@ -437,21 +413,19 @@ func (p *ApiParserParser) TypeStruct() (localctx ITypeStructContext) {
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
if _la == ApiParserParserID {
|
||||
{
|
||||
p.SetState(155)
|
||||
|
||||
var _m = p.Match(ApiParserParserID)
|
||||
_m := p.Match(ApiParserParserID)
|
||||
|
||||
localctx.(*TypeStructContext).structToken = _m
|
||||
}
|
||||
|
||||
}
|
||||
{
|
||||
p.SetState(158)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__3)
|
||||
_m := p.Match(ApiParserParserT__3)
|
||||
|
||||
localctx.(*TypeStructContext).lbrace = _m
|
||||
}
|
||||
@@ -465,8 +439,6 @@ func (p *ApiParserParser) TypeStruct() (localctx ITypeStructContext) {
|
||||
p.SetState(159)
|
||||
p.Field()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
p.SetState(164)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
@@ -475,17 +447,14 @@ func (p *ApiParserParser) TypeStruct() (localctx ITypeStructContext) {
|
||||
{
|
||||
p.SetState(165)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__4)
|
||||
_m := p.Match(ApiParserParserT__4)
|
||||
|
||||
localctx.(*TypeStructContext).rbrace = _m
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// ITypeAliasContext is an interface to support dynamic dispatch.
|
||||
type ITypeAliasContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -499,14 +468,12 @@ type ITypeAliasContext interface {
|
||||
// GetAssign returns the assign token.
|
||||
GetAssign() antlr.Token
|
||||
|
||||
|
||||
// SetAlias sets the alias token.
|
||||
SetAlias(antlr.Token)
|
||||
|
||||
// SetAssign sets the assign token.
|
||||
SetAssign(antlr.Token)
|
||||
|
||||
|
||||
// IsTypeAliasContext differentiates from other interfaces.
|
||||
IsTypeAliasContext()
|
||||
}
|
||||
@@ -519,7 +486,7 @@ type TypeAliasContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyTypeAliasContext() *TypeAliasContext {
|
||||
var p = new(TypeAliasContext)
|
||||
p := new(TypeAliasContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_typeAlias
|
||||
return p
|
||||
@@ -528,7 +495,7 @@ func NewEmptyTypeAliasContext() *TypeAliasContext {
|
||||
func (*TypeAliasContext) IsTypeAliasContext() {}
|
||||
|
||||
func NewTypeAliasContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeAliasContext {
|
||||
var p = new(TypeAliasContext)
|
||||
p := new(TypeAliasContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -544,14 +511,12 @@ func (s *TypeAliasContext) GetAlias() antlr.Token { return s.alias }
|
||||
|
||||
func (s *TypeAliasContext) GetAssign() antlr.Token { return s.assign }
|
||||
|
||||
|
||||
func (s *TypeAliasContext) SetAlias(v antlr.Token) { s.alias = v }
|
||||
|
||||
func (s *TypeAliasContext) SetAssign(v antlr.Token) { s.assign = v }
|
||||
|
||||
|
||||
func (s *TypeAliasContext) DataType() IDataTypeContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -572,7 +537,6 @@ func (s *TypeAliasContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *TypeAliasContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -583,15 +547,11 @@ func (s *TypeAliasContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) TypeAlias() (localctx ITypeAliasContext) {
|
||||
localctx = NewTypeAliasContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 30, ApiParserParserRULE_typeAlias)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -613,7 +573,7 @@ func (p *ApiParserParser) TypeAlias() (localctx ITypeAliasContext) {
|
||||
{
|
||||
p.SetState(168)
|
||||
|
||||
var _m = p.Match(ApiParserParserID)
|
||||
_m := p.Match(ApiParserParserID)
|
||||
|
||||
localctx.(*TypeAliasContext).alias = _m
|
||||
}
|
||||
@@ -621,28 +581,23 @@ func (p *ApiParserParser) TypeAlias() (localctx ITypeAliasContext) {
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
if _la == ApiParserParserT__0 {
|
||||
{
|
||||
p.SetState(169)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__0)
|
||||
_m := p.Match(ApiParserParserT__0)
|
||||
|
||||
localctx.(*TypeAliasContext).assign = _m
|
||||
}
|
||||
|
||||
}
|
||||
{
|
||||
p.SetState(172)
|
||||
p.DataType()
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// ITypeBlockStructContext is an interface to support dynamic dispatch.
|
||||
type ITypeBlockStructContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -662,7 +617,6 @@ type ITypeBlockStructContext interface {
|
||||
// GetRbrace returns the rbrace token.
|
||||
GetRbrace() antlr.Token
|
||||
|
||||
|
||||
// SetStructName sets the structName token.
|
||||
SetStructName(antlr.Token)
|
||||
|
||||
@@ -675,7 +629,6 @@ type ITypeBlockStructContext interface {
|
||||
// SetRbrace sets the rbrace token.
|
||||
SetRbrace(antlr.Token)
|
||||
|
||||
|
||||
// IsTypeBlockStructContext differentiates from other interfaces.
|
||||
IsTypeBlockStructContext()
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ type TypeBlockStructContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyTypeBlockStructContext() *TypeBlockStructContext {
|
||||
var p = new(TypeBlockStructContext)
|
||||
p := new(TypeBlockStructContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_typeBlockStruct
|
||||
return p
|
||||
@@ -29,7 +29,7 @@ func NewEmptyTypeBlockStructContext() *TypeBlockStructContext {
|
||||
func (*TypeBlockStructContext) IsTypeBlockStructContext() {}
|
||||
|
||||
func NewTypeBlockStructContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeBlockStructContext {
|
||||
var p = new(TypeBlockStructContext)
|
||||
p := new(TypeBlockStructContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -49,7 +49,6 @@ func (s *TypeBlockStructContext) GetLbrace() antlr.Token { return s.lbrace }
|
||||
|
||||
func (s *TypeBlockStructContext) GetRbrace() antlr.Token { return s.rbrace }
|
||||
|
||||
|
||||
func (s *TypeBlockStructContext) SetStructName(v antlr.Token) { s.structName = v }
|
||||
|
||||
func (s *TypeBlockStructContext) SetStructToken(v antlr.Token) { s.structToken = v }
|
||||
@@ -58,7 +57,6 @@ func (s *TypeBlockStructContext) SetLbrace(v antlr.Token) { s.lbrace = v }
|
||||
|
||||
func (s *TypeBlockStructContext) SetRbrace(v antlr.Token) { s.rbrace = v }
|
||||
|
||||
|
||||
func (s *TypeBlockStructContext) AllID() []antlr.TerminalNode {
|
||||
return s.GetTokens(ApiParserParserID)
|
||||
}
|
||||
@@ -68,8 +66,8 @@ func (s *TypeBlockStructContext) ID(i int) antlr.TerminalNode {
|
||||
}
|
||||
|
||||
func (s *TypeBlockStructContext) AllField() []IFieldContext {
|
||||
var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IFieldContext)(nil)).Elem())
|
||||
var tst = make([]IFieldContext, len(ts))
|
||||
ts := s.GetTypedRuleContexts(reflect.TypeOf((*IFieldContext)(nil)).Elem())
|
||||
tst := make([]IFieldContext, len(ts))
|
||||
|
||||
for i, t := range ts {
|
||||
if t != nil {
|
||||
@@ -81,7 +79,7 @@ func (s *TypeBlockStructContext) AllField() []IFieldContext {
|
||||
}
|
||||
|
||||
func (s *TypeBlockStructContext) Field(i int) IFieldContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IFieldContext)(nil)).Elem(), i)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IFieldContext)(nil)).Elem(), i)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -98,7 +96,6 @@ func (s *TypeBlockStructContext) ToStringTree(ruleNames []string, recog antlr.Re
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *TypeBlockStructContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -109,15 +106,11 @@ func (s *TypeBlockStructContext) Accept(visitor antlr.ParseTreeVisitor) interfac
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) TypeBlockStruct() (localctx ITypeBlockStructContext) {
|
||||
localctx = NewTypeBlockStructContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 32, ApiParserParserRULE_typeBlockStruct)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -141,7 +134,7 @@ func (p *ApiParserParser) TypeBlockStruct() (localctx ITypeBlockStructContext) {
|
||||
{
|
||||
p.SetState(175)
|
||||
|
||||
var _m = p.Match(ApiParserParserID)
|
||||
_m := p.Match(ApiParserParserID)
|
||||
|
||||
localctx.(*TypeBlockStructContext).structName = _m
|
||||
}
|
||||
@@ -149,21 +142,19 @@ func (p *ApiParserParser) TypeBlockStruct() (localctx ITypeBlockStructContext) {
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
if _la == ApiParserParserID {
|
||||
{
|
||||
p.SetState(176)
|
||||
|
||||
var _m = p.Match(ApiParserParserID)
|
||||
_m := p.Match(ApiParserParserID)
|
||||
|
||||
localctx.(*TypeBlockStructContext).structToken = _m
|
||||
}
|
||||
|
||||
}
|
||||
{
|
||||
p.SetState(179)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__3)
|
||||
_m := p.Match(ApiParserParserT__3)
|
||||
|
||||
localctx.(*TypeBlockStructContext).lbrace = _m
|
||||
}
|
||||
@@ -177,8 +168,6 @@ func (p *ApiParserParser) TypeBlockStruct() (localctx ITypeBlockStructContext) {
|
||||
p.SetState(180)
|
||||
p.Field()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
p.SetState(185)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
@@ -187,17 +176,14 @@ func (p *ApiParserParser) TypeBlockStruct() (localctx ITypeBlockStructContext) {
|
||||
{
|
||||
p.SetState(186)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__4)
|
||||
_m := p.Match(ApiParserParserT__4)
|
||||
|
||||
localctx.(*TypeBlockStructContext).rbrace = _m
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// ITypeBlockAliasContext is an interface to support dynamic dispatch.
|
||||
type ITypeBlockAliasContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -211,14 +197,12 @@ type ITypeBlockAliasContext interface {
|
||||
// GetAssign returns the assign token.
|
||||
GetAssign() antlr.Token
|
||||
|
||||
|
||||
// SetAlias sets the alias token.
|
||||
SetAlias(antlr.Token)
|
||||
|
||||
// SetAssign sets the assign token.
|
||||
SetAssign(antlr.Token)
|
||||
|
||||
|
||||
// IsTypeBlockAliasContext differentiates from other interfaces.
|
||||
IsTypeBlockAliasContext()
|
||||
}
|
||||
@@ -231,7 +215,7 @@ type TypeBlockAliasContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyTypeBlockAliasContext() *TypeBlockAliasContext {
|
||||
var p = new(TypeBlockAliasContext)
|
||||
p := new(TypeBlockAliasContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_typeBlockAlias
|
||||
return p
|
||||
@@ -240,7 +224,7 @@ func NewEmptyTypeBlockAliasContext() *TypeBlockAliasContext {
|
||||
func (*TypeBlockAliasContext) IsTypeBlockAliasContext() {}
|
||||
|
||||
func NewTypeBlockAliasContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeBlockAliasContext {
|
||||
var p = new(TypeBlockAliasContext)
|
||||
p := new(TypeBlockAliasContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -256,14 +240,12 @@ func (s *TypeBlockAliasContext) GetAlias() antlr.Token { return s.alias }
|
||||
|
||||
func (s *TypeBlockAliasContext) GetAssign() antlr.Token { return s.assign }
|
||||
|
||||
|
||||
func (s *TypeBlockAliasContext) SetAlias(v antlr.Token) { s.alias = v }
|
||||
|
||||
func (s *TypeBlockAliasContext) SetAssign(v antlr.Token) { s.assign = v }
|
||||
|
||||
|
||||
func (s *TypeBlockAliasContext) DataType() IDataTypeContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -284,7 +266,6 @@ func (s *TypeBlockAliasContext) ToStringTree(ruleNames []string, recog antlr.Rec
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *TypeBlockAliasContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -295,15 +276,11 @@ func (s *TypeBlockAliasContext) Accept(visitor antlr.ParseTreeVisitor) interface
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) TypeBlockAlias() (localctx ITypeBlockAliasContext) {
|
||||
localctx = NewTypeBlockAliasContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 34, ApiParserParserRULE_typeBlockAlias)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -325,7 +302,7 @@ func (p *ApiParserParser) TypeBlockAlias() (localctx ITypeBlockAliasContext) {
|
||||
{
|
||||
p.SetState(189)
|
||||
|
||||
var _m = p.Match(ApiParserParserID)
|
||||
_m := p.Match(ApiParserParserID)
|
||||
|
||||
localctx.(*TypeBlockAliasContext).alias = _m
|
||||
}
|
||||
@@ -333,28 +310,23 @@ func (p *ApiParserParser) TypeBlockAlias() (localctx ITypeBlockAliasContext) {
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
if _la == ApiParserParserT__0 {
|
||||
{
|
||||
p.SetState(190)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__0)
|
||||
_m := p.Match(ApiParserParserT__0)
|
||||
|
||||
localctx.(*TypeBlockAliasContext).assign = _m
|
||||
}
|
||||
|
||||
}
|
||||
{
|
||||
p.SetState(193)
|
||||
p.DataType()
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IFieldContext is an interface to support dynamic dispatch.
|
||||
type IFieldContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -372,7 +344,7 @@ type FieldContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyFieldContext() *FieldContext {
|
||||
var p = new(FieldContext)
|
||||
p := new(FieldContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_field
|
||||
return p
|
||||
@@ -381,7 +353,7 @@ func NewEmptyFieldContext() *FieldContext {
|
||||
func (*FieldContext) IsFieldContext() {}
|
||||
|
||||
func NewFieldContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FieldContext {
|
||||
var p = new(FieldContext)
|
||||
p := new(FieldContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -394,7 +366,7 @@ func NewFieldContext(parser antlr.Parser, parent antlr.ParserRuleContext, invoki
|
||||
func (s *FieldContext) GetParser() antlr.Parser { return s.parser }
|
||||
|
||||
func (s *FieldContext) NormalField() INormalFieldContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*INormalFieldContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*INormalFieldContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -404,7 +376,7 @@ func (s *FieldContext) NormalField() INormalFieldContext {
|
||||
}
|
||||
|
||||
func (s *FieldContext) AnonymousFiled() IAnonymousFiledContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IAnonymousFiledContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IAnonymousFiledContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -421,7 +393,6 @@ func (s *FieldContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *FieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -432,9 +403,6 @@ func (s *FieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) Field() (localctx IFieldContext) {
|
||||
localctx = NewFieldContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 36, ApiParserParserRULE_field)
|
||||
@@ -470,7 +438,6 @@ func (p *ApiParserParser) Field() (localctx IFieldContext) {
|
||||
p.NormalField()
|
||||
}
|
||||
|
||||
|
||||
case 2:
|
||||
p.EnterOuterAlt(localctx, 2)
|
||||
{
|
||||
@@ -480,11 +447,9 @@ func (p *ApiParserParser) Field() (localctx IFieldContext) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// INormalFieldContext is an interface to support dynamic dispatch.
|
||||
type INormalFieldContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -498,14 +463,12 @@ type INormalFieldContext interface {
|
||||
// GetTag returns the tag token.
|
||||
GetTag() antlr.Token
|
||||
|
||||
|
||||
// SetFieldName sets the fieldName token.
|
||||
SetFieldName(antlr.Token)
|
||||
|
||||
// SetTag sets the tag token.
|
||||
SetTag(antlr.Token)
|
||||
|
||||
|
||||
// IsNormalFieldContext differentiates from other interfaces.
|
||||
IsNormalFieldContext()
|
||||
}
|
||||
@@ -518,7 +481,7 @@ type NormalFieldContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyNormalFieldContext() *NormalFieldContext {
|
||||
var p = new(NormalFieldContext)
|
||||
p := new(NormalFieldContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_normalField
|
||||
return p
|
||||
@@ -527,7 +490,7 @@ func NewEmptyNormalFieldContext() *NormalFieldContext {
|
||||
func (*NormalFieldContext) IsNormalFieldContext() {}
|
||||
|
||||
func NewNormalFieldContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *NormalFieldContext {
|
||||
var p = new(NormalFieldContext)
|
||||
p := new(NormalFieldContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -543,14 +506,12 @@ func (s *NormalFieldContext) GetFieldName() antlr.Token { return s.fieldName }
|
||||
|
||||
func (s *NormalFieldContext) GetTag() antlr.Token { return s.tag }
|
||||
|
||||
|
||||
func (s *NormalFieldContext) SetFieldName(v antlr.Token) { s.fieldName = v }
|
||||
|
||||
func (s *NormalFieldContext) SetTag(v antlr.Token) { s.tag = v }
|
||||
|
||||
|
||||
func (s *NormalFieldContext) DataType() IDataTypeContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -575,7 +536,6 @@ func (s *NormalFieldContext) ToStringTree(ruleNames []string, recog antlr.Recogn
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *NormalFieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -586,9 +546,6 @@ func (s *NormalFieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) NormalField() (localctx INormalFieldContext) {
|
||||
localctx = NewNormalFieldContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 38, ApiParserParserRULE_normalField)
|
||||
@@ -614,7 +571,7 @@ func (p *ApiParserParser) NormalField() (localctx INormalFieldContext) {
|
||||
{
|
||||
p.SetState(201)
|
||||
|
||||
var _m = p.Match(ApiParserParserID)
|
||||
_m := p.Match(ApiParserParserID)
|
||||
|
||||
localctx.(*NormalFieldContext).fieldName = _m
|
||||
}
|
||||
@@ -625,25 +582,19 @@ func (p *ApiParserParser) NormalField() (localctx INormalFieldContext) {
|
||||
p.SetState(204)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
|
||||
|
||||
if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 16, p.GetParserRuleContext()) == 1 {
|
||||
{
|
||||
p.SetState(203)
|
||||
|
||||
var _m = p.Match(ApiParserParserRAW_STRING)
|
||||
_m := p.Match(ApiParserParserRAW_STRING)
|
||||
|
||||
localctx.(*NormalFieldContext).tag = _m
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IAnonymousFiledContext is an interface to support dynamic dispatch.
|
||||
type IAnonymousFiledContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -654,11 +605,9 @@ type IAnonymousFiledContext interface {
|
||||
// GetStar returns the star token.
|
||||
GetStar() antlr.Token
|
||||
|
||||
|
||||
// SetStar sets the star token.
|
||||
SetStar(antlr.Token)
|
||||
|
||||
|
||||
// IsAnonymousFiledContext differentiates from other interfaces.
|
||||
IsAnonymousFiledContext()
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ type AnonymousFiledContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyAnonymousFiledContext() *AnonymousFiledContext {
|
||||
var p = new(AnonymousFiledContext)
|
||||
p := new(AnonymousFiledContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_anonymousFiled
|
||||
return p
|
||||
@@ -26,7 +26,7 @@ func NewEmptyAnonymousFiledContext() *AnonymousFiledContext {
|
||||
func (*AnonymousFiledContext) IsAnonymousFiledContext() {}
|
||||
|
||||
func NewAnonymousFiledContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AnonymousFiledContext {
|
||||
var p = new(AnonymousFiledContext)
|
||||
p := new(AnonymousFiledContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -40,10 +40,8 @@ func (s *AnonymousFiledContext) GetParser() antlr.Parser { return s.parser }
|
||||
|
||||
func (s *AnonymousFiledContext) GetStar() antlr.Token { return s.star }
|
||||
|
||||
|
||||
func (s *AnonymousFiledContext) SetStar(v antlr.Token) { s.star = v }
|
||||
|
||||
|
||||
func (s *AnonymousFiledContext) ID() antlr.TerminalNode {
|
||||
return s.GetToken(ApiParserParserID, 0)
|
||||
}
|
||||
@@ -56,7 +54,6 @@ func (s *AnonymousFiledContext) ToStringTree(ruleNames []string, recog antlr.Rec
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *AnonymousFiledContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -67,15 +64,11 @@ func (s *AnonymousFiledContext) Accept(visitor antlr.ParseTreeVisitor) interface
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) AnonymousFiled() (localctx IAnonymousFiledContext) {
|
||||
localctx = NewAnonymousFiledContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 40, ApiParserParserRULE_anonymousFiled)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -97,28 +90,23 @@ func (p *ApiParserParser) AnonymousFiled() (localctx IAnonymousFiledContext) {
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
if _la == ApiParserParserT__5 {
|
||||
{
|
||||
p.SetState(206)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__5)
|
||||
_m := p.Match(ApiParserParserT__5)
|
||||
|
||||
localctx.(*AnonymousFiledContext).star = _m
|
||||
}
|
||||
|
||||
}
|
||||
{
|
||||
p.SetState(209)
|
||||
p.Match(ApiParserParserID)
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IDataTypeContext is an interface to support dynamic dispatch.
|
||||
type IDataTypeContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -132,14 +120,12 @@ type IDataTypeContext interface {
|
||||
// GetTime returns the time token.
|
||||
GetTime() antlr.Token
|
||||
|
||||
|
||||
// SetInter sets the inter token.
|
||||
SetInter(antlr.Token)
|
||||
|
||||
// SetTime sets the time token.
|
||||
SetTime(antlr.Token)
|
||||
|
||||
|
||||
// IsDataTypeContext differentiates from other interfaces.
|
||||
IsDataTypeContext()
|
||||
}
|
||||
@@ -152,7 +138,7 @@ type DataTypeContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyDataTypeContext() *DataTypeContext {
|
||||
var p = new(DataTypeContext)
|
||||
p := new(DataTypeContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_dataType
|
||||
return p
|
||||
@@ -161,7 +147,7 @@ func NewEmptyDataTypeContext() *DataTypeContext {
|
||||
func (*DataTypeContext) IsDataTypeContext() {}
|
||||
|
||||
func NewDataTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DataTypeContext {
|
||||
var p = new(DataTypeContext)
|
||||
p := new(DataTypeContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -177,18 +163,16 @@ func (s *DataTypeContext) GetInter() antlr.Token { return s.inter }
|
||||
|
||||
func (s *DataTypeContext) GetTime() antlr.Token { return s.time }
|
||||
|
||||
|
||||
func (s *DataTypeContext) SetInter(v antlr.Token) { s.inter = v }
|
||||
|
||||
func (s *DataTypeContext) SetTime(v antlr.Token) { s.time = v }
|
||||
|
||||
|
||||
func (s *DataTypeContext) ID() antlr.TerminalNode {
|
||||
return s.GetToken(ApiParserParserID, 0)
|
||||
}
|
||||
|
||||
func (s *DataTypeContext) MapType() IMapTypeContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IMapTypeContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IMapTypeContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -198,7 +182,7 @@ func (s *DataTypeContext) MapType() IMapTypeContext {
|
||||
}
|
||||
|
||||
func (s *DataTypeContext) ArrayType() IArrayTypeContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IArrayTypeContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IArrayTypeContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -212,7 +196,7 @@ func (s *DataTypeContext) INTERFACE() antlr.TerminalNode {
|
||||
}
|
||||
|
||||
func (s *DataTypeContext) PointerType() IPointerTypeContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IPointerTypeContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IPointerTypeContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -222,7 +206,7 @@ func (s *DataTypeContext) PointerType() IPointerTypeContext {
|
||||
}
|
||||
|
||||
func (s *DataTypeContext) TypeStruct() ITypeStructContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*ITypeStructContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*ITypeStructContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -239,7 +223,6 @@ func (s *DataTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognize
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *DataTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -250,9 +233,6 @@ func (s *DataTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) DataType() (localctx IDataTypeContext) {
|
||||
localctx = NewDataTypeContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 42, ApiParserParserRULE_dataType)
|
||||
@@ -284,7 +264,6 @@ func (p *ApiParserParser) DataType() (localctx IDataTypeContext) {
|
||||
p.Match(ApiParserParserID)
|
||||
}
|
||||
|
||||
|
||||
case 2:
|
||||
p.EnterOuterAlt(localctx, 2)
|
||||
{
|
||||
@@ -292,7 +271,6 @@ func (p *ApiParserParser) DataType() (localctx IDataTypeContext) {
|
||||
p.MapType()
|
||||
}
|
||||
|
||||
|
||||
case 3:
|
||||
p.EnterOuterAlt(localctx, 3)
|
||||
{
|
||||
@@ -300,29 +278,26 @@ func (p *ApiParserParser) DataType() (localctx IDataTypeContext) {
|
||||
p.ArrayType()
|
||||
}
|
||||
|
||||
|
||||
case 4:
|
||||
p.EnterOuterAlt(localctx, 4)
|
||||
{
|
||||
p.SetState(215)
|
||||
|
||||
var _m = p.Match(ApiParserParserINTERFACE)
|
||||
_m := p.Match(ApiParserParserINTERFACE)
|
||||
|
||||
localctx.(*DataTypeContext).inter = _m
|
||||
}
|
||||
|
||||
|
||||
case 5:
|
||||
p.EnterOuterAlt(localctx, 5)
|
||||
{
|
||||
p.SetState(216)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__6)
|
||||
_m := p.Match(ApiParserParserT__6)
|
||||
|
||||
localctx.(*DataTypeContext).time = _m
|
||||
}
|
||||
|
||||
|
||||
case 6:
|
||||
p.EnterOuterAlt(localctx, 6)
|
||||
{
|
||||
@@ -330,7 +305,6 @@ func (p *ApiParserParser) DataType() (localctx IDataTypeContext) {
|
||||
p.PointerType()
|
||||
}
|
||||
|
||||
|
||||
case 7:
|
||||
p.EnterOuterAlt(localctx, 7)
|
||||
{
|
||||
@@ -340,11 +314,9 @@ func (p *ApiParserParser) DataType() (localctx IDataTypeContext) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IPointerTypeContext is an interface to support dynamic dispatch.
|
||||
type IPointerTypeContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -355,11 +327,9 @@ type IPointerTypeContext interface {
|
||||
// GetStar returns the star token.
|
||||
GetStar() antlr.Token
|
||||
|
||||
|
||||
// SetStar sets the star token.
|
||||
SetStar(antlr.Token)
|
||||
|
||||
|
||||
// IsPointerTypeContext differentiates from other interfaces.
|
||||
IsPointerTypeContext()
|
||||
}
|
||||
@@ -371,7 +341,7 @@ type PointerTypeContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyPointerTypeContext() *PointerTypeContext {
|
||||
var p = new(PointerTypeContext)
|
||||
p := new(PointerTypeContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_pointerType
|
||||
return p
|
||||
@@ -380,7 +350,7 @@ func NewEmptyPointerTypeContext() *PointerTypeContext {
|
||||
func (*PointerTypeContext) IsPointerTypeContext() {}
|
||||
|
||||
func NewPointerTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PointerTypeContext {
|
||||
var p = new(PointerTypeContext)
|
||||
p := new(PointerTypeContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -394,10 +364,8 @@ func (s *PointerTypeContext) GetParser() antlr.Parser { return s.parser }
|
||||
|
||||
func (s *PointerTypeContext) GetStar() antlr.Token { return s.star }
|
||||
|
||||
|
||||
func (s *PointerTypeContext) SetStar(v antlr.Token) { s.star = v }
|
||||
|
||||
|
||||
func (s *PointerTypeContext) ID() antlr.TerminalNode {
|
||||
return s.GetToken(ApiParserParserID, 0)
|
||||
}
|
||||
@@ -410,7 +378,6 @@ func (s *PointerTypeContext) ToStringTree(ruleNames []string, recog antlr.Recogn
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *PointerTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -421,9 +388,6 @@ func (s *PointerTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) PointerType() (localctx IPointerTypeContext) {
|
||||
localctx = NewPointerTypeContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 44, ApiParserParserRULE_pointerType)
|
||||
@@ -448,7 +412,7 @@ func (p *ApiParserParser) PointerType() (localctx IPointerTypeContext) {
|
||||
{
|
||||
p.SetState(221)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__5)
|
||||
_m := p.Match(ApiParserParserT__5)
|
||||
|
||||
localctx.(*PointerTypeContext).star = _m
|
||||
}
|
||||
@@ -458,12 +422,9 @@ func (p *ApiParserParser) PointerType() (localctx IPointerTypeContext) {
|
||||
p.Match(ApiParserParserID)
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IMapTypeContext is an interface to support dynamic dispatch.
|
||||
type IMapTypeContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -483,7 +444,6 @@ type IMapTypeContext interface {
|
||||
// GetRbrack returns the rbrack token.
|
||||
GetRbrack() antlr.Token
|
||||
|
||||
|
||||
// SetMapToken sets the mapToken token.
|
||||
SetMapToken(antlr.Token)
|
||||
|
||||
@@ -496,15 +456,12 @@ type IMapTypeContext interface {
|
||||
// SetRbrack sets the rbrack token.
|
||||
SetRbrack(antlr.Token)
|
||||
|
||||
|
||||
// GetValue returns the value rule contexts.
|
||||
GetValue() IDataTypeContext
|
||||
|
||||
|
||||
// SetValue sets the value rule contexts.
|
||||
SetValue(IDataTypeContext)
|
||||
|
||||
|
||||
// IsMapTypeContext differentiates from other interfaces.
|
||||
IsMapTypeContext()
|
||||
}
|
||||
@@ -520,7 +477,7 @@ type MapTypeContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyMapTypeContext() *MapTypeContext {
|
||||
var p = new(MapTypeContext)
|
||||
p := new(MapTypeContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_mapType
|
||||
return p
|
||||
@@ -529,7 +486,7 @@ func NewEmptyMapTypeContext() *MapTypeContext {
|
||||
func (*MapTypeContext) IsMapTypeContext() {}
|
||||
|
||||
func NewMapTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MapTypeContext {
|
||||
var p = new(MapTypeContext)
|
||||
p := new(MapTypeContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -549,7 +506,6 @@ func (s *MapTypeContext) GetKey() antlr.Token { return s.key }
|
||||
|
||||
func (s *MapTypeContext) GetRbrack() antlr.Token { return s.rbrack }
|
||||
|
||||
|
||||
func (s *MapTypeContext) SetMapToken(v antlr.Token) { s.mapToken = v }
|
||||
|
||||
func (s *MapTypeContext) SetLbrack(v antlr.Token) { s.lbrack = v }
|
||||
@@ -558,13 +514,10 @@ func (s *MapTypeContext) SetKey(v antlr.Token) { s.key = v }
|
||||
|
||||
func (s *MapTypeContext) SetRbrack(v antlr.Token) { s.rbrack = v }
|
||||
|
||||
|
||||
func (s *MapTypeContext) GetValue() IDataTypeContext { return s.value }
|
||||
|
||||
|
||||
func (s *MapTypeContext) SetValue(v IDataTypeContext) { s.value = v }
|
||||
|
||||
|
||||
func (s *MapTypeContext) AllID() []antlr.TerminalNode {
|
||||
return s.GetTokens(ApiParserParserID)
|
||||
}
|
||||
@@ -574,7 +527,7 @@ func (s *MapTypeContext) ID(i int) antlr.TerminalNode {
|
||||
}
|
||||
|
||||
func (s *MapTypeContext) DataType() IDataTypeContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -591,7 +544,6 @@ func (s *MapTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *MapTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -602,9 +554,6 @@ func (s *MapTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) MapType() (localctx IMapTypeContext) {
|
||||
localctx = NewMapTypeContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 46, ApiParserParserRULE_mapType)
|
||||
@@ -626,18 +575,18 @@ func (p *ApiParserParser) MapType() (localctx IMapTypeContext) {
|
||||
}()
|
||||
|
||||
p.EnterOuterAlt(localctx, 1)
|
||||
match(p,"map")
|
||||
match(p, "map")
|
||||
{
|
||||
p.SetState(226)
|
||||
|
||||
var _m = p.Match(ApiParserParserID)
|
||||
_m := p.Match(ApiParserParserID)
|
||||
|
||||
localctx.(*MapTypeContext).mapToken = _m
|
||||
}
|
||||
{
|
||||
p.SetState(227)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__7)
|
||||
_m := p.Match(ApiParserParserT__7)
|
||||
|
||||
localctx.(*MapTypeContext).lbrack = _m
|
||||
}
|
||||
@@ -645,27 +594,24 @@ func (p *ApiParserParser) MapType() (localctx IMapTypeContext) {
|
||||
{
|
||||
p.SetState(229)
|
||||
|
||||
var _m = p.Match(ApiParserParserID)
|
||||
_m := p.Match(ApiParserParserID)
|
||||
|
||||
localctx.(*MapTypeContext).key = _m
|
||||
}
|
||||
{
|
||||
p.SetState(230)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__8)
|
||||
_m := p.Match(ApiParserParserT__8)
|
||||
|
||||
localctx.(*MapTypeContext).rbrack = _m
|
||||
}
|
||||
{
|
||||
p.SetState(231)
|
||||
|
||||
var _x = p.DataType()
|
||||
|
||||
_x := p.DataType()
|
||||
|
||||
localctx.(*MapTypeContext).value = _x
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
// The apiparser_parser.go file was split into multiple files because it
|
||||
// was too large and caused a possible memory overflow during goctl installation.
|
||||
|
||||
|
||||
// IArrayTypeContext is an interface to support dynamic dispatch.
|
||||
type IArrayTypeContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -24,14 +23,12 @@ type IArrayTypeContext interface {
|
||||
// GetRbrack returns the rbrack token.
|
||||
GetRbrack() antlr.Token
|
||||
|
||||
|
||||
// SetLbrack sets the lbrack token.
|
||||
SetLbrack(antlr.Token)
|
||||
|
||||
// SetRbrack sets the rbrack token.
|
||||
SetRbrack(antlr.Token)
|
||||
|
||||
|
||||
// IsArrayTypeContext differentiates from other interfaces.
|
||||
IsArrayTypeContext()
|
||||
}
|
||||
@@ -44,7 +41,7 @@ type ArrayTypeContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyArrayTypeContext() *ArrayTypeContext {
|
||||
var p = new(ArrayTypeContext)
|
||||
p := new(ArrayTypeContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_arrayType
|
||||
return p
|
||||
@@ -53,7 +50,7 @@ func NewEmptyArrayTypeContext() *ArrayTypeContext {
|
||||
func (*ArrayTypeContext) IsArrayTypeContext() {}
|
||||
|
||||
func NewArrayTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArrayTypeContext {
|
||||
var p = new(ArrayTypeContext)
|
||||
p := new(ArrayTypeContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -69,14 +66,12 @@ func (s *ArrayTypeContext) GetLbrack() antlr.Token { return s.lbrack }
|
||||
|
||||
func (s *ArrayTypeContext) GetRbrack() antlr.Token { return s.rbrack }
|
||||
|
||||
|
||||
func (s *ArrayTypeContext) SetLbrack(v antlr.Token) { s.lbrack = v }
|
||||
|
||||
func (s *ArrayTypeContext) SetRbrack(v antlr.Token) { s.rbrack = v }
|
||||
|
||||
|
||||
func (s *ArrayTypeContext) DataType() IDataTypeContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -93,7 +88,6 @@ func (s *ArrayTypeContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *ArrayTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -104,9 +98,6 @@ func (s *ArrayTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) ArrayType() (localctx IArrayTypeContext) {
|
||||
localctx = NewArrayTypeContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 48, ApiParserParserRULE_arrayType)
|
||||
@@ -131,14 +122,14 @@ func (p *ApiParserParser) ArrayType() (localctx IArrayTypeContext) {
|
||||
{
|
||||
p.SetState(233)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__7)
|
||||
_m := p.Match(ApiParserParserT__7)
|
||||
|
||||
localctx.(*ArrayTypeContext).lbrack = _m
|
||||
}
|
||||
{
|
||||
p.SetState(234)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__8)
|
||||
_m := p.Match(ApiParserParserT__8)
|
||||
|
||||
localctx.(*ArrayTypeContext).rbrack = _m
|
||||
}
|
||||
@@ -147,12 +138,9 @@ func (p *ApiParserParser) ArrayType() (localctx IArrayTypeContext) {
|
||||
p.DataType()
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IServiceSpecContext is an interface to support dynamic dispatch.
|
||||
type IServiceSpecContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -170,7 +158,7 @@ type ServiceSpecContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyServiceSpecContext() *ServiceSpecContext {
|
||||
var p = new(ServiceSpecContext)
|
||||
p := new(ServiceSpecContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_serviceSpec
|
||||
return p
|
||||
@@ -179,7 +167,7 @@ func NewEmptyServiceSpecContext() *ServiceSpecContext {
|
||||
func (*ServiceSpecContext) IsServiceSpecContext() {}
|
||||
|
||||
func NewServiceSpecContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ServiceSpecContext {
|
||||
var p = new(ServiceSpecContext)
|
||||
p := new(ServiceSpecContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -192,7 +180,7 @@ func NewServiceSpecContext(parser antlr.Parser, parent antlr.ParserRuleContext,
|
||||
func (s *ServiceSpecContext) GetParser() antlr.Parser { return s.parser }
|
||||
|
||||
func (s *ServiceSpecContext) ServiceApi() IServiceApiContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IServiceApiContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IServiceApiContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -202,7 +190,7 @@ func (s *ServiceSpecContext) ServiceApi() IServiceApiContext {
|
||||
}
|
||||
|
||||
func (s *ServiceSpecContext) AtServer() IAtServerContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IAtServerContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IAtServerContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -219,7 +207,6 @@ func (s *ServiceSpecContext) ToStringTree(ruleNames []string, recog antlr.Recogn
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *ServiceSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -230,15 +217,11 @@ func (s *ServiceSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) ServiceSpec() (localctx IServiceSpecContext) {
|
||||
localctx = NewServiceSpecContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 50, ApiParserParserRULE_serviceSpec)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -260,25 +243,20 @@ func (p *ApiParserParser) ServiceSpec() (localctx IServiceSpecContext) {
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
if _la == ApiParserParserATSERVER {
|
||||
{
|
||||
p.SetState(237)
|
||||
p.AtServer()
|
||||
}
|
||||
|
||||
}
|
||||
{
|
||||
p.SetState(240)
|
||||
p.ServiceApi()
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IAtServerContext is an interface to support dynamic dispatch.
|
||||
type IAtServerContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -292,14 +270,12 @@ type IAtServerContext interface {
|
||||
// GetRp returns the rp token.
|
||||
GetRp() antlr.Token
|
||||
|
||||
|
||||
// SetLp sets the lp token.
|
||||
SetLp(antlr.Token)
|
||||
|
||||
// SetRp sets the rp token.
|
||||
SetRp(antlr.Token)
|
||||
|
||||
|
||||
// IsAtServerContext differentiates from other interfaces.
|
||||
IsAtServerContext()
|
||||
}
|
||||
@@ -312,7 +288,7 @@ type AtServerContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyAtServerContext() *AtServerContext {
|
||||
var p = new(AtServerContext)
|
||||
p := new(AtServerContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_atServer
|
||||
return p
|
||||
@@ -321,7 +297,7 @@ func NewEmptyAtServerContext() *AtServerContext {
|
||||
func (*AtServerContext) IsAtServerContext() {}
|
||||
|
||||
func NewAtServerContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AtServerContext {
|
||||
var p = new(AtServerContext)
|
||||
p := new(AtServerContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -337,19 +313,17 @@ func (s *AtServerContext) GetLp() antlr.Token { return s.lp }
|
||||
|
||||
func (s *AtServerContext) GetRp() antlr.Token { return s.rp }
|
||||
|
||||
|
||||
func (s *AtServerContext) SetLp(v antlr.Token) { s.lp = v }
|
||||
|
||||
func (s *AtServerContext) SetRp(v antlr.Token) { s.rp = v }
|
||||
|
||||
|
||||
func (s *AtServerContext) ATSERVER() antlr.TerminalNode {
|
||||
return s.GetToken(ApiParserParserATSERVER, 0)
|
||||
}
|
||||
|
||||
func (s *AtServerContext) AllKvLit() []IKvLitContext {
|
||||
var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IKvLitContext)(nil)).Elem())
|
||||
var tst = make([]IKvLitContext, len(ts))
|
||||
ts := s.GetTypedRuleContexts(reflect.TypeOf((*IKvLitContext)(nil)).Elem())
|
||||
tst := make([]IKvLitContext, len(ts))
|
||||
|
||||
for i, t := range ts {
|
||||
if t != nil {
|
||||
@@ -361,7 +335,7 @@ func (s *AtServerContext) AllKvLit() []IKvLitContext {
|
||||
}
|
||||
|
||||
func (s *AtServerContext) KvLit(i int) IKvLitContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IKvLitContext)(nil)).Elem(), i)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IKvLitContext)(nil)).Elem(), i)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -378,7 +352,6 @@ func (s *AtServerContext) ToStringTree(ruleNames []string, recog antlr.Recognize
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *AtServerContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -389,15 +362,11 @@ func (s *AtServerContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) AtServer() (localctx IAtServerContext) {
|
||||
localctx = NewAtServerContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 52, ApiParserParserRULE_atServer)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -422,7 +391,7 @@ func (p *ApiParserParser) AtServer() (localctx IAtServerContext) {
|
||||
{
|
||||
p.SetState(243)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__1)
|
||||
_m := p.Match(ApiParserParserT__1)
|
||||
|
||||
localctx.(*AtServerContext).lp = _m
|
||||
}
|
||||
@@ -435,7 +404,6 @@ func (p *ApiParserParser) AtServer() (localctx IAtServerContext) {
|
||||
p.KvLit()
|
||||
}
|
||||
|
||||
|
||||
p.SetState(247)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
@@ -443,17 +411,14 @@ func (p *ApiParserParser) AtServer() (localctx IAtServerContext) {
|
||||
{
|
||||
p.SetState(249)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__2)
|
||||
_m := p.Match(ApiParserParserT__2)
|
||||
|
||||
localctx.(*AtServerContext).rp = _m
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IServiceApiContext is an interface to support dynamic dispatch.
|
||||
type IServiceApiContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -470,7 +435,6 @@ type IServiceApiContext interface {
|
||||
// GetRbrace returns the rbrace token.
|
||||
GetRbrace() antlr.Token
|
||||
|
||||
|
||||
// SetServiceToken sets the serviceToken token.
|
||||
SetServiceToken(antlr.Token)
|
||||
|
||||
@@ -480,7 +444,6 @@ type IServiceApiContext interface {
|
||||
// SetRbrace sets the rbrace token.
|
||||
SetRbrace(antlr.Token)
|
||||
|
||||
|
||||
// IsServiceApiContext differentiates from other interfaces.
|
||||
IsServiceApiContext()
|
||||
}
|
||||
@@ -494,7 +457,7 @@ type ServiceApiContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyServiceApiContext() *ServiceApiContext {
|
||||
var p = new(ServiceApiContext)
|
||||
p := new(ServiceApiContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_serviceApi
|
||||
return p
|
||||
@@ -503,7 +466,7 @@ func NewEmptyServiceApiContext() *ServiceApiContext {
|
||||
func (*ServiceApiContext) IsServiceApiContext() {}
|
||||
|
||||
func NewServiceApiContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ServiceApiContext {
|
||||
var p = new(ServiceApiContext)
|
||||
p := new(ServiceApiContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -521,16 +484,14 @@ func (s *ServiceApiContext) GetLbrace() antlr.Token { return s.lbrace }
|
||||
|
||||
func (s *ServiceApiContext) GetRbrace() antlr.Token { return s.rbrace }
|
||||
|
||||
|
||||
func (s *ServiceApiContext) SetServiceToken(v antlr.Token) { s.serviceToken = v }
|
||||
|
||||
func (s *ServiceApiContext) SetLbrace(v antlr.Token) { s.lbrace = v }
|
||||
|
||||
func (s *ServiceApiContext) SetRbrace(v antlr.Token) { s.rbrace = v }
|
||||
|
||||
|
||||
func (s *ServiceApiContext) ServiceName() IServiceNameContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IServiceNameContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IServiceNameContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -544,8 +505,8 @@ func (s *ServiceApiContext) ID() antlr.TerminalNode {
|
||||
}
|
||||
|
||||
func (s *ServiceApiContext) AllServiceRoute() []IServiceRouteContext {
|
||||
var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IServiceRouteContext)(nil)).Elem())
|
||||
var tst = make([]IServiceRouteContext, len(ts))
|
||||
ts := s.GetTypedRuleContexts(reflect.TypeOf((*IServiceRouteContext)(nil)).Elem())
|
||||
tst := make([]IServiceRouteContext, len(ts))
|
||||
|
||||
for i, t := range ts {
|
||||
if t != nil {
|
||||
@@ -557,7 +518,7 @@ func (s *ServiceApiContext) AllServiceRoute() []IServiceRouteContext {
|
||||
}
|
||||
|
||||
func (s *ServiceApiContext) ServiceRoute(i int) IServiceRouteContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IServiceRouteContext)(nil)).Elem(), i)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IServiceRouteContext)(nil)).Elem(), i)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -574,7 +535,6 @@ func (s *ServiceApiContext) ToStringTree(ruleNames []string, recog antlr.Recogni
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *ServiceApiContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -585,15 +545,11 @@ func (s *ServiceApiContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) ServiceApi() (localctx IServiceApiContext) {
|
||||
localctx = NewServiceApiContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 54, ApiParserParserRULE_serviceApi)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -611,11 +567,11 @@ func (p *ApiParserParser) ServiceApi() (localctx IServiceApiContext) {
|
||||
}()
|
||||
|
||||
p.EnterOuterAlt(localctx, 1)
|
||||
match(p,"service")
|
||||
match(p, "service")
|
||||
{
|
||||
p.SetState(252)
|
||||
|
||||
var _m = p.Match(ApiParserParserID)
|
||||
_m := p.Match(ApiParserParserID)
|
||||
|
||||
localctx.(*ServiceApiContext).serviceToken = _m
|
||||
}
|
||||
@@ -626,7 +582,7 @@ func (p *ApiParserParser) ServiceApi() (localctx IServiceApiContext) {
|
||||
{
|
||||
p.SetState(254)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__3)
|
||||
_m := p.Match(ApiParserParserT__3)
|
||||
|
||||
localctx.(*ServiceApiContext).lbrace = _m
|
||||
}
|
||||
@@ -634,14 +590,12 @@ func (p *ApiParserParser) ServiceApi() (localctx IServiceApiContext) {
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
for (((_la) & -(0x1f+1)) == 0 && ((1 << uint(_la)) & ((1 << ApiParserParserATDOC) | (1 << ApiParserParserATHANDLER) | (1 << ApiParserParserATSERVER))) != 0) {
|
||||
for ((_la)&-(0x1f+1)) == 0 && ((1<<uint(_la))&((1<<ApiParserParserATDOC)|(1<<ApiParserParserATHANDLER)|(1<<ApiParserParserATSERVER))) != 0 {
|
||||
{
|
||||
p.SetState(255)
|
||||
p.ServiceRoute()
|
||||
}
|
||||
|
||||
|
||||
p.SetState(260)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
@@ -649,12 +603,10 @@ func (p *ApiParserParser) ServiceApi() (localctx IServiceApiContext) {
|
||||
{
|
||||
p.SetState(261)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__4)
|
||||
_m := p.Match(ApiParserParserT__4)
|
||||
|
||||
localctx.(*ServiceApiContext).rbrace = _m
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
// The apiparser_parser.go file was split into multiple files because it
|
||||
// was too large and caused a possible memory overflow during goctl installation.
|
||||
|
||||
|
||||
// IServiceRouteContext is an interface to support dynamic dispatch.
|
||||
type IServiceRouteContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -28,7 +27,7 @@ type ServiceRouteContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyServiceRouteContext() *ServiceRouteContext {
|
||||
var p = new(ServiceRouteContext)
|
||||
p := new(ServiceRouteContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_serviceRoute
|
||||
return p
|
||||
@@ -37,7 +36,7 @@ func NewEmptyServiceRouteContext() *ServiceRouteContext {
|
||||
func (*ServiceRouteContext) IsServiceRouteContext() {}
|
||||
|
||||
func NewServiceRouteContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ServiceRouteContext {
|
||||
var p = new(ServiceRouteContext)
|
||||
p := new(ServiceRouteContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -50,7 +49,7 @@ func NewServiceRouteContext(parser antlr.Parser, parent antlr.ParserRuleContext,
|
||||
func (s *ServiceRouteContext) GetParser() antlr.Parser { return s.parser }
|
||||
|
||||
func (s *ServiceRouteContext) Route() IRouteContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IRouteContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IRouteContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -60,7 +59,7 @@ func (s *ServiceRouteContext) Route() IRouteContext {
|
||||
}
|
||||
|
||||
func (s *ServiceRouteContext) AtServer() IAtServerContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IAtServerContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IAtServerContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -70,7 +69,7 @@ func (s *ServiceRouteContext) AtServer() IAtServerContext {
|
||||
}
|
||||
|
||||
func (s *ServiceRouteContext) AtHandler() IAtHandlerContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IAtHandlerContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IAtHandlerContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -80,7 +79,7 @@ func (s *ServiceRouteContext) AtHandler() IAtHandlerContext {
|
||||
}
|
||||
|
||||
func (s *ServiceRouteContext) AtDoc() IAtDocContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IAtDocContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IAtDocContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -97,7 +96,6 @@ func (s *ServiceRouteContext) ToStringTree(ruleNames []string, recog antlr.Recog
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *ServiceRouteContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -108,15 +106,11 @@ func (s *ServiceRouteContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) ServiceRoute() (localctx IServiceRouteContext) {
|
||||
localctx = NewServiceRouteContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 56, ApiParserParserRULE_serviceRoute)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -138,13 +132,11 @@ func (p *ApiParserParser) ServiceRoute() (localctx IServiceRouteContext) {
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
if _la == ApiParserParserATDOC {
|
||||
{
|
||||
p.SetState(263)
|
||||
p.AtDoc()
|
||||
}
|
||||
|
||||
}
|
||||
p.SetState(268)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
@@ -156,15 +148,12 @@ func (p *ApiParserParser) ServiceRoute() (localctx IServiceRouteContext) {
|
||||
p.AtServer()
|
||||
}
|
||||
|
||||
|
||||
case ApiParserParserATHANDLER:
|
||||
{
|
||||
p.SetState(267)
|
||||
p.AtHandler()
|
||||
}
|
||||
|
||||
|
||||
|
||||
default:
|
||||
panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
|
||||
}
|
||||
@@ -173,12 +162,9 @@ func (p *ApiParserParser) ServiceRoute() (localctx IServiceRouteContext) {
|
||||
p.Route()
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IAtDocContext is an interface to support dynamic dispatch.
|
||||
type IAtDocContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -192,14 +178,12 @@ type IAtDocContext interface {
|
||||
// GetRp returns the rp token.
|
||||
GetRp() antlr.Token
|
||||
|
||||
|
||||
// SetLp sets the lp token.
|
||||
SetLp(antlr.Token)
|
||||
|
||||
// SetRp sets the rp token.
|
||||
SetRp(antlr.Token)
|
||||
|
||||
|
||||
// IsAtDocContext differentiates from other interfaces.
|
||||
IsAtDocContext()
|
||||
}
|
||||
@@ -212,7 +196,7 @@ type AtDocContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyAtDocContext() *AtDocContext {
|
||||
var p = new(AtDocContext)
|
||||
p := new(AtDocContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_atDoc
|
||||
return p
|
||||
@@ -221,7 +205,7 @@ func NewEmptyAtDocContext() *AtDocContext {
|
||||
func (*AtDocContext) IsAtDocContext() {}
|
||||
|
||||
func NewAtDocContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AtDocContext {
|
||||
var p = new(AtDocContext)
|
||||
p := new(AtDocContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -237,12 +221,10 @@ func (s *AtDocContext) GetLp() antlr.Token { return s.lp }
|
||||
|
||||
func (s *AtDocContext) GetRp() antlr.Token { return s.rp }
|
||||
|
||||
|
||||
func (s *AtDocContext) SetLp(v antlr.Token) { s.lp = v }
|
||||
|
||||
func (s *AtDocContext) SetRp(v antlr.Token) { s.rp = v }
|
||||
|
||||
|
||||
func (s *AtDocContext) ATDOC() antlr.TerminalNode {
|
||||
return s.GetToken(ApiParserParserATDOC, 0)
|
||||
}
|
||||
@@ -252,8 +234,8 @@ func (s *AtDocContext) STRING() antlr.TerminalNode {
|
||||
}
|
||||
|
||||
func (s *AtDocContext) AllKvLit() []IKvLitContext {
|
||||
var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IKvLitContext)(nil)).Elem())
|
||||
var tst = make([]IKvLitContext, len(ts))
|
||||
ts := s.GetTypedRuleContexts(reflect.TypeOf((*IKvLitContext)(nil)).Elem())
|
||||
tst := make([]IKvLitContext, len(ts))
|
||||
|
||||
for i, t := range ts {
|
||||
if t != nil {
|
||||
@@ -265,7 +247,7 @@ func (s *AtDocContext) AllKvLit() []IKvLitContext {
|
||||
}
|
||||
|
||||
func (s *AtDocContext) KvLit(i int) IKvLitContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IKvLitContext)(nil)).Elem(), i)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IKvLitContext)(nil)).Elem(), i)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -282,7 +264,6 @@ func (s *AtDocContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *AtDocContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -293,15 +274,11 @@ func (s *AtDocContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) AtDoc() (localctx IAtDocContext) {
|
||||
localctx = NewAtDocContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 58, ApiParserParserRULE_atDoc)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -327,16 +304,14 @@ func (p *ApiParserParser) AtDoc() (localctx IAtDocContext) {
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
if _la == ApiParserParserT__1 {
|
||||
{
|
||||
p.SetState(273)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__1)
|
||||
_m := p.Match(ApiParserParserT__1)
|
||||
|
||||
localctx.(*AtDocContext).lp = _m
|
||||
}
|
||||
|
||||
}
|
||||
p.SetState(282)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
@@ -352,22 +327,17 @@ func (p *ApiParserParser) AtDoc() (localctx IAtDocContext) {
|
||||
p.KvLit()
|
||||
}
|
||||
|
||||
|
||||
p.SetState(279)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
}
|
||||
|
||||
|
||||
|
||||
case ApiParserParserSTRING:
|
||||
{
|
||||
p.SetState(281)
|
||||
p.Match(ApiParserParserSTRING)
|
||||
}
|
||||
|
||||
|
||||
|
||||
default:
|
||||
panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
|
||||
}
|
||||
@@ -375,24 +345,19 @@ func (p *ApiParserParser) AtDoc() (localctx IAtDocContext) {
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
if _la == ApiParserParserT__2 {
|
||||
{
|
||||
p.SetState(284)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__2)
|
||||
_m := p.Match(ApiParserParserT__2)
|
||||
|
||||
localctx.(*AtDocContext).rp = _m
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IAtHandlerContext is an interface to support dynamic dispatch.
|
||||
type IAtHandlerContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -410,7 +375,7 @@ type AtHandlerContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyAtHandlerContext() *AtHandlerContext {
|
||||
var p = new(AtHandlerContext)
|
||||
p := new(AtHandlerContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_atHandler
|
||||
return p
|
||||
@@ -419,7 +384,7 @@ func NewEmptyAtHandlerContext() *AtHandlerContext {
|
||||
func (*AtHandlerContext) IsAtHandlerContext() {}
|
||||
|
||||
func NewAtHandlerContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AtHandlerContext {
|
||||
var p = new(AtHandlerContext)
|
||||
p := new(AtHandlerContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -447,7 +412,6 @@ func (s *AtHandlerContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *AtHandlerContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -458,9 +422,6 @@ func (s *AtHandlerContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) AtHandler() (localctx IAtHandlerContext) {
|
||||
localctx = NewAtHandlerContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 60, ApiParserParserRULE_atHandler)
|
||||
@@ -491,12 +452,9 @@ func (p *ApiParserParser) AtHandler() (localctx IAtHandlerContext) {
|
||||
p.Match(ApiParserParserID)
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IRouteContext is an interface to support dynamic dispatch.
|
||||
type IRouteContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -507,25 +465,21 @@ type IRouteContext interface {
|
||||
// GetHttpMethod returns the httpMethod token.
|
||||
GetHttpMethod() antlr.Token
|
||||
|
||||
|
||||
// SetHttpMethod sets the httpMethod token.
|
||||
SetHttpMethod(antlr.Token)
|
||||
|
||||
|
||||
// GetRequest returns the request rule contexts.
|
||||
GetRequest() IBodyContext
|
||||
|
||||
// GetResponse returns the response rule contexts.
|
||||
GetResponse() IReplybodyContext
|
||||
|
||||
|
||||
// SetRequest sets the request rule contexts.
|
||||
SetRequest(IBodyContext)
|
||||
|
||||
// SetResponse sets the response rule contexts.
|
||||
SetResponse(IReplybodyContext)
|
||||
|
||||
|
||||
// IsRouteContext differentiates from other interfaces.
|
||||
IsRouteContext()
|
||||
}
|
||||
@@ -539,7 +493,7 @@ type RouteContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyRouteContext() *RouteContext {
|
||||
var p = new(RouteContext)
|
||||
p := new(RouteContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_route
|
||||
return p
|
||||
@@ -548,7 +502,7 @@ func NewEmptyRouteContext() *RouteContext {
|
||||
func (*RouteContext) IsRouteContext() {}
|
||||
|
||||
func NewRouteContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RouteContext {
|
||||
var p = new(RouteContext)
|
||||
p := new(RouteContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -562,22 +516,18 @@ func (s *RouteContext) GetParser() antlr.Parser { return s.parser }
|
||||
|
||||
func (s *RouteContext) GetHttpMethod() antlr.Token { return s.httpMethod }
|
||||
|
||||
|
||||
func (s *RouteContext) SetHttpMethod(v antlr.Token) { s.httpMethod = v }
|
||||
|
||||
|
||||
func (s *RouteContext) GetRequest() IBodyContext { return s.request }
|
||||
|
||||
func (s *RouteContext) GetResponse() IReplybodyContext { return s.response }
|
||||
|
||||
|
||||
func (s *RouteContext) SetRequest(v IBodyContext) { s.request = v }
|
||||
|
||||
func (s *RouteContext) SetResponse(v IReplybodyContext) { s.response = v }
|
||||
|
||||
|
||||
func (s *RouteContext) Path() IPathContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IPathContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IPathContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -591,7 +541,7 @@ func (s *RouteContext) ID() antlr.TerminalNode {
|
||||
}
|
||||
|
||||
func (s *RouteContext) Body() IBodyContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IBodyContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IBodyContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -601,7 +551,7 @@ func (s *RouteContext) Body() IBodyContext {
|
||||
}
|
||||
|
||||
func (s *RouteContext) Replybody() IReplybodyContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IReplybodyContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IReplybodyContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -618,7 +568,6 @@ func (s *RouteContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *RouteContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -629,15 +578,11 @@ func (s *RouteContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) Route() (localctx IRouteContext) {
|
||||
localctx = NewRouteContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 62, ApiParserParserRULE_route)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -659,7 +604,7 @@ func (p *ApiParserParser) Route() (localctx IRouteContext) {
|
||||
{
|
||||
p.SetState(291)
|
||||
|
||||
var _m = p.Match(ApiParserParserID)
|
||||
_m := p.Match(ApiParserParserID)
|
||||
|
||||
localctx.(*RouteContext).httpMethod = _m
|
||||
}
|
||||
@@ -671,36 +616,28 @@ func (p *ApiParserParser) Route() (localctx IRouteContext) {
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
if _la == ApiParserParserT__1 {
|
||||
{
|
||||
p.SetState(293)
|
||||
|
||||
var _x = p.Body()
|
||||
|
||||
_x := p.Body()
|
||||
|
||||
localctx.(*RouteContext).request = _x
|
||||
}
|
||||
|
||||
}
|
||||
p.SetState(297)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
if _la == ApiParserParserT__9 {
|
||||
{
|
||||
p.SetState(296)
|
||||
|
||||
var _x = p.Replybody()
|
||||
|
||||
_x := p.Replybody()
|
||||
|
||||
localctx.(*RouteContext).response = _x
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
// The apiparser_parser.go file was split into multiple files because it
|
||||
// was too large and caused a possible memory overflow during goctl installation.
|
||||
|
||||
|
||||
// IBodyContext is an interface to support dynamic dispatch.
|
||||
type IBodyContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -24,14 +23,12 @@ type IBodyContext interface {
|
||||
// GetRp returns the rp token.
|
||||
GetRp() antlr.Token
|
||||
|
||||
|
||||
// SetLp sets the lp token.
|
||||
SetLp(antlr.Token)
|
||||
|
||||
// SetRp sets the rp token.
|
||||
SetRp(antlr.Token)
|
||||
|
||||
|
||||
// IsBodyContext differentiates from other interfaces.
|
||||
IsBodyContext()
|
||||
}
|
||||
@@ -44,7 +41,7 @@ type BodyContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyBodyContext() *BodyContext {
|
||||
var p = new(BodyContext)
|
||||
p := new(BodyContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_body
|
||||
return p
|
||||
@@ -53,7 +50,7 @@ func NewEmptyBodyContext() *BodyContext {
|
||||
func (*BodyContext) IsBodyContext() {}
|
||||
|
||||
func NewBodyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BodyContext {
|
||||
var p = new(BodyContext)
|
||||
p := new(BodyContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -69,12 +66,10 @@ func (s *BodyContext) GetLp() antlr.Token { return s.lp }
|
||||
|
||||
func (s *BodyContext) GetRp() antlr.Token { return s.rp }
|
||||
|
||||
|
||||
func (s *BodyContext) SetLp(v antlr.Token) { s.lp = v }
|
||||
|
||||
func (s *BodyContext) SetRp(v antlr.Token) { s.rp = v }
|
||||
|
||||
|
||||
func (s *BodyContext) ID() antlr.TerminalNode {
|
||||
return s.GetToken(ApiParserParserID, 0)
|
||||
}
|
||||
@@ -87,7 +82,6 @@ func (s *BodyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) s
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *BodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -98,15 +92,11 @@ func (s *BodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) Body() (localctx IBodyContext) {
|
||||
localctx = NewBodyContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 64, ApiParserParserRULE_body)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -127,7 +117,7 @@ func (p *ApiParserParser) Body() (localctx IBodyContext) {
|
||||
{
|
||||
p.SetState(299)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__1)
|
||||
_m := p.Match(ApiParserParserT__1)
|
||||
|
||||
localctx.(*BodyContext).lp = _m
|
||||
}
|
||||
@@ -135,28 +125,23 @@ func (p *ApiParserParser) Body() (localctx IBodyContext) {
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
if _la == ApiParserParserID {
|
||||
{
|
||||
p.SetState(300)
|
||||
p.Match(ApiParserParserID)
|
||||
}
|
||||
|
||||
}
|
||||
{
|
||||
p.SetState(303)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__2)
|
||||
_m := p.Match(ApiParserParserT__2)
|
||||
|
||||
localctx.(*BodyContext).rp = _m
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IReplybodyContext is an interface to support dynamic dispatch.
|
||||
type IReplybodyContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -173,7 +158,6 @@ type IReplybodyContext interface {
|
||||
// GetRp returns the rp token.
|
||||
GetRp() antlr.Token
|
||||
|
||||
|
||||
// SetReturnToken sets the returnToken token.
|
||||
SetReturnToken(antlr.Token)
|
||||
|
||||
@@ -183,7 +167,6 @@ type IReplybodyContext interface {
|
||||
// SetRp sets the rp token.
|
||||
SetRp(antlr.Token)
|
||||
|
||||
|
||||
// IsReplybodyContext differentiates from other interfaces.
|
||||
IsReplybodyContext()
|
||||
}
|
||||
@@ -197,7 +180,7 @@ type ReplybodyContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyReplybodyContext() *ReplybodyContext {
|
||||
var p = new(ReplybodyContext)
|
||||
p := new(ReplybodyContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_replybody
|
||||
return p
|
||||
@@ -206,7 +189,7 @@ func NewEmptyReplybodyContext() *ReplybodyContext {
|
||||
func (*ReplybodyContext) IsReplybodyContext() {}
|
||||
|
||||
func NewReplybodyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ReplybodyContext {
|
||||
var p = new(ReplybodyContext)
|
||||
p := new(ReplybodyContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -224,16 +207,14 @@ func (s *ReplybodyContext) GetLp() antlr.Token { return s.lp }
|
||||
|
||||
func (s *ReplybodyContext) GetRp() antlr.Token { return s.rp }
|
||||
|
||||
|
||||
func (s *ReplybodyContext) SetReturnToken(v antlr.Token) { s.returnToken = v }
|
||||
|
||||
func (s *ReplybodyContext) SetLp(v antlr.Token) { s.lp = v }
|
||||
|
||||
func (s *ReplybodyContext) SetRp(v antlr.Token) { s.rp = v }
|
||||
|
||||
|
||||
func (s *ReplybodyContext) DataType() IDataTypeContext {
|
||||
var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
|
||||
t := s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
|
||||
|
||||
if t == nil {
|
||||
return nil
|
||||
@@ -250,7 +231,6 @@ func (s *ReplybodyContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *ReplybodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -261,15 +241,11 @@ func (s *ReplybodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) Replybody() (localctx IReplybodyContext) {
|
||||
localctx = NewReplybodyContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 66, ApiParserParserRULE_replybody)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -290,14 +266,14 @@ func (p *ApiParserParser) Replybody() (localctx IReplybodyContext) {
|
||||
{
|
||||
p.SetState(305)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__9)
|
||||
_m := p.Match(ApiParserParserT__9)
|
||||
|
||||
localctx.(*ReplybodyContext).returnToken = _m
|
||||
}
|
||||
{
|
||||
p.SetState(306)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__1)
|
||||
_m := p.Match(ApiParserParserT__1)
|
||||
|
||||
localctx.(*ReplybodyContext).lp = _m
|
||||
}
|
||||
@@ -305,28 +281,23 @@ func (p *ApiParserParser) Replybody() (localctx IReplybodyContext) {
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
if (((_la) & -(0x1f+1)) == 0 && ((1 << uint(_la)) & ((1 << ApiParserParserT__5) | (1 << ApiParserParserT__6) | (1 << ApiParserParserT__7) | (1 << ApiParserParserINTERFACE) | (1 << ApiParserParserID))) != 0) {
|
||||
if ((_la)&-(0x1f+1)) == 0 && ((1<<uint(_la))&((1<<ApiParserParserT__5)|(1<<ApiParserParserT__6)|(1<<ApiParserParserT__7)|(1<<ApiParserParserINTERFACE)|(1<<ApiParserParserID))) != 0 {
|
||||
{
|
||||
p.SetState(307)
|
||||
p.DataType()
|
||||
}
|
||||
|
||||
}
|
||||
{
|
||||
p.SetState(310)
|
||||
|
||||
var _m = p.Match(ApiParserParserT__2)
|
||||
_m := p.Match(ApiParserParserT__2)
|
||||
|
||||
localctx.(*ReplybodyContext).rp = _m
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IKvLitContext is an interface to support dynamic dispatch.
|
||||
type IKvLitContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -340,14 +311,12 @@ type IKvLitContext interface {
|
||||
// GetValue returns the value token.
|
||||
GetValue() antlr.Token
|
||||
|
||||
|
||||
// SetKey sets the key token.
|
||||
SetKey(antlr.Token)
|
||||
|
||||
// SetValue sets the value token.
|
||||
SetValue(antlr.Token)
|
||||
|
||||
|
||||
// IsKvLitContext differentiates from other interfaces.
|
||||
IsKvLitContext()
|
||||
}
|
||||
@@ -360,7 +329,7 @@ type KvLitContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyKvLitContext() *KvLitContext {
|
||||
var p = new(KvLitContext)
|
||||
p := new(KvLitContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_kvLit
|
||||
return p
|
||||
@@ -369,7 +338,7 @@ func NewEmptyKvLitContext() *KvLitContext {
|
||||
func (*KvLitContext) IsKvLitContext() {}
|
||||
|
||||
func NewKvLitContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *KvLitContext {
|
||||
var p = new(KvLitContext)
|
||||
p := new(KvLitContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -385,12 +354,10 @@ func (s *KvLitContext) GetKey() antlr.Token { return s.key }
|
||||
|
||||
func (s *KvLitContext) GetValue() antlr.Token { return s.value }
|
||||
|
||||
|
||||
func (s *KvLitContext) SetKey(v antlr.Token) { s.key = v }
|
||||
|
||||
func (s *KvLitContext) SetValue(v antlr.Token) { s.value = v }
|
||||
|
||||
|
||||
func (s *KvLitContext) ID() antlr.TerminalNode {
|
||||
return s.GetToken(ApiParserParserID, 0)
|
||||
}
|
||||
@@ -407,7 +374,6 @@ func (s *KvLitContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *KvLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -418,9 +384,6 @@ func (s *KvLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) KvLit() (localctx IKvLitContext) {
|
||||
localctx = NewKvLitContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 68, ApiParserParserRULE_kvLit)
|
||||
@@ -445,7 +408,7 @@ func (p *ApiParserParser) KvLit() (localctx IKvLitContext) {
|
||||
{
|
||||
p.SetState(312)
|
||||
|
||||
var _m = p.Match(ApiParserParserID)
|
||||
_m := p.Match(ApiParserParserID)
|
||||
|
||||
localctx.(*KvLitContext).key = _m
|
||||
}
|
||||
@@ -453,17 +416,14 @@ func (p *ApiParserParser) KvLit() (localctx IKvLitContext) {
|
||||
{
|
||||
p.SetState(314)
|
||||
|
||||
var _m = p.Match(ApiParserParserLINE_VALUE)
|
||||
_m := p.Match(ApiParserParserLINE_VALUE)
|
||||
|
||||
localctx.(*KvLitContext).value = _m
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IServiceNameContext is an interface to support dynamic dispatch.
|
||||
type IServiceNameContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -481,7 +441,7 @@ type ServiceNameContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyServiceNameContext() *ServiceNameContext {
|
||||
var p = new(ServiceNameContext)
|
||||
p := new(ServiceNameContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_serviceName
|
||||
return p
|
||||
@@ -490,7 +450,7 @@ func NewEmptyServiceNameContext() *ServiceNameContext {
|
||||
func (*ServiceNameContext) IsServiceNameContext() {}
|
||||
|
||||
func NewServiceNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ServiceNameContext {
|
||||
var p = new(ServiceNameContext)
|
||||
p := new(ServiceNameContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -518,7 +478,6 @@ func (s *ServiceNameContext) ToStringTree(ruleNames []string, recog antlr.Recogn
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *ServiceNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -529,15 +488,11 @@ func (s *ServiceNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) ServiceName() (localctx IServiceNameContext) {
|
||||
localctx = NewServiceNameContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 70, ApiParserParserRULE_serviceName)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -567,27 +522,21 @@ func (p *ApiParserParser) ServiceName() (localctx IServiceNameContext) {
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
if _la == ApiParserParserT__10 {
|
||||
{
|
||||
p.SetState(317)
|
||||
p.Match(ApiParserParserT__10)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
p.SetState(322)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
}
|
||||
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
|
||||
// IPathContext is an interface to support dynamic dispatch.
|
||||
type IPathContext interface {
|
||||
antlr.ParserRuleContext
|
||||
@@ -605,7 +554,7 @@ type PathContext struct {
|
||||
}
|
||||
|
||||
func NewEmptyPathContext() *PathContext {
|
||||
var p = new(PathContext)
|
||||
p := new(PathContext)
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
|
||||
p.RuleIndex = ApiParserParserRULE_path
|
||||
return p
|
||||
@@ -614,7 +563,7 @@ func NewEmptyPathContext() *PathContext {
|
||||
func (*PathContext) IsPathContext() {}
|
||||
|
||||
func NewPathContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PathContext {
|
||||
var p = new(PathContext)
|
||||
p := new(PathContext)
|
||||
|
||||
p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState)
|
||||
|
||||
@@ -642,7 +591,6 @@ func (s *PathContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) s
|
||||
return antlr.TreesStringTree(s, ruleNames, recog)
|
||||
}
|
||||
|
||||
|
||||
func (s *PathContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
switch t := visitor.(type) {
|
||||
case ApiParserVisitor:
|
||||
@@ -653,15 +601,11 @@ func (s *PathContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func (p *ApiParserParser) Path() (localctx IPathContext) {
|
||||
localctx = NewPathContext(p, p.GetParserRuleContext(), p.GetState())
|
||||
p.EnterRule(localctx, 72, ApiParserParserRULE_path)
|
||||
var _la int
|
||||
|
||||
|
||||
defer func() {
|
||||
p.ExitRule()
|
||||
}()
|
||||
@@ -705,7 +649,6 @@ func (p *ApiParserParser) Path() (localctx IPathContext) {
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
for _la == ApiParserParserT__10 {
|
||||
{
|
||||
p.SetState(326)
|
||||
@@ -716,15 +659,11 @@ func (p *ApiParserParser) Path() (localctx IPathContext) {
|
||||
p.Match(ApiParserParserID)
|
||||
}
|
||||
|
||||
|
||||
p.SetState(332)
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
case ApiParserParserT__12:
|
||||
{
|
||||
p.SetState(333)
|
||||
@@ -739,7 +678,6 @@ func (p *ApiParserParser) Path() (localctx IPathContext) {
|
||||
p.GetErrorHandler().Sync(p)
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
|
||||
|
||||
if _la == ApiParserParserT__10 {
|
||||
{
|
||||
p.SetState(335)
|
||||
@@ -752,10 +690,6 @@ func (p *ApiParserParser) Path() (localctx IPathContext) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
default:
|
||||
panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
|
||||
}
|
||||
@@ -765,7 +699,6 @@ func (p *ApiParserParser) Path() (localctx IPathContext) {
|
||||
_la = p.GetTokenStream().LA(1)
|
||||
}
|
||||
|
||||
|
||||
case 2:
|
||||
p.EnterOuterAlt(localctx, 2)
|
||||
{
|
||||
@@ -775,6 +708,5 @@ func (p *ApiParserParser) Path() (localctx IPathContext) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
return localctx
|
||||
}
|
||||
|
||||
@@ -10,15 +10,15 @@ import (
|
||||
// The apiparser_parser.go file was split into multiple files because it
|
||||
// was too large and caused a possible memory overflow during goctl installation.
|
||||
|
||||
|
||||
func (p *ApiParserParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool {
|
||||
switch ruleIndex {
|
||||
case 18:
|
||||
var t *FieldContext = nil
|
||||
if localctx != nil { t = localctx.(*FieldContext) }
|
||||
if localctx != nil {
|
||||
t = localctx.(*FieldContext)
|
||||
}
|
||||
return p.Field_Sempred(t, predIndex)
|
||||
|
||||
|
||||
default:
|
||||
panic("No predicate with index: " + fmt.Sprint(ruleIndex))
|
||||
}
|
||||
@@ -33,5 +33,3 @@ func (p *ApiParserParser) Field_Sempred(localctx antlr.RuleContext, predIndex in
|
||||
panic("No predicate with index: " + fmt.Sprint(predIndex))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,118 +1,119 @@
|
||||
package api // ApiParser
|
||||
|
||||
import "github.com/zeromicro/antlr"
|
||||
// A complete Visitor for a parse tree produced by ApiParserParser.
|
||||
|
||||
// ApiParserVisitor is a complete Visitor for a parse tree produced by ApiParserParser.
|
||||
type ApiParserVisitor interface {
|
||||
antlr.ParseTreeVisitor
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#api.
|
||||
// VisitApi is a parse tree produced by ApiParserParser#api.
|
||||
VisitApi(ctx *ApiContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#spec.
|
||||
// VisitSpec is a parse tree produced by ApiParserParser#spec.
|
||||
VisitSpec(ctx *SpecContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#syntaxLit.
|
||||
// VisitSyntaxLit is a parse tree produced by ApiParserParser#syntaxLit.
|
||||
VisitSyntaxLit(ctx *SyntaxLitContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#importSpec.
|
||||
// VisitImportSpec is a parse tree produced by ApiParserParser#importSpec.
|
||||
VisitImportSpec(ctx *ImportSpecContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#importLit.
|
||||
// VisitImportLit is a parse tree produced by ApiParserParser#importLit.
|
||||
VisitImportLit(ctx *ImportLitContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#importBlock.
|
||||
// VisitImportBlock is a parse tree produced by ApiParserParser#importBlock.
|
||||
VisitImportBlock(ctx *ImportBlockContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#importBlockValue.
|
||||
// VisitImportBlockValue is a parse tree produced by ApiParserParser#importBlockValue.
|
||||
VisitImportBlockValue(ctx *ImportBlockValueContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#importValue.
|
||||
// VisitImportValue is a parse tree produced by ApiParserParser#importValue.
|
||||
VisitImportValue(ctx *ImportValueContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#infoSpec.
|
||||
// VisitInfoSpec is a parse tree produced by ApiParserParser#infoSpec.
|
||||
VisitInfoSpec(ctx *InfoSpecContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#typeSpec.
|
||||
// VisitTypeSpec is a parse tree produced by ApiParserParser#typeSpec.
|
||||
VisitTypeSpec(ctx *TypeSpecContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#typeLit.
|
||||
// VisitTypeLit is a parse tree produced by ApiParserParser#typeLit.
|
||||
VisitTypeLit(ctx *TypeLitContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#typeBlock.
|
||||
// VisitTypeBlock is a parse tree produced by ApiParserParser#typeBlock.
|
||||
VisitTypeBlock(ctx *TypeBlockContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#typeLitBody.
|
||||
// VisitTypeLitBody is a parse tree produced by ApiParserParser#typeLitBody.
|
||||
VisitTypeLitBody(ctx *TypeLitBodyContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#typeBlockBody.
|
||||
// VisitTypeBlockBody is a parse tree produced by ApiParserParser#typeBlockBody.
|
||||
VisitTypeBlockBody(ctx *TypeBlockBodyContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#typeStruct.
|
||||
// VisitTypeStruct is a parse tree produced by ApiParserParser#typeStruct.
|
||||
VisitTypeStruct(ctx *TypeStructContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#typeAlias.
|
||||
// VisitTypeAlias is a parse tree produced by ApiParserParser#typeAlias.
|
||||
VisitTypeAlias(ctx *TypeAliasContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#typeBlockStruct.
|
||||
// VisitTypeBlockStruct is a parse tree produced by ApiParserParser#typeBlockStruct.
|
||||
VisitTypeBlockStruct(ctx *TypeBlockStructContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#typeBlockAlias.
|
||||
// VisitTypeBlockAlias is a parse tree produced by ApiParserParser#typeBlockAlias.
|
||||
VisitTypeBlockAlias(ctx *TypeBlockAliasContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#field.
|
||||
// VisitField is a parse tree produced by ApiParserParser#field.
|
||||
VisitField(ctx *FieldContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#normalField.
|
||||
// VisitNormalField is a parse tree produced by ApiParserParser#normalField.
|
||||
VisitNormalField(ctx *NormalFieldContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#anonymousFiled.
|
||||
// VisitAnonymousFiled is a parse tree produced by ApiParserParser#anonymousFiled.
|
||||
VisitAnonymousFiled(ctx *AnonymousFiledContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#dataType.
|
||||
// VisitDataType is a parse tree produced by ApiParserParser#dataType.
|
||||
VisitDataType(ctx *DataTypeContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#pointerType.
|
||||
// VisitPointerType is a parse tree produced by ApiParserParser#pointerType.
|
||||
VisitPointerType(ctx *PointerTypeContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#mapType.
|
||||
// VisitMapType is a parse tree produced by ApiParserParser#mapType.
|
||||
VisitMapType(ctx *MapTypeContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#arrayType.
|
||||
// VisitArrayType is a parse tree produced by ApiParserParser#arrayType.
|
||||
VisitArrayType(ctx *ArrayTypeContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#serviceSpec.
|
||||
// VisitServiceSpec is a parse tree produced by ApiParserParser#serviceSpec.
|
||||
VisitServiceSpec(ctx *ServiceSpecContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#atServer.
|
||||
// VisitAtServer is a parse tree produced by ApiParserParser#atServer.
|
||||
VisitAtServer(ctx *AtServerContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#serviceApi.
|
||||
// VisitServiceApi is a parse tree produced by ApiParserParser#serviceApi.
|
||||
VisitServiceApi(ctx *ServiceApiContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#serviceRoute.
|
||||
// VisitServiceRoute is a parse tree produced by ApiParserParser#serviceRoute.
|
||||
VisitServiceRoute(ctx *ServiceRouteContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#atDoc.
|
||||
// VisitAtDoc is a parse tree produced by ApiParserParser#atDoc.
|
||||
VisitAtDoc(ctx *AtDocContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#atHandler.
|
||||
// VisitAtHandler is a parse tree produced by ApiParserParser#atHandler.
|
||||
VisitAtHandler(ctx *AtHandlerContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#route.
|
||||
// VisitRoute is a parse tree produced by ApiParserParser#route.
|
||||
VisitRoute(ctx *RouteContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#body.
|
||||
// VisitBody is a parse tree produced by ApiParserParser#body.
|
||||
VisitBody(ctx *BodyContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#replybody.
|
||||
// VisitReplybody is a parse tree produced by ApiParserParser#replybody.
|
||||
VisitReplybody(ctx *ReplybodyContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#kvLit.
|
||||
// VisitKvLit is a parse tree produced by ApiParserParser#kvLit.
|
||||
VisitKvLit(ctx *KvLitContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#serviceName.
|
||||
// VisitServiceName is a parse tree produced by ApiParserParser#serviceName.
|
||||
VisitServiceName(ctx *ServiceNameContext) interface{}
|
||||
|
||||
// Visit a parse tree produced by ApiParserParser#path.
|
||||
// VisitPath is a parse tree produced by ApiParserParser#path.
|
||||
VisitPath(ctx *PathContext) interface{}
|
||||
|
||||
}
|
||||
@@ -28,7 +28,7 @@ func TestFileSplitor(t *testing.T) {
|
||||
buffer := bytes.NewBuffer(nil)
|
||||
|
||||
for {
|
||||
var fn, part = "apiparser_parser0.go", "main"
|
||||
fn, part := "apiparser_parser0.go", "main"
|
||||
if files > 0 {
|
||||
fn = fmt.Sprintf("apiparser_parser%d.go", files)
|
||||
part = fmt.Sprintf("%d", files)
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
// Upgrade gets the latest goctl by
|
||||
// go get -u github.com/tal-tech/go-zero/tools/goctl
|
||||
func Upgrade(_ *cli.Context) error {
|
||||
var cmd = `GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go install github.com/tal-tech/go-zero/tools/goctl@cli`
|
||||
cmd := `GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go install github.com/tal-tech/go-zero/tools/goctl@cli`
|
||||
if runtime.GOOS == "windows" {
|
||||
cmd = `set GOPROXY=https://goproxy.cn,direct && go install github.com/tal-tech/go-zero/tools/goctl@cli`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user