* fix #1318

* fix #1318

* remove never used code

* fix unit tes

Co-authored-by: anqiansong <anqiansong@bytedance.com>
This commit is contained in:
anqiansong
2021-12-13 22:55:11 +08:00
committed by GitHub
parent 914692cc82
commit 1b14de2ff9
18 changed files with 1103 additions and 660 deletions

View File

@@ -78,7 +78,7 @@ service A-api {
@server( @server(
handler: NoResponseHandler handler: NoResponseHandler
) )
get /greet/get(Request) returns get /greet/get(Request)
} }
` `

View File

@@ -63,9 +63,9 @@ serviceApi: {match(p,"service")}serviceToken=ID serviceName lbrace='{' servi
serviceRoute: atDoc? (atServer|atHandler) route; serviceRoute: atDoc? (atServer|atHandler) route;
atDoc: ATDOC lp='('? ((kvLit+)|STRING) rp=')'?; atDoc: ATDOC lp='('? ((kvLit+)|STRING) rp=')'?;
atHandler: ATHANDLER ID; atHandler: ATHANDLER ID;
route: {checkHTTPMethod(p)}httpMethod=ID path request=body? returnToken=ID? response=replybody?; route: {checkHTTPMethod(p)}httpMethod=ID path request=body? response=replybody?;
body: lp='(' (ID)? rp=')'; body: lp='(' (ID)? rp=')';
replybody: lp='(' dataType? rp=')'; replybody: returnToken='returns' lp='(' dataType? rp=')';
// kv // kv
kvLit: key=ID {checkKeyValue(p)}value=LINE_VALUE; kvLit: key=ID {checkKeyValue(p)}value=LINE_VALUE;

View File

@@ -21,7 +21,7 @@ type (
// ApiVisitor wraps api.BaseApiParserVisitor to call methods which has prefix Visit to // ApiVisitor wraps api.BaseApiParserVisitor to call methods which has prefix Visit to
// visit node from the api syntax // visit node from the api syntax
ApiVisitor struct { ApiVisitor struct {
api.BaseApiParserVisitor *api.BaseApiParserVisitor
debug bool debug bool
log console.Console log console.Console
prefix string prefix string

View File

@@ -71,6 +71,7 @@ type Route struct {
// Body describes request,response body ast for api syntax // Body describes request,response body ast for api syntax
type Body struct { type Body struct {
ReturnExpr Expr
Lp Expr Lp Expr
Rp Expr Rp Expr
Name DataType Name DataType
@@ -175,7 +176,7 @@ func (v *ApiVisitor) VisitAtHandler(ctx *api.AtHandlerContext) interface{} {
return &atHandler return &atHandler
} }
// VisitRoute implements from api.BaseApiParserVisitor // serVisitRoute implements from api.BaseApiParserVisitor
func (v *ApiVisitor) VisitRoute(ctx *api.RouteContext) interface{} { func (v *ApiVisitor) VisitRoute(ctx *api.RouteContext) interface{} {
var route Route var route Route
path := ctx.Path() path := ctx.Path()
@@ -193,16 +194,12 @@ func (v *ApiVisitor) VisitRoute(ctx *api.RouteContext) interface{} {
if ctx.GetResponse() != nil { if ctx.GetResponse() != nil {
reply := ctx.GetResponse().Accept(v) reply := ctx.GetResponse().Accept(v)
if reply != nil { if reply != nil {
route.Reply = reply.(*Body) resp := reply.(*Body)
route.ReturnToken = resp.ReturnExpr
resp.ReturnExpr = nil
route.Reply = resp
} }
} }
if ctx.GetReturnToken() != nil {
returnExpr := v.newExprWithToken(ctx.GetReturnToken())
if ctx.GetReturnToken().GetText() != "returns" {
v.panic(returnExpr, fmt.Sprintf("expecting returns, found input '%s'", ctx.GetReturnToken().GetText()))
}
route.ReturnToken = returnExpr
}
route.DocExpr = v.getDoc(ctx) route.DocExpr = v.getDoc(ctx)
route.CommentExpr = v.getComment(ctx) route.CommentExpr = v.getComment(ctx)
@@ -249,6 +246,14 @@ func (v *ApiVisitor) VisitReplybody(ctx *api.ReplybodyContext) interface{} {
return nil return nil
} }
var returnExpr Expr
if ctx.GetReturnToken() != nil {
returnExpr = v.newExprWithToken(ctx.GetReturnToken())
if ctx.GetReturnToken().GetText() != "returns" {
v.panic(returnExpr, fmt.Sprintf("expecting returns, found input '%s'", ctx.GetReturnToken().GetText()))
}
}
dt := ctx.DataType().Accept(v).(DataType) dt := ctx.DataType().Accept(v).(DataType)
if dt == nil { if dt == nil {
return nil return nil
@@ -275,6 +280,7 @@ func (v *ApiVisitor) VisitReplybody(ctx *api.ReplybodyContext) interface{} {
} }
return &Body{ return &Body{
ReturnExpr: returnExpr,
Lp: v.newExprWithToken(ctx.GetLp()), Lp: v.newExprWithToken(ctx.GetLp()),
Rp: v.newExprWithToken(ctx.GetRp()), Rp: v.newExprWithToken(ctx.GetRp()),
Name: dt, Name: dt,

View File

@@ -1,3 +1,4 @@
package api // ApiParser package api // ApiParser
import "github.com/zeromicro/antlr" import "github.com/zeromicro/antlr"

View File

@@ -1,143 +1,146 @@
package api package api
import ( import (
"fmt" "fmt"
"unicode" "unicode"
"github.com/zeromicro/antlr" "github.com/zeromicro/antlr"
) )
// Suppress unused import error // Suppress unused import error
var _ = fmt.Printf var _ = fmt.Printf
var _ = unicode.IsLetter var _ = unicode.IsLetter
var serializedLexerAtn = []uint16{ var serializedLexerAtn = []uint16{
3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 25, 266, 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 26, 276,
8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7,
9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12,
4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4,
18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23,
9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9,
28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 3, 2, 3, 2, 3, 3, 3, 3, 3, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 3, 2, 3, 2,
4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8,
8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10,
3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3,
15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16,
3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3,
17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 6, 18, 132, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18,
10, 18, 13, 18, 14, 18, 133, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 6, 19, 142, 10,
7, 19, 142, 10, 19, 12, 19, 14, 19, 145, 11, 19, 3, 19, 3, 19, 3, 19, 3, 19, 13, 19, 14, 19, 143, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 7, 20,
19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 7, 20, 156, 10, 20, 12, 20, 14, 152, 10, 20, 12, 20, 14, 20, 155, 11, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3,
20, 159, 11, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 7, 21, 166, 10, 21, 20, 3, 21, 3, 21, 3, 21, 3, 21, 7, 21, 166, 10, 21, 12, 21, 14, 21, 169,
12, 21, 14, 21, 169, 11, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 6, 22, 11, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 7, 22, 176, 10, 22, 12, 22,
176, 10, 22, 13, 22, 14, 22, 177, 3, 22, 3, 22, 3, 23, 3, 23, 7, 23, 184, 14, 22, 179, 11, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 6, 23, 186, 10,
10, 23, 12, 23, 14, 23, 187, 11, 23, 3, 23, 3, 23, 7, 23, 191, 10, 23, 23, 13, 23, 14, 23, 187, 3, 23, 3, 23, 3, 24, 3, 24, 7, 24, 194, 10, 24,
12, 23, 14, 23, 194, 11, 23, 5, 23, 196, 10, 23, 3, 24, 3, 24, 7, 24, 200, 12, 24, 14, 24, 197, 11, 24, 3, 24, 3, 24, 7, 24, 201, 10, 24, 12, 24,
10, 24, 12, 24, 14, 24, 203, 11, 24, 3, 25, 3, 25, 5, 25, 207, 10, 25, 14, 24, 204, 11, 24, 5, 24, 206, 10, 24, 3, 25, 3, 25, 7, 25, 210, 10,
3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 215, 10, 26, 3, 26, 5, 25, 12, 25, 14, 25, 213, 11, 25, 3, 26, 3, 26, 5, 26, 217, 10, 26, 3, 26,
26, 218, 10, 26, 3, 26, 3, 26, 3, 26, 6, 26, 223, 10, 26, 13, 26, 14, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 225, 10, 27, 3, 27, 5, 27, 228,
224, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 232, 10, 26, 3, 27, 3, 27, 10, 27, 3, 27, 3, 27, 3, 27, 6, 27, 233, 10, 27, 13, 27, 14, 27, 234, 3,
3, 27, 7, 27, 237, 10, 27, 12, 27, 14, 27, 240, 11, 27, 3, 27, 5, 27, 243, 27, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 242, 10, 27, 3, 28, 3, 28, 3, 28,
10, 27, 3, 28, 3, 28, 3, 29, 3, 29, 7, 29, 249, 10, 29, 12, 29, 14, 29, 7, 28, 247, 10, 28, 12, 28, 14, 28, 250, 11, 28, 3, 28, 5, 28, 253, 10,
252, 11, 29, 3, 29, 5, 29, 255, 10, 29, 3, 30, 3, 30, 5, 30, 259, 10, 30, 28, 3, 29, 3, 29, 3, 30, 3, 30, 7, 30, 259, 10, 30, 12, 30, 14, 30, 262,
3, 31, 3, 31, 3, 31, 3, 31, 5, 31, 265, 10, 31, 3, 143, 2, 32, 3, 3, 5, 11, 30, 3, 30, 5, 30, 265, 10, 30, 3, 31, 3, 31, 5, 31, 269, 10, 31, 3,
4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 32, 3, 32, 3, 32, 3, 32, 5, 32, 275, 10, 32, 3, 153, 2, 33, 3, 3, 5, 4,
14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14,
23, 45, 24, 47, 25, 49, 2, 51, 2, 53, 2, 55, 2, 57, 2, 59, 2, 61, 2, 3, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23,
2, 20, 5, 2, 11, 12, 14, 15, 34, 34, 4, 2, 12, 12, 15, 15, 4, 2, 36, 36, 45, 24, 47, 25, 49, 26, 51, 2, 53, 2, 55, 2, 57, 2, 59, 2, 61, 2, 63, 2,
94, 94, 6, 2, 12, 12, 15, 15, 94, 94, 98, 98, 4, 2, 11, 11, 34, 34, 6, 3, 2, 20, 5, 2, 11, 12, 14, 15, 34, 34, 4, 2, 12, 12, 15, 15, 4, 2, 36,
2, 12, 12, 15, 15, 36, 36, 98, 98, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 36, 94, 94, 6, 2, 12, 12, 15, 15, 94, 94, 98, 98, 4, 2, 11, 11, 34, 34,
47, 47, 10, 2, 36, 36, 41, 41, 94, 94, 100, 100, 104, 104, 112, 112, 116, 6, 2, 12, 12, 15, 15, 36, 36, 98, 98, 4, 2, 71, 71, 103, 103, 4, 2, 45,
116, 118, 118, 3, 2, 50, 53, 3, 2, 50, 57, 5, 2, 50, 59, 67, 72, 99, 104, 45, 47, 47, 10, 2, 36, 36, 41, 41, 94, 94, 100, 100, 104, 104, 112, 112,
3, 2, 50, 59, 4, 2, 50, 59, 97, 97, 6, 2, 38, 38, 67, 92, 97, 97, 99, 124, 116, 116, 118, 118, 3, 2, 50, 53, 3, 2, 50, 57, 5, 2, 50, 59, 67, 72, 99,
4, 2, 2, 129, 55298, 56321, 3, 2, 55298, 56321, 3, 2, 56322, 57345, 2, 104, 3, 2, 50, 59, 4, 2, 50, 59, 97, 97, 6, 2, 38, 38, 67, 92, 97, 97,
283, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 99, 124, 4, 2, 2, 129, 55298, 56321, 3, 2, 55298, 56321, 3, 2, 56322, 57345,
2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 293, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3,
2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17,
3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2,
33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2,
2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2,
2, 3, 63, 3, 2, 2, 2, 5, 65, 3, 2, 2, 2, 7, 67, 3, 2, 2, 2, 9, 69, 3, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2,
2, 2, 11, 71, 3, 2, 2, 2, 13, 73, 3, 2, 2, 2, 15, 75, 3, 2, 2, 2, 17, 85, 2, 2, 2, 49, 3, 2, 2, 2, 3, 65, 3, 2, 2, 2, 5, 67, 3, 2, 2, 2, 7, 69, 3,
3, 2, 2, 2, 19, 87, 3, 2, 2, 2, 21, 89, 3, 2, 2, 2, 23, 91, 3, 2, 2, 2, 2, 2, 2, 9, 71, 3, 2, 2, 2, 11, 73, 3, 2, 2, 2, 13, 75, 3, 2, 2, 2, 15,
25, 93, 3, 2, 2, 2, 27, 96, 3, 2, 2, 2, 29, 101, 3, 2, 2, 2, 31, 110, 3, 77, 3, 2, 2, 2, 17, 87, 3, 2, 2, 2, 19, 89, 3, 2, 2, 2, 21, 91, 3, 2, 2,
2, 2, 2, 33, 122, 3, 2, 2, 2, 35, 131, 3, 2, 2, 2, 37, 137, 3, 2, 2, 2, 2, 23, 99, 3, 2, 2, 2, 25, 101, 3, 2, 2, 2, 27, 103, 3, 2, 2, 2, 29, 106,
39, 151, 3, 2, 2, 2, 41, 162, 3, 2, 2, 2, 43, 172, 3, 2, 2, 2, 45, 181, 3, 2, 2, 2, 31, 111, 3, 2, 2, 2, 33, 120, 3, 2, 2, 2, 35, 132, 3, 2, 2,
3, 2, 2, 2, 47, 197, 3, 2, 2, 2, 49, 204, 3, 2, 2, 2, 51, 231, 3, 2, 2, 2, 37, 141, 3, 2, 2, 2, 39, 147, 3, 2, 2, 2, 41, 161, 3, 2, 2, 2, 43, 172,
2, 53, 233, 3, 2, 2, 2, 55, 244, 3, 2, 2, 2, 57, 246, 3, 2, 2, 2, 59, 258, 3, 2, 2, 2, 45, 182, 3, 2, 2, 2, 47, 191, 3, 2, 2, 2, 49, 207, 3, 2, 2,
3, 2, 2, 2, 61, 264, 3, 2, 2, 2, 63, 64, 7, 63, 2, 2, 64, 4, 3, 2, 2, 2, 2, 51, 214, 3, 2, 2, 2, 53, 241, 3, 2, 2, 2, 55, 243, 3, 2, 2, 2, 57, 254,
65, 66, 7, 42, 2, 2, 66, 6, 3, 2, 2, 2, 67, 68, 7, 43, 2, 2, 68, 8, 3, 3, 2, 2, 2, 59, 256, 3, 2, 2, 2, 61, 268, 3, 2, 2, 2, 63, 274, 3, 2, 2,
2, 2, 2, 69, 70, 7, 125, 2, 2, 70, 10, 3, 2, 2, 2, 71, 72, 7, 127, 2, 2, 2, 65, 66, 7, 63, 2, 2, 66, 4, 3, 2, 2, 2, 67, 68, 7, 42, 2, 2, 68, 6,
72, 12, 3, 2, 2, 2, 73, 74, 7, 44, 2, 2, 74, 14, 3, 2, 2, 2, 75, 76, 7, 3, 2, 2, 2, 69, 70, 7, 43, 2, 2, 70, 8, 3, 2, 2, 2, 71, 72, 7, 125, 2,
118, 2, 2, 76, 77, 7, 107, 2, 2, 77, 78, 7, 111, 2, 2, 78, 79, 7, 103, 2, 72, 10, 3, 2, 2, 2, 73, 74, 7, 127, 2, 2, 74, 12, 3, 2, 2, 2, 75, 76,
2, 2, 79, 80, 7, 48, 2, 2, 80, 81, 7, 86, 2, 2, 81, 82, 7, 107, 2, 2, 82, 7, 44, 2, 2, 76, 14, 3, 2, 2, 2, 77, 78, 7, 118, 2, 2, 78, 79, 7, 107,
83, 7, 111, 2, 2, 83, 84, 7, 103, 2, 2, 84, 16, 3, 2, 2, 2, 85, 86, 7, 2, 2, 79, 80, 7, 111, 2, 2, 80, 81, 7, 103, 2, 2, 81, 82, 7, 48, 2, 2,
93, 2, 2, 86, 18, 3, 2, 2, 2, 87, 88, 7, 95, 2, 2, 88, 20, 3, 2, 2, 2, 82, 83, 7, 86, 2, 2, 83, 84, 7, 107, 2, 2, 84, 85, 7, 111, 2, 2, 85, 86,
89, 90, 7, 47, 2, 2, 90, 22, 3, 2, 2, 2, 91, 92, 7, 49, 2, 2, 92, 24, 3, 7, 103, 2, 2, 86, 16, 3, 2, 2, 2, 87, 88, 7, 93, 2, 2, 88, 18, 3, 2, 2,
2, 2, 2, 93, 94, 7, 49, 2, 2, 94, 95, 7, 60, 2, 2, 95, 26, 3, 2, 2, 2, 2, 89, 90, 7, 95, 2, 2, 90, 20, 3, 2, 2, 2, 91, 92, 7, 116, 2, 2, 92, 93,
96, 97, 7, 66, 2, 2, 97, 98, 7, 102, 2, 2, 98, 99, 7, 113, 2, 2, 99, 100, 7, 103, 2, 2, 93, 94, 7, 118, 2, 2, 94, 95, 7, 119, 2, 2, 95, 96, 7, 116,
7, 101, 2, 2, 100, 28, 3, 2, 2, 2, 101, 102, 7, 66, 2, 2, 102, 103, 7, 2, 2, 96, 97, 7, 112, 2, 2, 97, 98, 7, 117, 2, 2, 98, 22, 3, 2, 2, 2, 99,
106, 2, 2, 103, 104, 7, 99, 2, 2, 104, 105, 7, 112, 2, 2, 105, 106, 7, 100, 7, 47, 2, 2, 100, 24, 3, 2, 2, 2, 101, 102, 7, 49, 2, 2, 102, 26,
102, 2, 2, 106, 107, 7, 110, 2, 2, 107, 108, 7, 103, 2, 2, 108, 109, 7, 3, 2, 2, 2, 103, 104, 7, 49, 2, 2, 104, 105, 7, 60, 2, 2, 105, 28, 3, 2,
116, 2, 2, 109, 30, 3, 2, 2, 2, 110, 111, 7, 107, 2, 2, 111, 112, 7, 112, 2, 2, 106, 107, 7, 66, 2, 2, 107, 108, 7, 102, 2, 2, 108, 109, 7, 113,
2, 2, 112, 113, 7, 118, 2, 2, 113, 114, 7, 103, 2, 2, 114, 115, 7, 116, 2, 2, 109, 110, 7, 101, 2, 2, 110, 30, 3, 2, 2, 2, 111, 112, 7, 66, 2,
2, 2, 115, 116, 7, 104, 2, 2, 116, 117, 7, 99, 2, 2, 117, 118, 7, 101, 2, 112, 113, 7, 106, 2, 2, 113, 114, 7, 99, 2, 2, 114, 115, 7, 112, 2,
2, 2, 118, 119, 7, 103, 2, 2, 119, 120, 7, 125, 2, 2, 120, 121, 7, 127, 2, 115, 116, 7, 102, 2, 2, 116, 117, 7, 110, 2, 2, 117, 118, 7, 103, 2,
2, 2, 121, 32, 3, 2, 2, 2, 122, 123, 7, 66, 2, 2, 123, 124, 7, 117, 2, 2, 118, 119, 7, 116, 2, 2, 119, 32, 3, 2, 2, 2, 120, 121, 7, 107, 2, 2,
2, 124, 125, 7, 103, 2, 2, 125, 126, 7, 116, 2, 2, 126, 127, 7, 120, 2, 121, 122, 7, 112, 2, 2, 122, 123, 7, 118, 2, 2, 123, 124, 7, 103, 2, 2,
2, 127, 128, 7, 103, 2, 2, 128, 129, 7, 116, 2, 2, 129, 34, 3, 2, 2, 2, 124, 125, 7, 116, 2, 2, 125, 126, 7, 104, 2, 2, 126, 127, 7, 99, 2, 2,
130, 132, 9, 2, 2, 2, 131, 130, 3, 2, 2, 2, 132, 133, 3, 2, 2, 2, 133, 127, 128, 7, 101, 2, 2, 128, 129, 7, 103, 2, 2, 129, 130, 7, 125, 2, 2,
131, 3, 2, 2, 2, 133, 134, 3, 2, 2, 2, 134, 135, 3, 2, 2, 2, 135, 136, 130, 131, 7, 127, 2, 2, 131, 34, 3, 2, 2, 2, 132, 133, 7, 66, 2, 2, 133,
8, 18, 2, 2, 136, 36, 3, 2, 2, 2, 137, 138, 7, 49, 2, 2, 138, 139, 7, 44, 134, 7, 117, 2, 2, 134, 135, 7, 103, 2, 2, 135, 136, 7, 116, 2, 2, 136,
2, 2, 139, 143, 3, 2, 2, 2, 140, 142, 11, 2, 2, 2, 141, 140, 3, 2, 2, 2, 137, 7, 120, 2, 2, 137, 138, 7, 103, 2, 2, 138, 139, 7, 116, 2, 2, 139,
142, 145, 3, 2, 2, 2, 143, 144, 3, 2, 2, 2, 143, 141, 3, 2, 2, 2, 144, 36, 3, 2, 2, 2, 140, 142, 9, 2, 2, 2, 141, 140, 3, 2, 2, 2, 142, 143, 3,
146, 3, 2, 2, 2, 145, 143, 3, 2, 2, 2, 146, 147, 7, 44, 2, 2, 147, 148, 2, 2, 2, 143, 141, 3, 2, 2, 2, 143, 144, 3, 2, 2, 2, 144, 145, 3, 2, 2,
7, 49, 2, 2, 148, 149, 3, 2, 2, 2, 149, 150, 8, 19, 3, 2, 150, 38, 3, 2, 2, 145, 146, 8, 19, 2, 2, 146, 38, 3, 2, 2, 2, 147, 148, 7, 49, 2, 2, 148,
2, 2, 151, 152, 7, 49, 2, 2, 152, 153, 7, 49, 2, 2, 153, 157, 3, 2, 2, 149, 7, 44, 2, 2, 149, 153, 3, 2, 2, 2, 150, 152, 11, 2, 2, 2, 151, 150,
2, 154, 156, 10, 3, 2, 2, 155, 154, 3, 2, 2, 2, 156, 159, 3, 2, 2, 2, 157, 3, 2, 2, 2, 152, 155, 3, 2, 2, 2, 153, 154, 3, 2, 2, 2, 153, 151, 3, 2,
155, 3, 2, 2, 2, 157, 158, 3, 2, 2, 2, 158, 160, 3, 2, 2, 2, 159, 157, 2, 2, 154, 156, 3, 2, 2, 2, 155, 153, 3, 2, 2, 2, 156, 157, 7, 44, 2, 2,
3, 2, 2, 2, 160, 161, 8, 20, 3, 2, 161, 40, 3, 2, 2, 2, 162, 167, 7, 36, 157, 158, 7, 49, 2, 2, 158, 159, 3, 2, 2, 2, 159, 160, 8, 20, 3, 2, 160,
2, 2, 163, 166, 10, 4, 2, 2, 164, 166, 5, 51, 26, 2, 165, 163, 3, 2, 2, 40, 3, 2, 2, 2, 161, 162, 7, 49, 2, 2, 162, 163, 7, 49, 2, 2, 163, 167,
2, 165, 164, 3, 2, 2, 2, 166, 169, 3, 2, 2, 2, 167, 165, 3, 2, 2, 2, 167, 3, 2, 2, 2, 164, 166, 10, 3, 2, 2, 165, 164, 3, 2, 2, 2, 166, 169, 3, 2,
168, 3, 2, 2, 2, 168, 170, 3, 2, 2, 2, 169, 167, 3, 2, 2, 2, 170, 171, 2, 2, 167, 165, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 170, 3, 2, 2, 2,
7, 36, 2, 2, 171, 42, 3, 2, 2, 2, 172, 175, 7, 98, 2, 2, 173, 176, 10, 169, 167, 3, 2, 2, 2, 170, 171, 8, 21, 3, 2, 171, 42, 3, 2, 2, 2, 172,
5, 2, 2, 174, 176, 5, 51, 26, 2, 175, 173, 3, 2, 2, 2, 175, 174, 3, 2, 177, 7, 36, 2, 2, 173, 176, 10, 4, 2, 2, 174, 176, 5, 53, 27, 2, 175, 173,
2, 2, 176, 177, 3, 2, 2, 2, 177, 175, 3, 2, 2, 2, 177, 178, 3, 2, 2, 2, 3, 2, 2, 2, 175, 174, 3, 2, 2, 2, 176, 179, 3, 2, 2, 2, 177, 175, 3, 2,
178, 179, 3, 2, 2, 2, 179, 180, 7, 98, 2, 2, 180, 44, 3, 2, 2, 2, 181, 2, 2, 177, 178, 3, 2, 2, 2, 178, 180, 3, 2, 2, 2, 179, 177, 3, 2, 2, 2,
185, 7, 60, 2, 2, 182, 184, 9, 6, 2, 2, 183, 182, 3, 2, 2, 2, 184, 187, 180, 181, 7, 36, 2, 2, 181, 44, 3, 2, 2, 2, 182, 185, 7, 98, 2, 2, 183,
3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 185, 186, 3, 2, 2, 2, 186, 195, 3, 2, 186, 10, 5, 2, 2, 184, 186, 5, 53, 27, 2, 185, 183, 3, 2, 2, 2, 185, 184,
2, 2, 187, 185, 3, 2, 2, 2, 188, 196, 5, 41, 21, 2, 189, 191, 10, 7, 2, 3, 2, 2, 2, 186, 187, 3, 2, 2, 2, 187, 185, 3, 2, 2, 2, 187, 188, 3, 2,
2, 190, 189, 3, 2, 2, 2, 191, 194, 3, 2, 2, 2, 192, 190, 3, 2, 2, 2, 192, 2, 2, 188, 189, 3, 2, 2, 2, 189, 190, 7, 98, 2, 2, 190, 46, 3, 2, 2, 2,
193, 3, 2, 2, 2, 193, 196, 3, 2, 2, 2, 194, 192, 3, 2, 2, 2, 195, 188, 191, 195, 7, 60, 2, 2, 192, 194, 9, 6, 2, 2, 193, 192, 3, 2, 2, 2, 194,
3, 2, 2, 2, 195, 192, 3, 2, 2, 2, 196, 46, 3, 2, 2, 2, 197, 201, 5, 61, 197, 3, 2, 2, 2, 195, 193, 3, 2, 2, 2, 195, 196, 3, 2, 2, 2, 196, 205,
31, 2, 198, 200, 5, 59, 30, 2, 199, 198, 3, 2, 2, 2, 200, 203, 3, 2, 2, 3, 2, 2, 2, 197, 195, 3, 2, 2, 2, 198, 206, 5, 43, 22, 2, 199, 201, 10,
2, 201, 199, 3, 2, 2, 2, 201, 202, 3, 2, 2, 2, 202, 48, 3, 2, 2, 2, 203, 7, 2, 2, 200, 199, 3, 2, 2, 2, 201, 204, 3, 2, 2, 2, 202, 200, 3, 2, 2,
201, 3, 2, 2, 2, 204, 206, 9, 8, 2, 2, 205, 207, 9, 9, 2, 2, 206, 205, 2, 202, 203, 3, 2, 2, 2, 203, 206, 3, 2, 2, 2, 204, 202, 3, 2, 2, 2, 205,
3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, 208, 3, 2, 2, 2, 208, 209, 5, 57, 198, 3, 2, 2, 2, 205, 202, 3, 2, 2, 2, 206, 48, 3, 2, 2, 2, 207, 211, 5,
29, 2, 209, 50, 3, 2, 2, 2, 210, 211, 7, 94, 2, 2, 211, 232, 9, 10, 2, 63, 32, 2, 208, 210, 5, 61, 31, 2, 209, 208, 3, 2, 2, 2, 210, 213, 3, 2,
2, 212, 217, 7, 94, 2, 2, 213, 215, 9, 11, 2, 2, 214, 213, 3, 2, 2, 2, 2, 2, 211, 209, 3, 2, 2, 2, 211, 212, 3, 2, 2, 2, 212, 50, 3, 2, 2, 2,
214, 215, 3, 2, 2, 2, 215, 216, 3, 2, 2, 2, 216, 218, 9, 12, 2, 2, 217, 213, 211, 3, 2, 2, 2, 214, 216, 9, 8, 2, 2, 215, 217, 9, 9, 2, 2, 216,
214, 3, 2, 2, 2, 217, 218, 3, 2, 2, 2, 218, 219, 3, 2, 2, 2, 219, 232, 215, 3, 2, 2, 2, 216, 217, 3, 2, 2, 2, 217, 218, 3, 2, 2, 2, 218, 219,
9, 12, 2, 2, 220, 222, 7, 94, 2, 2, 221, 223, 7, 119, 2, 2, 222, 221, 3, 5, 59, 30, 2, 219, 52, 3, 2, 2, 2, 220, 221, 7, 94, 2, 2, 221, 242, 9,
2, 2, 2, 223, 224, 3, 2, 2, 2, 224, 222, 3, 2, 2, 2, 224, 225, 3, 2, 2, 10, 2, 2, 222, 227, 7, 94, 2, 2, 223, 225, 9, 11, 2, 2, 224, 223, 3, 2,
2, 225, 226, 3, 2, 2, 2, 226, 227, 5, 55, 28, 2, 227, 228, 5, 55, 28, 2, 2, 2, 224, 225, 3, 2, 2, 2, 225, 226, 3, 2, 2, 2, 226, 228, 9, 12, 2, 2,
228, 229, 5, 55, 28, 2, 229, 230, 5, 55, 28, 2, 230, 232, 3, 2, 2, 2, 231, 227, 224, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 229, 3, 2, 2, 2, 229,
210, 3, 2, 2, 2, 231, 212, 3, 2, 2, 2, 231, 220, 3, 2, 2, 2, 232, 52, 3, 242, 9, 12, 2, 2, 230, 232, 7, 94, 2, 2, 231, 233, 7, 119, 2, 2, 232, 231,
2, 2, 2, 233, 242, 5, 55, 28, 2, 234, 237, 5, 55, 28, 2, 235, 237, 7, 97, 3, 2, 2, 2, 233, 234, 3, 2, 2, 2, 234, 232, 3, 2, 2, 2, 234, 235, 3, 2,
2, 2, 236, 234, 3, 2, 2, 2, 236, 235, 3, 2, 2, 2, 237, 240, 3, 2, 2, 2, 2, 2, 235, 236, 3, 2, 2, 2, 236, 237, 5, 57, 29, 2, 237, 238, 5, 57, 29,
238, 236, 3, 2, 2, 2, 238, 239, 3, 2, 2, 2, 239, 241, 3, 2, 2, 2, 240, 2, 238, 239, 5, 57, 29, 2, 239, 240, 5, 57, 29, 2, 240, 242, 3, 2, 2, 2,
238, 3, 2, 2, 2, 241, 243, 5, 55, 28, 2, 242, 238, 3, 2, 2, 2, 242, 243, 241, 220, 3, 2, 2, 2, 241, 222, 3, 2, 2, 2, 241, 230, 3, 2, 2, 2, 242,
3, 2, 2, 2, 243, 54, 3, 2, 2, 2, 244, 245, 9, 13, 2, 2, 245, 56, 3, 2, 54, 3, 2, 2, 2, 243, 252, 5, 57, 29, 2, 244, 247, 5, 57, 29, 2, 245, 247,
2, 2, 246, 254, 9, 14, 2, 2, 247, 249, 9, 15, 2, 2, 248, 247, 3, 2, 2, 7, 97, 2, 2, 246, 244, 3, 2, 2, 2, 246, 245, 3, 2, 2, 2, 247, 250, 3, 2,
2, 249, 252, 3, 2, 2, 2, 250, 248, 3, 2, 2, 2, 250, 251, 3, 2, 2, 2, 251, 2, 2, 248, 246, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 251, 3, 2, 2, 2,
253, 3, 2, 2, 2, 252, 250, 3, 2, 2, 2, 253, 255, 9, 14, 2, 2, 254, 250, 250, 248, 3, 2, 2, 2, 251, 253, 5, 57, 29, 2, 252, 248, 3, 2, 2, 2, 252,
3, 2, 2, 2, 254, 255, 3, 2, 2, 2, 255, 58, 3, 2, 2, 2, 256, 259, 5, 61, 253, 3, 2, 2, 2, 253, 56, 3, 2, 2, 2, 254, 255, 9, 13, 2, 2, 255, 58, 3,
31, 2, 257, 259, 9, 14, 2, 2, 258, 256, 3, 2, 2, 2, 258, 257, 3, 2, 2, 2, 2, 2, 256, 264, 9, 14, 2, 2, 257, 259, 9, 15, 2, 2, 258, 257, 3, 2,
2, 259, 60, 3, 2, 2, 2, 260, 265, 9, 16, 2, 2, 261, 265, 10, 17, 2, 2, 2, 2, 259, 262, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 260, 261, 3, 2, 2, 2,
262, 263, 9, 18, 2, 2, 263, 265, 9, 19, 2, 2, 264, 260, 3, 2, 2, 2, 264, 261, 263, 3, 2, 2, 2, 262, 260, 3, 2, 2, 2, 263, 265, 9, 14, 2, 2, 264,
261, 3, 2, 2, 2, 264, 262, 3, 2, 2, 2, 265, 62, 3, 2, 2, 2, 26, 2, 133, 260, 3, 2, 2, 2, 264, 265, 3, 2, 2, 2, 265, 60, 3, 2, 2, 2, 266, 269, 5,
143, 157, 165, 167, 175, 177, 185, 192, 195, 201, 206, 214, 217, 224, 231, 63, 32, 2, 267, 269, 9, 14, 2, 2, 268, 266, 3, 2, 2, 2, 268, 267, 3, 2,
236, 238, 242, 250, 254, 258, 264, 4, 2, 3, 2, 2, 90, 2, 2, 2, 269, 62, 3, 2, 2, 2, 270, 275, 9, 16, 2, 2, 271, 275, 10, 17, 2,
2, 272, 273, 9, 18, 2, 2, 273, 275, 9, 19, 2, 2, 274, 270, 3, 2, 2, 2,
274, 271, 3, 2, 2, 2, 274, 272, 3, 2, 2, 2, 275, 64, 3, 2, 2, 2, 26, 2,
143, 153, 167, 175, 177, 185, 187, 195, 202, 205, 211, 216, 224, 227, 234,
241, 246, 248, 252, 260, 264, 268, 274, 4, 2, 3, 2, 2, 90, 2,
} }
var lexerChannelNames = []string{ var lexerChannelNames = []string{
@@ -150,23 +153,23 @@ var lexerModeNames = []string{
var lexerLiteralNames = []string{ var lexerLiteralNames = []string{
"", "'='", "'('", "')'", "'{'", "'}'", "'*'", "'time.Time'", "'['", "']'", "", "'='", "'('", "')'", "'{'", "'}'", "'*'", "'time.Time'", "'['", "']'",
"'-'", "'/'", "'/:'", "'@doc'", "'@handler'", "'interface{}'", "'@server'", "'returns'", "'-'", "'/'", "'/:'", "'@doc'", "'@handler'", "'interface{}'",
"'@server'",
} }
var lexerSymbolicNames = []string{ var lexerSymbolicNames = []string{
"", "", "", "", "", "", "", "", "", "", "", "", "", "ATDOC", "ATHANDLER", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "ATDOC", "ATHANDLER",
"INTERFACE", "ATSERVER", "WS", "COMMENT", "LINE_COMMENT", "STRING", "RAW_STRING", "INTERFACE", "ATSERVER", "WS", "COMMENT", "LINE_COMMENT", "STRING", "RAW_STRING",
"LINE_VALUE", "ID", "LINE_VALUE", "ID",
} }
var lexerRuleNames = []string{ var lexerRuleNames = []string{
"T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8",
"T__9", "T__10", "T__11", "ATDOC", "ATHANDLER", "INTERFACE", "ATSERVER", "T__9", "T__10", "T__11", "T__12", "ATDOC", "ATHANDLER", "INTERFACE", "ATSERVER",
"WS", "COMMENT", "LINE_COMMENT", "STRING", "RAW_STRING", "LINE_VALUE", "WS", "COMMENT", "LINE_COMMENT", "STRING", "RAW_STRING", "LINE_VALUE",
"ID", "ExponentPart", "EscapeSequence", "HexDigits", "HexDigit", "Digits", "ID", "ExponentPart", "EscapeSequence", "HexDigits", "HexDigit", "Digits",
"LetterOrDigit", "Letter", "LetterOrDigit", "Letter",
} }
type ApiParserLexer struct { type ApiParserLexer struct {
*antlr.BaseLexer *antlr.BaseLexer
channelNames []string channelNames []string
@@ -216,17 +219,22 @@ const (
ApiParserLexerT__9 = 10 ApiParserLexerT__9 = 10
ApiParserLexerT__10 = 11 ApiParserLexerT__10 = 11
ApiParserLexerT__11 = 12 ApiParserLexerT__11 = 12
ApiParserLexerATDOC = 13 ApiParserLexerT__12 = 13
ApiParserLexerATHANDLER = 14 ApiParserLexerATDOC = 14
ApiParserLexerINTERFACE = 15 ApiParserLexerATHANDLER = 15
ApiParserLexerATSERVER = 16 ApiParserLexerINTERFACE = 16
ApiParserLexerWS = 17 ApiParserLexerATSERVER = 17
ApiParserLexerCOMMENT = 18 ApiParserLexerWS = 18
ApiParserLexerLINE_COMMENT = 19 ApiParserLexerCOMMENT = 19
ApiParserLexerSTRING = 20 ApiParserLexerLINE_COMMENT = 20
ApiParserLexerRAW_STRING = 21 ApiParserLexerSTRING = 21
ApiParserLexerLINE_VALUE = 22 ApiParserLexerRAW_STRING = 22
ApiParserLexerID = 23 ApiParserLexerLINE_VALUE = 23
ApiParserLexerID = 24
) )
const COMEMNTS = 88 const COMEMNTS = 88

View File

@@ -12,8 +12,9 @@ var _ = fmt.Printf
var _ = reflect.Copy var _ = reflect.Copy
var _ = strconv.Itoa var _ = strconv.Itoa
var parserATN = []uint16{ var parserATN = []uint16{
3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 25, 351, 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 26, 349,
4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7,
4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13,
9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9,
@@ -45,134 +46,134 @@ var parserATN = []uint16{
30, 3, 30, 3, 30, 3, 31, 3, 31, 5, 31, 277, 10, 31, 3, 31, 6, 31, 280, 30, 3, 30, 3, 30, 3, 31, 3, 31, 5, 31, 277, 10, 31, 3, 31, 6, 31, 280,
10, 31, 13, 31, 14, 31, 281, 3, 31, 5, 31, 285, 10, 31, 3, 31, 5, 31, 288, 10, 31, 13, 31, 14, 31, 281, 3, 31, 5, 31, 285, 10, 31, 3, 31, 5, 31, 288,
10, 31, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 5, 33, 297, 10, 10, 31, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 5, 33, 297, 10,
33, 3, 33, 5, 33, 300, 10, 33, 3, 33, 5, 33, 303, 10, 33, 3, 34, 3, 34, 33, 3, 33, 5, 33, 300, 10, 33, 3, 34, 3, 34, 5, 34, 304, 10, 34, 3, 34,
5, 34, 307, 10, 34, 3, 34, 3, 34, 3, 35, 3, 35, 5, 35, 313, 10, 35, 3, 3, 34, 3, 35, 3, 35, 3, 35, 5, 35, 311, 10, 35, 3, 35, 3, 35, 3, 36, 3,
35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 5, 37, 323, 10, 37, 36, 3, 36, 3, 36, 3, 37, 3, 37, 5, 37, 321, 10, 37, 6, 37, 323, 10, 37,
6, 37, 325, 10, 37, 13, 37, 14, 37, 326, 3, 38, 3, 38, 3, 38, 3, 38, 7, 13, 37, 14, 37, 324, 3, 38, 3, 38, 3, 38, 3, 38, 7, 38, 331, 10, 38, 12,
38, 333, 10, 38, 12, 38, 14, 38, 336, 11, 38, 3, 38, 3, 38, 3, 38, 3, 38, 38, 14, 38, 334, 11, 38, 3, 38, 3, 38, 3, 38, 3, 38, 5, 38, 340, 10, 38,
5, 38, 342, 10, 38, 6, 38, 344, 10, 38, 13, 38, 14, 38, 345, 3, 38, 5, 6, 38, 342, 10, 38, 13, 38, 14, 38, 343, 3, 38, 5, 38, 347, 10, 38, 3,
38, 349, 10, 38, 3, 38, 2, 2, 39, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 38, 2, 2, 39, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32,
24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68,
60, 62, 64, 66, 68, 70, 72, 74, 2, 2, 2, 361, 2, 79, 3, 2, 2, 2, 4, 87, 70, 72, 74, 2, 2, 2, 358, 2, 79, 3, 2, 2, 2, 4, 87, 3, 2, 2, 2, 6, 89,
3, 2, 2, 2, 6, 89, 3, 2, 2, 2, 8, 97, 3, 2, 2, 2, 10, 99, 3, 2, 2, 2, 12, 3, 2, 2, 2, 8, 97, 3, 2, 2, 2, 10, 99, 3, 2, 2, 2, 12, 103, 3, 2, 2, 2,
103, 3, 2, 2, 2, 14, 113, 3, 2, 2, 2, 16, 115, 3, 2, 2, 2, 18, 118, 3, 14, 113, 3, 2, 2, 2, 16, 115, 3, 2, 2, 2, 18, 118, 3, 2, 2, 2, 20, 130,
2, 2, 2, 20, 130, 3, 2, 2, 2, 22, 132, 3, 2, 2, 2, 24, 136, 3, 2, 2, 2, 3, 2, 2, 2, 22, 132, 3, 2, 2, 2, 24, 136, 3, 2, 2, 2, 26, 149, 3, 2, 2,
26, 149, 3, 2, 2, 2, 28, 153, 3, 2, 2, 2, 30, 155, 3, 2, 2, 2, 32, 169, 2, 28, 153, 3, 2, 2, 2, 30, 155, 3, 2, 2, 2, 32, 169, 3, 2, 2, 2, 34, 176,
3, 2, 2, 2, 34, 176, 3, 2, 2, 2, 36, 190, 3, 2, 2, 2, 38, 200, 3, 2, 2, 3, 2, 2, 2, 36, 190, 3, 2, 2, 2, 38, 200, 3, 2, 2, 2, 40, 202, 3, 2, 2,
2, 40, 202, 3, 2, 2, 2, 42, 209, 3, 2, 2, 2, 44, 221, 3, 2, 2, 2, 46, 223, 2, 42, 209, 3, 2, 2, 2, 44, 221, 3, 2, 2, 2, 46, 223, 3, 2, 2, 2, 48, 227,
3, 2, 2, 2, 48, 227, 3, 2, 2, 2, 50, 235, 3, 2, 2, 2, 52, 240, 3, 2, 2, 3, 2, 2, 2, 50, 235, 3, 2, 2, 2, 52, 240, 3, 2, 2, 2, 54, 244, 3, 2, 2,
2, 54, 244, 3, 2, 2, 2, 56, 253, 3, 2, 2, 2, 58, 266, 3, 2, 2, 2, 60, 274, 2, 56, 253, 3, 2, 2, 2, 58, 266, 3, 2, 2, 2, 60, 274, 3, 2, 2, 2, 62, 289,
3, 2, 2, 2, 62, 289, 3, 2, 2, 2, 64, 292, 3, 2, 2, 2, 66, 304, 3, 2, 2, 3, 2, 2, 2, 64, 292, 3, 2, 2, 2, 66, 301, 3, 2, 2, 2, 68, 307, 3, 2, 2,
2, 68, 310, 3, 2, 2, 2, 70, 316, 3, 2, 2, 2, 72, 324, 3, 2, 2, 2, 74, 348, 2, 70, 314, 3, 2, 2, 2, 72, 322, 3, 2, 2, 2, 74, 346, 3, 2, 2, 2, 76, 78,
3, 2, 2, 2, 76, 78, 5, 4, 3, 2, 77, 76, 3, 2, 2, 2, 78, 81, 3, 2, 2, 2, 5, 4, 3, 2, 77, 76, 3, 2, 2, 2, 78, 81, 3, 2, 2, 2, 79, 77, 3, 2, 2, 2,
79, 77, 3, 2, 2, 2, 79, 80, 3, 2, 2, 2, 80, 3, 3, 2, 2, 2, 81, 79, 3, 2, 79, 80, 3, 2, 2, 2, 80, 3, 3, 2, 2, 2, 81, 79, 3, 2, 2, 2, 82, 88, 5, 6,
2, 2, 82, 88, 5, 6, 4, 2, 83, 88, 5, 8, 5, 2, 84, 88, 5, 18, 10, 2, 85, 4, 2, 83, 88, 5, 8, 5, 2, 84, 88, 5, 18, 10, 2, 85, 88, 5, 20, 11, 2, 86,
88, 5, 20, 11, 2, 86, 88, 5, 52, 27, 2, 87, 82, 3, 2, 2, 2, 87, 83, 3, 88, 5, 52, 27, 2, 87, 82, 3, 2, 2, 2, 87, 83, 3, 2, 2, 2, 87, 84, 3, 2,
2, 2, 2, 87, 84, 3, 2, 2, 2, 87, 85, 3, 2, 2, 2, 87, 86, 3, 2, 2, 2, 88, 2, 2, 87, 85, 3, 2, 2, 2, 87, 86, 3, 2, 2, 2, 88, 5, 3, 2, 2, 2, 89, 90,
5, 3, 2, 2, 2, 89, 90, 8, 4, 1, 2, 90, 91, 7, 25, 2, 2, 91, 92, 7, 3, 2, 8, 4, 1, 2, 90, 91, 7, 26, 2, 2, 91, 92, 7, 3, 2, 2, 92, 93, 8, 4, 1, 2,
2, 92, 93, 8, 4, 1, 2, 93, 94, 7, 22, 2, 2, 94, 7, 3, 2, 2, 2, 95, 98, 93, 94, 7, 23, 2, 2, 94, 7, 3, 2, 2, 2, 95, 98, 5, 10, 6, 2, 96, 98, 5,
5, 10, 6, 2, 96, 98, 5, 12, 7, 2, 97, 95, 3, 2, 2, 2, 97, 96, 3, 2, 2, 12, 7, 2, 97, 95, 3, 2, 2, 2, 97, 96, 3, 2, 2, 2, 98, 9, 3, 2, 2, 2, 99,
2, 98, 9, 3, 2, 2, 2, 99, 100, 8, 6, 1, 2, 100, 101, 7, 25, 2, 2, 101, 100, 8, 6, 1, 2, 100, 101, 7, 26, 2, 2, 101, 102, 5, 16, 9, 2, 102, 11,
102, 5, 16, 9, 2, 102, 11, 3, 2, 2, 2, 103, 104, 8, 7, 1, 2, 104, 105, 3, 2, 2, 2, 103, 104, 8, 7, 1, 2, 104, 105, 7, 26, 2, 2, 105, 107, 7, 4,
7, 25, 2, 2, 105, 107, 7, 4, 2, 2, 106, 108, 5, 14, 8, 2, 107, 106, 3, 2, 2, 106, 108, 5, 14, 8, 2, 107, 106, 3, 2, 2, 2, 108, 109, 3, 2, 2, 2,
2, 2, 2, 108, 109, 3, 2, 2, 2, 109, 107, 3, 2, 2, 2, 109, 110, 3, 2, 2, 109, 107, 3, 2, 2, 2, 109, 110, 3, 2, 2, 2, 110, 111, 3, 2, 2, 2, 111,
2, 110, 111, 3, 2, 2, 2, 111, 112, 7, 5, 2, 2, 112, 13, 3, 2, 2, 2, 113, 112, 7, 5, 2, 2, 112, 13, 3, 2, 2, 2, 113, 114, 5, 16, 9, 2, 114, 15, 3,
114, 5, 16, 9, 2, 114, 15, 3, 2, 2, 2, 115, 116, 8, 9, 1, 2, 116, 117, 2, 2, 2, 115, 116, 8, 9, 1, 2, 116, 117, 7, 23, 2, 2, 117, 17, 3, 2, 2,
7, 22, 2, 2, 117, 17, 3, 2, 2, 2, 118, 119, 8, 10, 1, 2, 119, 120, 7, 25, 2, 118, 119, 8, 10, 1, 2, 119, 120, 7, 26, 2, 2, 120, 122, 7, 4, 2, 2,
2, 2, 120, 122, 7, 4, 2, 2, 121, 123, 5, 70, 36, 2, 122, 121, 3, 2, 2, 121, 123, 5, 70, 36, 2, 122, 121, 3, 2, 2, 2, 123, 124, 3, 2, 2, 2, 124,
2, 123, 124, 3, 2, 2, 2, 124, 122, 3, 2, 2, 2, 124, 125, 3, 2, 2, 2, 125, 122, 3, 2, 2, 2, 124, 125, 3, 2, 2, 2, 125, 126, 3, 2, 2, 2, 126, 127,
126, 3, 2, 2, 2, 126, 127, 7, 5, 2, 2, 127, 19, 3, 2, 2, 2, 128, 131, 5, 7, 5, 2, 2, 127, 19, 3, 2, 2, 2, 128, 131, 5, 22, 12, 2, 129, 131, 5, 24,
22, 12, 2, 129, 131, 5, 24, 13, 2, 130, 128, 3, 2, 2, 2, 130, 129, 3, 2, 13, 2, 130, 128, 3, 2, 2, 2, 130, 129, 3, 2, 2, 2, 131, 21, 3, 2, 2, 2,
2, 2, 131, 21, 3, 2, 2, 2, 132, 133, 8, 12, 1, 2, 133, 134, 7, 25, 2, 2, 132, 133, 8, 12, 1, 2, 133, 134, 7, 26, 2, 2, 134, 135, 5, 26, 14, 2, 135,
134, 135, 5, 26, 14, 2, 135, 23, 3, 2, 2, 2, 136, 137, 8, 13, 1, 2, 137, 23, 3, 2, 2, 2, 136, 137, 8, 13, 1, 2, 137, 138, 7, 26, 2, 2, 138, 142,
138, 7, 25, 2, 2, 138, 142, 7, 4, 2, 2, 139, 141, 5, 28, 15, 2, 140, 139, 7, 4, 2, 2, 139, 141, 5, 28, 15, 2, 140, 139, 3, 2, 2, 2, 141, 144, 3,
3, 2, 2, 2, 141, 144, 3, 2, 2, 2, 142, 140, 3, 2, 2, 2, 142, 143, 3, 2, 2, 2, 2, 142, 140, 3, 2, 2, 2, 142, 143, 3, 2, 2, 2, 143, 145, 3, 2, 2,
2, 2, 143, 145, 3, 2, 2, 2, 144, 142, 3, 2, 2, 2, 145, 146, 7, 5, 2, 2, 2, 144, 142, 3, 2, 2, 2, 145, 146, 7, 5, 2, 2, 146, 25, 3, 2, 2, 2, 147,
146, 25, 3, 2, 2, 2, 147, 150, 5, 30, 16, 2, 148, 150, 5, 32, 17, 2, 149, 150, 5, 30, 16, 2, 148, 150, 5, 32, 17, 2, 149, 147, 3, 2, 2, 2, 149, 148,
147, 3, 2, 2, 2, 149, 148, 3, 2, 2, 2, 150, 27, 3, 2, 2, 2, 151, 154, 5, 3, 2, 2, 2, 150, 27, 3, 2, 2, 2, 151, 154, 5, 34, 18, 2, 152, 154, 5, 36,
34, 18, 2, 152, 154, 5, 36, 19, 2, 153, 151, 3, 2, 2, 2, 153, 152, 3, 2, 19, 2, 153, 151, 3, 2, 2, 2, 153, 152, 3, 2, 2, 2, 154, 29, 3, 2, 2, 2,
2, 2, 154, 29, 3, 2, 2, 2, 155, 156, 8, 16, 1, 2, 156, 158, 7, 25, 2, 2, 155, 156, 8, 16, 1, 2, 156, 158, 7, 26, 2, 2, 157, 159, 7, 26, 2, 2, 158,
157, 159, 7, 25, 2, 2, 158, 157, 3, 2, 2, 2, 158, 159, 3, 2, 2, 2, 159, 157, 3, 2, 2, 2, 158, 159, 3, 2, 2, 2, 159, 160, 3, 2, 2, 2, 160, 164,
160, 3, 2, 2, 2, 160, 164, 7, 6, 2, 2, 161, 163, 5, 38, 20, 2, 162, 161, 7, 6, 2, 2, 161, 163, 5, 38, 20, 2, 162, 161, 3, 2, 2, 2, 163, 166, 3,
3, 2, 2, 2, 163, 166, 3, 2, 2, 2, 164, 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 2, 164, 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 167, 3, 2, 2,
2, 2, 165, 167, 3, 2, 2, 2, 166, 164, 3, 2, 2, 2, 167, 168, 7, 7, 2, 2, 2, 166, 164, 3, 2, 2, 2, 167, 168, 7, 7, 2, 2, 168, 31, 3, 2, 2, 2, 169,
168, 31, 3, 2, 2, 2, 169, 170, 8, 17, 1, 2, 170, 172, 7, 25, 2, 2, 171, 170, 8, 17, 1, 2, 170, 172, 7, 26, 2, 2, 171, 173, 7, 3, 2, 2, 172, 171,
173, 7, 3, 2, 2, 172, 171, 3, 2, 2, 2, 172, 173, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, 172, 173, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, 174, 175, 5, 44,
3, 2, 2, 2, 174, 175, 5, 44, 23, 2, 175, 33, 3, 2, 2, 2, 176, 177, 8, 18, 23, 2, 175, 33, 3, 2, 2, 2, 176, 177, 8, 18, 1, 2, 177, 179, 7, 26, 2,
1, 2, 177, 179, 7, 25, 2, 2, 178, 180, 7, 25, 2, 2, 179, 178, 3, 2, 2, 2, 178, 180, 7, 26, 2, 2, 179, 178, 3, 2, 2, 2, 179, 180, 3, 2, 2, 2, 180,
2, 179, 180, 3, 2, 2, 2, 180, 181, 3, 2, 2, 2, 181, 185, 7, 6, 2, 2, 182, 181, 3, 2, 2, 2, 181, 185, 7, 6, 2, 2, 182, 184, 5, 38, 20, 2, 183, 182,
184, 5, 38, 20, 2, 183, 182, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 184, 187, 3, 2, 2, 2, 185, 183, 3, 2, 2, 2, 185, 186, 3, 2,
3, 2, 2, 2, 185, 186, 3, 2, 2, 2, 186, 188, 3, 2, 2, 2, 187, 185, 3, 2, 2, 2, 186, 188, 3, 2, 2, 2, 187, 185, 3, 2, 2, 2, 188, 189, 7, 7, 2, 2,
2, 2, 188, 189, 7, 7, 2, 2, 189, 35, 3, 2, 2, 2, 190, 191, 8, 19, 1, 2, 189, 35, 3, 2, 2, 2, 190, 191, 8, 19, 1, 2, 191, 193, 7, 26, 2, 2, 192,
191, 193, 7, 25, 2, 2, 192, 194, 7, 3, 2, 2, 193, 192, 3, 2, 2, 2, 193, 194, 7, 3, 2, 2, 193, 192, 3, 2, 2, 2, 193, 194, 3, 2, 2, 2, 194, 195,
194, 3, 2, 2, 2, 194, 195, 3, 2, 2, 2, 195, 196, 5, 44, 23, 2, 196, 37, 3, 2, 2, 2, 195, 196, 5, 44, 23, 2, 196, 37, 3, 2, 2, 2, 197, 198, 6, 20,
3, 2, 2, 2, 197, 198, 6, 20, 2, 2, 198, 201, 5, 40, 21, 2, 199, 201, 5, 2, 2, 198, 201, 5, 40, 21, 2, 199, 201, 5, 42, 22, 2, 200, 197, 3, 2, 2,
42, 22, 2, 200, 197, 3, 2, 2, 2, 200, 199, 3, 2, 2, 2, 201, 39, 3, 2, 2, 2, 200, 199, 3, 2, 2, 2, 201, 39, 3, 2, 2, 2, 202, 203, 8, 21, 1, 2, 203,
2, 202, 203, 8, 21, 1, 2, 203, 204, 7, 25, 2, 2, 204, 206, 5, 44, 23, 2, 204, 7, 26, 2, 2, 204, 206, 5, 44, 23, 2, 205, 207, 7, 24, 2, 2, 206, 205,
205, 207, 7, 23, 2, 2, 206, 205, 3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, 3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, 41, 3, 2, 2, 2, 208, 210, 7, 8,
41, 3, 2, 2, 2, 208, 210, 7, 8, 2, 2, 209, 208, 3, 2, 2, 2, 209, 210, 3, 2, 2, 209, 208, 3, 2, 2, 2, 209, 210, 3, 2, 2, 2, 210, 211, 3, 2, 2, 2,
2, 2, 2, 210, 211, 3, 2, 2, 2, 211, 212, 7, 25, 2, 2, 212, 43, 3, 2, 2, 211, 212, 7, 26, 2, 2, 212, 43, 3, 2, 2, 2, 213, 214, 8, 23, 1, 2, 214,
2, 213, 214, 8, 23, 1, 2, 214, 222, 7, 25, 2, 2, 215, 222, 5, 48, 25, 2, 222, 7, 26, 2, 2, 215, 222, 5, 48, 25, 2, 216, 222, 5, 50, 26, 2, 217,
216, 222, 5, 50, 26, 2, 217, 222, 7, 17, 2, 2, 218, 222, 7, 9, 2, 2, 219, 222, 7, 18, 2, 2, 218, 222, 7, 9, 2, 2, 219, 222, 5, 46, 24, 2, 220, 222,
222, 5, 46, 24, 2, 220, 222, 5, 30, 16, 2, 221, 213, 3, 2, 2, 2, 221, 215, 5, 30, 16, 2, 221, 213, 3, 2, 2, 2, 221, 215, 3, 2, 2, 2, 221, 216, 3,
3, 2, 2, 2, 221, 216, 3, 2, 2, 2, 221, 217, 3, 2, 2, 2, 221, 218, 3, 2, 2, 2, 2, 221, 217, 3, 2, 2, 2, 221, 218, 3, 2, 2, 2, 221, 219, 3, 2, 2,
2, 2, 221, 219, 3, 2, 2, 2, 221, 220, 3, 2, 2, 2, 222, 45, 3, 2, 2, 2, 2, 221, 220, 3, 2, 2, 2, 222, 45, 3, 2, 2, 2, 223, 224, 7, 8, 2, 2, 224,
223, 224, 7, 8, 2, 2, 224, 225, 8, 24, 1, 2, 225, 226, 7, 25, 2, 2, 226, 225, 8, 24, 1, 2, 225, 226, 7, 26, 2, 2, 226, 47, 3, 2, 2, 2, 227, 228,
47, 3, 2, 2, 2, 227, 228, 8, 25, 1, 2, 228, 229, 7, 25, 2, 2, 229, 230, 8, 25, 1, 2, 228, 229, 7, 26, 2, 2, 229, 230, 7, 10, 2, 2, 230, 231, 8,
7, 10, 2, 2, 230, 231, 8, 25, 1, 2, 231, 232, 7, 25, 2, 2, 232, 233, 7, 25, 1, 2, 231, 232, 7, 26, 2, 2, 232, 233, 7, 11, 2, 2, 233, 234, 5, 44,
11, 2, 2, 233, 234, 5, 44, 23, 2, 234, 49, 3, 2, 2, 2, 235, 236, 7, 10, 23, 2, 234, 49, 3, 2, 2, 2, 235, 236, 7, 10, 2, 2, 236, 237, 7, 11, 2,
2, 2, 236, 237, 7, 11, 2, 2, 237, 238, 5, 44, 23, 2, 238, 51, 3, 2, 2, 2, 237, 238, 5, 44, 23, 2, 238, 51, 3, 2, 2, 2, 239, 241, 5, 54, 28, 2,
2, 239, 241, 5, 54, 28, 2, 240, 239, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 240, 239, 3, 2, 2, 2, 240, 241, 3, 2, 2, 2, 241, 242, 3, 2, 2, 2, 242,
241, 242, 3, 2, 2, 2, 242, 243, 5, 56, 29, 2, 243, 53, 3, 2, 2, 2, 244, 243, 5, 56, 29, 2, 243, 53, 3, 2, 2, 2, 244, 245, 7, 19, 2, 2, 245, 247,
245, 7, 18, 2, 2, 245, 247, 7, 4, 2, 2, 246, 248, 5, 70, 36, 2, 247, 246, 7, 4, 2, 2, 246, 248, 5, 70, 36, 2, 247, 246, 3, 2, 2, 2, 248, 249, 3,
3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 247, 3, 2, 2, 2, 249, 250, 3, 2, 2, 2, 2, 249, 247, 3, 2, 2, 2, 249, 250, 3, 2, 2, 2, 250, 251, 3, 2, 2,
2, 2, 250, 251, 3, 2, 2, 2, 251, 252, 7, 5, 2, 2, 252, 55, 3, 2, 2, 2, 2, 251, 252, 7, 5, 2, 2, 252, 55, 3, 2, 2, 2, 253, 254, 8, 29, 1, 2, 254,
253, 254, 8, 29, 1, 2, 254, 255, 7, 25, 2, 2, 255, 256, 5, 72, 37, 2, 256, 255, 7, 26, 2, 2, 255, 256, 5, 72, 37, 2, 256, 260, 7, 6, 2, 2, 257, 259,
260, 7, 6, 2, 2, 257, 259, 5, 58, 30, 2, 258, 257, 3, 2, 2, 2, 259, 262, 5, 58, 30, 2, 258, 257, 3, 2, 2, 2, 259, 262, 3, 2, 2, 2, 260, 258, 3,
3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 260, 261, 3, 2, 2, 2, 261, 263, 3, 2, 2, 2, 2, 260, 261, 3, 2, 2, 2, 261, 263, 3, 2, 2, 2, 262, 260, 3, 2, 2,
2, 2, 262, 260, 3, 2, 2, 2, 263, 264, 7, 7, 2, 2, 264, 57, 3, 2, 2, 2, 2, 263, 264, 7, 7, 2, 2, 264, 57, 3, 2, 2, 2, 265, 267, 5, 60, 31, 2, 266,
265, 267, 5, 60, 31, 2, 266, 265, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 265, 3, 2, 2, 2, 266, 267, 3, 2, 2, 2, 267, 270, 3, 2, 2, 2, 268, 271,
270, 3, 2, 2, 2, 268, 271, 5, 54, 28, 2, 269, 271, 5, 62, 32, 2, 270, 268, 5, 54, 28, 2, 269, 271, 5, 62, 32, 2, 270, 268, 3, 2, 2, 2, 270, 269, 3,
3, 2, 2, 2, 270, 269, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 273, 5, 64, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 273, 5, 64, 33, 2, 273, 59, 3, 2, 2,
33, 2, 273, 59, 3, 2, 2, 2, 274, 276, 7, 15, 2, 2, 275, 277, 7, 4, 2, 2, 2, 274, 276, 7, 16, 2, 2, 275, 277, 7, 4, 2, 2, 276, 275, 3, 2, 2, 2, 276,
276, 275, 3, 2, 2, 2, 276, 277, 3, 2, 2, 2, 277, 284, 3, 2, 2, 2, 278, 277, 3, 2, 2, 2, 277, 284, 3, 2, 2, 2, 278, 280, 5, 70, 36, 2, 279, 278,
280, 5, 70, 36, 2, 279, 278, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, 280, 281, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, 281, 282, 3, 2,
3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 285, 3, 2, 2, 2, 283, 285, 7, 22, 2, 2, 282, 285, 3, 2, 2, 2, 283, 285, 7, 23, 2, 2, 284, 279, 3, 2, 2, 2,
2, 2, 284, 279, 3, 2, 2, 2, 284, 283, 3, 2, 2, 2, 285, 287, 3, 2, 2, 2, 284, 283, 3, 2, 2, 2, 285, 287, 3, 2, 2, 2, 286, 288, 7, 5, 2, 2, 287,
286, 288, 7, 5, 2, 2, 287, 286, 3, 2, 2, 2, 287, 288, 3, 2, 2, 2, 288, 286, 3, 2, 2, 2, 287, 288, 3, 2, 2, 2, 288, 61, 3, 2, 2, 2, 289, 290, 7,
61, 3, 2, 2, 2, 289, 290, 7, 16, 2, 2, 290, 291, 7, 25, 2, 2, 291, 63, 17, 2, 2, 290, 291, 7, 26, 2, 2, 291, 63, 3, 2, 2, 2, 292, 293, 8, 33,
3, 2, 2, 2, 292, 293, 8, 33, 1, 2, 293, 294, 7, 25, 2, 2, 294, 296, 5, 1, 2, 293, 294, 7, 26, 2, 2, 294, 296, 5, 74, 38, 2, 295, 297, 5, 66, 34,
74, 38, 2, 295, 297, 5, 66, 34, 2, 296, 295, 3, 2, 2, 2, 296, 297, 3, 2, 2, 296, 295, 3, 2, 2, 2, 296, 297, 3, 2, 2, 2, 297, 299, 3, 2, 2, 2, 298,
2, 2, 297, 299, 3, 2, 2, 2, 298, 300, 7, 25, 2, 2, 299, 298, 3, 2, 2, 2, 300, 5, 68, 35, 2, 299, 298, 3, 2, 2, 2, 299, 300, 3, 2, 2, 2, 300, 65,
299, 300, 3, 2, 2, 2, 300, 302, 3, 2, 2, 2, 301, 303, 5, 68, 35, 2, 302, 3, 2, 2, 2, 301, 303, 7, 4, 2, 2, 302, 304, 7, 26, 2, 2, 303, 302, 3, 2,
301, 3, 2, 2, 2, 302, 303, 3, 2, 2, 2, 303, 65, 3, 2, 2, 2, 304, 306, 7, 2, 2, 303, 304, 3, 2, 2, 2, 304, 305, 3, 2, 2, 2, 305, 306, 7, 5, 2, 2,
4, 2, 2, 305, 307, 7, 25, 2, 2, 306, 305, 3, 2, 2, 2, 306, 307, 3, 2, 2, 306, 67, 3, 2, 2, 2, 307, 308, 7, 12, 2, 2, 308, 310, 7, 4, 2, 2, 309,
2, 307, 308, 3, 2, 2, 2, 308, 309, 7, 5, 2, 2, 309, 67, 3, 2, 2, 2, 310, 311, 5, 44, 23, 2, 310, 309, 3, 2, 2, 2, 310, 311, 3, 2, 2, 2, 311, 312,
312, 7, 4, 2, 2, 311, 313, 5, 44, 23, 2, 312, 311, 3, 2, 2, 2, 312, 313, 3, 2, 2, 2, 312, 313, 7, 5, 2, 2, 313, 69, 3, 2, 2, 2, 314, 315, 7, 26,
3, 2, 2, 2, 313, 314, 3, 2, 2, 2, 314, 315, 7, 5, 2, 2, 315, 69, 3, 2, 2, 2, 315, 316, 8, 36, 1, 2, 316, 317, 7, 25, 2, 2, 317, 71, 3, 2, 2, 2,
2, 2, 316, 317, 7, 25, 2, 2, 317, 318, 8, 36, 1, 2, 318, 319, 7, 24, 2, 318, 320, 7, 26, 2, 2, 319, 321, 7, 13, 2, 2, 320, 319, 3, 2, 2, 2, 320,
2, 319, 71, 3, 2, 2, 2, 320, 322, 7, 25, 2, 2, 321, 323, 7, 12, 2, 2, 322, 321, 3, 2, 2, 2, 321, 323, 3, 2, 2, 2, 322, 318, 3, 2, 2, 2, 323, 324,
321, 3, 2, 2, 2, 322, 323, 3, 2, 2, 2, 323, 325, 3, 2, 2, 2, 324, 320, 3, 2, 2, 2, 324, 322, 3, 2, 2, 2, 324, 325, 3, 2, 2, 2, 325, 73, 3, 2,
3, 2, 2, 2, 325, 326, 3, 2, 2, 2, 326, 324, 3, 2, 2, 2, 326, 327, 3, 2, 2, 2, 326, 327, 7, 14, 2, 2, 327, 332, 7, 26, 2, 2, 328, 329, 7, 13, 2,
2, 2, 327, 73, 3, 2, 2, 2, 328, 329, 7, 13, 2, 2, 329, 334, 7, 25, 2, 2, 2, 329, 331, 7, 26, 2, 2, 330, 328, 3, 2, 2, 2, 331, 334, 3, 2, 2, 2, 332,
330, 331, 7, 12, 2, 2, 331, 333, 7, 25, 2, 2, 332, 330, 3, 2, 2, 2, 333, 330, 3, 2, 2, 2, 332, 333, 3, 2, 2, 2, 333, 342, 3, 2, 2, 2, 334, 332,
336, 3, 2, 2, 2, 334, 332, 3, 2, 2, 2, 334, 335, 3, 2, 2, 2, 335, 344, 3, 2, 2, 2, 335, 336, 7, 15, 2, 2, 336, 339, 7, 26, 2, 2, 337, 338, 7,
3, 2, 2, 2, 336, 334, 3, 2, 2, 2, 337, 338, 7, 14, 2, 2, 338, 341, 7, 25, 13, 2, 2, 338, 340, 7, 26, 2, 2, 339, 337, 3, 2, 2, 2, 339, 340, 3, 2,
2, 2, 339, 340, 7, 12, 2, 2, 340, 342, 7, 25, 2, 2, 341, 339, 3, 2, 2, 2, 2, 340, 342, 3, 2, 2, 2, 341, 326, 3, 2, 2, 2, 341, 335, 3, 2, 2, 2,
2, 341, 342, 3, 2, 2, 2, 342, 344, 3, 2, 2, 2, 343, 328, 3, 2, 2, 2, 343, 342, 343, 3, 2, 2, 2, 343, 341, 3, 2, 2, 2, 343, 344, 3, 2, 2, 2, 344,
337, 3, 2, 2, 2, 344, 345, 3, 2, 2, 2, 345, 343, 3, 2, 2, 2, 345, 346, 347, 3, 2, 2, 2, 345, 347, 7, 14, 2, 2, 346, 341, 3, 2, 2, 2, 346, 345,
3, 2, 2, 2, 346, 349, 3, 2, 2, 2, 347, 349, 7, 13, 2, 2, 348, 343, 3, 2, 3, 2, 2, 2, 347, 75, 3, 2, 2, 2, 41, 79, 87, 97, 109, 124, 130, 142, 149,
2, 2, 348, 347, 3, 2, 2, 2, 349, 75, 3, 2, 2, 2, 42, 79, 87, 97, 109, 124, 153, 158, 164, 172, 179, 185, 193, 200, 206, 209, 221, 240, 249, 260, 266,
130, 142, 149, 153, 158, 164, 172, 179, 185, 193, 200, 206, 209, 221, 240, 270, 276, 281, 284, 287, 296, 299, 303, 310, 320, 324, 332, 339, 341, 343,
249, 260, 266, 270, 276, 281, 284, 287, 296, 299, 302, 306, 312, 322, 326, 346,
334, 341, 343, 345, 348,
} }
var literalNames = []string{ var literalNames = []string{
"", "'='", "'('", "')'", "'{'", "'}'", "'*'", "'time.Time'", "'['", "']'", "", "'='", "'('", "')'", "'{'", "'}'", "'*'", "'time.Time'", "'['", "']'",
"'-'", "'/'", "'/:'", "'@doc'", "'@handler'", "'interface{}'", "'@server'", "'returns'", "'-'", "'/'", "'/:'", "'@doc'", "'@handler'", "'interface{}'",
"'@server'",
} }
var symbolicNames = []string{ var symbolicNames = []string{
"", "", "", "", "", "", "", "", "", "", "", "", "", "ATDOC", "ATHANDLER", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "ATDOC", "ATHANDLER",
"INTERFACE", "ATSERVER", "WS", "COMMENT", "LINE_COMMENT", "STRING", "RAW_STRING", "INTERFACE", "ATSERVER", "WS", "COMMENT", "LINE_COMMENT", "STRING", "RAW_STRING",
"LINE_VALUE", "ID", "LINE_VALUE", "ID",
} }
@@ -185,7 +186,6 @@ var ruleNames = []string{
"arrayType", "serviceSpec", "atServer", "serviceApi", "serviceRoute", "atDoc", "arrayType", "serviceSpec", "atServer", "serviceApi", "serviceRoute", "atDoc",
"atHandler", "route", "body", "replybody", "kvLit", "serviceName", "path", "atHandler", "route", "body", "replybody", "kvLit", "serviceName", "path",
} }
type ApiParserParser struct { type ApiParserParser struct {
*antlr.BaseParser *antlr.BaseParser
} }
@@ -215,6 +215,7 @@ func NewApiParserParser(input antlr.TokenStream) *ApiParserParser {
return this return this
} }
// ApiParserParser tokens. // ApiParserParser tokens.
const ( const (
ApiParserParserEOF = antlr.TokenEOF ApiParserParserEOF = antlr.TokenEOF
@@ -230,17 +231,18 @@ const (
ApiParserParserT__9 = 10 ApiParserParserT__9 = 10
ApiParserParserT__10 = 11 ApiParserParserT__10 = 11
ApiParserParserT__11 = 12 ApiParserParserT__11 = 12
ApiParserParserATDOC = 13 ApiParserParserT__12 = 13
ApiParserParserATHANDLER = 14 ApiParserParserATDOC = 14
ApiParserParserINTERFACE = 15 ApiParserParserATHANDLER = 15
ApiParserParserATSERVER = 16 ApiParserParserINTERFACE = 16
ApiParserParserWS = 17 ApiParserParserATSERVER = 17
ApiParserParserCOMMENT = 18 ApiParserParserWS = 18
ApiParserParserLINE_COMMENT = 19 ApiParserParserCOMMENT = 19
ApiParserParserSTRING = 20 ApiParserParserLINE_COMMENT = 20
ApiParserParserRAW_STRING = 21 ApiParserParserSTRING = 21
ApiParserParserLINE_VALUE = 22 ApiParserParserRAW_STRING = 22
ApiParserParserID = 23 ApiParserParserLINE_VALUE = 23
ApiParserParserID = 24
) )
// ApiParserParser rules. // ApiParserParser rules.
@@ -353,6 +355,7 @@ func (s *ApiContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) st
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *ApiContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *ApiContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -363,11 +366,15 @@ func (s *ApiContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) Api() (localctx IApiContext) { func (p *ApiParserParser) Api() (localctx IApiContext) {
localctx = NewApiContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewApiContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 0, ApiParserParserRULE_api) p.EnterRule(localctx, 0, ApiParserParserRULE_api)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -389,20 +396,25 @@ func (p *ApiParserParser) Api() (localctx IApiContext) {
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
for _la == ApiParserParserATSERVER || _la == ApiParserParserID { for _la == ApiParserParserATSERVER || _la == ApiParserParserID {
{ {
p.SetState(74) p.SetState(74)
p.Spec() p.Spec()
} }
p.SetState(79) p.SetState(79)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
} }
return localctx return localctx
} }
// ISpecContext is an interface to support dynamic dispatch. // ISpecContext is an interface to support dynamic dispatch.
type ISpecContext interface { type ISpecContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -499,6 +511,7 @@ func (s *SpecContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) s
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *SpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *SpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -509,6 +522,9 @@ func (s *SpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) Spec() (localctx ISpecContext) { func (p *ApiParserParser) Spec() (localctx ISpecContext) {
localctx = NewSpecContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewSpecContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 2, ApiParserParserRULE_spec) p.EnterRule(localctx, 2, ApiParserParserRULE_spec)
@@ -539,6 +555,7 @@ func (p *ApiParserParser) Spec() (localctx ISpecContext) {
p.SyntaxLit() p.SyntaxLit()
} }
case 2: case 2:
p.EnterOuterAlt(localctx, 2) p.EnterOuterAlt(localctx, 2)
{ {
@@ -546,6 +563,7 @@ func (p *ApiParserParser) Spec() (localctx ISpecContext) {
p.ImportSpec() p.ImportSpec()
} }
case 3: case 3:
p.EnterOuterAlt(localctx, 3) p.EnterOuterAlt(localctx, 3)
{ {
@@ -553,6 +571,7 @@ func (p *ApiParserParser) Spec() (localctx ISpecContext) {
p.InfoSpec() p.InfoSpec()
} }
case 4: case 4:
p.EnterOuterAlt(localctx, 4) p.EnterOuterAlt(localctx, 4)
{ {
@@ -560,6 +579,7 @@ func (p *ApiParserParser) Spec() (localctx ISpecContext) {
p.TypeSpec() p.TypeSpec()
} }
case 5: case 5:
p.EnterOuterAlt(localctx, 5) p.EnterOuterAlt(localctx, 5)
{ {
@@ -569,9 +589,11 @@ func (p *ApiParserParser) Spec() (localctx ISpecContext) {
} }
return localctx return localctx
} }
// ISyntaxLitContext is an interface to support dynamic dispatch. // ISyntaxLitContext is an interface to support dynamic dispatch.
type ISyntaxLitContext interface { type ISyntaxLitContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -588,6 +610,7 @@ type ISyntaxLitContext interface {
// GetVersion returns the version token. // GetVersion returns the version token.
GetVersion() antlr.Token GetVersion() antlr.Token
// SetSyntaxToken sets the syntaxToken token. // SetSyntaxToken sets the syntaxToken token.
SetSyntaxToken(antlr.Token) SetSyntaxToken(antlr.Token)
@@ -597,6 +620,7 @@ type ISyntaxLitContext interface {
// SetVersion sets the version token. // SetVersion sets the version token.
SetVersion(antlr.Token) SetVersion(antlr.Token)
// IsSyntaxLitContext differentiates from other interfaces. // IsSyntaxLitContext differentiates from other interfaces.
IsSyntaxLitContext() IsSyntaxLitContext()
} }

View File

@@ -18,12 +18,14 @@ func (s *SyntaxLitContext) GetAssign() antlr.Token { return s.assign }
func (s *SyntaxLitContext) GetVersion() antlr.Token { return s.version } func (s *SyntaxLitContext) GetVersion() antlr.Token { return s.version }
func (s *SyntaxLitContext) SetSyntaxToken(v antlr.Token) { s.syntaxToken = v } func (s *SyntaxLitContext) SetSyntaxToken(v antlr.Token) { s.syntaxToken = v }
func (s *SyntaxLitContext) SetAssign(v antlr.Token) { s.assign = v } func (s *SyntaxLitContext) SetAssign(v antlr.Token) { s.assign = v }
func (s *SyntaxLitContext) SetVersion(v antlr.Token) { s.version = v } func (s *SyntaxLitContext) SetVersion(v antlr.Token) { s.version = v }
func (s *SyntaxLitContext) ID() antlr.TerminalNode { func (s *SyntaxLitContext) ID() antlr.TerminalNode {
return s.GetToken(ApiParserParserID, 0) return s.GetToken(ApiParserParserID, 0)
} }
@@ -40,6 +42,7 @@ func (s *SyntaxLitContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *SyntaxLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *SyntaxLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -50,6 +53,9 @@ func (s *SyntaxLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) SyntaxLit() (localctx ISyntaxLitContext) { func (p *ApiParserParser) SyntaxLit() (localctx ISyntaxLitContext) {
localctx = NewSyntaxLitContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewSyntaxLitContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 4, ApiParserParserRULE_syntaxLit) p.EnterRule(localctx, 4, ApiParserParserRULE_syntaxLit)
@@ -95,9 +101,12 @@ func (p *ApiParserParser) SyntaxLit() (localctx ISyntaxLitContext) {
localctx.(*SyntaxLitContext).version = _m localctx.(*SyntaxLitContext).version = _m
} }
return localctx return localctx
} }
// IImportSpecContext is an interface to support dynamic dispatch. // IImportSpecContext is an interface to support dynamic dispatch.
type IImportSpecContext interface { type IImportSpecContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -164,6 +173,7 @@ func (s *ImportSpecContext) ToStringTree(ruleNames []string, recog antlr.Recogni
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *ImportSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *ImportSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -174,6 +184,9 @@ func (s *ImportSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) ImportSpec() (localctx IImportSpecContext) { func (p *ApiParserParser) ImportSpec() (localctx IImportSpecContext) {
localctx = NewImportSpecContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewImportSpecContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 6, ApiParserParserRULE_importSpec) p.EnterRule(localctx, 6, ApiParserParserRULE_importSpec)
@@ -204,6 +217,7 @@ func (p *ApiParserParser) ImportSpec() (localctx IImportSpecContext) {
p.ImportLit() p.ImportLit()
} }
case 2: case 2:
p.EnterOuterAlt(localctx, 2) p.EnterOuterAlt(localctx, 2)
{ {
@@ -213,9 +227,11 @@ func (p *ApiParserParser) ImportSpec() (localctx IImportSpecContext) {
} }
return localctx return localctx
} }
// IImportLitContext is an interface to support dynamic dispatch. // IImportLitContext is an interface to support dynamic dispatch.
type IImportLitContext interface { type IImportLitContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -226,9 +242,11 @@ type IImportLitContext interface {
// GetImportToken returns the importToken token. // GetImportToken returns the importToken token.
GetImportToken() antlr.Token GetImportToken() antlr.Token
// SetImportToken sets the importToken token. // SetImportToken sets the importToken token.
SetImportToken(antlr.Token) SetImportToken(antlr.Token)
// IsImportLitContext differentiates from other interfaces. // IsImportLitContext differentiates from other interfaces.
IsImportLitContext() IsImportLitContext()
} }
@@ -263,8 +281,10 @@ func (s *ImportLitContext) GetParser() antlr.Parser { return s.parser }
func (s *ImportLitContext) GetImportToken() antlr.Token { return s.importToken } func (s *ImportLitContext) GetImportToken() antlr.Token { return s.importToken }
func (s *ImportLitContext) SetImportToken(v antlr.Token) { s.importToken = v } func (s *ImportLitContext) SetImportToken(v antlr.Token) { s.importToken = v }
func (s *ImportLitContext) ImportValue() IImportValueContext { func (s *ImportLitContext) ImportValue() IImportValueContext {
var t = s.GetTypedRuleContext(reflect.TypeOf((*IImportValueContext)(nil)).Elem(), 0) var t = s.GetTypedRuleContext(reflect.TypeOf((*IImportValueContext)(nil)).Elem(), 0)
@@ -287,6 +307,7 @@ func (s *ImportLitContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *ImportLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *ImportLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -297,6 +318,9 @@ func (s *ImportLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) ImportLit() (localctx IImportLitContext) { func (p *ApiParserParser) ImportLit() (localctx IImportLitContext) {
localctx = NewImportLitContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewImportLitContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 8, ApiParserParserRULE_importLit) p.EnterRule(localctx, 8, ApiParserParserRULE_importLit)
@@ -331,9 +355,12 @@ func (p *ApiParserParser) ImportLit() (localctx IImportLitContext) {
p.ImportValue() p.ImportValue()
} }
return localctx return localctx
} }
// IImportBlockContext is an interface to support dynamic dispatch. // IImportBlockContext is an interface to support dynamic dispatch.
type IImportBlockContext interface { type IImportBlockContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -344,9 +371,11 @@ type IImportBlockContext interface {
// GetImportToken returns the importToken token. // GetImportToken returns the importToken token.
GetImportToken() antlr.Token GetImportToken() antlr.Token
// SetImportToken sets the importToken token. // SetImportToken sets the importToken token.
SetImportToken(antlr.Token) SetImportToken(antlr.Token)
// IsImportBlockContext differentiates from other interfaces. // IsImportBlockContext differentiates from other interfaces.
IsImportBlockContext() IsImportBlockContext()
} }
@@ -381,8 +410,10 @@ func (s *ImportBlockContext) GetParser() antlr.Parser { return s.parser }
func (s *ImportBlockContext) GetImportToken() antlr.Token { return s.importToken } func (s *ImportBlockContext) GetImportToken() antlr.Token { return s.importToken }
func (s *ImportBlockContext) SetImportToken(v antlr.Token) { s.importToken = v } func (s *ImportBlockContext) SetImportToken(v antlr.Token) { s.importToken = v }
func (s *ImportBlockContext) ID() antlr.TerminalNode { func (s *ImportBlockContext) ID() antlr.TerminalNode {
return s.GetToken(ApiParserParserID, 0) return s.GetToken(ApiParserParserID, 0)
} }
@@ -418,6 +449,7 @@ func (s *ImportBlockContext) ToStringTree(ruleNames []string, recog antlr.Recogn
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *ImportBlockContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *ImportBlockContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -428,11 +460,15 @@ func (s *ImportBlockContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
} }
} }
func (p *ApiParserParser) ImportBlock() (localctx IImportBlockContext) { func (p *ApiParserParser) ImportBlock() (localctx IImportBlockContext) {
localctx = NewImportBlockContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewImportBlockContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 10, ApiParserParserRULE_importBlock) p.EnterRule(localctx, 10, ApiParserParserRULE_importBlock)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -471,6 +507,7 @@ func (p *ApiParserParser) ImportBlock() (localctx IImportBlockContext) {
p.ImportBlockValue() p.ImportBlockValue()
} }
p.SetState(107) p.SetState(107)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
@@ -480,9 +517,12 @@ func (p *ApiParserParser) ImportBlock() (localctx IImportBlockContext) {
p.Match(ApiParserParserT__2) p.Match(ApiParserParserT__2)
} }
return localctx return localctx
} }
// IImportBlockValueContext is an interface to support dynamic dispatch. // IImportBlockValueContext is an interface to support dynamic dispatch.
type IImportBlockValueContext interface { type IImportBlockValueContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -539,6 +579,7 @@ func (s *ImportBlockValueContext) ToStringTree(ruleNames []string, recog antlr.R
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *ImportBlockValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *ImportBlockValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -549,6 +590,9 @@ func (s *ImportBlockValueContext) Accept(visitor antlr.ParseTreeVisitor) interfa
} }
} }
func (p *ApiParserParser) ImportBlockValue() (localctx IImportBlockValueContext) { func (p *ApiParserParser) ImportBlockValue() (localctx IImportBlockValueContext) {
localctx = NewImportBlockValueContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewImportBlockValueContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 12, ApiParserParserRULE_importBlockValue) p.EnterRule(localctx, 12, ApiParserParserRULE_importBlockValue)
@@ -575,9 +619,12 @@ func (p *ApiParserParser) ImportBlockValue() (localctx IImportBlockValueContext)
p.ImportValue() p.ImportValue()
} }
return localctx return localctx
} }
// IImportValueContext is an interface to support dynamic dispatch. // IImportValueContext is an interface to support dynamic dispatch.
type IImportValueContext interface { type IImportValueContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext

View File

@@ -24,6 +24,7 @@ func (s *ImportValueContext) ToStringTree(ruleNames []string, recog antlr.Recogn
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *ImportValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *ImportValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -34,6 +35,9 @@ func (s *ImportValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
} }
} }
func (p *ApiParserParser) ImportValue() (localctx IImportValueContext) { func (p *ApiParserParser) ImportValue() (localctx IImportValueContext) {
localctx = NewImportValueContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewImportValueContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 14, ApiParserParserRULE_importValue) p.EnterRule(localctx, 14, ApiParserParserRULE_importValue)
@@ -61,9 +65,12 @@ func (p *ApiParserParser) ImportValue() (localctx IImportValueContext) {
p.Match(ApiParserParserSTRING) p.Match(ApiParserParserSTRING)
} }
return localctx return localctx
} }
// IInfoSpecContext is an interface to support dynamic dispatch. // IInfoSpecContext is an interface to support dynamic dispatch.
type IInfoSpecContext interface { type IInfoSpecContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -80,6 +87,7 @@ type IInfoSpecContext interface {
// GetRp returns the rp token. // GetRp returns the rp token.
GetRp() antlr.Token GetRp() antlr.Token
// SetInfoToken sets the infoToken token. // SetInfoToken sets the infoToken token.
SetInfoToken(antlr.Token) SetInfoToken(antlr.Token)
@@ -89,6 +97,7 @@ type IInfoSpecContext interface {
// SetRp sets the rp token. // SetRp sets the rp token.
SetRp(antlr.Token) SetRp(antlr.Token)
// IsInfoSpecContext differentiates from other interfaces. // IsInfoSpecContext differentiates from other interfaces.
IsInfoSpecContext() IsInfoSpecContext()
} }
@@ -129,12 +138,14 @@ func (s *InfoSpecContext) GetLp() antlr.Token { return s.lp }
func (s *InfoSpecContext) GetRp() antlr.Token { return s.rp } func (s *InfoSpecContext) GetRp() antlr.Token { return s.rp }
func (s *InfoSpecContext) SetInfoToken(v antlr.Token) { s.infoToken = v } func (s *InfoSpecContext) SetInfoToken(v antlr.Token) { s.infoToken = v }
func (s *InfoSpecContext) SetLp(v antlr.Token) { s.lp = v } func (s *InfoSpecContext) SetLp(v antlr.Token) { s.lp = v }
func (s *InfoSpecContext) SetRp(v antlr.Token) { s.rp = v } func (s *InfoSpecContext) SetRp(v antlr.Token) { s.rp = v }
func (s *InfoSpecContext) ID() antlr.TerminalNode { func (s *InfoSpecContext) ID() antlr.TerminalNode {
return s.GetToken(ApiParserParserID, 0) return s.GetToken(ApiParserParserID, 0)
} }
@@ -170,6 +181,7 @@ func (s *InfoSpecContext) ToStringTree(ruleNames []string, recog antlr.Recognize
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *InfoSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *InfoSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -180,11 +192,15 @@ func (s *InfoSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) InfoSpec() (localctx IInfoSpecContext) { func (p *ApiParserParser) InfoSpec() (localctx IInfoSpecContext) {
localctx = NewInfoSpecContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewInfoSpecContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 16, ApiParserParserRULE_infoSpec) p.EnterRule(localctx, 16, ApiParserParserRULE_infoSpec)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -226,6 +242,7 @@ func (p *ApiParserParser) InfoSpec() (localctx IInfoSpecContext) {
p.KvLit() p.KvLit()
} }
p.SetState(122) p.SetState(122)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
@@ -238,9 +255,12 @@ func (p *ApiParserParser) InfoSpec() (localctx IInfoSpecContext) {
localctx.(*InfoSpecContext).rp = _m localctx.(*InfoSpecContext).rp = _m
} }
return localctx return localctx
} }
// ITypeSpecContext is an interface to support dynamic dispatch. // ITypeSpecContext is an interface to support dynamic dispatch.
type ITypeSpecContext interface { type ITypeSpecContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -307,6 +327,7 @@ func (s *TypeSpecContext) ToStringTree(ruleNames []string, recog antlr.Recognize
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *TypeSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *TypeSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -317,6 +338,9 @@ func (s *TypeSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) TypeSpec() (localctx ITypeSpecContext) { func (p *ApiParserParser) TypeSpec() (localctx ITypeSpecContext) {
localctx = NewTypeSpecContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewTypeSpecContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 18, ApiParserParserRULE_typeSpec) p.EnterRule(localctx, 18, ApiParserParserRULE_typeSpec)
@@ -347,6 +371,7 @@ func (p *ApiParserParser) TypeSpec() (localctx ITypeSpecContext) {
p.TypeLit() p.TypeLit()
} }
case 2: case 2:
p.EnterOuterAlt(localctx, 2) p.EnterOuterAlt(localctx, 2)
{ {
@@ -356,9 +381,11 @@ func (p *ApiParserParser) TypeSpec() (localctx ITypeSpecContext) {
} }
return localctx return localctx
} }
// ITypeLitContext is an interface to support dynamic dispatch. // ITypeLitContext is an interface to support dynamic dispatch.
type ITypeLitContext interface { type ITypeLitContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -369,9 +396,11 @@ type ITypeLitContext interface {
// GetTypeToken returns the typeToken token. // GetTypeToken returns the typeToken token.
GetTypeToken() antlr.Token GetTypeToken() antlr.Token
// SetTypeToken sets the typeToken token. // SetTypeToken sets the typeToken token.
SetTypeToken(antlr.Token) SetTypeToken(antlr.Token)
// IsTypeLitContext differentiates from other interfaces. // IsTypeLitContext differentiates from other interfaces.
IsTypeLitContext() IsTypeLitContext()
} }
@@ -406,8 +435,10 @@ func (s *TypeLitContext) GetParser() antlr.Parser { return s.parser }
func (s *TypeLitContext) GetTypeToken() antlr.Token { return s.typeToken } func (s *TypeLitContext) GetTypeToken() antlr.Token { return s.typeToken }
func (s *TypeLitContext) SetTypeToken(v antlr.Token) { s.typeToken = v } func (s *TypeLitContext) SetTypeToken(v antlr.Token) { s.typeToken = v }
func (s *TypeLitContext) TypeLitBody() ITypeLitBodyContext { func (s *TypeLitContext) TypeLitBody() ITypeLitBodyContext {
var t = s.GetTypedRuleContext(reflect.TypeOf((*ITypeLitBodyContext)(nil)).Elem(), 0) var t = s.GetTypedRuleContext(reflect.TypeOf((*ITypeLitBodyContext)(nil)).Elem(), 0)
@@ -430,6 +461,7 @@ func (s *TypeLitContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *TypeLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *TypeLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -440,6 +472,9 @@ func (s *TypeLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) TypeLit() (localctx ITypeLitContext) { func (p *ApiParserParser) TypeLit() (localctx ITypeLitContext) {
localctx = NewTypeLitContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewTypeLitContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 20, ApiParserParserRULE_typeLit) p.EnterRule(localctx, 20, ApiParserParserRULE_typeLit)
@@ -474,9 +509,12 @@ func (p *ApiParserParser) TypeLit() (localctx ITypeLitContext) {
p.TypeLitBody() p.TypeLitBody()
} }
return localctx return localctx
} }
// ITypeBlockContext is an interface to support dynamic dispatch. // ITypeBlockContext is an interface to support dynamic dispatch.
type ITypeBlockContext interface { type ITypeBlockContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -493,6 +531,7 @@ type ITypeBlockContext interface {
// GetRp returns the rp token. // GetRp returns the rp token.
GetRp() antlr.Token GetRp() antlr.Token
// SetTypeToken sets the typeToken token. // SetTypeToken sets the typeToken token.
SetTypeToken(antlr.Token) SetTypeToken(antlr.Token)
@@ -502,6 +541,7 @@ type ITypeBlockContext interface {
// SetRp sets the rp token. // SetRp sets the rp token.
SetRp(antlr.Token) SetRp(antlr.Token)
// IsTypeBlockContext differentiates from other interfaces. // IsTypeBlockContext differentiates from other interfaces.
IsTypeBlockContext() IsTypeBlockContext()
} }
@@ -542,12 +582,14 @@ func (s *TypeBlockContext) GetLp() antlr.Token { return s.lp }
func (s *TypeBlockContext) GetRp() antlr.Token { return s.rp } func (s *TypeBlockContext) GetRp() antlr.Token { return s.rp }
func (s *TypeBlockContext) SetTypeToken(v antlr.Token) { s.typeToken = v } func (s *TypeBlockContext) SetTypeToken(v antlr.Token) { s.typeToken = v }
func (s *TypeBlockContext) SetLp(v antlr.Token) { s.lp = v } func (s *TypeBlockContext) SetLp(v antlr.Token) { s.lp = v }
func (s *TypeBlockContext) SetRp(v antlr.Token) { s.rp = v } func (s *TypeBlockContext) SetRp(v antlr.Token) { s.rp = v }
func (s *TypeBlockContext) ID() antlr.TerminalNode { func (s *TypeBlockContext) ID() antlr.TerminalNode {
return s.GetToken(ApiParserParserID, 0) return s.GetToken(ApiParserParserID, 0)
} }
@@ -583,6 +625,7 @@ func (s *TypeBlockContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *TypeBlockContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *TypeBlockContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -593,11 +636,15 @@ func (s *TypeBlockContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) TypeBlock() (localctx ITypeBlockContext) { func (p *ApiParserParser) TypeBlock() (localctx ITypeBlockContext) {
localctx = NewTypeBlockContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewTypeBlockContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 22, ApiParserParserRULE_typeBlock) p.EnterRule(localctx, 22, ApiParserParserRULE_typeBlock)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -634,12 +681,14 @@ func (p *ApiParserParser) TypeBlock() (localctx ITypeBlockContext) {
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
for _la == ApiParserParserID { for _la == ApiParserParserID {
{ {
p.SetState(137) p.SetState(137)
p.TypeBlockBody() p.TypeBlockBody()
} }
p.SetState(142) p.SetState(142)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
@@ -652,5 +701,7 @@ func (p *ApiParserParser) TypeBlock() (localctx ITypeBlockContext) {
localctx.(*TypeBlockContext).rp = _m localctx.(*TypeBlockContext).rp = _m
} }
return localctx return localctx
} }

View File

@@ -10,6 +10,7 @@ import (
// The apiparser_parser.go file was split into multiple files because it // The apiparser_parser.go file was split into multiple files because it
// was too large and caused a possible memory overflow during goctl installation. // was too large and caused a possible memory overflow during goctl installation.
// ITypeLitBodyContext is an interface to support dynamic dispatch. // ITypeLitBodyContext is an interface to support dynamic dispatch.
type ITypeLitBodyContext interface { type ITypeLitBodyContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -76,6 +77,7 @@ func (s *TypeLitBodyContext) ToStringTree(ruleNames []string, recog antlr.Recogn
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *TypeLitBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *TypeLitBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -86,6 +88,9 @@ func (s *TypeLitBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
} }
} }
func (p *ApiParserParser) TypeLitBody() (localctx ITypeLitBodyContext) { func (p *ApiParserParser) TypeLitBody() (localctx ITypeLitBodyContext) {
localctx = NewTypeLitBodyContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewTypeLitBodyContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 24, ApiParserParserRULE_typeLitBody) p.EnterRule(localctx, 24, ApiParserParserRULE_typeLitBody)
@@ -116,6 +121,7 @@ func (p *ApiParserParser) TypeLitBody() (localctx ITypeLitBodyContext) {
p.TypeStruct() p.TypeStruct()
} }
case 2: case 2:
p.EnterOuterAlt(localctx, 2) p.EnterOuterAlt(localctx, 2)
{ {
@@ -125,9 +131,11 @@ func (p *ApiParserParser) TypeLitBody() (localctx ITypeLitBodyContext) {
} }
return localctx return localctx
} }
// ITypeBlockBodyContext is an interface to support dynamic dispatch. // ITypeBlockBodyContext is an interface to support dynamic dispatch.
type ITypeBlockBodyContext interface { type ITypeBlockBodyContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -194,6 +202,7 @@ func (s *TypeBlockBodyContext) ToStringTree(ruleNames []string, recog antlr.Reco
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *TypeBlockBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *TypeBlockBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -204,6 +213,9 @@ func (s *TypeBlockBodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{
} }
} }
func (p *ApiParserParser) TypeBlockBody() (localctx ITypeBlockBodyContext) { func (p *ApiParserParser) TypeBlockBody() (localctx ITypeBlockBodyContext) {
localctx = NewTypeBlockBodyContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewTypeBlockBodyContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 26, ApiParserParserRULE_typeBlockBody) p.EnterRule(localctx, 26, ApiParserParserRULE_typeBlockBody)
@@ -234,6 +246,7 @@ func (p *ApiParserParser) TypeBlockBody() (localctx ITypeBlockBodyContext) {
p.TypeBlockStruct() p.TypeBlockStruct()
} }
case 2: case 2:
p.EnterOuterAlt(localctx, 2) p.EnterOuterAlt(localctx, 2)
{ {
@@ -243,9 +256,11 @@ func (p *ApiParserParser) TypeBlockBody() (localctx ITypeBlockBodyContext) {
} }
return localctx return localctx
} }
// ITypeStructContext is an interface to support dynamic dispatch. // ITypeStructContext is an interface to support dynamic dispatch.
type ITypeStructContext interface { type ITypeStructContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -265,6 +280,7 @@ type ITypeStructContext interface {
// GetRbrace returns the rbrace token. // GetRbrace returns the rbrace token.
GetRbrace() antlr.Token GetRbrace() antlr.Token
// SetStructName sets the structName token. // SetStructName sets the structName token.
SetStructName(antlr.Token) SetStructName(antlr.Token)
@@ -277,6 +293,7 @@ type ITypeStructContext interface {
// SetRbrace sets the rbrace token. // SetRbrace sets the rbrace token.
SetRbrace(antlr.Token) SetRbrace(antlr.Token)
// IsTypeStructContext differentiates from other interfaces. // IsTypeStructContext differentiates from other interfaces.
IsTypeStructContext() IsTypeStructContext()
} }
@@ -320,6 +337,7 @@ func (s *TypeStructContext) GetLbrace() antlr.Token { return s.lbrace }
func (s *TypeStructContext) GetRbrace() antlr.Token { return s.rbrace } func (s *TypeStructContext) GetRbrace() antlr.Token { return s.rbrace }
func (s *TypeStructContext) SetStructName(v antlr.Token) { s.structName = v } func (s *TypeStructContext) SetStructName(v antlr.Token) { s.structName = v }
func (s *TypeStructContext) SetStructToken(v antlr.Token) { s.structToken = v } func (s *TypeStructContext) SetStructToken(v antlr.Token) { s.structToken = v }
@@ -328,6 +346,7 @@ func (s *TypeStructContext) SetLbrace(v antlr.Token) { s.lbrace = v }
func (s *TypeStructContext) SetRbrace(v antlr.Token) { s.rbrace = v } func (s *TypeStructContext) SetRbrace(v antlr.Token) { s.rbrace = v }
func (s *TypeStructContext) AllID() []antlr.TerminalNode { func (s *TypeStructContext) AllID() []antlr.TerminalNode {
return s.GetTokens(ApiParserParserID) return s.GetTokens(ApiParserParserID)
} }
@@ -367,6 +386,7 @@ func (s *TypeStructContext) ToStringTree(ruleNames []string, recog antlr.Recogni
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *TypeStructContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *TypeStructContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -377,11 +397,15 @@ func (s *TypeStructContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) TypeStruct() (localctx ITypeStructContext) { func (p *ApiParserParser) TypeStruct() (localctx ITypeStructContext) {
localctx = NewTypeStructContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewTypeStructContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 28, ApiParserParserRULE_typeStruct) p.EnterRule(localctx, 28, ApiParserParserRULE_typeStruct)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -413,6 +437,7 @@ func (p *ApiParserParser) TypeStruct() (localctx ITypeStructContext) {
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
if _la == ApiParserParserID { if _la == ApiParserParserID {
{ {
p.SetState(155) p.SetState(155)
@@ -441,6 +466,7 @@ func (p *ApiParserParser) TypeStruct() (localctx ITypeStructContext) {
p.Field() p.Field()
} }
} }
p.SetState(164) p.SetState(164)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
@@ -454,9 +480,12 @@ func (p *ApiParserParser) TypeStruct() (localctx ITypeStructContext) {
localctx.(*TypeStructContext).rbrace = _m localctx.(*TypeStructContext).rbrace = _m
} }
return localctx return localctx
} }
// ITypeAliasContext is an interface to support dynamic dispatch. // ITypeAliasContext is an interface to support dynamic dispatch.
type ITypeAliasContext interface { type ITypeAliasContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -470,12 +499,14 @@ type ITypeAliasContext interface {
// GetAssign returns the assign token. // GetAssign returns the assign token.
GetAssign() antlr.Token GetAssign() antlr.Token
// SetAlias sets the alias token. // SetAlias sets the alias token.
SetAlias(antlr.Token) SetAlias(antlr.Token)
// SetAssign sets the assign token. // SetAssign sets the assign token.
SetAssign(antlr.Token) SetAssign(antlr.Token)
// IsTypeAliasContext differentiates from other interfaces. // IsTypeAliasContext differentiates from other interfaces.
IsTypeAliasContext() IsTypeAliasContext()
} }
@@ -513,10 +544,12 @@ func (s *TypeAliasContext) GetAlias() antlr.Token { return s.alias }
func (s *TypeAliasContext) GetAssign() antlr.Token { return s.assign } func (s *TypeAliasContext) GetAssign() antlr.Token { return s.assign }
func (s *TypeAliasContext) SetAlias(v antlr.Token) { s.alias = v } func (s *TypeAliasContext) SetAlias(v antlr.Token) { s.alias = v }
func (s *TypeAliasContext) SetAssign(v antlr.Token) { s.assign = v } func (s *TypeAliasContext) SetAssign(v antlr.Token) { s.assign = v }
func (s *TypeAliasContext) DataType() IDataTypeContext { func (s *TypeAliasContext) DataType() IDataTypeContext {
var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0) var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
@@ -539,6 +572,7 @@ func (s *TypeAliasContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *TypeAliasContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *TypeAliasContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -549,11 +583,15 @@ func (s *TypeAliasContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) TypeAlias() (localctx ITypeAliasContext) { func (p *ApiParserParser) TypeAlias() (localctx ITypeAliasContext) {
localctx = NewTypeAliasContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewTypeAliasContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 30, ApiParserParserRULE_typeAlias) p.EnterRule(localctx, 30, ApiParserParserRULE_typeAlias)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -583,6 +621,7 @@ func (p *ApiParserParser) TypeAlias() (localctx ITypeAliasContext) {
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
if _la == ApiParserParserT__0 { if _la == ApiParserParserT__0 {
{ {
p.SetState(169) p.SetState(169)
@@ -598,9 +637,12 @@ func (p *ApiParserParser) TypeAlias() (localctx ITypeAliasContext) {
p.DataType() p.DataType()
} }
return localctx return localctx
} }
// ITypeBlockStructContext is an interface to support dynamic dispatch. // ITypeBlockStructContext is an interface to support dynamic dispatch.
type ITypeBlockStructContext interface { type ITypeBlockStructContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -620,6 +662,7 @@ type ITypeBlockStructContext interface {
// GetRbrace returns the rbrace token. // GetRbrace returns the rbrace token.
GetRbrace() antlr.Token GetRbrace() antlr.Token
// SetStructName sets the structName token. // SetStructName sets the structName token.
SetStructName(antlr.Token) SetStructName(antlr.Token)
@@ -632,6 +675,7 @@ type ITypeBlockStructContext interface {
// SetRbrace sets the rbrace token. // SetRbrace sets the rbrace token.
SetRbrace(antlr.Token) SetRbrace(antlr.Token)
// IsTypeBlockStructContext differentiates from other interfaces. // IsTypeBlockStructContext differentiates from other interfaces.
IsTypeBlockStructContext() IsTypeBlockStructContext()
} }

View File

@@ -49,6 +49,7 @@ func (s *TypeBlockStructContext) GetLbrace() antlr.Token { return s.lbrace }
func (s *TypeBlockStructContext) GetRbrace() antlr.Token { return s.rbrace } func (s *TypeBlockStructContext) GetRbrace() antlr.Token { return s.rbrace }
func (s *TypeBlockStructContext) SetStructName(v antlr.Token) { s.structName = v } func (s *TypeBlockStructContext) SetStructName(v antlr.Token) { s.structName = v }
func (s *TypeBlockStructContext) SetStructToken(v antlr.Token) { s.structToken = v } func (s *TypeBlockStructContext) SetStructToken(v antlr.Token) { s.structToken = v }
@@ -57,6 +58,7 @@ func (s *TypeBlockStructContext) SetLbrace(v antlr.Token) { s.lbrace = v }
func (s *TypeBlockStructContext) SetRbrace(v antlr.Token) { s.rbrace = v } func (s *TypeBlockStructContext) SetRbrace(v antlr.Token) { s.rbrace = v }
func (s *TypeBlockStructContext) AllID() []antlr.TerminalNode { func (s *TypeBlockStructContext) AllID() []antlr.TerminalNode {
return s.GetTokens(ApiParserParserID) return s.GetTokens(ApiParserParserID)
} }
@@ -96,6 +98,7 @@ func (s *TypeBlockStructContext) ToStringTree(ruleNames []string, recog antlr.Re
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *TypeBlockStructContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *TypeBlockStructContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -106,11 +109,15 @@ func (s *TypeBlockStructContext) Accept(visitor antlr.ParseTreeVisitor) interfac
} }
} }
func (p *ApiParserParser) TypeBlockStruct() (localctx ITypeBlockStructContext) { func (p *ApiParserParser) TypeBlockStruct() (localctx ITypeBlockStructContext) {
localctx = NewTypeBlockStructContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewTypeBlockStructContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 32, ApiParserParserRULE_typeBlockStruct) p.EnterRule(localctx, 32, ApiParserParserRULE_typeBlockStruct)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -142,6 +149,7 @@ func (p *ApiParserParser) TypeBlockStruct() (localctx ITypeBlockStructContext) {
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
if _la == ApiParserParserID { if _la == ApiParserParserID {
{ {
p.SetState(176) p.SetState(176)
@@ -170,6 +178,7 @@ func (p *ApiParserParser) TypeBlockStruct() (localctx ITypeBlockStructContext) {
p.Field() p.Field()
} }
} }
p.SetState(185) p.SetState(185)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
@@ -183,9 +192,12 @@ func (p *ApiParserParser) TypeBlockStruct() (localctx ITypeBlockStructContext) {
localctx.(*TypeBlockStructContext).rbrace = _m localctx.(*TypeBlockStructContext).rbrace = _m
} }
return localctx return localctx
} }
// ITypeBlockAliasContext is an interface to support dynamic dispatch. // ITypeBlockAliasContext is an interface to support dynamic dispatch.
type ITypeBlockAliasContext interface { type ITypeBlockAliasContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -199,12 +211,14 @@ type ITypeBlockAliasContext interface {
// GetAssign returns the assign token. // GetAssign returns the assign token.
GetAssign() antlr.Token GetAssign() antlr.Token
// SetAlias sets the alias token. // SetAlias sets the alias token.
SetAlias(antlr.Token) SetAlias(antlr.Token)
// SetAssign sets the assign token. // SetAssign sets the assign token.
SetAssign(antlr.Token) SetAssign(antlr.Token)
// IsTypeBlockAliasContext differentiates from other interfaces. // IsTypeBlockAliasContext differentiates from other interfaces.
IsTypeBlockAliasContext() IsTypeBlockAliasContext()
} }
@@ -242,10 +256,12 @@ func (s *TypeBlockAliasContext) GetAlias() antlr.Token { return s.alias }
func (s *TypeBlockAliasContext) GetAssign() antlr.Token { return s.assign } func (s *TypeBlockAliasContext) GetAssign() antlr.Token { return s.assign }
func (s *TypeBlockAliasContext) SetAlias(v antlr.Token) { s.alias = v } func (s *TypeBlockAliasContext) SetAlias(v antlr.Token) { s.alias = v }
func (s *TypeBlockAliasContext) SetAssign(v antlr.Token) { s.assign = v } func (s *TypeBlockAliasContext) SetAssign(v antlr.Token) { s.assign = v }
func (s *TypeBlockAliasContext) DataType() IDataTypeContext { func (s *TypeBlockAliasContext) DataType() IDataTypeContext {
var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0) var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
@@ -268,6 +284,7 @@ func (s *TypeBlockAliasContext) ToStringTree(ruleNames []string, recog antlr.Rec
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *TypeBlockAliasContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *TypeBlockAliasContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -278,11 +295,15 @@ func (s *TypeBlockAliasContext) Accept(visitor antlr.ParseTreeVisitor) interface
} }
} }
func (p *ApiParserParser) TypeBlockAlias() (localctx ITypeBlockAliasContext) { func (p *ApiParserParser) TypeBlockAlias() (localctx ITypeBlockAliasContext) {
localctx = NewTypeBlockAliasContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewTypeBlockAliasContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 34, ApiParserParserRULE_typeBlockAlias) p.EnterRule(localctx, 34, ApiParserParserRULE_typeBlockAlias)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -312,6 +333,7 @@ func (p *ApiParserParser) TypeBlockAlias() (localctx ITypeBlockAliasContext) {
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
if _la == ApiParserParserT__0 { if _la == ApiParserParserT__0 {
{ {
p.SetState(190) p.SetState(190)
@@ -327,9 +349,12 @@ func (p *ApiParserParser) TypeBlockAlias() (localctx ITypeBlockAliasContext) {
p.DataType() p.DataType()
} }
return localctx return localctx
} }
// IFieldContext is an interface to support dynamic dispatch. // IFieldContext is an interface to support dynamic dispatch.
type IFieldContext interface { type IFieldContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -396,6 +421,7 @@ func (s *FieldContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *FieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *FieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -406,6 +432,9 @@ func (s *FieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) Field() (localctx IFieldContext) { func (p *ApiParserParser) Field() (localctx IFieldContext) {
localctx = NewFieldContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewFieldContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 36, ApiParserParserRULE_field) p.EnterRule(localctx, 36, ApiParserParserRULE_field)
@@ -441,6 +470,7 @@ func (p *ApiParserParser) Field() (localctx IFieldContext) {
p.NormalField() p.NormalField()
} }
case 2: case 2:
p.EnterOuterAlt(localctx, 2) p.EnterOuterAlt(localctx, 2)
{ {
@@ -450,9 +480,11 @@ func (p *ApiParserParser) Field() (localctx IFieldContext) {
} }
return localctx return localctx
} }
// INormalFieldContext is an interface to support dynamic dispatch. // INormalFieldContext is an interface to support dynamic dispatch.
type INormalFieldContext interface { type INormalFieldContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -466,12 +498,14 @@ type INormalFieldContext interface {
// GetTag returns the tag token. // GetTag returns the tag token.
GetTag() antlr.Token GetTag() antlr.Token
// SetFieldName sets the fieldName token. // SetFieldName sets the fieldName token.
SetFieldName(antlr.Token) SetFieldName(antlr.Token)
// SetTag sets the tag token. // SetTag sets the tag token.
SetTag(antlr.Token) SetTag(antlr.Token)
// IsNormalFieldContext differentiates from other interfaces. // IsNormalFieldContext differentiates from other interfaces.
IsNormalFieldContext() IsNormalFieldContext()
} }
@@ -509,10 +543,12 @@ func (s *NormalFieldContext) GetFieldName() antlr.Token { return s.fieldName }
func (s *NormalFieldContext) GetTag() antlr.Token { return s.tag } func (s *NormalFieldContext) GetTag() antlr.Token { return s.tag }
func (s *NormalFieldContext) SetFieldName(v antlr.Token) { s.fieldName = v } func (s *NormalFieldContext) SetFieldName(v antlr.Token) { s.fieldName = v }
func (s *NormalFieldContext) SetTag(v antlr.Token) { s.tag = v } func (s *NormalFieldContext) SetTag(v antlr.Token) { s.tag = v }
func (s *NormalFieldContext) DataType() IDataTypeContext { func (s *NormalFieldContext) DataType() IDataTypeContext {
var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0) var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
@@ -539,6 +575,7 @@ func (s *NormalFieldContext) ToStringTree(ruleNames []string, recog antlr.Recogn
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *NormalFieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *NormalFieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -549,6 +586,9 @@ func (s *NormalFieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
} }
} }
func (p *ApiParserParser) NormalField() (localctx INormalFieldContext) { func (p *ApiParserParser) NormalField() (localctx INormalFieldContext) {
localctx = NewNormalFieldContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewNormalFieldContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 38, ApiParserParserRULE_normalField) p.EnterRule(localctx, 38, ApiParserParserRULE_normalField)
@@ -585,6 +625,7 @@ func (p *ApiParserParser) NormalField() (localctx INormalFieldContext) {
p.SetState(204) p.SetState(204)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 16, p.GetParserRuleContext()) == 1 { if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 16, p.GetParserRuleContext()) == 1 {
{ {
p.SetState(203) p.SetState(203)
@@ -594,11 +635,15 @@ func (p *ApiParserParser) NormalField() (localctx INormalFieldContext) {
localctx.(*NormalFieldContext).tag = _m localctx.(*NormalFieldContext).tag = _m
} }
} }
return localctx return localctx
} }
// IAnonymousFiledContext is an interface to support dynamic dispatch. // IAnonymousFiledContext is an interface to support dynamic dispatch.
type IAnonymousFiledContext interface { type IAnonymousFiledContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -609,9 +654,11 @@ type IAnonymousFiledContext interface {
// GetStar returns the star token. // GetStar returns the star token.
GetStar() antlr.Token GetStar() antlr.Token
// SetStar sets the star token. // SetStar sets the star token.
SetStar(antlr.Token) SetStar(antlr.Token)
// IsAnonymousFiledContext differentiates from other interfaces. // IsAnonymousFiledContext differentiates from other interfaces.
IsAnonymousFiledContext() IsAnonymousFiledContext()
} }

View File

@@ -40,8 +40,10 @@ func (s *AnonymousFiledContext) GetParser() antlr.Parser { return s.parser }
func (s *AnonymousFiledContext) GetStar() antlr.Token { return s.star } func (s *AnonymousFiledContext) GetStar() antlr.Token { return s.star }
func (s *AnonymousFiledContext) SetStar(v antlr.Token) { s.star = v } func (s *AnonymousFiledContext) SetStar(v antlr.Token) { s.star = v }
func (s *AnonymousFiledContext) ID() antlr.TerminalNode { func (s *AnonymousFiledContext) ID() antlr.TerminalNode {
return s.GetToken(ApiParserParserID, 0) return s.GetToken(ApiParserParserID, 0)
} }
@@ -54,6 +56,7 @@ func (s *AnonymousFiledContext) ToStringTree(ruleNames []string, recog antlr.Rec
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *AnonymousFiledContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *AnonymousFiledContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -64,11 +67,15 @@ func (s *AnonymousFiledContext) Accept(visitor antlr.ParseTreeVisitor) interface
} }
} }
func (p *ApiParserParser) AnonymousFiled() (localctx IAnonymousFiledContext) { func (p *ApiParserParser) AnonymousFiled() (localctx IAnonymousFiledContext) {
localctx = NewAnonymousFiledContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewAnonymousFiledContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 40, ApiParserParserRULE_anonymousFiled) p.EnterRule(localctx, 40, ApiParserParserRULE_anonymousFiled)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -90,6 +97,7 @@ func (p *ApiParserParser) AnonymousFiled() (localctx IAnonymousFiledContext) {
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
if _la == ApiParserParserT__5 { if _la == ApiParserParserT__5 {
{ {
p.SetState(206) p.SetState(206)
@@ -105,9 +113,12 @@ func (p *ApiParserParser) AnonymousFiled() (localctx IAnonymousFiledContext) {
p.Match(ApiParserParserID) p.Match(ApiParserParserID)
} }
return localctx return localctx
} }
// IDataTypeContext is an interface to support dynamic dispatch. // IDataTypeContext is an interface to support dynamic dispatch.
type IDataTypeContext interface { type IDataTypeContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -121,12 +132,14 @@ type IDataTypeContext interface {
// GetTime returns the time token. // GetTime returns the time token.
GetTime() antlr.Token GetTime() antlr.Token
// SetInter sets the inter token. // SetInter sets the inter token.
SetInter(antlr.Token) SetInter(antlr.Token)
// SetTime sets the time token. // SetTime sets the time token.
SetTime(antlr.Token) SetTime(antlr.Token)
// IsDataTypeContext differentiates from other interfaces. // IsDataTypeContext differentiates from other interfaces.
IsDataTypeContext() IsDataTypeContext()
} }
@@ -164,10 +177,12 @@ func (s *DataTypeContext) GetInter() antlr.Token { return s.inter }
func (s *DataTypeContext) GetTime() antlr.Token { return s.time } func (s *DataTypeContext) GetTime() antlr.Token { return s.time }
func (s *DataTypeContext) SetInter(v antlr.Token) { s.inter = v } func (s *DataTypeContext) SetInter(v antlr.Token) { s.inter = v }
func (s *DataTypeContext) SetTime(v antlr.Token) { s.time = v } func (s *DataTypeContext) SetTime(v antlr.Token) { s.time = v }
func (s *DataTypeContext) ID() antlr.TerminalNode { func (s *DataTypeContext) ID() antlr.TerminalNode {
return s.GetToken(ApiParserParserID, 0) return s.GetToken(ApiParserParserID, 0)
} }
@@ -224,6 +239,7 @@ func (s *DataTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognize
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *DataTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *DataTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -234,6 +250,9 @@ func (s *DataTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) DataType() (localctx IDataTypeContext) { func (p *ApiParserParser) DataType() (localctx IDataTypeContext) {
localctx = NewDataTypeContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewDataTypeContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 42, ApiParserParserRULE_dataType) p.EnterRule(localctx, 42, ApiParserParserRULE_dataType)
@@ -265,6 +284,7 @@ func (p *ApiParserParser) DataType() (localctx IDataTypeContext) {
p.Match(ApiParserParserID) p.Match(ApiParserParserID)
} }
case 2: case 2:
p.EnterOuterAlt(localctx, 2) p.EnterOuterAlt(localctx, 2)
{ {
@@ -272,6 +292,7 @@ func (p *ApiParserParser) DataType() (localctx IDataTypeContext) {
p.MapType() p.MapType()
} }
case 3: case 3:
p.EnterOuterAlt(localctx, 3) p.EnterOuterAlt(localctx, 3)
{ {
@@ -279,6 +300,7 @@ func (p *ApiParserParser) DataType() (localctx IDataTypeContext) {
p.ArrayType() p.ArrayType()
} }
case 4: case 4:
p.EnterOuterAlt(localctx, 4) p.EnterOuterAlt(localctx, 4)
{ {
@@ -289,6 +311,7 @@ func (p *ApiParserParser) DataType() (localctx IDataTypeContext) {
localctx.(*DataTypeContext).inter = _m localctx.(*DataTypeContext).inter = _m
} }
case 5: case 5:
p.EnterOuterAlt(localctx, 5) p.EnterOuterAlt(localctx, 5)
{ {
@@ -299,6 +322,7 @@ func (p *ApiParserParser) DataType() (localctx IDataTypeContext) {
localctx.(*DataTypeContext).time = _m localctx.(*DataTypeContext).time = _m
} }
case 6: case 6:
p.EnterOuterAlt(localctx, 6) p.EnterOuterAlt(localctx, 6)
{ {
@@ -306,6 +330,7 @@ func (p *ApiParserParser) DataType() (localctx IDataTypeContext) {
p.PointerType() p.PointerType()
} }
case 7: case 7:
p.EnterOuterAlt(localctx, 7) p.EnterOuterAlt(localctx, 7)
{ {
@@ -315,9 +340,11 @@ func (p *ApiParserParser) DataType() (localctx IDataTypeContext) {
} }
return localctx return localctx
} }
// IPointerTypeContext is an interface to support dynamic dispatch. // IPointerTypeContext is an interface to support dynamic dispatch.
type IPointerTypeContext interface { type IPointerTypeContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -328,9 +355,11 @@ type IPointerTypeContext interface {
// GetStar returns the star token. // GetStar returns the star token.
GetStar() antlr.Token GetStar() antlr.Token
// SetStar sets the star token. // SetStar sets the star token.
SetStar(antlr.Token) SetStar(antlr.Token)
// IsPointerTypeContext differentiates from other interfaces. // IsPointerTypeContext differentiates from other interfaces.
IsPointerTypeContext() IsPointerTypeContext()
} }
@@ -365,8 +394,10 @@ func (s *PointerTypeContext) GetParser() antlr.Parser { return s.parser }
func (s *PointerTypeContext) GetStar() antlr.Token { return s.star } func (s *PointerTypeContext) GetStar() antlr.Token { return s.star }
func (s *PointerTypeContext) SetStar(v antlr.Token) { s.star = v } func (s *PointerTypeContext) SetStar(v antlr.Token) { s.star = v }
func (s *PointerTypeContext) ID() antlr.TerminalNode { func (s *PointerTypeContext) ID() antlr.TerminalNode {
return s.GetToken(ApiParserParserID, 0) return s.GetToken(ApiParserParserID, 0)
} }
@@ -379,6 +410,7 @@ func (s *PointerTypeContext) ToStringTree(ruleNames []string, recog antlr.Recogn
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *PointerTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *PointerTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -389,6 +421,9 @@ func (s *PointerTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
} }
} }
func (p *ApiParserParser) PointerType() (localctx IPointerTypeContext) { func (p *ApiParserParser) PointerType() (localctx IPointerTypeContext) {
localctx = NewPointerTypeContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewPointerTypeContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 44, ApiParserParserRULE_pointerType) p.EnterRule(localctx, 44, ApiParserParserRULE_pointerType)
@@ -423,9 +458,12 @@ func (p *ApiParserParser) PointerType() (localctx IPointerTypeContext) {
p.Match(ApiParserParserID) p.Match(ApiParserParserID)
} }
return localctx return localctx
} }
// IMapTypeContext is an interface to support dynamic dispatch. // IMapTypeContext is an interface to support dynamic dispatch.
type IMapTypeContext interface { type IMapTypeContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -445,6 +483,7 @@ type IMapTypeContext interface {
// GetRbrack returns the rbrack token. // GetRbrack returns the rbrack token.
GetRbrack() antlr.Token GetRbrack() antlr.Token
// SetMapToken sets the mapToken token. // SetMapToken sets the mapToken token.
SetMapToken(antlr.Token) SetMapToken(antlr.Token)
@@ -457,12 +496,15 @@ type IMapTypeContext interface {
// SetRbrack sets the rbrack token. // SetRbrack sets the rbrack token.
SetRbrack(antlr.Token) SetRbrack(antlr.Token)
// GetValue returns the value rule contexts. // GetValue returns the value rule contexts.
GetValue() IDataTypeContext GetValue() IDataTypeContext
// SetValue sets the value rule contexts. // SetValue sets the value rule contexts.
SetValue(IDataTypeContext) SetValue(IDataTypeContext)
// IsMapTypeContext differentiates from other interfaces. // IsMapTypeContext differentiates from other interfaces.
IsMapTypeContext() IsMapTypeContext()
} }
@@ -507,6 +549,7 @@ func (s *MapTypeContext) GetKey() antlr.Token { return s.key }
func (s *MapTypeContext) GetRbrack() antlr.Token { return s.rbrack } func (s *MapTypeContext) GetRbrack() antlr.Token { return s.rbrack }
func (s *MapTypeContext) SetMapToken(v antlr.Token) { s.mapToken = v } func (s *MapTypeContext) SetMapToken(v antlr.Token) { s.mapToken = v }
func (s *MapTypeContext) SetLbrack(v antlr.Token) { s.lbrack = v } func (s *MapTypeContext) SetLbrack(v antlr.Token) { s.lbrack = v }
@@ -515,10 +558,13 @@ func (s *MapTypeContext) SetKey(v antlr.Token) { s.key = v }
func (s *MapTypeContext) SetRbrack(v antlr.Token) { s.rbrack = v } func (s *MapTypeContext) SetRbrack(v antlr.Token) { s.rbrack = v }
func (s *MapTypeContext) GetValue() IDataTypeContext { return s.value } func (s *MapTypeContext) GetValue() IDataTypeContext { return s.value }
func (s *MapTypeContext) SetValue(v IDataTypeContext) { s.value = v } func (s *MapTypeContext) SetValue(v IDataTypeContext) { s.value = v }
func (s *MapTypeContext) AllID() []antlr.TerminalNode { func (s *MapTypeContext) AllID() []antlr.TerminalNode {
return s.GetTokens(ApiParserParserID) return s.GetTokens(ApiParserParserID)
} }
@@ -545,6 +591,7 @@ func (s *MapTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *MapTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *MapTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -555,6 +602,9 @@ func (s *MapTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) MapType() (localctx IMapTypeContext) { func (p *ApiParserParser) MapType() (localctx IMapTypeContext) {
localctx = NewMapTypeContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewMapTypeContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 46, ApiParserParserRULE_mapType) p.EnterRule(localctx, 46, ApiParserParserRULE_mapType)
@@ -611,8 +661,11 @@ func (p *ApiParserParser) MapType() (localctx IMapTypeContext) {
var _x = p.DataType() var _x = p.DataType()
localctx.(*MapTypeContext).value = _x localctx.(*MapTypeContext).value = _x
} }
return localctx return localctx
} }

View File

@@ -10,6 +10,7 @@ import (
// The apiparser_parser.go file was split into multiple files because it // The apiparser_parser.go file was split into multiple files because it
// was too large and caused a possible memory overflow during goctl installation. // was too large and caused a possible memory overflow during goctl installation.
// IArrayTypeContext is an interface to support dynamic dispatch. // IArrayTypeContext is an interface to support dynamic dispatch.
type IArrayTypeContext interface { type IArrayTypeContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -23,12 +24,14 @@ type IArrayTypeContext interface {
// GetRbrack returns the rbrack token. // GetRbrack returns the rbrack token.
GetRbrack() antlr.Token GetRbrack() antlr.Token
// SetLbrack sets the lbrack token. // SetLbrack sets the lbrack token.
SetLbrack(antlr.Token) SetLbrack(antlr.Token)
// SetRbrack sets the rbrack token. // SetRbrack sets the rbrack token.
SetRbrack(antlr.Token) SetRbrack(antlr.Token)
// IsArrayTypeContext differentiates from other interfaces. // IsArrayTypeContext differentiates from other interfaces.
IsArrayTypeContext() IsArrayTypeContext()
} }
@@ -66,10 +69,12 @@ func (s *ArrayTypeContext) GetLbrack() antlr.Token { return s.lbrack }
func (s *ArrayTypeContext) GetRbrack() antlr.Token { return s.rbrack } func (s *ArrayTypeContext) GetRbrack() antlr.Token { return s.rbrack }
func (s *ArrayTypeContext) SetLbrack(v antlr.Token) { s.lbrack = v } func (s *ArrayTypeContext) SetLbrack(v antlr.Token) { s.lbrack = v }
func (s *ArrayTypeContext) SetRbrack(v antlr.Token) { s.rbrack = v } func (s *ArrayTypeContext) SetRbrack(v antlr.Token) { s.rbrack = v }
func (s *ArrayTypeContext) DataType() IDataTypeContext { func (s *ArrayTypeContext) DataType() IDataTypeContext {
var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0) var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
@@ -88,6 +93,7 @@ func (s *ArrayTypeContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *ArrayTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *ArrayTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -98,6 +104,9 @@ func (s *ArrayTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) ArrayType() (localctx IArrayTypeContext) { func (p *ApiParserParser) ArrayType() (localctx IArrayTypeContext) {
localctx = NewArrayTypeContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewArrayTypeContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 48, ApiParserParserRULE_arrayType) p.EnterRule(localctx, 48, ApiParserParserRULE_arrayType)
@@ -138,9 +147,12 @@ func (p *ApiParserParser) ArrayType() (localctx IArrayTypeContext) {
p.DataType() p.DataType()
} }
return localctx return localctx
} }
// IServiceSpecContext is an interface to support dynamic dispatch. // IServiceSpecContext is an interface to support dynamic dispatch.
type IServiceSpecContext interface { type IServiceSpecContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -207,6 +219,7 @@ func (s *ServiceSpecContext) ToStringTree(ruleNames []string, recog antlr.Recogn
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *ServiceSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *ServiceSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -217,11 +230,15 @@ func (s *ServiceSpecContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
} }
} }
func (p *ApiParserParser) ServiceSpec() (localctx IServiceSpecContext) { func (p *ApiParserParser) ServiceSpec() (localctx IServiceSpecContext) {
localctx = NewServiceSpecContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewServiceSpecContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 50, ApiParserParserRULE_serviceSpec) p.EnterRule(localctx, 50, ApiParserParserRULE_serviceSpec)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -243,6 +260,7 @@ func (p *ApiParserParser) ServiceSpec() (localctx IServiceSpecContext) {
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
if _la == ApiParserParserATSERVER { if _la == ApiParserParserATSERVER {
{ {
p.SetState(237) p.SetState(237)
@@ -255,9 +273,12 @@ func (p *ApiParserParser) ServiceSpec() (localctx IServiceSpecContext) {
p.ServiceApi() p.ServiceApi()
} }
return localctx return localctx
} }
// IAtServerContext is an interface to support dynamic dispatch. // IAtServerContext is an interface to support dynamic dispatch.
type IAtServerContext interface { type IAtServerContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -271,12 +292,14 @@ type IAtServerContext interface {
// GetRp returns the rp token. // GetRp returns the rp token.
GetRp() antlr.Token GetRp() antlr.Token
// SetLp sets the lp token. // SetLp sets the lp token.
SetLp(antlr.Token) SetLp(antlr.Token)
// SetRp sets the rp token. // SetRp sets the rp token.
SetRp(antlr.Token) SetRp(antlr.Token)
// IsAtServerContext differentiates from other interfaces. // IsAtServerContext differentiates from other interfaces.
IsAtServerContext() IsAtServerContext()
} }
@@ -314,10 +337,12 @@ func (s *AtServerContext) GetLp() antlr.Token { return s.lp }
func (s *AtServerContext) GetRp() antlr.Token { return s.rp } func (s *AtServerContext) GetRp() antlr.Token { return s.rp }
func (s *AtServerContext) SetLp(v antlr.Token) { s.lp = v } func (s *AtServerContext) SetLp(v antlr.Token) { s.lp = v }
func (s *AtServerContext) SetRp(v antlr.Token) { s.rp = v } func (s *AtServerContext) SetRp(v antlr.Token) { s.rp = v }
func (s *AtServerContext) ATSERVER() antlr.TerminalNode { func (s *AtServerContext) ATSERVER() antlr.TerminalNode {
return s.GetToken(ApiParserParserATSERVER, 0) return s.GetToken(ApiParserParserATSERVER, 0)
} }
@@ -353,6 +378,7 @@ func (s *AtServerContext) ToStringTree(ruleNames []string, recog antlr.Recognize
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *AtServerContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *AtServerContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -363,11 +389,15 @@ func (s *AtServerContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) AtServer() (localctx IAtServerContext) { func (p *ApiParserParser) AtServer() (localctx IAtServerContext) {
localctx = NewAtServerContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewAtServerContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 52, ApiParserParserRULE_atServer) p.EnterRule(localctx, 52, ApiParserParserRULE_atServer)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -405,6 +435,7 @@ func (p *ApiParserParser) AtServer() (localctx IAtServerContext) {
p.KvLit() p.KvLit()
} }
p.SetState(247) p.SetState(247)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
@@ -417,9 +448,12 @@ func (p *ApiParserParser) AtServer() (localctx IAtServerContext) {
localctx.(*AtServerContext).rp = _m localctx.(*AtServerContext).rp = _m
} }
return localctx return localctx
} }
// IServiceApiContext is an interface to support dynamic dispatch. // IServiceApiContext is an interface to support dynamic dispatch.
type IServiceApiContext interface { type IServiceApiContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -436,6 +470,7 @@ type IServiceApiContext interface {
// GetRbrace returns the rbrace token. // GetRbrace returns the rbrace token.
GetRbrace() antlr.Token GetRbrace() antlr.Token
// SetServiceToken sets the serviceToken token. // SetServiceToken sets the serviceToken token.
SetServiceToken(antlr.Token) SetServiceToken(antlr.Token)
@@ -445,6 +480,7 @@ type IServiceApiContext interface {
// SetRbrace sets the rbrace token. // SetRbrace sets the rbrace token.
SetRbrace(antlr.Token) SetRbrace(antlr.Token)
// IsServiceApiContext differentiates from other interfaces. // IsServiceApiContext differentiates from other interfaces.
IsServiceApiContext() IsServiceApiContext()
} }
@@ -485,12 +521,14 @@ func (s *ServiceApiContext) GetLbrace() antlr.Token { return s.lbrace }
func (s *ServiceApiContext) GetRbrace() antlr.Token { return s.rbrace } func (s *ServiceApiContext) GetRbrace() antlr.Token { return s.rbrace }
func (s *ServiceApiContext) SetServiceToken(v antlr.Token) { s.serviceToken = v } func (s *ServiceApiContext) SetServiceToken(v antlr.Token) { s.serviceToken = v }
func (s *ServiceApiContext) SetLbrace(v antlr.Token) { s.lbrace = v } func (s *ServiceApiContext) SetLbrace(v antlr.Token) { s.lbrace = v }
func (s *ServiceApiContext) SetRbrace(v antlr.Token) { s.rbrace = v } func (s *ServiceApiContext) SetRbrace(v antlr.Token) { s.rbrace = v }
func (s *ServiceApiContext) ServiceName() IServiceNameContext { func (s *ServiceApiContext) ServiceName() IServiceNameContext {
var t = s.GetTypedRuleContext(reflect.TypeOf((*IServiceNameContext)(nil)).Elem(), 0) var t = s.GetTypedRuleContext(reflect.TypeOf((*IServiceNameContext)(nil)).Elem(), 0)
@@ -536,6 +574,7 @@ func (s *ServiceApiContext) ToStringTree(ruleNames []string, recog antlr.Recogni
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *ServiceApiContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *ServiceApiContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -546,11 +585,15 @@ func (s *ServiceApiContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) ServiceApi() (localctx IServiceApiContext) { func (p *ApiParserParser) ServiceApi() (localctx IServiceApiContext) {
localctx = NewServiceApiContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewServiceApiContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 54, ApiParserParserRULE_serviceApi) p.EnterRule(localctx, 54, ApiParserParserRULE_serviceApi)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -591,12 +634,14 @@ func (p *ApiParserParser) ServiceApi() (localctx IServiceApiContext) {
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _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.SetState(255)
p.ServiceRoute() p.ServiceRoute()
} }
p.SetState(260) p.SetState(260)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
@@ -609,5 +654,7 @@ func (p *ApiParserParser) ServiceApi() (localctx IServiceApiContext) {
localctx.(*ServiceApiContext).rbrace = _m localctx.(*ServiceApiContext).rbrace = _m
} }
return localctx return localctx
} }

View File

@@ -10,6 +10,7 @@ import (
// The apiparser_parser.go file was split into multiple files because it // The apiparser_parser.go file was split into multiple files because it
// was too large and caused a possible memory overflow during goctl installation. // was too large and caused a possible memory overflow during goctl installation.
// IServiceRouteContext is an interface to support dynamic dispatch. // IServiceRouteContext is an interface to support dynamic dispatch.
type IServiceRouteContext interface { type IServiceRouteContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -96,6 +97,7 @@ func (s *ServiceRouteContext) ToStringTree(ruleNames []string, recog antlr.Recog
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *ServiceRouteContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *ServiceRouteContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -106,11 +108,15 @@ func (s *ServiceRouteContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
} }
} }
func (p *ApiParserParser) ServiceRoute() (localctx IServiceRouteContext) { func (p *ApiParserParser) ServiceRoute() (localctx IServiceRouteContext) {
localctx = NewServiceRouteContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewServiceRouteContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 56, ApiParserParserRULE_serviceRoute) p.EnterRule(localctx, 56, ApiParserParserRULE_serviceRoute)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -132,6 +138,7 @@ func (p *ApiParserParser) ServiceRoute() (localctx IServiceRouteContext) {
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
if _la == ApiParserParserATDOC { if _la == ApiParserParserATDOC {
{ {
p.SetState(263) p.SetState(263)
@@ -149,12 +156,15 @@ func (p *ApiParserParser) ServiceRoute() (localctx IServiceRouteContext) {
p.AtServer() p.AtServer()
} }
case ApiParserParserATHANDLER: case ApiParserParserATHANDLER:
{ {
p.SetState(267) p.SetState(267)
p.AtHandler() p.AtHandler()
} }
default: default:
panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
} }
@@ -163,9 +173,12 @@ func (p *ApiParserParser) ServiceRoute() (localctx IServiceRouteContext) {
p.Route() p.Route()
} }
return localctx return localctx
} }
// IAtDocContext is an interface to support dynamic dispatch. // IAtDocContext is an interface to support dynamic dispatch.
type IAtDocContext interface { type IAtDocContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -179,12 +192,14 @@ type IAtDocContext interface {
// GetRp returns the rp token. // GetRp returns the rp token.
GetRp() antlr.Token GetRp() antlr.Token
// SetLp sets the lp token. // SetLp sets the lp token.
SetLp(antlr.Token) SetLp(antlr.Token)
// SetRp sets the rp token. // SetRp sets the rp token.
SetRp(antlr.Token) SetRp(antlr.Token)
// IsAtDocContext differentiates from other interfaces. // IsAtDocContext differentiates from other interfaces.
IsAtDocContext() IsAtDocContext()
} }
@@ -222,10 +237,12 @@ func (s *AtDocContext) GetLp() antlr.Token { return s.lp }
func (s *AtDocContext) GetRp() antlr.Token { return s.rp } func (s *AtDocContext) GetRp() antlr.Token { return s.rp }
func (s *AtDocContext) SetLp(v antlr.Token) { s.lp = v } func (s *AtDocContext) SetLp(v antlr.Token) { s.lp = v }
func (s *AtDocContext) SetRp(v antlr.Token) { s.rp = v } func (s *AtDocContext) SetRp(v antlr.Token) { s.rp = v }
func (s *AtDocContext) ATDOC() antlr.TerminalNode { func (s *AtDocContext) ATDOC() antlr.TerminalNode {
return s.GetToken(ApiParserParserATDOC, 0) return s.GetToken(ApiParserParserATDOC, 0)
} }
@@ -265,6 +282,7 @@ func (s *AtDocContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *AtDocContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *AtDocContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -275,11 +293,15 @@ func (s *AtDocContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) AtDoc() (localctx IAtDocContext) { func (p *ApiParserParser) AtDoc() (localctx IAtDocContext) {
localctx = NewAtDocContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewAtDocContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 58, ApiParserParserRULE_atDoc) p.EnterRule(localctx, 58, ApiParserParserRULE_atDoc)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -305,6 +327,7 @@ func (p *ApiParserParser) AtDoc() (localctx IAtDocContext) {
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
if _la == ApiParserParserT__1 { if _la == ApiParserParserT__1 {
{ {
p.SetState(273) p.SetState(273)
@@ -329,17 +352,22 @@ func (p *ApiParserParser) AtDoc() (localctx IAtDocContext) {
p.KvLit() p.KvLit()
} }
p.SetState(279) p.SetState(279)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
} }
case ApiParserParserSTRING: case ApiParserParserSTRING:
{ {
p.SetState(281) p.SetState(281)
p.Match(ApiParserParserSTRING) p.Match(ApiParserParserSTRING)
} }
default: default:
panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
} }
@@ -347,6 +375,7 @@ func (p *ApiParserParser) AtDoc() (localctx IAtDocContext) {
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
if _la == ApiParserParserT__2 { if _la == ApiParserParserT__2 {
{ {
p.SetState(284) p.SetState(284)
@@ -358,9 +387,12 @@ func (p *ApiParserParser) AtDoc() (localctx IAtDocContext) {
} }
return localctx return localctx
} }
// IAtHandlerContext is an interface to support dynamic dispatch. // IAtHandlerContext is an interface to support dynamic dispatch.
type IAtHandlerContext interface { type IAtHandlerContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -415,6 +447,7 @@ func (s *AtHandlerContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *AtHandlerContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *AtHandlerContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -425,6 +458,9 @@ func (s *AtHandlerContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) AtHandler() (localctx IAtHandlerContext) { func (p *ApiParserParser) AtHandler() (localctx IAtHandlerContext) {
localctx = NewAtHandlerContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewAtHandlerContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 60, ApiParserParserRULE_atHandler) p.EnterRule(localctx, 60, ApiParserParserRULE_atHandler)
@@ -455,9 +491,12 @@ func (p *ApiParserParser) AtHandler() (localctx IAtHandlerContext) {
p.Match(ApiParserParserID) p.Match(ApiParserParserID)
} }
return localctx return localctx
} }
// IRouteContext is an interface to support dynamic dispatch. // IRouteContext is an interface to support dynamic dispatch.
type IRouteContext interface { type IRouteContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -468,14 +507,10 @@ type IRouteContext interface {
// GetHttpMethod returns the httpMethod token. // GetHttpMethod returns the httpMethod token.
GetHttpMethod() antlr.Token GetHttpMethod() antlr.Token
// GetReturnToken returns the returnToken token.
GetReturnToken() antlr.Token
// SetHttpMethod sets the httpMethod token. // SetHttpMethod sets the httpMethod token.
SetHttpMethod(antlr.Token) SetHttpMethod(antlr.Token)
// SetReturnToken sets the returnToken token.
SetReturnToken(antlr.Token)
// GetRequest returns the request rule contexts. // GetRequest returns the request rule contexts.
GetRequest() IBodyContext GetRequest() IBodyContext
@@ -483,12 +518,14 @@ type IRouteContext interface {
// GetResponse returns the response rule contexts. // GetResponse returns the response rule contexts.
GetResponse() IReplybodyContext GetResponse() IReplybodyContext
// SetRequest sets the request rule contexts. // SetRequest sets the request rule contexts.
SetRequest(IBodyContext) SetRequest(IBodyContext)
// SetResponse sets the response rule contexts. // SetResponse sets the response rule contexts.
SetResponse(IReplybodyContext) SetResponse(IReplybodyContext)
// IsRouteContext differentiates from other interfaces. // IsRouteContext differentiates from other interfaces.
IsRouteContext() IsRouteContext()
} }
@@ -498,7 +535,6 @@ type RouteContext struct {
parser antlr.Parser parser antlr.Parser
httpMethod antlr.Token httpMethod antlr.Token
request IBodyContext request IBodyContext
returnToken antlr.Token
response IReplybodyContext response IReplybodyContext
} }
@@ -526,20 +562,20 @@ func (s *RouteContext) GetParser() antlr.Parser { return s.parser }
func (s *RouteContext) GetHttpMethod() antlr.Token { return s.httpMethod } func (s *RouteContext) GetHttpMethod() antlr.Token { return s.httpMethod }
func (s *RouteContext) GetReturnToken() antlr.Token { return s.returnToken }
func (s *RouteContext) SetHttpMethod(v antlr.Token) { s.httpMethod = v } func (s *RouteContext) SetHttpMethod(v antlr.Token) { s.httpMethod = v }
func (s *RouteContext) SetReturnToken(v antlr.Token) { s.returnToken = v }
func (s *RouteContext) GetRequest() IBodyContext { return s.request } func (s *RouteContext) GetRequest() IBodyContext { return s.request }
func (s *RouteContext) GetResponse() IReplybodyContext { return s.response } func (s *RouteContext) GetResponse() IReplybodyContext { return s.response }
func (s *RouteContext) SetRequest(v IBodyContext) { s.request = v } func (s *RouteContext) SetRequest(v IBodyContext) { s.request = v }
func (s *RouteContext) SetResponse(v IReplybodyContext) { s.response = v } func (s *RouteContext) SetResponse(v IReplybodyContext) { s.response = v }
func (s *RouteContext) Path() IPathContext { func (s *RouteContext) Path() IPathContext {
var t = s.GetTypedRuleContext(reflect.TypeOf((*IPathContext)(nil)).Elem(), 0) var t = s.GetTypedRuleContext(reflect.TypeOf((*IPathContext)(nil)).Elem(), 0)
@@ -550,12 +586,8 @@ func (s *RouteContext) Path() IPathContext {
return t.(IPathContext) return t.(IPathContext)
} }
func (s *RouteContext) AllID() []antlr.TerminalNode { func (s *RouteContext) ID() antlr.TerminalNode {
return s.GetTokens(ApiParserParserID) return s.GetToken(ApiParserParserID, 0)
}
func (s *RouteContext) ID(i int) antlr.TerminalNode {
return s.GetToken(ApiParserParserID, i)
} }
func (s *RouteContext) Body() IBodyContext { func (s *RouteContext) Body() IBodyContext {
@@ -586,6 +618,7 @@ func (s *RouteContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *RouteContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *RouteContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -596,11 +629,15 @@ func (s *RouteContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) Route() (localctx IRouteContext) { func (p *ApiParserParser) Route() (localctx IRouteContext) {
localctx = NewRouteContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewRouteContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 62, ApiParserParserRULE_route) p.EnterRule(localctx, 62, ApiParserParserRULE_route)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -632,13 +669,16 @@ func (p *ApiParserParser) Route() (localctx IRouteContext) {
} }
p.SetState(294) p.SetState(294)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1)
if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 28, p.GetParserRuleContext()) == 1 {
if _la == ApiParserParserT__1 {
{ {
p.SetState(293) p.SetState(293)
var _x = p.Body() var _x = p.Body()
localctx.(*RouteContext).request = _x localctx.(*RouteContext).request = _x
} }
@@ -647,30 +687,20 @@ func (p *ApiParserParser) Route() (localctx IRouteContext) {
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
if _la == ApiParserParserID {
if _la == ApiParserParserT__9 {
{ {
p.SetState(296) p.SetState(296)
var _m = p.Match(ApiParserParserID)
localctx.(*RouteContext).returnToken = _m
}
}
p.SetState(300)
p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1)
if _la == ApiParserParserT__1 {
{
p.SetState(299)
var _x = p.Replybody() var _x = p.Replybody()
localctx.(*RouteContext).response = _x localctx.(*RouteContext).response = _x
} }
} }
return localctx return localctx
} }

View File

@@ -10,6 +10,7 @@ import (
// The apiparser_parser.go file was split into multiple files because it // The apiparser_parser.go file was split into multiple files because it
// was too large and caused a possible memory overflow during goctl installation. // was too large and caused a possible memory overflow during goctl installation.
// IBodyContext is an interface to support dynamic dispatch. // IBodyContext is an interface to support dynamic dispatch.
type IBodyContext interface { type IBodyContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -23,12 +24,14 @@ type IBodyContext interface {
// GetRp returns the rp token. // GetRp returns the rp token.
GetRp() antlr.Token GetRp() antlr.Token
// SetLp sets the lp token. // SetLp sets the lp token.
SetLp(antlr.Token) SetLp(antlr.Token)
// SetRp sets the rp token. // SetRp sets the rp token.
SetRp(antlr.Token) SetRp(antlr.Token)
// IsBodyContext differentiates from other interfaces. // IsBodyContext differentiates from other interfaces.
IsBodyContext() IsBodyContext()
} }
@@ -66,10 +69,12 @@ func (s *BodyContext) GetLp() antlr.Token { return s.lp }
func (s *BodyContext) GetRp() antlr.Token { return s.rp } func (s *BodyContext) GetRp() antlr.Token { return s.rp }
func (s *BodyContext) SetLp(v antlr.Token) { s.lp = v } func (s *BodyContext) SetLp(v antlr.Token) { s.lp = v }
func (s *BodyContext) SetRp(v antlr.Token) { s.rp = v } func (s *BodyContext) SetRp(v antlr.Token) { s.rp = v }
func (s *BodyContext) ID() antlr.TerminalNode { func (s *BodyContext) ID() antlr.TerminalNode {
return s.GetToken(ApiParserParserID, 0) return s.GetToken(ApiParserParserID, 0)
} }
@@ -82,6 +87,7 @@ func (s *BodyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) s
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *BodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *BodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -92,11 +98,15 @@ func (s *BodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) Body() (localctx IBodyContext) { func (p *ApiParserParser) Body() (localctx IBodyContext) {
localctx = NewBodyContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewBodyContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 64, ApiParserParserRULE_body) p.EnterRule(localctx, 64, ApiParserParserRULE_body)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -115,34 +125,38 @@ func (p *ApiParserParser) Body() (localctx IBodyContext) {
p.EnterOuterAlt(localctx, 1) p.EnterOuterAlt(localctx, 1)
{ {
p.SetState(302) p.SetState(299)
var _m = p.Match(ApiParserParserT__1) var _m = p.Match(ApiParserParserT__1)
localctx.(*BodyContext).lp = _m localctx.(*BodyContext).lp = _m
} }
p.SetState(304) p.SetState(301)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
if _la == ApiParserParserID { if _la == ApiParserParserID {
{ {
p.SetState(303) p.SetState(300)
p.Match(ApiParserParserID) p.Match(ApiParserParserID)
} }
} }
{ {
p.SetState(306) p.SetState(303)
var _m = p.Match(ApiParserParserT__2) var _m = p.Match(ApiParserParserT__2)
localctx.(*BodyContext).rp = _m localctx.(*BodyContext).rp = _m
} }
return localctx return localctx
} }
// IReplybodyContext is an interface to support dynamic dispatch. // IReplybodyContext is an interface to support dynamic dispatch.
type IReplybodyContext interface { type IReplybodyContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -150,18 +164,26 @@ type IReplybodyContext interface {
// GetParser returns the parser. // GetParser returns the parser.
GetParser() antlr.Parser GetParser() antlr.Parser
// GetReturnToken returns the returnToken token.
GetReturnToken() antlr.Token
// GetLp returns the lp token. // GetLp returns the lp token.
GetLp() antlr.Token GetLp() antlr.Token
// GetRp returns the rp token. // GetRp returns the rp token.
GetRp() antlr.Token GetRp() antlr.Token
// SetReturnToken sets the returnToken token.
SetReturnToken(antlr.Token)
// SetLp sets the lp token. // SetLp sets the lp token.
SetLp(antlr.Token) SetLp(antlr.Token)
// SetRp sets the rp token. // SetRp sets the rp token.
SetRp(antlr.Token) SetRp(antlr.Token)
// IsReplybodyContext differentiates from other interfaces. // IsReplybodyContext differentiates from other interfaces.
IsReplybodyContext() IsReplybodyContext()
} }
@@ -169,6 +191,7 @@ type IReplybodyContext interface {
type ReplybodyContext struct { type ReplybodyContext struct {
*antlr.BaseParserRuleContext *antlr.BaseParserRuleContext
parser antlr.Parser parser antlr.Parser
returnToken antlr.Token
lp antlr.Token lp antlr.Token
rp antlr.Token rp antlr.Token
} }
@@ -195,14 +218,20 @@ func NewReplybodyContext(parser antlr.Parser, parent antlr.ParserRuleContext, in
func (s *ReplybodyContext) GetParser() antlr.Parser { return s.parser } func (s *ReplybodyContext) GetParser() antlr.Parser { return s.parser }
func (s *ReplybodyContext) GetReturnToken() antlr.Token { return s.returnToken }
func (s *ReplybodyContext) GetLp() antlr.Token { return s.lp } func (s *ReplybodyContext) GetLp() antlr.Token { return s.lp }
func (s *ReplybodyContext) GetRp() antlr.Token { return s.rp } 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) SetLp(v antlr.Token) { s.lp = v }
func (s *ReplybodyContext) SetRp(v antlr.Token) { s.rp = v } func (s *ReplybodyContext) SetRp(v antlr.Token) { s.rp = v }
func (s *ReplybodyContext) DataType() IDataTypeContext { func (s *ReplybodyContext) DataType() IDataTypeContext {
var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0) var t = s.GetTypedRuleContext(reflect.TypeOf((*IDataTypeContext)(nil)).Elem(), 0)
@@ -221,6 +250,7 @@ func (s *ReplybodyContext) ToStringTree(ruleNames []string, recog antlr.Recogniz
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *ReplybodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *ReplybodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -231,11 +261,15 @@ func (s *ReplybodyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) Replybody() (localctx IReplybodyContext) { func (p *ApiParserParser) Replybody() (localctx IReplybodyContext) {
localctx = NewReplybodyContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewReplybodyContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 66, ApiParserParserRULE_replybody) p.EnterRule(localctx, 66, ApiParserParserRULE_replybody)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -254,34 +288,45 @@ func (p *ApiParserParser) Replybody() (localctx IReplybodyContext) {
p.EnterOuterAlt(localctx, 1) p.EnterOuterAlt(localctx, 1)
{ {
p.SetState(308) p.SetState(305)
var _m = p.Match(ApiParserParserT__9)
localctx.(*ReplybodyContext).returnToken = _m
}
{
p.SetState(306)
var _m = p.Match(ApiParserParserT__1) var _m = p.Match(ApiParserParserT__1)
localctx.(*ReplybodyContext).lp = _m localctx.(*ReplybodyContext).lp = _m
} }
p.SetState(310) p.SetState(308)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _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(309) p.SetState(307)
p.DataType() p.DataType()
} }
} }
{ {
p.SetState(312) p.SetState(310)
var _m = p.Match(ApiParserParserT__2) var _m = p.Match(ApiParserParserT__2)
localctx.(*ReplybodyContext).rp = _m localctx.(*ReplybodyContext).rp = _m
} }
return localctx return localctx
} }
// IKvLitContext is an interface to support dynamic dispatch. // IKvLitContext is an interface to support dynamic dispatch.
type IKvLitContext interface { type IKvLitContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -295,12 +340,14 @@ type IKvLitContext interface {
// GetValue returns the value token. // GetValue returns the value token.
GetValue() antlr.Token GetValue() antlr.Token
// SetKey sets the key token. // SetKey sets the key token.
SetKey(antlr.Token) SetKey(antlr.Token)
// SetValue sets the value token. // SetValue sets the value token.
SetValue(antlr.Token) SetValue(antlr.Token)
// IsKvLitContext differentiates from other interfaces. // IsKvLitContext differentiates from other interfaces.
IsKvLitContext() IsKvLitContext()
} }
@@ -338,10 +385,12 @@ func (s *KvLitContext) GetKey() antlr.Token { return s.key }
func (s *KvLitContext) GetValue() antlr.Token { return s.value } func (s *KvLitContext) GetValue() antlr.Token { return s.value }
func (s *KvLitContext) SetKey(v antlr.Token) { s.key = v } func (s *KvLitContext) SetKey(v antlr.Token) { s.key = v }
func (s *KvLitContext) SetValue(v antlr.Token) { s.value = v } func (s *KvLitContext) SetValue(v antlr.Token) { s.value = v }
func (s *KvLitContext) ID() antlr.TerminalNode { func (s *KvLitContext) ID() antlr.TerminalNode {
return s.GetToken(ApiParserParserID, 0) return s.GetToken(ApiParserParserID, 0)
} }
@@ -358,6 +407,7 @@ func (s *KvLitContext) ToStringTree(ruleNames []string, recog antlr.Recognizer)
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *KvLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *KvLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -368,6 +418,9 @@ func (s *KvLitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) KvLit() (localctx IKvLitContext) { func (p *ApiParserParser) KvLit() (localctx IKvLitContext) {
localctx = NewKvLitContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewKvLitContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 68, ApiParserParserRULE_kvLit) p.EnterRule(localctx, 68, ApiParserParserRULE_kvLit)
@@ -390,7 +443,7 @@ func (p *ApiParserParser) KvLit() (localctx IKvLitContext) {
p.EnterOuterAlt(localctx, 1) p.EnterOuterAlt(localctx, 1)
{ {
p.SetState(314) p.SetState(312)
var _m = p.Match(ApiParserParserID) var _m = p.Match(ApiParserParserID)
@@ -398,16 +451,19 @@ func (p *ApiParserParser) KvLit() (localctx IKvLitContext) {
} }
checkKeyValue(p) checkKeyValue(p)
{ {
p.SetState(316) p.SetState(314)
var _m = p.Match(ApiParserParserLINE_VALUE) var _m = p.Match(ApiParserParserLINE_VALUE)
localctx.(*KvLitContext).value = _m localctx.(*KvLitContext).value = _m
} }
return localctx return localctx
} }
// IServiceNameContext is an interface to support dynamic dispatch. // IServiceNameContext is an interface to support dynamic dispatch.
type IServiceNameContext interface { type IServiceNameContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -462,6 +518,7 @@ func (s *ServiceNameContext) ToStringTree(ruleNames []string, recog antlr.Recogn
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *ServiceNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *ServiceNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -472,11 +529,15 @@ func (s *ServiceNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{}
} }
} }
func (p *ApiParserParser) ServiceName() (localctx IServiceNameContext) { func (p *ApiParserParser) ServiceName() (localctx IServiceNameContext) {
localctx = NewServiceNameContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewServiceNameContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 70, ApiParserParserRULE_serviceName) p.EnterRule(localctx, 70, ApiParserParserRULE_serviceName)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -494,34 +555,39 @@ func (p *ApiParserParser) ServiceName() (localctx IServiceNameContext) {
}() }()
p.EnterOuterAlt(localctx, 1) p.EnterOuterAlt(localctx, 1)
p.SetState(322) p.SetState(320)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
for ok := true; ok; ok = _la == ApiParserParserID { for ok := true; ok; ok = _la == ApiParserParserID {
{ {
p.SetState(318) p.SetState(316)
p.Match(ApiParserParserID) p.Match(ApiParserParserID)
} }
p.SetState(320) p.SetState(318)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
if _la == ApiParserParserT__9 {
if _la == ApiParserParserT__10 {
{ {
p.SetState(319) p.SetState(317)
p.Match(ApiParserParserT__9) p.Match(ApiParserParserT__10)
} }
} }
p.SetState(324)
p.SetState(322)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
} }
return localctx return localctx
} }
// IPathContext is an interface to support dynamic dispatch. // IPathContext is an interface to support dynamic dispatch.
type IPathContext interface { type IPathContext interface {
antlr.ParserRuleContext antlr.ParserRuleContext
@@ -576,6 +642,7 @@ func (s *PathContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) s
return antlr.TreesStringTree(s, ruleNames, recog) return antlr.TreesStringTree(s, ruleNames, recog)
} }
func (s *PathContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (s *PathContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
switch t := visitor.(type) { switch t := visitor.(type) {
case ApiParserVisitor: case ApiParserVisitor:
@@ -586,11 +653,15 @@ func (s *PathContext) Accept(visitor antlr.ParseTreeVisitor) interface{} {
} }
} }
func (p *ApiParserParser) Path() (localctx IPathContext) { func (p *ApiParserParser) Path() (localctx IPathContext) {
localctx = NewPathContext(p, p.GetParserRuleContext(), p.GetState()) localctx = NewPathContext(p, p.GetParserRuleContext(), p.GetState())
p.EnterRule(localctx, 72, ApiParserParserRULE_path) p.EnterRule(localctx, 72, ApiParserParserRULE_path)
var _la int var _la int
defer func() { defer func() {
p.ExitRule() p.ExitRule()
}() }()
@@ -607,91 +678,103 @@ func (p *ApiParserParser) Path() (localctx IPathContext) {
} }
}() }()
p.SetState(346) p.SetState(344)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 39, p.GetParserRuleContext()) { switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 38, p.GetParserRuleContext()) {
case 1: case 1:
p.EnterOuterAlt(localctx, 1) p.EnterOuterAlt(localctx, 1)
p.SetState(341) p.SetState(339)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
for ok := true; ok; ok = _la == ApiParserParserT__10 || _la == ApiParserParserT__11 { for ok := true; ok; ok = _la == ApiParserParserT__11 || _la == ApiParserParserT__12 {
p.SetState(341) p.SetState(339)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
switch p.GetTokenStream().LA(1) { switch p.GetTokenStream().LA(1) {
case ApiParserParserT__10:
{
p.SetState(326)
p.Match(ApiParserParserT__10)
}
{
p.SetState(327)
p.Match(ApiParserParserID)
}
p.SetState(332)
p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1)
for _la == ApiParserParserT__9 {
{
p.SetState(328)
p.Match(ApiParserParserT__9)
}
{
p.SetState(329)
p.Match(ApiParserParserID)
}
p.SetState(334)
p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1)
}
case ApiParserParserT__11: case ApiParserParserT__11:
{ {
p.SetState(335) p.SetState(324)
p.Match(ApiParserParserT__11) p.Match(ApiParserParserT__11)
} }
{ {
p.SetState(336) p.SetState(325)
p.Match(ApiParserParserID) p.Match(ApiParserParserID)
} }
p.SetState(339) p.SetState(330)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
if _la == ApiParserParserT__9 {
for _la == ApiParserParserT__10 {
{ {
p.SetState(337) p.SetState(326)
p.Match(ApiParserParserT__9) p.Match(ApiParserParserT__10)
} }
{ {
p.SetState(338) p.SetState(327)
p.Match(ApiParserParserID)
}
p.SetState(332)
p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1)
}
case ApiParserParserT__12:
{
p.SetState(333)
p.Match(ApiParserParserT__12)
}
{
p.SetState(334)
p.Match(ApiParserParserID)
}
p.SetState(337)
p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1)
if _la == ApiParserParserT__10 {
{
p.SetState(335)
p.Match(ApiParserParserT__10)
}
{
p.SetState(336)
p.Match(ApiParserParserID) p.Match(ApiParserParserID)
} }
} }
default: default:
panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil))
} }
p.SetState(343) p.SetState(341)
p.GetErrorHandler().Sync(p) p.GetErrorHandler().Sync(p)
_la = p.GetTokenStream().LA(1) _la = p.GetTokenStream().LA(1)
} }
case 2: case 2:
p.EnterOuterAlt(localctx, 2) p.EnterOuterAlt(localctx, 2)
{ {
p.SetState(345) p.SetState(343)
p.Match(ApiParserParserT__10) p.Match(ApiParserParserT__11)
} }
} }
return localctx return localctx
} }

View File

@@ -10,15 +10,15 @@ import (
// The apiparser_parser.go file was split into multiple files because it // The apiparser_parser.go file was split into multiple files because it
// was too large and caused a possible memory overflow during goctl installation. // was too large and caused a possible memory overflow during goctl installation.
func (p *ApiParserParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool { func (p *ApiParserParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool {
switch ruleIndex { switch ruleIndex {
case 18: case 18:
var t *FieldContext = nil var t *FieldContext = nil
if localctx != nil { if localctx != nil { t = localctx.(*FieldContext) }
t = localctx.(*FieldContext)
}
return p.Field_Sempred(t, predIndex) return p.Field_Sempred(t, predIndex)
default: default:
panic("No predicate with index: " + fmt.Sprint(ruleIndex)) panic("No predicate with index: " + fmt.Sprint(ruleIndex))
} }
@@ -33,3 +33,5 @@ func (p *ApiParserParser) Field_Sempred(localctx antlr.RuleContext, predIndex in
panic("No predicate with index: " + fmt.Sprint(predIndex)) panic("No predicate with index: " + fmt.Sprint(predIndex))
} }
} }

View File

@@ -1,6 +1,5 @@
package api // ApiParser package api // ApiParser
import "github.com/zeromicro/antlr" import "github.com/zeromicro/antlr"
// A complete Visitor for a parse tree produced by ApiParserParser. // A complete Visitor for a parse tree produced by ApiParserParser.
type ApiParserVisitor interface { type ApiParserVisitor interface {
antlr.ParseTreeVisitor antlr.ParseTreeVisitor
@@ -115,4 +114,5 @@ type ApiParserVisitor interface {
// Visit a parse tree produced by ApiParserParser#path. // Visit a parse tree produced by ApiParserParser#path.
VisitPath(ctx *PathContext) interface{} VisitPath(ctx *PathContext) interface{}
} }

View File

@@ -164,8 +164,8 @@ func TestRoute(t *testing.T) {
_, err = parser.Accept(fn, `post foo/bar`) _, err = parser.Accept(fn, `post foo/bar`)
assert.Error(t, err) assert.Error(t, err)
_, err = parser.Accept(fn, `post /foo/bar return (Bar)`) _, err = parser.Accept(fn, `post /foo/bar returns (Bar)`)
assert.Error(t, err) assert.Nil(t, err)
_, err = parser.Accept(fn, ` /foo/bar returns (Bar)`) _, err = parser.Accept(fn, ` /foo/bar returns (Bar)`)
assert.Error(t, err) assert.Error(t, err)