| 1 |
// Code generated from ./repl/parser/Commands.g4 by ANTLR 4.13.1. DO NOT EDIT. |
| 2 |
|
| 3 |
package parser // Commands |
| 4 |
import ( |
| 5 |
"fmt" |
| 6 |
"strconv" |
| 7 |
"sync" |
| 8 |
|
| 9 |
"github.com/antlr4-go/antlr/v4" |
| 10 |
) |
| 11 |
|
| 12 |
// Suppress unused import errors |
| 13 |
var _ = fmt.Printf |
| 14 |
var _ = strconv.Itoa |
| 15 |
var _ = sync.Once{} |
| 16 |
|
| 17 |
type CommandsParser struct { |
| 18 |
*antlr.BaseParser |
| 19 |
} |
| 20 |
|
| 21 |
var CommandsParserStaticData struct { |
| 22 |
once sync.Once |
| 23 |
serializedATN []int32 |
| 24 |
LiteralNames []string |
| 25 |
SymbolicNames []string |
| 26 |
RuleNames []string |
| 27 |
PredictionContextCache *antlr.PredictionContextCache |
| 28 |
atn *antlr.ATN |
| 29 |
decisionToDFA []*antlr.DFA |
| 30 |
} |
| 31 |
|
| 32 |
func commandsParserInit() { |
| 33 |
staticData := &CommandsParserStaticData |
| 34 |
staticData.LiteralNames = []string{ |
| 35 |
"", "'%help'", "'%?'", "'%let'", "'%declare'", "'%delete'", "'%compile'", |
| 36 |
"'%parse'", "'%eval'", "'--'", "", "", "'->'", "'='", "'=='", "'!='", |
| 37 |
"'in'", "'<'", "'<='", "'>='", "'>'", "'&&'", "'||'", "'['", "']'", |
| 38 |
"'{'", "'}'", "'('", "')'", "'.'", "','", "'-'", "'!'", "'?'", "':'", |
| 39 |
"'+'", "'*'", "'/'", "'%'", "'true'", "'false'", "'null'", |
| 40 |
} |
| 41 |
staticData.SymbolicNames = []string{ |
| 42 |
"", "", "", "", "", "", "", "", "", "", "COMMAND", "FLAG", "ARROW", |
| 43 |
"EQUAL_ASSIGN", "EQUALS", "NOT_EQUALS", "IN", "LESS", "LESS_EQUALS", |
| 44 |
"GREATER_EQUALS", "GREATER", "LOGICAL_AND", "LOGICAL_OR", "LBRACKET", |
| 45 |
"RPRACKET", "LBRACE", "RBRACE", "LPAREN", "RPAREN", "DOT", "COMMA", |
| 46 |
"MINUS", "EXCLAM", "QUESTIONMARK", "COLON", "PLUS", "STAR", "SLASH", |
| 47 |
"PERCENT", "CEL_TRUE", "CEL_FALSE", "NUL", "WHITESPACE", "COMMENT", |
| 48 |
"NUM_FLOAT", "NUM_INT", "NUM_UINT", "STRING", "BYTES", "IDENTIFIER", |
| 49 |
"ESC_IDENTIFIER", |
| 50 |
} |
| 51 |
staticData.RuleNames = []string{ |
| 52 |
"startCommand", "command", "help", "let", "declare", "varDecl", "fnDecl", |
| 53 |
"param", "delete", "simple", "empty", "compile", "parse", "exprCmd", |
| 54 |
"qualId", "startType", "type", "typeId", "typeParamList", "start", "expr", |
| 55 |
"conditionalOr", "conditionalAnd", "relation", "calc", "unary", "member", |
| 56 |
"primary", "exprList", "listInit", "fieldInitializerList", "optField", |
| 57 |
"mapInitializerList", "escapeIdent", "optExpr", "literal", |
| 58 |
} |
| 59 |
staticData.PredictionContextCache = antlr.NewPredictionContextCache() |
| 60 |
staticData.serializedATN = []int32{ |
| 61 |
4, 1, 50, 432, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, |
| 62 |
4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, |
| 63 |
10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, |
| 64 |
2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, |
| 65 |
21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, |
| 66 |
7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, |
| 67 |
31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 1, 0, 1, 0, |
| 68 |
1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 85, 8, |
| 69 |
1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 96, 8, 3, |
| 70 |
1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 3, 4, 103, 8, 4, 1, 5, 1, 5, 1, 5, 3, 5, |
| 71 |
108, 8, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 5, 6, 115, 8, 6, 10, 6, 12, 6, |
| 72 |
118, 9, 6, 3, 6, 120, 8, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, |
| 73 |
7, 1, 8, 1, 8, 1, 8, 3, 8, 133, 8, 8, 1, 9, 1, 9, 1, 9, 5, 9, 138, 8, 9, |
| 74 |
10, 9, 12, 9, 141, 9, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, |
| 75 |
1, 12, 1, 13, 1, 13, 1, 13, 5, 13, 154, 8, 13, 10, 13, 12, 13, 157, 9, |
| 76 |
13, 1, 13, 3, 13, 160, 8, 13, 3, 13, 162, 8, 13, 1, 13, 1, 13, 1, 14, 3, |
| 77 |
14, 167, 8, 14, 1, 14, 1, 14, 1, 14, 5, 14, 172, 8, 14, 10, 14, 12, 14, |
| 78 |
175, 9, 14, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 3, 16, 182, 8, 16, 1, 17, |
| 79 |
3, 17, 185, 8, 17, 1, 17, 1, 17, 1, 17, 5, 17, 190, 8, 17, 10, 17, 12, |
| 80 |
17, 193, 9, 17, 1, 18, 1, 18, 1, 18, 1, 18, 5, 18, 199, 8, 18, 10, 18, |
| 81 |
12, 18, 202, 9, 18, 3, 18, 204, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, |
| 82 |
1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 3, 20, 217, 8, 20, 1, 21, 1, |
| 83 |
21, 1, 21, 5, 21, 222, 8, 21, 10, 21, 12, 21, 225, 9, 21, 1, 22, 1, 22, |
| 84 |
1, 22, 5, 22, 230, 8, 22, 10, 22, 12, 22, 233, 9, 22, 1, 23, 1, 23, 1, |
| 85 |
23, 1, 23, 1, 23, 1, 23, 5, 23, 241, 8, 23, 10, 23, 12, 23, 244, 9, 23, |
| 86 |
1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 5, 24, 255, |
| 87 |
8, 24, 10, 24, 12, 24, 258, 9, 24, 1, 25, 1, 25, 4, 25, 262, 8, 25, 11, |
| 88 |
25, 12, 25, 263, 1, 25, 1, 25, 4, 25, 268, 8, 25, 11, 25, 12, 25, 269, |
| 89 |
1, 25, 3, 25, 273, 8, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 3, |
| 90 |
26, 281, 8, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 3, 26, 289, 8, |
| 91 |
26, 1, 26, 1, 26, 1, 26, 1, 26, 3, 26, 295, 8, 26, 1, 26, 1, 26, 1, 26, |
| 92 |
5, 26, 300, 8, 26, 10, 26, 12, 26, 303, 9, 26, 1, 27, 3, 27, 306, 8, 27, |
| 93 |
1, 27, 1, 27, 3, 27, 310, 8, 27, 1, 27, 1, 27, 1, 27, 3, 27, 315, 8, 27, |
| 94 |
1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 3, 27, 324, 8, 27, 1, |
| 95 |
27, 3, 27, 327, 8, 27, 1, 27, 1, 27, 1, 27, 3, 27, 332, 8, 27, 1, 27, 3, |
| 96 |
27, 335, 8, 27, 1, 27, 1, 27, 3, 27, 339, 8, 27, 1, 27, 1, 27, 1, 27, 5, |
| 97 |
27, 344, 8, 27, 10, 27, 12, 27, 347, 9, 27, 1, 27, 1, 27, 3, 27, 351, 8, |
| 98 |
27, 1, 27, 3, 27, 354, 8, 27, 1, 27, 1, 27, 3, 27, 358, 8, 27, 1, 28, 1, |
| 99 |
28, 1, 28, 5, 28, 363, 8, 28, 10, 28, 12, 28, 366, 9, 28, 1, 29, 1, 29, |
| 100 |
1, 29, 5, 29, 371, 8, 29, 10, 29, 12, 29, 374, 9, 29, 1, 30, 1, 30, 1, |
| 101 |
30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 5, 30, 384, 8, 30, 10, 30, 12, 30, |
| 102 |
387, 9, 30, 1, 31, 3, 31, 390, 8, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, |
| 103 |
1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 5, 32, 402, 8, 32, 10, 32, 12, 32, 405, |
| 104 |
9, 32, 1, 33, 1, 33, 3, 33, 409, 8, 33, 1, 34, 3, 34, 412, 8, 34, 1, 34, |
| 105 |
1, 34, 1, 35, 3, 35, 417, 8, 35, 1, 35, 1, 35, 1, 35, 3, 35, 422, 8, 35, |
| 106 |
1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 3, 35, 430, 8, 35, 1, 35, 0, |
| 107 |
3, 46, 48, 52, 36, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, |
| 108 |
30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, |
| 109 |
66, 68, 70, 0, 5, 1, 0, 1, 2, 2, 0, 41, 41, 49, 49, 1, 0, 14, 20, 1, 0, |
| 110 |
36, 38, 2, 0, 31, 31, 35, 35, 470, 0, 72, 1, 0, 0, 0, 2, 84, 1, 0, 0, 0, |
| 111 |
4, 86, 1, 0, 0, 0, 6, 88, 1, 0, 0, 0, 8, 99, 1, 0, 0, 0, 10, 104, 1, 0, |
| 112 |
0, 0, 12, 109, 1, 0, 0, 0, 14, 125, 1, 0, 0, 0, 16, 129, 1, 0, 0, 0, 18, |
| 113 |
134, 1, 0, 0, 0, 20, 142, 1, 0, 0, 0, 22, 144, 1, 0, 0, 0, 24, 147, 1, |
| 114 |
0, 0, 0, 26, 161, 1, 0, 0, 0, 28, 166, 1, 0, 0, 0, 30, 176, 1, 0, 0, 0, |
| 115 |
32, 179, 1, 0, 0, 0, 34, 184, 1, 0, 0, 0, 36, 194, 1, 0, 0, 0, 38, 207, |
| 116 |
1, 0, 0, 0, 40, 210, 1, 0, 0, 0, 42, 218, 1, 0, 0, 0, 44, 226, 1, 0, 0, |
| 117 |
0, 46, 234, 1, 0, 0, 0, 48, 245, 1, 0, 0, 0, 50, 272, 1, 0, 0, 0, 52, 274, |
| 118 |
1, 0, 0, 0, 54, 357, 1, 0, 0, 0, 56, 359, 1, 0, 0, 0, 58, 367, 1, 0, 0, |
| 119 |
0, 60, 375, 1, 0, 0, 0, 62, 389, 1, 0, 0, 0, 64, 393, 1, 0, 0, 0, 66, 408, |
| 120 |
1, 0, 0, 0, 68, 411, 1, 0, 0, 0, 70, 429, 1, 0, 0, 0, 72, 73, 3, 2, 1, |
| 121 |
0, 73, 74, 5, 0, 0, 1, 74, 1, 1, 0, 0, 0, 75, 85, 3, 4, 2, 0, 76, 85, 3, |
| 122 |
6, 3, 0, 77, 85, 3, 8, 4, 0, 78, 85, 3, 16, 8, 0, 79, 85, 3, 18, 9, 0, |
| 123 |
80, 85, 3, 22, 11, 0, 81, 85, 3, 24, 12, 0, 82, 85, 3, 26, 13, 0, 83, 85, |
| 124 |
3, 20, 10, 0, 84, 75, 1, 0, 0, 0, 84, 76, 1, 0, 0, 0, 84, 77, 1, 0, 0, |
| 125 |
0, 84, 78, 1, 0, 0, 0, 84, 79, 1, 0, 0, 0, 84, 80, 1, 0, 0, 0, 84, 81, |
| 126 |
1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 84, 83, 1, 0, 0, 0, 85, 3, 1, 0, 0, 0, |
| 127 |
86, 87, 7, 0, 0, 0, 87, 5, 1, 0, 0, 0, 88, 95, 5, 3, 0, 0, 89, 90, 3, 10, |
| 128 |
5, 0, 90, 91, 5, 13, 0, 0, 91, 96, 1, 0, 0, 0, 92, 93, 3, 12, 6, 0, 93, |
| 129 |
94, 5, 12, 0, 0, 94, 96, 1, 0, 0, 0, 95, 89, 1, 0, 0, 0, 95, 92, 1, 0, |
| 130 |
0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 3, 40, 20, 0, 98, 7, 1, 0, 0, 0, 99, |
| 131 |
102, 5, 4, 0, 0, 100, 103, 3, 10, 5, 0, 101, 103, 3, 12, 6, 0, 102, 100, |
| 132 |
1, 0, 0, 0, 102, 101, 1, 0, 0, 0, 103, 9, 1, 0, 0, 0, 104, 107, 3, 28, |
| 133 |
14, 0, 105, 106, 5, 34, 0, 0, 106, 108, 3, 32, 16, 0, 107, 105, 1, 0, 0, |
| 134 |
0, 107, 108, 1, 0, 0, 0, 108, 11, 1, 0, 0, 0, 109, 110, 3, 28, 14, 0, 110, |
| 135 |
119, 5, 27, 0, 0, 111, 116, 3, 14, 7, 0, 112, 113, 5, 30, 0, 0, 113, 115, |
| 136 |
3, 14, 7, 0, 114, 112, 1, 0, 0, 0, 115, 118, 1, 0, 0, 0, 116, 114, 1, 0, |
| 137 |
0, 0, 116, 117, 1, 0, 0, 0, 117, 120, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, |
| 138 |
119, 111, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 121, 1, 0, 0, 0, 121, |
| 139 |
122, 5, 28, 0, 0, 122, 123, 5, 34, 0, 0, 123, 124, 3, 32, 16, 0, 124, 13, |
| 140 |
1, 0, 0, 0, 125, 126, 5, 49, 0, 0, 126, 127, 5, 34, 0, 0, 127, 128, 3, |
| 141 |
32, 16, 0, 128, 15, 1, 0, 0, 0, 129, 132, 5, 5, 0, 0, 130, 133, 3, 10, |
| 142 |
5, 0, 131, 133, 3, 12, 6, 0, 132, 130, 1, 0, 0, 0, 132, 131, 1, 0, 0, 0, |
| 143 |
133, 17, 1, 0, 0, 0, 134, 139, 5, 10, 0, 0, 135, 138, 5, 11, 0, 0, 136, |
| 144 |
138, 5, 47, 0, 0, 137, 135, 1, 0, 0, 0, 137, 136, 1, 0, 0, 0, 138, 141, |
| 145 |
1, 0, 0, 0, 139, 137, 1, 0, 0, 0, 139, 140, 1, 0, 0, 0, 140, 19, 1, 0, |
| 146 |
0, 0, 141, 139, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 21, 1, 0, 0, 0, |
| 147 |
144, 145, 5, 6, 0, 0, 145, 146, 3, 40, 20, 0, 146, 23, 1, 0, 0, 0, 147, |
| 148 |
148, 5, 7, 0, 0, 148, 149, 3, 40, 20, 0, 149, 25, 1, 0, 0, 0, 150, 159, |
| 149 |
5, 8, 0, 0, 151, 155, 5, 11, 0, 0, 152, 154, 5, 11, 0, 0, 153, 152, 1, |
| 150 |
0, 0, 0, 154, 157, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 155, 156, 1, 0, 0, |
| 151 |
0, 156, 158, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 158, 160, 5, 9, 0, 0, 159, |
| 152 |
151, 1, 0, 0, 0, 159, 160, 1, 0, 0, 0, 160, 162, 1, 0, 0, 0, 161, 150, |
| 153 |
1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 164, 3, 40, |
| 154 |
20, 0, 164, 27, 1, 0, 0, 0, 165, 167, 5, 29, 0, 0, 166, 165, 1, 0, 0, 0, |
| 155 |
166, 167, 1, 0, 0, 0, 167, 168, 1, 0, 0, 0, 168, 173, 5, 49, 0, 0, 169, |
| 156 |
170, 5, 29, 0, 0, 170, 172, 5, 49, 0, 0, 171, 169, 1, 0, 0, 0, 172, 175, |
| 157 |
1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 29, 1, 0, |
| 158 |
0, 0, 175, 173, 1, 0, 0, 0, 176, 177, 3, 32, 16, 0, 177, 178, 5, 0, 0, |
| 159 |
1, 178, 31, 1, 0, 0, 0, 179, 181, 3, 34, 17, 0, 180, 182, 3, 36, 18, 0, |
| 160 |
181, 180, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 33, 1, 0, 0, 0, 183, 185, |
| 161 |
5, 29, 0, 0, 184, 183, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 186, 1, 0, |
| 162 |
0, 0, 186, 191, 7, 1, 0, 0, 187, 188, 5, 29, 0, 0, 188, 190, 5, 49, 0, |
| 163 |
0, 189, 187, 1, 0, 0, 0, 190, 193, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 191, |
| 164 |
192, 1, 0, 0, 0, 192, 35, 1, 0, 0, 0, 193, 191, 1, 0, 0, 0, 194, 203, 5, |
| 165 |
27, 0, 0, 195, 200, 3, 32, 16, 0, 196, 197, 5, 30, 0, 0, 197, 199, 3, 32, |
| 166 |
16, 0, 198, 196, 1, 0, 0, 0, 199, 202, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, |
| 167 |
200, 201, 1, 0, 0, 0, 201, 204, 1, 0, 0, 0, 202, 200, 1, 0, 0, 0, 203, |
| 168 |
195, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, 206, |
| 169 |
5, 28, 0, 0, 206, 37, 1, 0, 0, 0, 207, 208, 3, 40, 20, 0, 208, 209, 5, |
| 170 |
0, 0, 1, 209, 39, 1, 0, 0, 0, 210, 216, 3, 42, 21, 0, 211, 212, 5, 33, |
| 171 |
0, 0, 212, 213, 3, 42, 21, 0, 213, 214, 5, 34, 0, 0, 214, 215, 3, 40, 20, |
| 172 |
0, 215, 217, 1, 0, 0, 0, 216, 211, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, |
| 173 |
41, 1, 0, 0, 0, 218, 223, 3, 44, 22, 0, 219, 220, 5, 22, 0, 0, 220, 222, |
| 174 |
3, 44, 22, 0, 221, 219, 1, 0, 0, 0, 222, 225, 1, 0, 0, 0, 223, 221, 1, |
| 175 |
0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 43, 1, 0, 0, 0, 225, 223, 1, 0, 0, |
| 176 |
0, 226, 231, 3, 46, 23, 0, 227, 228, 5, 21, 0, 0, 228, 230, 3, 46, 23, |
| 177 |
0, 229, 227, 1, 0, 0, 0, 230, 233, 1, 0, 0, 0, 231, 229, 1, 0, 0, 0, 231, |
| 178 |
232, 1, 0, 0, 0, 232, 45, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 234, 235, 6, |
| 179 |
23, -1, 0, 235, 236, 3, 48, 24, 0, 236, 242, 1, 0, 0, 0, 237, 238, 10, |
| 180 |
1, 0, 0, 238, 239, 7, 2, 0, 0, 239, 241, 3, 46, 23, 2, 240, 237, 1, 0, |
| 181 |
0, 0, 241, 244, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, |
| 182 |
243, 47, 1, 0, 0, 0, 244, 242, 1, 0, 0, 0, 245, 246, 6, 24, -1, 0, 246, |
| 183 |
247, 3, 50, 25, 0, 247, 256, 1, 0, 0, 0, 248, 249, 10, 2, 0, 0, 249, 250, |
| 184 |
7, 3, 0, 0, 250, 255, 3, 48, 24, 3, 251, 252, 10, 1, 0, 0, 252, 253, 7, |
| 185 |
4, 0, 0, 253, 255, 3, 48, 24, 2, 254, 248, 1, 0, 0, 0, 254, 251, 1, 0, |
| 186 |
0, 0, 255, 258, 1, 0, 0, 0, 256, 254, 1, 0, 0, 0, 256, 257, 1, 0, 0, 0, |
| 187 |
257, 49, 1, 0, 0, 0, 258, 256, 1, 0, 0, 0, 259, 273, 3, 52, 26, 0, 260, |
| 188 |
262, 5, 32, 0, 0, 261, 260, 1, 0, 0, 0, 262, 263, 1, 0, 0, 0, 263, 261, |
| 189 |
1, 0, 0, 0, 263, 264, 1, 0, 0, 0, 264, 265, 1, 0, 0, 0, 265, 273, 3, 52, |
| 190 |
26, 0, 266, 268, 5, 31, 0, 0, 267, 266, 1, 0, 0, 0, 268, 269, 1, 0, 0, |
| 191 |
0, 269, 267, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, |
| 192 |
273, 3, 52, 26, 0, 272, 259, 1, 0, 0, 0, 272, 261, 1, 0, 0, 0, 272, 267, |
| 193 |
1, 0, 0, 0, 273, 51, 1, 0, 0, 0, 274, 275, 6, 26, -1, 0, 275, 276, 3, 54, |
| 194 |
27, 0, 276, 301, 1, 0, 0, 0, 277, 278, 10, 3, 0, 0, 278, 280, 5, 29, 0, |
| 195 |
0, 279, 281, 5, 33, 0, 0, 280, 279, 1, 0, 0, 0, 280, 281, 1, 0, 0, 0, 281, |
| 196 |
282, 1, 0, 0, 0, 282, 300, 3, 66, 33, 0, 283, 284, 10, 2, 0, 0, 284, 285, |
| 197 |
5, 29, 0, 0, 285, 286, 5, 49, 0, 0, 286, 288, 5, 27, 0, 0, 287, 289, 3, |
| 198 |
56, 28, 0, 288, 287, 1, 0, 0, 0, 288, 289, 1, 0, 0, 0, 289, 290, 1, 0, |
| 199 |
0, 0, 290, 300, 5, 28, 0, 0, 291, 292, 10, 1, 0, 0, 292, 294, 5, 23, 0, |
| 200 |
0, 293, 295, 5, 33, 0, 0, 294, 293, 1, 0, 0, 0, 294, 295, 1, 0, 0, 0, 295, |
| 201 |
296, 1, 0, 0, 0, 296, 297, 3, 40, 20, 0, 297, 298, 5, 24, 0, 0, 298, 300, |
| 202 |
1, 0, 0, 0, 299, 277, 1, 0, 0, 0, 299, 283, 1, 0, 0, 0, 299, 291, 1, 0, |
| 203 |
0, 0, 300, 303, 1, 0, 0, 0, 301, 299, 1, 0, 0, 0, 301, 302, 1, 0, 0, 0, |
| 204 |
302, 53, 1, 0, 0, 0, 303, 301, 1, 0, 0, 0, 304, 306, 5, 29, 0, 0, 305, |
| 205 |
304, 1, 0, 0, 0, 305, 306, 1, 0, 0, 0, 306, 307, 1, 0, 0, 0, 307, 358, |
| 206 |
5, 49, 0, 0, 308, 310, 5, 29, 0, 0, 309, 308, 1, 0, 0, 0, 309, 310, 1, |
| 207 |
0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 312, 5, 49, 0, 0, 312, 314, 5, 27, |
| 208 |
0, 0, 313, 315, 3, 56, 28, 0, 314, 313, 1, 0, 0, 0, 314, 315, 1, 0, 0, |
| 209 |
0, 315, 316, 1, 0, 0, 0, 316, 358, 5, 28, 0, 0, 317, 318, 5, 27, 0, 0, |
| 210 |
318, 319, 3, 40, 20, 0, 319, 320, 5, 28, 0, 0, 320, 358, 1, 0, 0, 0, 321, |
| 211 |
323, 5, 23, 0, 0, 322, 324, 3, 58, 29, 0, 323, 322, 1, 0, 0, 0, 323, 324, |
| 212 |
1, 0, 0, 0, 324, 326, 1, 0, 0, 0, 325, 327, 5, 30, 0, 0, 326, 325, 1, 0, |
| 213 |
0, 0, 326, 327, 1, 0, 0, 0, 327, 328, 1, 0, 0, 0, 328, 358, 5, 24, 0, 0, |
| 214 |
329, 331, 5, 25, 0, 0, 330, 332, 3, 64, 32, 0, 331, 330, 1, 0, 0, 0, 331, |
| 215 |
332, 1, 0, 0, 0, 332, 334, 1, 0, 0, 0, 333, 335, 5, 30, 0, 0, 334, 333, |
| 216 |
1, 0, 0, 0, 334, 335, 1, 0, 0, 0, 335, 336, 1, 0, 0, 0, 336, 358, 5, 26, |
| 217 |
0, 0, 337, 339, 5, 29, 0, 0, 338, 337, 1, 0, 0, 0, 338, 339, 1, 0, 0, 0, |
| 218 |
339, 340, 1, 0, 0, 0, 340, 345, 5, 49, 0, 0, 341, 342, 5, 29, 0, 0, 342, |
| 219 |
344, 5, 49, 0, 0, 343, 341, 1, 0, 0, 0, 344, 347, 1, 0, 0, 0, 345, 343, |
| 220 |
1, 0, 0, 0, 345, 346, 1, 0, 0, 0, 346, 348, 1, 0, 0, 0, 347, 345, 1, 0, |
| 221 |
0, 0, 348, 350, 5, 25, 0, 0, 349, 351, 3, 60, 30, 0, 350, 349, 1, 0, 0, |
| 222 |
0, 350, 351, 1, 0, 0, 0, 351, 353, 1, 0, 0, 0, 352, 354, 5, 30, 0, 0, 353, |
| 223 |
352, 1, 0, 0, 0, 353, 354, 1, 0, 0, 0, 354, 355, 1, 0, 0, 0, 355, 358, |
| 224 |
5, 26, 0, 0, 356, 358, 3, 70, 35, 0, 357, 305, 1, 0, 0, 0, 357, 309, 1, |
| 225 |
0, 0, 0, 357, 317, 1, 0, 0, 0, 357, 321, 1, 0, 0, 0, 357, 329, 1, 0, 0, |
| 226 |
0, 357, 338, 1, 0, 0, 0, 357, 356, 1, 0, 0, 0, 358, 55, 1, 0, 0, 0, 359, |
| 227 |
364, 3, 40, 20, 0, 360, 361, 5, 30, 0, 0, 361, 363, 3, 40, 20, 0, 362, |
| 228 |
360, 1, 0, 0, 0, 363, 366, 1, 0, 0, 0, 364, 362, 1, 0, 0, 0, 364, 365, |
| 229 |
1, 0, 0, 0, 365, 57, 1, 0, 0, 0, 366, 364, 1, 0, 0, 0, 367, 372, 3, 68, |
| 230 |
34, 0, 368, 369, 5, 30, 0, 0, 369, 371, 3, 68, 34, 0, 370, 368, 1, 0, 0, |
| 231 |
0, 371, 374, 1, 0, 0, 0, 372, 370, 1, 0, 0, 0, 372, 373, 1, 0, 0, 0, 373, |
| 232 |
59, 1, 0, 0, 0, 374, 372, 1, 0, 0, 0, 375, 376, 3, 62, 31, 0, 376, 377, |
| 233 |
5, 34, 0, 0, 377, 385, 3, 40, 20, 0, 378, 379, 5, 30, 0, 0, 379, 380, 3, |
| 234 |
62, 31, 0, 380, 381, 5, 34, 0, 0, 381, 382, 3, 40, 20, 0, 382, 384, 1, |
| 235 |
0, 0, 0, 383, 378, 1, 0, 0, 0, 384, 387, 1, 0, 0, 0, 385, 383, 1, 0, 0, |
| 236 |
0, 385, 386, 1, 0, 0, 0, 386, 61, 1, 0, 0, 0, 387, 385, 1, 0, 0, 0, 388, |
| 237 |
390, 5, 33, 0, 0, 389, 388, 1, 0, 0, 0, 389, 390, 1, 0, 0, 0, 390, 391, |
| 238 |
1, 0, 0, 0, 391, 392, 3, 66, 33, 0, 392, 63, 1, 0, 0, 0, 393, 394, 3, 68, |
| 239 |
34, 0, 394, 395, 5, 34, 0, 0, 395, 403, 3, 40, 20, 0, 396, 397, 5, 30, |
| 240 |
0, 0, 397, 398, 3, 68, 34, 0, 398, 399, 5, 34, 0, 0, 399, 400, 3, 40, 20, |
| 241 |
0, 400, 402, 1, 0, 0, 0, 401, 396, 1, 0, 0, 0, 402, 405, 1, 0, 0, 0, 403, |
| 242 |
401, 1, 0, 0, 0, 403, 404, 1, 0, 0, 0, 404, 65, 1, 0, 0, 0, 405, 403, 1, |
| 243 |
0, 0, 0, 406, 409, 5, 49, 0, 0, 407, 409, 5, 50, 0, 0, 408, 406, 1, 0, |
| 244 |
0, 0, 408, 407, 1, 0, 0, 0, 409, 67, 1, 0, 0, 0, 410, 412, 5, 33, 0, 0, |
| 245 |
411, 410, 1, 0, 0, 0, 411, 412, 1, 0, 0, 0, 412, 413, 1, 0, 0, 0, 413, |
| 246 |
414, 3, 40, 20, 0, 414, 69, 1, 0, 0, 0, 415, 417, 5, 31, 0, 0, 416, 415, |
| 247 |
1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 418, 1, 0, 0, 0, 418, 430, 5, 45, |
| 248 |
0, 0, 419, 430, 5, 46, 0, 0, 420, 422, 5, 31, 0, 0, 421, 420, 1, 0, 0, |
| 249 |
0, 421, 422, 1, 0, 0, 0, 422, 423, 1, 0, 0, 0, 423, 430, 5, 44, 0, 0, 424, |
| 250 |
430, 5, 47, 0, 0, 425, 430, 5, 48, 0, 0, 426, 430, 5, 39, 0, 0, 427, 430, |
| 251 |
5, 40, 0, 0, 428, 430, 5, 41, 0, 0, 429, 416, 1, 0, 0, 0, 429, 419, 1, |
| 252 |
0, 0, 0, 429, 421, 1, 0, 0, 0, 429, 424, 1, 0, 0, 0, 429, 425, 1, 0, 0, |
| 253 |
0, 429, 426, 1, 0, 0, 0, 429, 427, 1, 0, 0, 0, 429, 428, 1, 0, 0, 0, 430, |
| 254 |
71, 1, 0, 0, 0, 55, 84, 95, 102, 107, 116, 119, 132, 137, 139, 155, 159, |
| 255 |
161, 166, 173, 181, 184, 191, 200, 203, 216, 223, 231, 242, 254, 256, 263, |
| 256 |
269, 272, 280, 288, 294, 299, 301, 305, 309, 314, 323, 326, 331, 334, 338, |
| 257 |
345, 350, 353, 357, 364, 372, 385, 389, 403, 408, 411, 416, 421, 429, |
| 258 |
} |
| 259 |
deserializer := antlr.NewATNDeserializer(nil) |
| 260 |
staticData.atn = deserializer.Deserialize(staticData.serializedATN) |
| 261 |
atn := staticData.atn |
| 262 |
staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState)) |
| 263 |
decisionToDFA := staticData.decisionToDFA |
| 264 |
for index, state := range atn.DecisionToState { |
| 265 |
decisionToDFA[index] = antlr.NewDFA(state, index) |
| 266 |
} |
| 267 |
} |
| 268 |
|
| 269 |
// CommandsParserInit initializes any static state used to implement CommandsParser. By default the |
| 270 |
// static state used to implement the parser is lazily initialized during the first call to |
| 271 |
// NewCommandsParser(). You can call this function if you wish to initialize the static state ahead |
| 272 |
// of time. |
| 273 |
func CommandsParserInit() { |
| 274 |
staticData := &CommandsParserStaticData |
| 275 |
staticData.once.Do(commandsParserInit) |
| 276 |
} |
| 277 |
|
| 278 |
// NewCommandsParser produces a new parser instance for the optional input antlr.TokenStream. |
| 279 |
func NewCommandsParser(input antlr.TokenStream) *CommandsParser { |
| 280 |
CommandsParserInit() |
| 281 |
this := new(CommandsParser) |
| 282 |
this.BaseParser = antlr.NewBaseParser(input) |
| 283 |
staticData := &CommandsParserStaticData |
| 284 |
this.Interpreter = antlr.NewParserATNSimulator(this, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache) |
| 285 |
this.RuleNames = staticData.RuleNames |
| 286 |
this.LiteralNames = staticData.LiteralNames |
| 287 |
this.SymbolicNames = staticData.SymbolicNames |
| 288 |
this.GrammarFileName = "Commands.g4" |
| 289 |
|
| 290 |
return this |
| 291 |
} |
| 292 |
|
| 293 |
// CommandsParser tokens. |
| 294 |
const ( |
| 295 |
CommandsParserEOF = antlr.TokenEOF |
| 296 |
CommandsParserT__0 = 1 |
| 297 |
CommandsParserT__1 = 2 |
| 298 |
CommandsParserT__2 = 3 |
| 299 |
CommandsParserT__3 = 4 |
| 300 |
CommandsParserT__4 = 5 |
| 301 |
CommandsParserT__5 = 6 |
| 302 |
CommandsParserT__6 = 7 |
| 303 |
CommandsParserT__7 = 8 |
| 304 |
CommandsParserT__8 = 9 |
| 305 |
CommandsParserCOMMAND = 10 |
| 306 |
CommandsParserFLAG = 11 |
| 307 |
CommandsParserARROW = 12 |
| 308 |
CommandsParserEQUAL_ASSIGN = 13 |
| 309 |
CommandsParserEQUALS = 14 |
| 310 |
CommandsParserNOT_EQUALS = 15 |
| 311 |
CommandsParserIN = 16 |
| 312 |
CommandsParserLESS = 17 |
| 313 |
CommandsParserLESS_EQUALS = 18 |
| 314 |
CommandsParserGREATER_EQUALS = 19 |
| 315 |
CommandsParserGREATER = 20 |
| 316 |
CommandsParserLOGICAL_AND = 21 |
| 317 |
CommandsParserLOGICAL_OR = 22 |
| 318 |
CommandsParserLBRACKET = 23 |
| 319 |
CommandsParserRPRACKET = 24 |
| 320 |
CommandsParserLBRACE = 25 |
| 321 |
CommandsParserRBRACE = 26 |
| 322 |
CommandsParserLPAREN = 27 |
| 323 |
CommandsParserRPAREN = 28 |
| 324 |
CommandsParserDOT = 29 |
| 325 |
CommandsParserCOMMA = 30 |
| 326 |
CommandsParserMINUS = 31 |
| 327 |
CommandsParserEXCLAM = 32 |
| 328 |
CommandsParserQUESTIONMARK = 33 |
| 329 |
CommandsParserCOLON = 34 |
| 330 |
CommandsParserPLUS = 35 |
| 331 |
CommandsParserSTAR = 36 |
| 332 |
CommandsParserSLASH = 37 |
| 333 |
CommandsParserPERCENT = 38 |
| 334 |
CommandsParserCEL_TRUE = 39 |
| 335 |
CommandsParserCEL_FALSE = 40 |
| 336 |
CommandsParserNUL = 41 |
| 337 |
CommandsParserWHITESPACE = 42 |
| 338 |
CommandsParserCOMMENT = 43 |
| 339 |
CommandsParserNUM_FLOAT = 44 |
| 340 |
CommandsParserNUM_INT = 45 |
| 341 |
CommandsParserNUM_UINT = 46 |
| 342 |
CommandsParserSTRING = 47 |
| 343 |
CommandsParserBYTES = 48 |
| 344 |
CommandsParserIDENTIFIER = 49 |
| 345 |
CommandsParserESC_IDENTIFIER = 50 |
| 346 |
) |
| 347 |
|
| 348 |
// CommandsParser rules. |
| 349 |
const ( |
| 350 |
CommandsParserRULE_startCommand = 0 |
| 351 |
CommandsParserRULE_command = 1 |
| 352 |
CommandsParserRULE_help = 2 |
| 353 |
CommandsParserRULE_let = 3 |
| 354 |
CommandsParserRULE_declare = 4 |
| 355 |
CommandsParserRULE_varDecl = 5 |
| 356 |
CommandsParserRULE_fnDecl = 6 |
| 357 |
CommandsParserRULE_param = 7 |
| 358 |
CommandsParserRULE_delete = 8 |
| 359 |
CommandsParserRULE_simple = 9 |
| 360 |
CommandsParserRULE_empty = 10 |
| 361 |
CommandsParserRULE_compile = 11 |
| 362 |
CommandsParserRULE_parse = 12 |
| 363 |
CommandsParserRULE_exprCmd = 13 |
| 364 |
CommandsParserRULE_qualId = 14 |
| 365 |
CommandsParserRULE_startType = 15 |
| 366 |
CommandsParserRULE_type = 16 |
| 367 |
CommandsParserRULE_typeId = 17 |
| 368 |
CommandsParserRULE_typeParamList = 18 |
| 369 |
CommandsParserRULE_start = 19 |
| 370 |
CommandsParserRULE_expr = 20 |
| 371 |
CommandsParserRULE_conditionalOr = 21 |
| 372 |
CommandsParserRULE_conditionalAnd = 22 |
| 373 |
CommandsParserRULE_relation = 23 |
| 374 |
CommandsParserRULE_calc = 24 |
| 375 |
CommandsParserRULE_unary = 25 |
| 376 |
CommandsParserRULE_member = 26 |
| 377 |
CommandsParserRULE_primary = 27 |
| 378 |
CommandsParserRULE_exprList = 28 |
| 379 |
CommandsParserRULE_listInit = 29 |
| 380 |
CommandsParserRULE_fieldInitializerList = 30 |
| 381 |
CommandsParserRULE_optField = 31 |
| 382 |
CommandsParserRULE_mapInitializerList = 32 |
| 383 |
CommandsParserRULE_escapeIdent = 33 |
| 384 |
CommandsParserRULE_optExpr = 34 |
| 385 |
CommandsParserRULE_literal = 35 |
| 386 |
) |
| 387 |
|
| 388 |
// IStartCommandContext is an interface to support dynamic dispatch. |
| 389 |
type IStartCommandContext interface { |
| 390 |
antlr.ParserRuleContext |
| 391 |
|
| 392 |
// GetParser returns the parser. |
| 393 |
GetParser() antlr.Parser |
| 394 |
|
| 395 |
// Getter signatures |
| 396 |
Command() ICommandContext |
| 397 |
EOF() antlr.TerminalNode |
| 398 |
|
| 399 |
// IsStartCommandContext differentiates from other interfaces. |
| 400 |
IsStartCommandContext() |
| 401 |
} |
| 402 |
|
| 403 |
type StartCommandContext struct { |
| 404 |
antlr.BaseParserRuleContext |
| 405 |
parser antlr.Parser |
| 406 |
} |
| 407 |
|
| 408 |
func NewEmptyStartCommandContext() *StartCommandContext { |
| 409 |
var p = new(StartCommandContext) |
| 410 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 411 |
p.RuleIndex = CommandsParserRULE_startCommand |
| 412 |
return p |
| 413 |
} |
| 414 |
|
| 415 |
func InitEmptyStartCommandContext(p *StartCommandContext) { |
| 416 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 417 |
p.RuleIndex = CommandsParserRULE_startCommand |
| 418 |
} |
| 419 |
|
| 420 |
func (*StartCommandContext) IsStartCommandContext() {} |
| 421 |
|
| 422 |
func NewStartCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StartCommandContext { |
| 423 |
var p = new(StartCommandContext) |
| 424 |
|
| 425 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 426 |
|
| 427 |
p.parser = parser |
| 428 |
p.RuleIndex = CommandsParserRULE_startCommand |
| 429 |
|
| 430 |
return p |
| 431 |
} |
| 432 |
|
| 433 |
func (s *StartCommandContext) GetParser() antlr.Parser { return s.parser } |
| 434 |
|
| 435 |
func (s *StartCommandContext) Command() ICommandContext { |
| 436 |
var t antlr.RuleContext |
| 437 |
for _, ctx := range s.GetChildren() { |
| 438 |
if _, ok := ctx.(ICommandContext); ok { |
| 439 |
t = ctx.(antlr.RuleContext) |
| 440 |
break |
| 441 |
} |
| 442 |
} |
| 443 |
|
| 444 |
if t == nil { |
| 445 |
return nil |
| 446 |
} |
| 447 |
|
| 448 |
return t.(ICommandContext) |
| 449 |
} |
| 450 |
|
| 451 |
func (s *StartCommandContext) EOF() antlr.TerminalNode { |
| 452 |
return s.GetToken(CommandsParserEOF, 0) |
| 453 |
} |
| 454 |
|
| 455 |
func (s *StartCommandContext) GetRuleContext() antlr.RuleContext { |
| 456 |
return s |
| 457 |
} |
| 458 |
|
| 459 |
func (s *StartCommandContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 460 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 461 |
} |
| 462 |
|
| 463 |
func (s *StartCommandContext) EnterRule(listener antlr.ParseTreeListener) { |
| 464 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 465 |
listenerT.EnterStartCommand(s) |
| 466 |
} |
| 467 |
} |
| 468 |
|
| 469 |
func (s *StartCommandContext) ExitRule(listener antlr.ParseTreeListener) { |
| 470 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 471 |
listenerT.ExitStartCommand(s) |
| 472 |
} |
| 473 |
} |
| 474 |
|
| 475 |
func (s *StartCommandContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 476 |
switch t := visitor.(type) { |
| 477 |
case CommandsVisitor: |
| 478 |
return t.VisitStartCommand(s) |
| 479 |
|
| 480 |
default: |
| 481 |
return t.VisitChildren(s) |
| 482 |
} |
| 483 |
} |
| 484 |
|
| 485 |
func (p *CommandsParser) StartCommand() (localctx IStartCommandContext) { |
| 486 |
localctx = NewStartCommandContext(p, p.GetParserRuleContext(), p.GetState()) |
| 487 |
p.EnterRule(localctx, 0, CommandsParserRULE_startCommand) |
| 488 |
p.EnterOuterAlt(localctx, 1) |
| 489 |
{ |
| 490 |
p.SetState(72) |
| 491 |
p.Command() |
| 492 |
} |
| 493 |
{ |
| 494 |
p.SetState(73) |
| 495 |
p.Match(CommandsParserEOF) |
| 496 |
if p.HasError() { |
| 497 |
// Recognition error - abort rule |
| 498 |
goto errorExit |
| 499 |
} |
| 500 |
} |
| 501 |
|
| 502 |
errorExit: |
| 503 |
if p.HasError() { |
| 504 |
v := p.GetError() |
| 505 |
localctx.SetException(v) |
| 506 |
p.GetErrorHandler().ReportError(p, v) |
| 507 |
p.GetErrorHandler().Recover(p, v) |
| 508 |
p.SetError(nil) |
| 509 |
} |
| 510 |
p.ExitRule() |
| 511 |
return localctx |
| 512 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 513 |
} |
| 514 |
|
| 515 |
// ICommandContext is an interface to support dynamic dispatch. |
| 516 |
type ICommandContext interface { |
| 517 |
antlr.ParserRuleContext |
| 518 |
|
| 519 |
// GetParser returns the parser. |
| 520 |
GetParser() antlr.Parser |
| 521 |
|
| 522 |
// Getter signatures |
| 523 |
Help() IHelpContext |
| 524 |
Let() ILetContext |
| 525 |
Declare() IDeclareContext |
| 526 |
Delete_() IDeleteContext |
| 527 |
Simple() ISimpleContext |
| 528 |
Compile() ICompileContext |
| 529 |
Parse() IParseContext |
| 530 |
ExprCmd() IExprCmdContext |
| 531 |
Empty() IEmptyContext |
| 532 |
|
| 533 |
// IsCommandContext differentiates from other interfaces. |
| 534 |
IsCommandContext() |
| 535 |
} |
| 536 |
|
| 537 |
type CommandContext struct { |
| 538 |
antlr.BaseParserRuleContext |
| 539 |
parser antlr.Parser |
| 540 |
} |
| 541 |
|
| 542 |
func NewEmptyCommandContext() *CommandContext { |
| 543 |
var p = new(CommandContext) |
| 544 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 545 |
p.RuleIndex = CommandsParserRULE_command |
| 546 |
return p |
| 547 |
} |
| 548 |
|
| 549 |
func InitEmptyCommandContext(p *CommandContext) { |
| 550 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 551 |
p.RuleIndex = CommandsParserRULE_command |
| 552 |
} |
| 553 |
|
| 554 |
func (*CommandContext) IsCommandContext() {} |
| 555 |
|
| 556 |
func NewCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CommandContext { |
| 557 |
var p = new(CommandContext) |
| 558 |
|
| 559 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 560 |
|
| 561 |
p.parser = parser |
| 562 |
p.RuleIndex = CommandsParserRULE_command |
| 563 |
|
| 564 |
return p |
| 565 |
} |
| 566 |
|
| 567 |
func (s *CommandContext) GetParser() antlr.Parser { return s.parser } |
| 568 |
|
| 569 |
func (s *CommandContext) Help() IHelpContext { |
| 570 |
var t antlr.RuleContext |
| 571 |
for _, ctx := range s.GetChildren() { |
| 572 |
if _, ok := ctx.(IHelpContext); ok { |
| 573 |
t = ctx.(antlr.RuleContext) |
| 574 |
break |
| 575 |
} |
| 576 |
} |
| 577 |
|
| 578 |
if t == nil { |
| 579 |
return nil |
| 580 |
} |
| 581 |
|
| 582 |
return t.(IHelpContext) |
| 583 |
} |
| 584 |
|
| 585 |
func (s *CommandContext) Let() ILetContext { |
| 586 |
var t antlr.RuleContext |
| 587 |
for _, ctx := range s.GetChildren() { |
| 588 |
if _, ok := ctx.(ILetContext); ok { |
| 589 |
t = ctx.(antlr.RuleContext) |
| 590 |
break |
| 591 |
} |
| 592 |
} |
| 593 |
|
| 594 |
if t == nil { |
| 595 |
return nil |
| 596 |
} |
| 597 |
|
| 598 |
return t.(ILetContext) |
| 599 |
} |
| 600 |
|
| 601 |
func (s *CommandContext) Declare() IDeclareContext { |
| 602 |
var t antlr.RuleContext |
| 603 |
for _, ctx := range s.GetChildren() { |
| 604 |
if _, ok := ctx.(IDeclareContext); ok { |
| 605 |
t = ctx.(antlr.RuleContext) |
| 606 |
break |
| 607 |
} |
| 608 |
} |
| 609 |
|
| 610 |
if t == nil { |
| 611 |
return nil |
| 612 |
} |
| 613 |
|
| 614 |
return t.(IDeclareContext) |
| 615 |
} |
| 616 |
|
| 617 |
func (s *CommandContext) Delete_() IDeleteContext { |
| 618 |
var t antlr.RuleContext |
| 619 |
for _, ctx := range s.GetChildren() { |
| 620 |
if _, ok := ctx.(IDeleteContext); ok { |
| 621 |
t = ctx.(antlr.RuleContext) |
| 622 |
break |
| 623 |
} |
| 624 |
} |
| 625 |
|
| 626 |
if t == nil { |
| 627 |
return nil |
| 628 |
} |
| 629 |
|
| 630 |
return t.(IDeleteContext) |
| 631 |
} |
| 632 |
|
| 633 |
func (s *CommandContext) Simple() ISimpleContext { |
| 634 |
var t antlr.RuleContext |
| 635 |
for _, ctx := range s.GetChildren() { |
| 636 |
if _, ok := ctx.(ISimpleContext); ok { |
| 637 |
t = ctx.(antlr.RuleContext) |
| 638 |
break |
| 639 |
} |
| 640 |
} |
| 641 |
|
| 642 |
if t == nil { |
| 643 |
return nil |
| 644 |
} |
| 645 |
|
| 646 |
return t.(ISimpleContext) |
| 647 |
} |
| 648 |
|
| 649 |
func (s *CommandContext) Compile() ICompileContext { |
| 650 |
var t antlr.RuleContext |
| 651 |
for _, ctx := range s.GetChildren() { |
| 652 |
if _, ok := ctx.(ICompileContext); ok { |
| 653 |
t = ctx.(antlr.RuleContext) |
| 654 |
break |
| 655 |
} |
| 656 |
} |
| 657 |
|
| 658 |
if t == nil { |
| 659 |
return nil |
| 660 |
} |
| 661 |
|
| 662 |
return t.(ICompileContext) |
| 663 |
} |
| 664 |
|
| 665 |
func (s *CommandContext) Parse() IParseContext { |
| 666 |
var t antlr.RuleContext |
| 667 |
for _, ctx := range s.GetChildren() { |
| 668 |
if _, ok := ctx.(IParseContext); ok { |
| 669 |
t = ctx.(antlr.RuleContext) |
| 670 |
break |
| 671 |
} |
| 672 |
} |
| 673 |
|
| 674 |
if t == nil { |
| 675 |
return nil |
| 676 |
} |
| 677 |
|
| 678 |
return t.(IParseContext) |
| 679 |
} |
| 680 |
|
| 681 |
func (s *CommandContext) ExprCmd() IExprCmdContext { |
| 682 |
var t antlr.RuleContext |
| 683 |
for _, ctx := range s.GetChildren() { |
| 684 |
if _, ok := ctx.(IExprCmdContext); ok { |
| 685 |
t = ctx.(antlr.RuleContext) |
| 686 |
break |
| 687 |
} |
| 688 |
} |
| 689 |
|
| 690 |
if t == nil { |
| 691 |
return nil |
| 692 |
} |
| 693 |
|
| 694 |
return t.(IExprCmdContext) |
| 695 |
} |
| 696 |
|
| 697 |
func (s *CommandContext) Empty() IEmptyContext { |
| 698 |
var t antlr.RuleContext |
| 699 |
for _, ctx := range s.GetChildren() { |
| 700 |
if _, ok := ctx.(IEmptyContext); ok { |
| 701 |
t = ctx.(antlr.RuleContext) |
| 702 |
break |
| 703 |
} |
| 704 |
} |
| 705 |
|
| 706 |
if t == nil { |
| 707 |
return nil |
| 708 |
} |
| 709 |
|
| 710 |
return t.(IEmptyContext) |
| 711 |
} |
| 712 |
|
| 713 |
func (s *CommandContext) GetRuleContext() antlr.RuleContext { |
| 714 |
return s |
| 715 |
} |
| 716 |
|
| 717 |
func (s *CommandContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 718 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 719 |
} |
| 720 |
|
| 721 |
func (s *CommandContext) EnterRule(listener antlr.ParseTreeListener) { |
| 722 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 723 |
listenerT.EnterCommand(s) |
| 724 |
} |
| 725 |
} |
| 726 |
|
| 727 |
func (s *CommandContext) ExitRule(listener antlr.ParseTreeListener) { |
| 728 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 729 |
listenerT.ExitCommand(s) |
| 730 |
} |
| 731 |
} |
| 732 |
|
| 733 |
func (s *CommandContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 734 |
switch t := visitor.(type) { |
| 735 |
case CommandsVisitor: |
| 736 |
return t.VisitCommand(s) |
| 737 |
|
| 738 |
default: |
| 739 |
return t.VisitChildren(s) |
| 740 |
} |
| 741 |
} |
| 742 |
|
| 743 |
func (p *CommandsParser) Command() (localctx ICommandContext) { |
| 744 |
localctx = NewCommandContext(p, p.GetParserRuleContext(), p.GetState()) |
| 745 |
p.EnterRule(localctx, 2, CommandsParserRULE_command) |
| 746 |
p.SetState(84) |
| 747 |
p.GetErrorHandler().Sync(p) |
| 748 |
if p.HasError() { |
| 749 |
goto errorExit |
| 750 |
} |
| 751 |
|
| 752 |
switch p.GetTokenStream().LA(1) { |
| 753 |
case CommandsParserT__0, CommandsParserT__1: |
| 754 |
p.EnterOuterAlt(localctx, 1) |
| 755 |
{ |
| 756 |
p.SetState(75) |
| 757 |
p.Help() |
| 758 |
} |
| 759 |
|
| 760 |
case CommandsParserT__2: |
| 761 |
p.EnterOuterAlt(localctx, 2) |
| 762 |
{ |
| 763 |
p.SetState(76) |
| 764 |
p.Let() |
| 765 |
} |
| 766 |
|
| 767 |
case CommandsParserT__3: |
| 768 |
p.EnterOuterAlt(localctx, 3) |
| 769 |
{ |
| 770 |
p.SetState(77) |
| 771 |
p.Declare() |
| 772 |
} |
| 773 |
|
| 774 |
case CommandsParserT__4: |
| 775 |
p.EnterOuterAlt(localctx, 4) |
| 776 |
{ |
| 777 |
p.SetState(78) |
| 778 |
p.Delete_() |
| 779 |
} |
| 780 |
|
| 781 |
case CommandsParserCOMMAND: |
| 782 |
p.EnterOuterAlt(localctx, 5) |
| 783 |
{ |
| 784 |
p.SetState(79) |
| 785 |
p.Simple() |
| 786 |
} |
| 787 |
|
| 788 |
case CommandsParserT__5: |
| 789 |
p.EnterOuterAlt(localctx, 6) |
| 790 |
{ |
| 791 |
p.SetState(80) |
| 792 |
p.Compile() |
| 793 |
} |
| 794 |
|
| 795 |
case CommandsParserT__6: |
| 796 |
p.EnterOuterAlt(localctx, 7) |
| 797 |
{ |
| 798 |
p.SetState(81) |
| 799 |
p.Parse() |
| 800 |
} |
| 801 |
|
| 802 |
case CommandsParserT__7, CommandsParserLBRACKET, CommandsParserLBRACE, CommandsParserLPAREN, CommandsParserDOT, CommandsParserMINUS, CommandsParserEXCLAM, CommandsParserCEL_TRUE, CommandsParserCEL_FALSE, CommandsParserNUL, CommandsParserNUM_FLOAT, CommandsParserNUM_INT, CommandsParserNUM_UINT, CommandsParserSTRING, CommandsParserBYTES, CommandsParserIDENTIFIER: |
| 803 |
p.EnterOuterAlt(localctx, 8) |
| 804 |
{ |
| 805 |
p.SetState(82) |
| 806 |
p.ExprCmd() |
| 807 |
} |
| 808 |
|
| 809 |
case CommandsParserEOF: |
| 810 |
p.EnterOuterAlt(localctx, 9) |
| 811 |
{ |
| 812 |
p.SetState(83) |
| 813 |
p.Empty() |
| 814 |
} |
| 815 |
|
| 816 |
default: |
| 817 |
p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) |
| 818 |
goto errorExit |
| 819 |
} |
| 820 |
|
| 821 |
errorExit: |
| 822 |
if p.HasError() { |
| 823 |
v := p.GetError() |
| 824 |
localctx.SetException(v) |
| 825 |
p.GetErrorHandler().ReportError(p, v) |
| 826 |
p.GetErrorHandler().Recover(p, v) |
| 827 |
p.SetError(nil) |
| 828 |
} |
| 829 |
p.ExitRule() |
| 830 |
return localctx |
| 831 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 832 |
} |
| 833 |
|
| 834 |
// IHelpContext is an interface to support dynamic dispatch. |
| 835 |
type IHelpContext interface { |
| 836 |
antlr.ParserRuleContext |
| 837 |
|
| 838 |
// GetParser returns the parser. |
| 839 |
GetParser() antlr.Parser |
| 840 |
// IsHelpContext differentiates from other interfaces. |
| 841 |
IsHelpContext() |
| 842 |
} |
| 843 |
|
| 844 |
type HelpContext struct { |
| 845 |
antlr.BaseParserRuleContext |
| 846 |
parser antlr.Parser |
| 847 |
} |
| 848 |
|
| 849 |
func NewEmptyHelpContext() *HelpContext { |
| 850 |
var p = new(HelpContext) |
| 851 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 852 |
p.RuleIndex = CommandsParserRULE_help |
| 853 |
return p |
| 854 |
} |
| 855 |
|
| 856 |
func InitEmptyHelpContext(p *HelpContext) { |
| 857 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 858 |
p.RuleIndex = CommandsParserRULE_help |
| 859 |
} |
| 860 |
|
| 861 |
func (*HelpContext) IsHelpContext() {} |
| 862 |
|
| 863 |
func NewHelpContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *HelpContext { |
| 864 |
var p = new(HelpContext) |
| 865 |
|
| 866 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 867 |
|
| 868 |
p.parser = parser |
| 869 |
p.RuleIndex = CommandsParserRULE_help |
| 870 |
|
| 871 |
return p |
| 872 |
} |
| 873 |
|
| 874 |
func (s *HelpContext) GetParser() antlr.Parser { return s.parser } |
| 875 |
func (s *HelpContext) GetRuleContext() antlr.RuleContext { |
| 876 |
return s |
| 877 |
} |
| 878 |
|
| 879 |
func (s *HelpContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 880 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 881 |
} |
| 882 |
|
| 883 |
func (s *HelpContext) EnterRule(listener antlr.ParseTreeListener) { |
| 884 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 885 |
listenerT.EnterHelp(s) |
| 886 |
} |
| 887 |
} |
| 888 |
|
| 889 |
func (s *HelpContext) ExitRule(listener antlr.ParseTreeListener) { |
| 890 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 891 |
listenerT.ExitHelp(s) |
| 892 |
} |
| 893 |
} |
| 894 |
|
| 895 |
func (s *HelpContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 896 |
switch t := visitor.(type) { |
| 897 |
case CommandsVisitor: |
| 898 |
return t.VisitHelp(s) |
| 899 |
|
| 900 |
default: |
| 901 |
return t.VisitChildren(s) |
| 902 |
} |
| 903 |
} |
| 904 |
|
| 905 |
func (p *CommandsParser) Help() (localctx IHelpContext) { |
| 906 |
localctx = NewHelpContext(p, p.GetParserRuleContext(), p.GetState()) |
| 907 |
p.EnterRule(localctx, 4, CommandsParserRULE_help) |
| 908 |
var _la int |
| 909 |
|
| 910 |
p.EnterOuterAlt(localctx, 1) |
| 911 |
{ |
| 912 |
p.SetState(86) |
| 913 |
_la = p.GetTokenStream().LA(1) |
| 914 |
|
| 915 |
if !(_la == CommandsParserT__0 || _la == CommandsParserT__1) { |
| 916 |
p.GetErrorHandler().RecoverInline(p) |
| 917 |
} else { |
| 918 |
p.GetErrorHandler().ReportMatch(p) |
| 919 |
p.Consume() |
| 920 |
} |
| 921 |
} |
| 922 |
|
| 923 |
errorExit: |
| 924 |
if p.HasError() { |
| 925 |
v := p.GetError() |
| 926 |
localctx.SetException(v) |
| 927 |
p.GetErrorHandler().ReportError(p, v) |
| 928 |
p.GetErrorHandler().Recover(p, v) |
| 929 |
p.SetError(nil) |
| 930 |
} |
| 931 |
p.ExitRule() |
| 932 |
return localctx |
| 933 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 934 |
} |
| 935 |
|
| 936 |
// ILetContext is an interface to support dynamic dispatch. |
| 937 |
type ILetContext interface { |
| 938 |
antlr.ParserRuleContext |
| 939 |
|
| 940 |
// GetParser returns the parser. |
| 941 |
GetParser() antlr.Parser |
| 942 |
|
| 943 |
// GetVar_ returns the var_ rule contexts. |
| 944 |
GetVar_() IVarDeclContext |
| 945 |
|
| 946 |
// GetFn returns the fn rule contexts. |
| 947 |
GetFn() IFnDeclContext |
| 948 |
|
| 949 |
// GetE returns the e rule contexts. |
| 950 |
GetE() IExprContext |
| 951 |
|
| 952 |
// SetVar_ sets the var_ rule contexts. |
| 953 |
SetVar_(IVarDeclContext) |
| 954 |
|
| 955 |
// SetFn sets the fn rule contexts. |
| 956 |
SetFn(IFnDeclContext) |
| 957 |
|
| 958 |
// SetE sets the e rule contexts. |
| 959 |
SetE(IExprContext) |
| 960 |
|
| 961 |
// Getter signatures |
| 962 |
Expr() IExprContext |
| 963 |
EQUAL_ASSIGN() antlr.TerminalNode |
| 964 |
ARROW() antlr.TerminalNode |
| 965 |
VarDecl() IVarDeclContext |
| 966 |
FnDecl() IFnDeclContext |
| 967 |
|
| 968 |
// IsLetContext differentiates from other interfaces. |
| 969 |
IsLetContext() |
| 970 |
} |
| 971 |
|
| 972 |
type LetContext struct { |
| 973 |
antlr.BaseParserRuleContext |
| 974 |
parser antlr.Parser |
| 975 |
var_ IVarDeclContext |
| 976 |
fn IFnDeclContext |
| 977 |
e IExprContext |
| 978 |
} |
| 979 |
|
| 980 |
func NewEmptyLetContext() *LetContext { |
| 981 |
var p = new(LetContext) |
| 982 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 983 |
p.RuleIndex = CommandsParserRULE_let |
| 984 |
return p |
| 985 |
} |
| 986 |
|
| 987 |
func InitEmptyLetContext(p *LetContext) { |
| 988 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 989 |
p.RuleIndex = CommandsParserRULE_let |
| 990 |
} |
| 991 |
|
| 992 |
func (*LetContext) IsLetContext() {} |
| 993 |
|
| 994 |
func NewLetContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LetContext { |
| 995 |
var p = new(LetContext) |
| 996 |
|
| 997 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 998 |
|
| 999 |
p.parser = parser |
| 1000 |
p.RuleIndex = CommandsParserRULE_let |
| 1001 |
|
| 1002 |
return p |
| 1003 |
} |
| 1004 |
|
| 1005 |
func (s *LetContext) GetParser() antlr.Parser { return s.parser } |
| 1006 |
|
| 1007 |
func (s *LetContext) GetVar_() IVarDeclContext { return s.var_ } |
| 1008 |
|
| 1009 |
func (s *LetContext) GetFn() IFnDeclContext { return s.fn } |
| 1010 |
|
| 1011 |
func (s *LetContext) GetE() IExprContext { return s.e } |
| 1012 |
|
| 1013 |
func (s *LetContext) SetVar_(v IVarDeclContext) { s.var_ = v } |
| 1014 |
|
| 1015 |
func (s *LetContext) SetFn(v IFnDeclContext) { s.fn = v } |
| 1016 |
|
| 1017 |
func (s *LetContext) SetE(v IExprContext) { s.e = v } |
| 1018 |
|
| 1019 |
func (s *LetContext) Expr() IExprContext { |
| 1020 |
var t antlr.RuleContext |
| 1021 |
for _, ctx := range s.GetChildren() { |
| 1022 |
if _, ok := ctx.(IExprContext); ok { |
| 1023 |
t = ctx.(antlr.RuleContext) |
| 1024 |
break |
| 1025 |
} |
| 1026 |
} |
| 1027 |
|
| 1028 |
if t == nil { |
| 1029 |
return nil |
| 1030 |
} |
| 1031 |
|
| 1032 |
return t.(IExprContext) |
| 1033 |
} |
| 1034 |
|
| 1035 |
func (s *LetContext) EQUAL_ASSIGN() antlr.TerminalNode { |
| 1036 |
return s.GetToken(CommandsParserEQUAL_ASSIGN, 0) |
| 1037 |
} |
| 1038 |
|
| 1039 |
func (s *LetContext) ARROW() antlr.TerminalNode { |
| 1040 |
return s.GetToken(CommandsParserARROW, 0) |
| 1041 |
} |
| 1042 |
|
| 1043 |
func (s *LetContext) VarDecl() IVarDeclContext { |
| 1044 |
var t antlr.RuleContext |
| 1045 |
for _, ctx := range s.GetChildren() { |
| 1046 |
if _, ok := ctx.(IVarDeclContext); ok { |
| 1047 |
t = ctx.(antlr.RuleContext) |
| 1048 |
break |
| 1049 |
} |
| 1050 |
} |
| 1051 |
|
| 1052 |
if t == nil { |
| 1053 |
return nil |
| 1054 |
} |
| 1055 |
|
| 1056 |
return t.(IVarDeclContext) |
| 1057 |
} |
| 1058 |
|
| 1059 |
func (s *LetContext) FnDecl() IFnDeclContext { |
| 1060 |
var t antlr.RuleContext |
| 1061 |
for _, ctx := range s.GetChildren() { |
| 1062 |
if _, ok := ctx.(IFnDeclContext); ok { |
| 1063 |
t = ctx.(antlr.RuleContext) |
| 1064 |
break |
| 1065 |
} |
| 1066 |
} |
| 1067 |
|
| 1068 |
if t == nil { |
| 1069 |
return nil |
| 1070 |
} |
| 1071 |
|
| 1072 |
return t.(IFnDeclContext) |
| 1073 |
} |
| 1074 |
|
| 1075 |
func (s *LetContext) GetRuleContext() antlr.RuleContext { |
| 1076 |
return s |
| 1077 |
} |
| 1078 |
|
| 1079 |
func (s *LetContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 1080 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 1081 |
} |
| 1082 |
|
| 1083 |
func (s *LetContext) EnterRule(listener antlr.ParseTreeListener) { |
| 1084 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 1085 |
listenerT.EnterLet(s) |
| 1086 |
} |
| 1087 |
} |
| 1088 |
|
| 1089 |
func (s *LetContext) ExitRule(listener antlr.ParseTreeListener) { |
| 1090 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 1091 |
listenerT.ExitLet(s) |
| 1092 |
} |
| 1093 |
} |
| 1094 |
|
| 1095 |
func (s *LetContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 1096 |
switch t := visitor.(type) { |
| 1097 |
case CommandsVisitor: |
| 1098 |
return t.VisitLet(s) |
| 1099 |
|
| 1100 |
default: |
| 1101 |
return t.VisitChildren(s) |
| 1102 |
} |
| 1103 |
} |
| 1104 |
|
| 1105 |
func (p *CommandsParser) Let() (localctx ILetContext) { |
| 1106 |
localctx = NewLetContext(p, p.GetParserRuleContext(), p.GetState()) |
| 1107 |
p.EnterRule(localctx, 6, CommandsParserRULE_let) |
| 1108 |
p.EnterOuterAlt(localctx, 1) |
| 1109 |
{ |
| 1110 |
p.SetState(88) |
| 1111 |
p.Match(CommandsParserT__2) |
| 1112 |
if p.HasError() { |
| 1113 |
// Recognition error - abort rule |
| 1114 |
goto errorExit |
| 1115 |
} |
| 1116 |
} |
| 1117 |
p.SetState(95) |
| 1118 |
p.GetErrorHandler().Sync(p) |
| 1119 |
if p.HasError() { |
| 1120 |
goto errorExit |
| 1121 |
} |
| 1122 |
|
| 1123 |
switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 1, p.GetParserRuleContext()) { |
| 1124 |
case 1: |
| 1125 |
{ |
| 1126 |
p.SetState(89) |
| 1127 |
|
| 1128 |
var _x = p.VarDecl() |
| 1129 |
|
| 1130 |
localctx.(*LetContext).var_ = _x |
| 1131 |
} |
| 1132 |
{ |
| 1133 |
p.SetState(90) |
| 1134 |
p.Match(CommandsParserEQUAL_ASSIGN) |
| 1135 |
if p.HasError() { |
| 1136 |
// Recognition error - abort rule |
| 1137 |
goto errorExit |
| 1138 |
} |
| 1139 |
} |
| 1140 |
|
| 1141 |
case 2: |
| 1142 |
{ |
| 1143 |
p.SetState(92) |
| 1144 |
|
| 1145 |
var _x = p.FnDecl() |
| 1146 |
|
| 1147 |
localctx.(*LetContext).fn = _x |
| 1148 |
} |
| 1149 |
{ |
| 1150 |
p.SetState(93) |
| 1151 |
p.Match(CommandsParserARROW) |
| 1152 |
if p.HasError() { |
| 1153 |
// Recognition error - abort rule |
| 1154 |
goto errorExit |
| 1155 |
} |
| 1156 |
} |
| 1157 |
|
| 1158 |
case antlr.ATNInvalidAltNumber: |
| 1159 |
goto errorExit |
| 1160 |
} |
| 1161 |
{ |
| 1162 |
p.SetState(97) |
| 1163 |
|
| 1164 |
var _x = p.Expr() |
| 1165 |
|
| 1166 |
localctx.(*LetContext).e = _x |
| 1167 |
} |
| 1168 |
|
| 1169 |
errorExit: |
| 1170 |
if p.HasError() { |
| 1171 |
v := p.GetError() |
| 1172 |
localctx.SetException(v) |
| 1173 |
p.GetErrorHandler().ReportError(p, v) |
| 1174 |
p.GetErrorHandler().Recover(p, v) |
| 1175 |
p.SetError(nil) |
| 1176 |
} |
| 1177 |
p.ExitRule() |
| 1178 |
return localctx |
| 1179 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 1180 |
} |
| 1181 |
|
| 1182 |
// IDeclareContext is an interface to support dynamic dispatch. |
| 1183 |
type IDeclareContext interface { |
| 1184 |
antlr.ParserRuleContext |
| 1185 |
|
| 1186 |
// GetParser returns the parser. |
| 1187 |
GetParser() antlr.Parser |
| 1188 |
|
| 1189 |
// GetVar_ returns the var_ rule contexts. |
| 1190 |
GetVar_() IVarDeclContext |
| 1191 |
|
| 1192 |
// GetFn returns the fn rule contexts. |
| 1193 |
GetFn() IFnDeclContext |
| 1194 |
|
| 1195 |
// SetVar_ sets the var_ rule contexts. |
| 1196 |
SetVar_(IVarDeclContext) |
| 1197 |
|
| 1198 |
// SetFn sets the fn rule contexts. |
| 1199 |
SetFn(IFnDeclContext) |
| 1200 |
|
| 1201 |
// Getter signatures |
| 1202 |
VarDecl() IVarDeclContext |
| 1203 |
FnDecl() IFnDeclContext |
| 1204 |
|
| 1205 |
// IsDeclareContext differentiates from other interfaces. |
| 1206 |
IsDeclareContext() |
| 1207 |
} |
| 1208 |
|
| 1209 |
type DeclareContext struct { |
| 1210 |
antlr.BaseParserRuleContext |
| 1211 |
parser antlr.Parser |
| 1212 |
var_ IVarDeclContext |
| 1213 |
fn IFnDeclContext |
| 1214 |
} |
| 1215 |
|
| 1216 |
func NewEmptyDeclareContext() *DeclareContext { |
| 1217 |
var p = new(DeclareContext) |
| 1218 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 1219 |
p.RuleIndex = CommandsParserRULE_declare |
| 1220 |
return p |
| 1221 |
} |
| 1222 |
|
| 1223 |
func InitEmptyDeclareContext(p *DeclareContext) { |
| 1224 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 1225 |
p.RuleIndex = CommandsParserRULE_declare |
| 1226 |
} |
| 1227 |
|
| 1228 |
func (*DeclareContext) IsDeclareContext() {} |
| 1229 |
|
| 1230 |
func NewDeclareContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DeclareContext { |
| 1231 |
var p = new(DeclareContext) |
| 1232 |
|
| 1233 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 1234 |
|
| 1235 |
p.parser = parser |
| 1236 |
p.RuleIndex = CommandsParserRULE_declare |
| 1237 |
|
| 1238 |
return p |
| 1239 |
} |
| 1240 |
|
| 1241 |
func (s *DeclareContext) GetParser() antlr.Parser { return s.parser } |
| 1242 |
|
| 1243 |
func (s *DeclareContext) GetVar_() IVarDeclContext { return s.var_ } |
| 1244 |
|
| 1245 |
func (s *DeclareContext) GetFn() IFnDeclContext { return s.fn } |
| 1246 |
|
| 1247 |
func (s *DeclareContext) SetVar_(v IVarDeclContext) { s.var_ = v } |
| 1248 |
|
| 1249 |
func (s *DeclareContext) SetFn(v IFnDeclContext) { s.fn = v } |
| 1250 |
|
| 1251 |
func (s *DeclareContext) VarDecl() IVarDeclContext { |
| 1252 |
var t antlr.RuleContext |
| 1253 |
for _, ctx := range s.GetChildren() { |
| 1254 |
if _, ok := ctx.(IVarDeclContext); ok { |
| 1255 |
t = ctx.(antlr.RuleContext) |
| 1256 |
break |
| 1257 |
} |
| 1258 |
} |
| 1259 |
|
| 1260 |
if t == nil { |
| 1261 |
return nil |
| 1262 |
} |
| 1263 |
|
| 1264 |
return t.(IVarDeclContext) |
| 1265 |
} |
| 1266 |
|
| 1267 |
func (s *DeclareContext) FnDecl() IFnDeclContext { |
| 1268 |
var t antlr.RuleContext |
| 1269 |
for _, ctx := range s.GetChildren() { |
| 1270 |
if _, ok := ctx.(IFnDeclContext); ok { |
| 1271 |
t = ctx.(antlr.RuleContext) |
| 1272 |
break |
| 1273 |
} |
| 1274 |
} |
| 1275 |
|
| 1276 |
if t == nil { |
| 1277 |
return nil |
| 1278 |
} |
| 1279 |
|
| 1280 |
return t.(IFnDeclContext) |
| 1281 |
} |
| 1282 |
|
| 1283 |
func (s *DeclareContext) GetRuleContext() antlr.RuleContext { |
| 1284 |
return s |
| 1285 |
} |
| 1286 |
|
| 1287 |
func (s *DeclareContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 1288 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 1289 |
} |
| 1290 |
|
| 1291 |
func (s *DeclareContext) EnterRule(listener antlr.ParseTreeListener) { |
| 1292 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 1293 |
listenerT.EnterDeclare(s) |
| 1294 |
} |
| 1295 |
} |
| 1296 |
|
| 1297 |
func (s *DeclareContext) ExitRule(listener antlr.ParseTreeListener) { |
| 1298 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 1299 |
listenerT.ExitDeclare(s) |
| 1300 |
} |
| 1301 |
} |
| 1302 |
|
| 1303 |
func (s *DeclareContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 1304 |
switch t := visitor.(type) { |
| 1305 |
case CommandsVisitor: |
| 1306 |
return t.VisitDeclare(s) |
| 1307 |
|
| 1308 |
default: |
| 1309 |
return t.VisitChildren(s) |
| 1310 |
} |
| 1311 |
} |
| 1312 |
|
| 1313 |
func (p *CommandsParser) Declare() (localctx IDeclareContext) { |
| 1314 |
localctx = NewDeclareContext(p, p.GetParserRuleContext(), p.GetState()) |
| 1315 |
p.EnterRule(localctx, 8, CommandsParserRULE_declare) |
| 1316 |
p.EnterOuterAlt(localctx, 1) |
| 1317 |
{ |
| 1318 |
p.SetState(99) |
| 1319 |
p.Match(CommandsParserT__3) |
| 1320 |
if p.HasError() { |
| 1321 |
// Recognition error - abort rule |
| 1322 |
goto errorExit |
| 1323 |
} |
| 1324 |
} |
| 1325 |
p.SetState(102) |
| 1326 |
p.GetErrorHandler().Sync(p) |
| 1327 |
if p.HasError() { |
| 1328 |
goto errorExit |
| 1329 |
} |
| 1330 |
|
| 1331 |
switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 2, p.GetParserRuleContext()) { |
| 1332 |
case 1: |
| 1333 |
{ |
| 1334 |
p.SetState(100) |
| 1335 |
|
| 1336 |
var _x = p.VarDecl() |
| 1337 |
|
| 1338 |
localctx.(*DeclareContext).var_ = _x |
| 1339 |
} |
| 1340 |
|
| 1341 |
case 2: |
| 1342 |
{ |
| 1343 |
p.SetState(101) |
| 1344 |
|
| 1345 |
var _x = p.FnDecl() |
| 1346 |
|
| 1347 |
localctx.(*DeclareContext).fn = _x |
| 1348 |
} |
| 1349 |
|
| 1350 |
case antlr.ATNInvalidAltNumber: |
| 1351 |
goto errorExit |
| 1352 |
} |
| 1353 |
|
| 1354 |
errorExit: |
| 1355 |
if p.HasError() { |
| 1356 |
v := p.GetError() |
| 1357 |
localctx.SetException(v) |
| 1358 |
p.GetErrorHandler().ReportError(p, v) |
| 1359 |
p.GetErrorHandler().Recover(p, v) |
| 1360 |
p.SetError(nil) |
| 1361 |
} |
| 1362 |
p.ExitRule() |
| 1363 |
return localctx |
| 1364 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 1365 |
} |
| 1366 |
|
| 1367 |
// IVarDeclContext is an interface to support dynamic dispatch. |
| 1368 |
type IVarDeclContext interface { |
| 1369 |
antlr.ParserRuleContext |
| 1370 |
|
| 1371 |
// GetParser returns the parser. |
| 1372 |
GetParser() antlr.Parser |
| 1373 |
|
| 1374 |
// GetId returns the id rule contexts. |
| 1375 |
GetId() IQualIdContext |
| 1376 |
|
| 1377 |
// GetT returns the t rule contexts. |
| 1378 |
GetT() ITypeContext |
| 1379 |
|
| 1380 |
// SetId sets the id rule contexts. |
| 1381 |
SetId(IQualIdContext) |
| 1382 |
|
| 1383 |
// SetT sets the t rule contexts. |
| 1384 |
SetT(ITypeContext) |
| 1385 |
|
| 1386 |
// Getter signatures |
| 1387 |
QualId() IQualIdContext |
| 1388 |
COLON() antlr.TerminalNode |
| 1389 |
Type_() ITypeContext |
| 1390 |
|
| 1391 |
// IsVarDeclContext differentiates from other interfaces. |
| 1392 |
IsVarDeclContext() |
| 1393 |
} |
| 1394 |
|
| 1395 |
type VarDeclContext struct { |
| 1396 |
antlr.BaseParserRuleContext |
| 1397 |
parser antlr.Parser |
| 1398 |
id IQualIdContext |
| 1399 |
t ITypeContext |
| 1400 |
} |
| 1401 |
|
| 1402 |
func NewEmptyVarDeclContext() *VarDeclContext { |
| 1403 |
var p = new(VarDeclContext) |
| 1404 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 1405 |
p.RuleIndex = CommandsParserRULE_varDecl |
| 1406 |
return p |
| 1407 |
} |
| 1408 |
|
| 1409 |
func InitEmptyVarDeclContext(p *VarDeclContext) { |
| 1410 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 1411 |
p.RuleIndex = CommandsParserRULE_varDecl |
| 1412 |
} |
| 1413 |
|
| 1414 |
func (*VarDeclContext) IsVarDeclContext() {} |
| 1415 |
|
| 1416 |
func NewVarDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *VarDeclContext { |
| 1417 |
var p = new(VarDeclContext) |
| 1418 |
|
| 1419 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 1420 |
|
| 1421 |
p.parser = parser |
| 1422 |
p.RuleIndex = CommandsParserRULE_varDecl |
| 1423 |
|
| 1424 |
return p |
| 1425 |
} |
| 1426 |
|
| 1427 |
func (s *VarDeclContext) GetParser() antlr.Parser { return s.parser } |
| 1428 |
|
| 1429 |
func (s *VarDeclContext) GetId() IQualIdContext { return s.id } |
| 1430 |
|
| 1431 |
func (s *VarDeclContext) GetT() ITypeContext { return s.t } |
| 1432 |
|
| 1433 |
func (s *VarDeclContext) SetId(v IQualIdContext) { s.id = v } |
| 1434 |
|
| 1435 |
func (s *VarDeclContext) SetT(v ITypeContext) { s.t = v } |
| 1436 |
|
| 1437 |
func (s *VarDeclContext) QualId() IQualIdContext { |
| 1438 |
var t antlr.RuleContext |
| 1439 |
for _, ctx := range s.GetChildren() { |
| 1440 |
if _, ok := ctx.(IQualIdContext); ok { |
| 1441 |
t = ctx.(antlr.RuleContext) |
| 1442 |
break |
| 1443 |
} |
| 1444 |
} |
| 1445 |
|
| 1446 |
if t == nil { |
| 1447 |
return nil |
| 1448 |
} |
| 1449 |
|
| 1450 |
return t.(IQualIdContext) |
| 1451 |
} |
| 1452 |
|
| 1453 |
func (s *VarDeclContext) COLON() antlr.TerminalNode { |
| 1454 |
return s.GetToken(CommandsParserCOLON, 0) |
| 1455 |
} |
| 1456 |
|
| 1457 |
func (s *VarDeclContext) Type_() ITypeContext { |
| 1458 |
var t antlr.RuleContext |
| 1459 |
for _, ctx := range s.GetChildren() { |
| 1460 |
if _, ok := ctx.(ITypeContext); ok { |
| 1461 |
t = ctx.(antlr.RuleContext) |
| 1462 |
break |
| 1463 |
} |
| 1464 |
} |
| 1465 |
|
| 1466 |
if t == nil { |
| 1467 |
return nil |
| 1468 |
} |
| 1469 |
|
| 1470 |
return t.(ITypeContext) |
| 1471 |
} |
| 1472 |
|
| 1473 |
func (s *VarDeclContext) GetRuleContext() antlr.RuleContext { |
| 1474 |
return s |
| 1475 |
} |
| 1476 |
|
| 1477 |
func (s *VarDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 1478 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 1479 |
} |
| 1480 |
|
| 1481 |
func (s *VarDeclContext) EnterRule(listener antlr.ParseTreeListener) { |
| 1482 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 1483 |
listenerT.EnterVarDecl(s) |
| 1484 |
} |
| 1485 |
} |
| 1486 |
|
| 1487 |
func (s *VarDeclContext) ExitRule(listener antlr.ParseTreeListener) { |
| 1488 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 1489 |
listenerT.ExitVarDecl(s) |
| 1490 |
} |
| 1491 |
} |
| 1492 |
|
| 1493 |
func (s *VarDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 1494 |
switch t := visitor.(type) { |
| 1495 |
case CommandsVisitor: |
| 1496 |
return t.VisitVarDecl(s) |
| 1497 |
|
| 1498 |
default: |
| 1499 |
return t.VisitChildren(s) |
| 1500 |
} |
| 1501 |
} |
| 1502 |
|
| 1503 |
func (p *CommandsParser) VarDecl() (localctx IVarDeclContext) { |
| 1504 |
localctx = NewVarDeclContext(p, p.GetParserRuleContext(), p.GetState()) |
| 1505 |
p.EnterRule(localctx, 10, CommandsParserRULE_varDecl) |
| 1506 |
var _la int |
| 1507 |
|
| 1508 |
p.EnterOuterAlt(localctx, 1) |
| 1509 |
{ |
| 1510 |
p.SetState(104) |
| 1511 |
|
| 1512 |
var _x = p.QualId() |
| 1513 |
|
| 1514 |
localctx.(*VarDeclContext).id = _x |
| 1515 |
} |
| 1516 |
p.SetState(107) |
| 1517 |
p.GetErrorHandler().Sync(p) |
| 1518 |
if p.HasError() { |
| 1519 |
goto errorExit |
| 1520 |
} |
| 1521 |
_la = p.GetTokenStream().LA(1) |
| 1522 |
|
| 1523 |
if _la == CommandsParserCOLON { |
| 1524 |
{ |
| 1525 |
p.SetState(105) |
| 1526 |
p.Match(CommandsParserCOLON) |
| 1527 |
if p.HasError() { |
| 1528 |
// Recognition error - abort rule |
| 1529 |
goto errorExit |
| 1530 |
} |
| 1531 |
} |
| 1532 |
{ |
| 1533 |
p.SetState(106) |
| 1534 |
|
| 1535 |
var _x = p.Type_() |
| 1536 |
|
| 1537 |
localctx.(*VarDeclContext).t = _x |
| 1538 |
} |
| 1539 |
|
| 1540 |
} |
| 1541 |
|
| 1542 |
errorExit: |
| 1543 |
if p.HasError() { |
| 1544 |
v := p.GetError() |
| 1545 |
localctx.SetException(v) |
| 1546 |
p.GetErrorHandler().ReportError(p, v) |
| 1547 |
p.GetErrorHandler().Recover(p, v) |
| 1548 |
p.SetError(nil) |
| 1549 |
} |
| 1550 |
p.ExitRule() |
| 1551 |
return localctx |
| 1552 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 1553 |
} |
| 1554 |
|
| 1555 |
// IFnDeclContext is an interface to support dynamic dispatch. |
| 1556 |
type IFnDeclContext interface { |
| 1557 |
antlr.ParserRuleContext |
| 1558 |
|
| 1559 |
// GetParser returns the parser. |
| 1560 |
GetParser() antlr.Parser |
| 1561 |
|
| 1562 |
// GetId returns the id rule contexts. |
| 1563 |
GetId() IQualIdContext |
| 1564 |
|
| 1565 |
// Get_param returns the _param rule contexts. |
| 1566 |
Get_param() IParamContext |
| 1567 |
|
| 1568 |
// GetRType returns the rType rule contexts. |
| 1569 |
GetRType() ITypeContext |
| 1570 |
|
| 1571 |
// SetId sets the id rule contexts. |
| 1572 |
SetId(IQualIdContext) |
| 1573 |
|
| 1574 |
// Set_param sets the _param rule contexts. |
| 1575 |
Set_param(IParamContext) |
| 1576 |
|
| 1577 |
// SetRType sets the rType rule contexts. |
| 1578 |
SetRType(ITypeContext) |
| 1579 |
|
| 1580 |
// GetParams returns the params rule context list. |
| 1581 |
GetParams() []IParamContext |
| 1582 |
|
| 1583 |
// SetParams sets the params rule context list. |
| 1584 |
SetParams([]IParamContext) |
| 1585 |
|
| 1586 |
// Getter signatures |
| 1587 |
LPAREN() antlr.TerminalNode |
| 1588 |
RPAREN() antlr.TerminalNode |
| 1589 |
COLON() antlr.TerminalNode |
| 1590 |
QualId() IQualIdContext |
| 1591 |
Type_() ITypeContext |
| 1592 |
AllParam() []IParamContext |
| 1593 |
Param(i int) IParamContext |
| 1594 |
AllCOMMA() []antlr.TerminalNode |
| 1595 |
COMMA(i int) antlr.TerminalNode |
| 1596 |
|
| 1597 |
// IsFnDeclContext differentiates from other interfaces. |
| 1598 |
IsFnDeclContext() |
| 1599 |
} |
| 1600 |
|
| 1601 |
type FnDeclContext struct { |
| 1602 |
antlr.BaseParserRuleContext |
| 1603 |
parser antlr.Parser |
| 1604 |
id IQualIdContext |
| 1605 |
_param IParamContext |
| 1606 |
params []IParamContext |
| 1607 |
rType ITypeContext |
| 1608 |
} |
| 1609 |
|
| 1610 |
func NewEmptyFnDeclContext() *FnDeclContext { |
| 1611 |
var p = new(FnDeclContext) |
| 1612 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 1613 |
p.RuleIndex = CommandsParserRULE_fnDecl |
| 1614 |
return p |
| 1615 |
} |
| 1616 |
|
| 1617 |
func InitEmptyFnDeclContext(p *FnDeclContext) { |
| 1618 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 1619 |
p.RuleIndex = CommandsParserRULE_fnDecl |
| 1620 |
} |
| 1621 |
|
| 1622 |
func (*FnDeclContext) IsFnDeclContext() {} |
| 1623 |
|
| 1624 |
func NewFnDeclContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FnDeclContext { |
| 1625 |
var p = new(FnDeclContext) |
| 1626 |
|
| 1627 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 1628 |
|
| 1629 |
p.parser = parser |
| 1630 |
p.RuleIndex = CommandsParserRULE_fnDecl |
| 1631 |
|
| 1632 |
return p |
| 1633 |
} |
| 1634 |
|
| 1635 |
func (s *FnDeclContext) GetParser() antlr.Parser { return s.parser } |
| 1636 |
|
| 1637 |
func (s *FnDeclContext) GetId() IQualIdContext { return s.id } |
| 1638 |
|
| 1639 |
func (s *FnDeclContext) Get_param() IParamContext { return s._param } |
| 1640 |
|
| 1641 |
func (s *FnDeclContext) GetRType() ITypeContext { return s.rType } |
| 1642 |
|
| 1643 |
func (s *FnDeclContext) SetId(v IQualIdContext) { s.id = v } |
| 1644 |
|
| 1645 |
func (s *FnDeclContext) Set_param(v IParamContext) { s._param = v } |
| 1646 |
|
| 1647 |
func (s *FnDeclContext) SetRType(v ITypeContext) { s.rType = v } |
| 1648 |
|
| 1649 |
func (s *FnDeclContext) GetParams() []IParamContext { return s.params } |
| 1650 |
|
| 1651 |
func (s *FnDeclContext) SetParams(v []IParamContext) { s.params = v } |
| 1652 |
|
| 1653 |
func (s *FnDeclContext) LPAREN() antlr.TerminalNode { |
| 1654 |
return s.GetToken(CommandsParserLPAREN, 0) |
| 1655 |
} |
| 1656 |
|
| 1657 |
func (s *FnDeclContext) RPAREN() antlr.TerminalNode { |
| 1658 |
return s.GetToken(CommandsParserRPAREN, 0) |
| 1659 |
} |
| 1660 |
|
| 1661 |
func (s *FnDeclContext) COLON() antlr.TerminalNode { |
| 1662 |
return s.GetToken(CommandsParserCOLON, 0) |
| 1663 |
} |
| 1664 |
|
| 1665 |
func (s *FnDeclContext) QualId() IQualIdContext { |
| 1666 |
var t antlr.RuleContext |
| 1667 |
for _, ctx := range s.GetChildren() { |
| 1668 |
if _, ok := ctx.(IQualIdContext); ok { |
| 1669 |
t = ctx.(antlr.RuleContext) |
| 1670 |
break |
| 1671 |
} |
| 1672 |
} |
| 1673 |
|
| 1674 |
if t == nil { |
| 1675 |
return nil |
| 1676 |
} |
| 1677 |
|
| 1678 |
return t.(IQualIdContext) |
| 1679 |
} |
| 1680 |
|
| 1681 |
func (s *FnDeclContext) Type_() ITypeContext { |
| 1682 |
var t antlr.RuleContext |
| 1683 |
for _, ctx := range s.GetChildren() { |
| 1684 |
if _, ok := ctx.(ITypeContext); ok { |
| 1685 |
t = ctx.(antlr.RuleContext) |
| 1686 |
break |
| 1687 |
} |
| 1688 |
} |
| 1689 |
|
| 1690 |
if t == nil { |
| 1691 |
return nil |
| 1692 |
} |
| 1693 |
|
| 1694 |
return t.(ITypeContext) |
| 1695 |
} |
| 1696 |
|
| 1697 |
func (s *FnDeclContext) AllParam() []IParamContext { |
| 1698 |
children := s.GetChildren() |
| 1699 |
len := 0 |
| 1700 |
for _, ctx := range children { |
| 1701 |
if _, ok := ctx.(IParamContext); ok { |
| 1702 |
len++ |
| 1703 |
} |
| 1704 |
} |
| 1705 |
|
| 1706 |
tst := make([]IParamContext, len) |
| 1707 |
i := 0 |
| 1708 |
for _, ctx := range children { |
| 1709 |
if t, ok := ctx.(IParamContext); ok { |
| 1710 |
tst[i] = t.(IParamContext) |
| 1711 |
i++ |
| 1712 |
} |
| 1713 |
} |
| 1714 |
|
| 1715 |
return tst |
| 1716 |
} |
| 1717 |
|
| 1718 |
func (s *FnDeclContext) Param(i int) IParamContext { |
| 1719 |
var t antlr.RuleContext |
| 1720 |
j := 0 |
| 1721 |
for _, ctx := range s.GetChildren() { |
| 1722 |
if _, ok := ctx.(IParamContext); ok { |
| 1723 |
if j == i { |
| 1724 |
t = ctx.(antlr.RuleContext) |
| 1725 |
break |
| 1726 |
} |
| 1727 |
j++ |
| 1728 |
} |
| 1729 |
} |
| 1730 |
|
| 1731 |
if t == nil { |
| 1732 |
return nil |
| 1733 |
} |
| 1734 |
|
| 1735 |
return t.(IParamContext) |
| 1736 |
} |
| 1737 |
|
| 1738 |
func (s *FnDeclContext) AllCOMMA() []antlr.TerminalNode { |
| 1739 |
return s.GetTokens(CommandsParserCOMMA) |
| 1740 |
} |
| 1741 |
|
| 1742 |
func (s *FnDeclContext) COMMA(i int) antlr.TerminalNode { |
| 1743 |
return s.GetToken(CommandsParserCOMMA, i) |
| 1744 |
} |
| 1745 |
|
| 1746 |
func (s *FnDeclContext) GetRuleContext() antlr.RuleContext { |
| 1747 |
return s |
| 1748 |
} |
| 1749 |
|
| 1750 |
func (s *FnDeclContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 1751 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 1752 |
} |
| 1753 |
|
| 1754 |
func (s *FnDeclContext) EnterRule(listener antlr.ParseTreeListener) { |
| 1755 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 1756 |
listenerT.EnterFnDecl(s) |
| 1757 |
} |
| 1758 |
} |
| 1759 |
|
| 1760 |
func (s *FnDeclContext) ExitRule(listener antlr.ParseTreeListener) { |
| 1761 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 1762 |
listenerT.ExitFnDecl(s) |
| 1763 |
} |
| 1764 |
} |
| 1765 |
|
| 1766 |
func (s *FnDeclContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 1767 |
switch t := visitor.(type) { |
| 1768 |
case CommandsVisitor: |
| 1769 |
return t.VisitFnDecl(s) |
| 1770 |
|
| 1771 |
default: |
| 1772 |
return t.VisitChildren(s) |
| 1773 |
} |
| 1774 |
} |
| 1775 |
|
| 1776 |
func (p *CommandsParser) FnDecl() (localctx IFnDeclContext) { |
| 1777 |
localctx = NewFnDeclContext(p, p.GetParserRuleContext(), p.GetState()) |
| 1778 |
p.EnterRule(localctx, 12, CommandsParserRULE_fnDecl) |
| 1779 |
var _la int |
| 1780 |
|
| 1781 |
p.EnterOuterAlt(localctx, 1) |
| 1782 |
{ |
| 1783 |
p.SetState(109) |
| 1784 |
|
| 1785 |
var _x = p.QualId() |
| 1786 |
|
| 1787 |
localctx.(*FnDeclContext).id = _x |
| 1788 |
} |
| 1789 |
{ |
| 1790 |
p.SetState(110) |
| 1791 |
p.Match(CommandsParserLPAREN) |
| 1792 |
if p.HasError() { |
| 1793 |
// Recognition error - abort rule |
| 1794 |
goto errorExit |
| 1795 |
} |
| 1796 |
} |
| 1797 |
p.SetState(119) |
| 1798 |
p.GetErrorHandler().Sync(p) |
| 1799 |
if p.HasError() { |
| 1800 |
goto errorExit |
| 1801 |
} |
| 1802 |
_la = p.GetTokenStream().LA(1) |
| 1803 |
|
| 1804 |
if _la == CommandsParserIDENTIFIER { |
| 1805 |
{ |
| 1806 |
p.SetState(111) |
| 1807 |
|
| 1808 |
var _x = p.Param() |
| 1809 |
|
| 1810 |
localctx.(*FnDeclContext)._param = _x |
| 1811 |
} |
| 1812 |
localctx.(*FnDeclContext).params = append(localctx.(*FnDeclContext).params, localctx.(*FnDeclContext)._param) |
| 1813 |
p.SetState(116) |
| 1814 |
p.GetErrorHandler().Sync(p) |
| 1815 |
if p.HasError() { |
| 1816 |
goto errorExit |
| 1817 |
} |
| 1818 |
_la = p.GetTokenStream().LA(1) |
| 1819 |
|
| 1820 |
for _la == CommandsParserCOMMA { |
| 1821 |
{ |
| 1822 |
p.SetState(112) |
| 1823 |
p.Match(CommandsParserCOMMA) |
| 1824 |
if p.HasError() { |
| 1825 |
// Recognition error - abort rule |
| 1826 |
goto errorExit |
| 1827 |
} |
| 1828 |
} |
| 1829 |
{ |
| 1830 |
p.SetState(113) |
| 1831 |
|
| 1832 |
var _x = p.Param() |
| 1833 |
|
| 1834 |
localctx.(*FnDeclContext)._param = _x |
| 1835 |
} |
| 1836 |
localctx.(*FnDeclContext).params = append(localctx.(*FnDeclContext).params, localctx.(*FnDeclContext)._param) |
| 1837 |
|
| 1838 |
p.SetState(118) |
| 1839 |
p.GetErrorHandler().Sync(p) |
| 1840 |
if p.HasError() { |
| 1841 |
goto errorExit |
| 1842 |
} |
| 1843 |
_la = p.GetTokenStream().LA(1) |
| 1844 |
} |
| 1845 |
|
| 1846 |
} |
| 1847 |
{ |
| 1848 |
p.SetState(121) |
| 1849 |
p.Match(CommandsParserRPAREN) |
| 1850 |
if p.HasError() { |
| 1851 |
// Recognition error - abort rule |
| 1852 |
goto errorExit |
| 1853 |
} |
| 1854 |
} |
| 1855 |
{ |
| 1856 |
p.SetState(122) |
| 1857 |
p.Match(CommandsParserCOLON) |
| 1858 |
if p.HasError() { |
| 1859 |
// Recognition error - abort rule |
| 1860 |
goto errorExit |
| 1861 |
} |
| 1862 |
} |
| 1863 |
{ |
| 1864 |
p.SetState(123) |
| 1865 |
|
| 1866 |
var _x = p.Type_() |
| 1867 |
|
| 1868 |
localctx.(*FnDeclContext).rType = _x |
| 1869 |
} |
| 1870 |
|
| 1871 |
errorExit: |
| 1872 |
if p.HasError() { |
| 1873 |
v := p.GetError() |
| 1874 |
localctx.SetException(v) |
| 1875 |
p.GetErrorHandler().ReportError(p, v) |
| 1876 |
p.GetErrorHandler().Recover(p, v) |
| 1877 |
p.SetError(nil) |
| 1878 |
} |
| 1879 |
p.ExitRule() |
| 1880 |
return localctx |
| 1881 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 1882 |
} |
| 1883 |
|
| 1884 |
// IParamContext is an interface to support dynamic dispatch. |
| 1885 |
type IParamContext interface { |
| 1886 |
antlr.ParserRuleContext |
| 1887 |
|
| 1888 |
// GetParser returns the parser. |
| 1889 |
GetParser() antlr.Parser |
| 1890 |
|
| 1891 |
// GetPid returns the pid token. |
| 1892 |
GetPid() antlr.Token |
| 1893 |
|
| 1894 |
// SetPid sets the pid token. |
| 1895 |
SetPid(antlr.Token) |
| 1896 |
|
| 1897 |
// GetT returns the t rule contexts. |
| 1898 |
GetT() ITypeContext |
| 1899 |
|
| 1900 |
// SetT sets the t rule contexts. |
| 1901 |
SetT(ITypeContext) |
| 1902 |
|
| 1903 |
// Getter signatures |
| 1904 |
COLON() antlr.TerminalNode |
| 1905 |
IDENTIFIER() antlr.TerminalNode |
| 1906 |
Type_() ITypeContext |
| 1907 |
|
| 1908 |
// IsParamContext differentiates from other interfaces. |
| 1909 |
IsParamContext() |
| 1910 |
} |
| 1911 |
|
| 1912 |
type ParamContext struct { |
| 1913 |
antlr.BaseParserRuleContext |
| 1914 |
parser antlr.Parser |
| 1915 |
pid antlr.Token |
| 1916 |
t ITypeContext |
| 1917 |
} |
| 1918 |
|
| 1919 |
func NewEmptyParamContext() *ParamContext { |
| 1920 |
var p = new(ParamContext) |
| 1921 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 1922 |
p.RuleIndex = CommandsParserRULE_param |
| 1923 |
return p |
| 1924 |
} |
| 1925 |
|
| 1926 |
func InitEmptyParamContext(p *ParamContext) { |
| 1927 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 1928 |
p.RuleIndex = CommandsParserRULE_param |
| 1929 |
} |
| 1930 |
|
| 1931 |
func (*ParamContext) IsParamContext() {} |
| 1932 |
|
| 1933 |
func NewParamContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ParamContext { |
| 1934 |
var p = new(ParamContext) |
| 1935 |
|
| 1936 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 1937 |
|
| 1938 |
p.parser = parser |
| 1939 |
p.RuleIndex = CommandsParserRULE_param |
| 1940 |
|
| 1941 |
return p |
| 1942 |
} |
| 1943 |
|
| 1944 |
func (s *ParamContext) GetParser() antlr.Parser { return s.parser } |
| 1945 |
|
| 1946 |
func (s *ParamContext) GetPid() antlr.Token { return s.pid } |
| 1947 |
|
| 1948 |
func (s *ParamContext) SetPid(v antlr.Token) { s.pid = v } |
| 1949 |
|
| 1950 |
func (s *ParamContext) GetT() ITypeContext { return s.t } |
| 1951 |
|
| 1952 |
func (s *ParamContext) SetT(v ITypeContext) { s.t = v } |
| 1953 |
|
| 1954 |
func (s *ParamContext) COLON() antlr.TerminalNode { |
| 1955 |
return s.GetToken(CommandsParserCOLON, 0) |
| 1956 |
} |
| 1957 |
|
| 1958 |
func (s *ParamContext) IDENTIFIER() antlr.TerminalNode { |
| 1959 |
return s.GetToken(CommandsParserIDENTIFIER, 0) |
| 1960 |
} |
| 1961 |
|
| 1962 |
func (s *ParamContext) Type_() ITypeContext { |
| 1963 |
var t antlr.RuleContext |
| 1964 |
for _, ctx := range s.GetChildren() { |
| 1965 |
if _, ok := ctx.(ITypeContext); ok { |
| 1966 |
t = ctx.(antlr.RuleContext) |
| 1967 |
break |
| 1968 |
} |
| 1969 |
} |
| 1970 |
|
| 1971 |
if t == nil { |
| 1972 |
return nil |
| 1973 |
} |
| 1974 |
|
| 1975 |
return t.(ITypeContext) |
| 1976 |
} |
| 1977 |
|
| 1978 |
func (s *ParamContext) GetRuleContext() antlr.RuleContext { |
| 1979 |
return s |
| 1980 |
} |
| 1981 |
|
| 1982 |
func (s *ParamContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 1983 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 1984 |
} |
| 1985 |
|
| 1986 |
func (s *ParamContext) EnterRule(listener antlr.ParseTreeListener) { |
| 1987 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 1988 |
listenerT.EnterParam(s) |
| 1989 |
} |
| 1990 |
} |
| 1991 |
|
| 1992 |
func (s *ParamContext) ExitRule(listener antlr.ParseTreeListener) { |
| 1993 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 1994 |
listenerT.ExitParam(s) |
| 1995 |
} |
| 1996 |
} |
| 1997 |
|
| 1998 |
func (s *ParamContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 1999 |
switch t := visitor.(type) { |
| 2000 |
case CommandsVisitor: |
| 2001 |
return t.VisitParam(s) |
| 2002 |
|
| 2003 |
default: |
| 2004 |
return t.VisitChildren(s) |
| 2005 |
} |
| 2006 |
} |
| 2007 |
|
| 2008 |
func (p *CommandsParser) Param() (localctx IParamContext) { |
| 2009 |
localctx = NewParamContext(p, p.GetParserRuleContext(), p.GetState()) |
| 2010 |
p.EnterRule(localctx, 14, CommandsParserRULE_param) |
| 2011 |
p.EnterOuterAlt(localctx, 1) |
| 2012 |
{ |
| 2013 |
p.SetState(125) |
| 2014 |
|
| 2015 |
var _m = p.Match(CommandsParserIDENTIFIER) |
| 2016 |
|
| 2017 |
localctx.(*ParamContext).pid = _m |
| 2018 |
if p.HasError() { |
| 2019 |
// Recognition error - abort rule |
| 2020 |
goto errorExit |
| 2021 |
} |
| 2022 |
} |
| 2023 |
{ |
| 2024 |
p.SetState(126) |
| 2025 |
p.Match(CommandsParserCOLON) |
| 2026 |
if p.HasError() { |
| 2027 |
// Recognition error - abort rule |
| 2028 |
goto errorExit |
| 2029 |
} |
| 2030 |
} |
| 2031 |
{ |
| 2032 |
p.SetState(127) |
| 2033 |
|
| 2034 |
var _x = p.Type_() |
| 2035 |
|
| 2036 |
localctx.(*ParamContext).t = _x |
| 2037 |
} |
| 2038 |
|
| 2039 |
errorExit: |
| 2040 |
if p.HasError() { |
| 2041 |
v := p.GetError() |
| 2042 |
localctx.SetException(v) |
| 2043 |
p.GetErrorHandler().ReportError(p, v) |
| 2044 |
p.GetErrorHandler().Recover(p, v) |
| 2045 |
p.SetError(nil) |
| 2046 |
} |
| 2047 |
p.ExitRule() |
| 2048 |
return localctx |
| 2049 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 2050 |
} |
| 2051 |
|
| 2052 |
// IDeleteContext is an interface to support dynamic dispatch. |
| 2053 |
type IDeleteContext interface { |
| 2054 |
antlr.ParserRuleContext |
| 2055 |
|
| 2056 |
// GetParser returns the parser. |
| 2057 |
GetParser() antlr.Parser |
| 2058 |
|
| 2059 |
// GetVar_ returns the var_ rule contexts. |
| 2060 |
GetVar_() IVarDeclContext |
| 2061 |
|
| 2062 |
// GetFn returns the fn rule contexts. |
| 2063 |
GetFn() IFnDeclContext |
| 2064 |
|
| 2065 |
// SetVar_ sets the var_ rule contexts. |
| 2066 |
SetVar_(IVarDeclContext) |
| 2067 |
|
| 2068 |
// SetFn sets the fn rule contexts. |
| 2069 |
SetFn(IFnDeclContext) |
| 2070 |
|
| 2071 |
// Getter signatures |
| 2072 |
VarDecl() IVarDeclContext |
| 2073 |
FnDecl() IFnDeclContext |
| 2074 |
|
| 2075 |
// IsDeleteContext differentiates from other interfaces. |
| 2076 |
IsDeleteContext() |
| 2077 |
} |
| 2078 |
|
| 2079 |
type DeleteContext struct { |
| 2080 |
antlr.BaseParserRuleContext |
| 2081 |
parser antlr.Parser |
| 2082 |
var_ IVarDeclContext |
| 2083 |
fn IFnDeclContext |
| 2084 |
} |
| 2085 |
|
| 2086 |
func NewEmptyDeleteContext() *DeleteContext { |
| 2087 |
var p = new(DeleteContext) |
| 2088 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 2089 |
p.RuleIndex = CommandsParserRULE_delete |
| 2090 |
return p |
| 2091 |
} |
| 2092 |
|
| 2093 |
func InitEmptyDeleteContext(p *DeleteContext) { |
| 2094 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 2095 |
p.RuleIndex = CommandsParserRULE_delete |
| 2096 |
} |
| 2097 |
|
| 2098 |
func (*DeleteContext) IsDeleteContext() {} |
| 2099 |
|
| 2100 |
func NewDeleteContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DeleteContext { |
| 2101 |
var p = new(DeleteContext) |
| 2102 |
|
| 2103 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 2104 |
|
| 2105 |
p.parser = parser |
| 2106 |
p.RuleIndex = CommandsParserRULE_delete |
| 2107 |
|
| 2108 |
return p |
| 2109 |
} |
| 2110 |
|
| 2111 |
func (s *DeleteContext) GetParser() antlr.Parser { return s.parser } |
| 2112 |
|
| 2113 |
func (s *DeleteContext) GetVar_() IVarDeclContext { return s.var_ } |
| 2114 |
|
| 2115 |
func (s *DeleteContext) GetFn() IFnDeclContext { return s.fn } |
| 2116 |
|
| 2117 |
func (s *DeleteContext) SetVar_(v IVarDeclContext) { s.var_ = v } |
| 2118 |
|
| 2119 |
func (s *DeleteContext) SetFn(v IFnDeclContext) { s.fn = v } |
| 2120 |
|
| 2121 |
func (s *DeleteContext) VarDecl() IVarDeclContext { |
| 2122 |
var t antlr.RuleContext |
| 2123 |
for _, ctx := range s.GetChildren() { |
| 2124 |
if _, ok := ctx.(IVarDeclContext); ok { |
| 2125 |
t = ctx.(antlr.RuleContext) |
| 2126 |
break |
| 2127 |
} |
| 2128 |
} |
| 2129 |
|
| 2130 |
if t == nil { |
| 2131 |
return nil |
| 2132 |
} |
| 2133 |
|
| 2134 |
return t.(IVarDeclContext) |
| 2135 |
} |
| 2136 |
|
| 2137 |
func (s *DeleteContext) FnDecl() IFnDeclContext { |
| 2138 |
var t antlr.RuleContext |
| 2139 |
for _, ctx := range s.GetChildren() { |
| 2140 |
if _, ok := ctx.(IFnDeclContext); ok { |
| 2141 |
t = ctx.(antlr.RuleContext) |
| 2142 |
break |
| 2143 |
} |
| 2144 |
} |
| 2145 |
|
| 2146 |
if t == nil { |
| 2147 |
return nil |
| 2148 |
} |
| 2149 |
|
| 2150 |
return t.(IFnDeclContext) |
| 2151 |
} |
| 2152 |
|
| 2153 |
func (s *DeleteContext) GetRuleContext() antlr.RuleContext { |
| 2154 |
return s |
| 2155 |
} |
| 2156 |
|
| 2157 |
func (s *DeleteContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 2158 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 2159 |
} |
| 2160 |
|
| 2161 |
func (s *DeleteContext) EnterRule(listener antlr.ParseTreeListener) { |
| 2162 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 2163 |
listenerT.EnterDelete(s) |
| 2164 |
} |
| 2165 |
} |
| 2166 |
|
| 2167 |
func (s *DeleteContext) ExitRule(listener antlr.ParseTreeListener) { |
| 2168 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 2169 |
listenerT.ExitDelete(s) |
| 2170 |
} |
| 2171 |
} |
| 2172 |
|
| 2173 |
func (s *DeleteContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 2174 |
switch t := visitor.(type) { |
| 2175 |
case CommandsVisitor: |
| 2176 |
return t.VisitDelete(s) |
| 2177 |
|
| 2178 |
default: |
| 2179 |
return t.VisitChildren(s) |
| 2180 |
} |
| 2181 |
} |
| 2182 |
|
| 2183 |
func (p *CommandsParser) Delete_() (localctx IDeleteContext) { |
| 2184 |
localctx = NewDeleteContext(p, p.GetParserRuleContext(), p.GetState()) |
| 2185 |
p.EnterRule(localctx, 16, CommandsParserRULE_delete) |
| 2186 |
p.EnterOuterAlt(localctx, 1) |
| 2187 |
{ |
| 2188 |
p.SetState(129) |
| 2189 |
p.Match(CommandsParserT__4) |
| 2190 |
if p.HasError() { |
| 2191 |
// Recognition error - abort rule |
| 2192 |
goto errorExit |
| 2193 |
} |
| 2194 |
} |
| 2195 |
p.SetState(132) |
| 2196 |
p.GetErrorHandler().Sync(p) |
| 2197 |
if p.HasError() { |
| 2198 |
goto errorExit |
| 2199 |
} |
| 2200 |
|
| 2201 |
switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 6, p.GetParserRuleContext()) { |
| 2202 |
case 1: |
| 2203 |
{ |
| 2204 |
p.SetState(130) |
| 2205 |
|
| 2206 |
var _x = p.VarDecl() |
| 2207 |
|
| 2208 |
localctx.(*DeleteContext).var_ = _x |
| 2209 |
} |
| 2210 |
|
| 2211 |
case 2: |
| 2212 |
{ |
| 2213 |
p.SetState(131) |
| 2214 |
|
| 2215 |
var _x = p.FnDecl() |
| 2216 |
|
| 2217 |
localctx.(*DeleteContext).fn = _x |
| 2218 |
} |
| 2219 |
|
| 2220 |
case antlr.ATNInvalidAltNumber: |
| 2221 |
goto errorExit |
| 2222 |
} |
| 2223 |
|
| 2224 |
errorExit: |
| 2225 |
if p.HasError() { |
| 2226 |
v := p.GetError() |
| 2227 |
localctx.SetException(v) |
| 2228 |
p.GetErrorHandler().ReportError(p, v) |
| 2229 |
p.GetErrorHandler().Recover(p, v) |
| 2230 |
p.SetError(nil) |
| 2231 |
} |
| 2232 |
p.ExitRule() |
| 2233 |
return localctx |
| 2234 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 2235 |
} |
| 2236 |
|
| 2237 |
// ISimpleContext is an interface to support dynamic dispatch. |
| 2238 |
type ISimpleContext interface { |
| 2239 |
antlr.ParserRuleContext |
| 2240 |
|
| 2241 |
// GetParser returns the parser. |
| 2242 |
GetParser() antlr.Parser |
| 2243 |
|
| 2244 |
// GetCmd returns the cmd token. |
| 2245 |
GetCmd() antlr.Token |
| 2246 |
|
| 2247 |
// Get_FLAG returns the _FLAG token. |
| 2248 |
Get_FLAG() antlr.Token |
| 2249 |
|
| 2250 |
// Get_STRING returns the _STRING token. |
| 2251 |
Get_STRING() antlr.Token |
| 2252 |
|
| 2253 |
// SetCmd sets the cmd token. |
| 2254 |
SetCmd(antlr.Token) |
| 2255 |
|
| 2256 |
// Set_FLAG sets the _FLAG token. |
| 2257 |
Set_FLAG(antlr.Token) |
| 2258 |
|
| 2259 |
// Set_STRING sets the _STRING token. |
| 2260 |
Set_STRING(antlr.Token) |
| 2261 |
|
| 2262 |
// GetArgs returns the args token list. |
| 2263 |
GetArgs() []antlr.Token |
| 2264 |
|
| 2265 |
// SetArgs sets the args token list. |
| 2266 |
SetArgs([]antlr.Token) |
| 2267 |
|
| 2268 |
// Getter signatures |
| 2269 |
COMMAND() antlr.TerminalNode |
| 2270 |
AllFLAG() []antlr.TerminalNode |
| 2271 |
FLAG(i int) antlr.TerminalNode |
| 2272 |
AllSTRING() []antlr.TerminalNode |
| 2273 |
STRING(i int) antlr.TerminalNode |
| 2274 |
|
| 2275 |
// IsSimpleContext differentiates from other interfaces. |
| 2276 |
IsSimpleContext() |
| 2277 |
} |
| 2278 |
|
| 2279 |
type SimpleContext struct { |
| 2280 |
antlr.BaseParserRuleContext |
| 2281 |
parser antlr.Parser |
| 2282 |
cmd antlr.Token |
| 2283 |
_FLAG antlr.Token |
| 2284 |
args []antlr.Token |
| 2285 |
_STRING antlr.Token |
| 2286 |
} |
| 2287 |
|
| 2288 |
func NewEmptySimpleContext() *SimpleContext { |
| 2289 |
var p = new(SimpleContext) |
| 2290 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 2291 |
p.RuleIndex = CommandsParserRULE_simple |
| 2292 |
return p |
| 2293 |
} |
| 2294 |
|
| 2295 |
func InitEmptySimpleContext(p *SimpleContext) { |
| 2296 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 2297 |
p.RuleIndex = CommandsParserRULE_simple |
| 2298 |
} |
| 2299 |
|
| 2300 |
func (*SimpleContext) IsSimpleContext() {} |
| 2301 |
|
| 2302 |
func NewSimpleContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SimpleContext { |
| 2303 |
var p = new(SimpleContext) |
| 2304 |
|
| 2305 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 2306 |
|
| 2307 |
p.parser = parser |
| 2308 |
p.RuleIndex = CommandsParserRULE_simple |
| 2309 |
|
| 2310 |
return p |
| 2311 |
} |
| 2312 |
|
| 2313 |
func (s *SimpleContext) GetParser() antlr.Parser { return s.parser } |
| 2314 |
|
| 2315 |
func (s *SimpleContext) GetCmd() antlr.Token { return s.cmd } |
| 2316 |
|
| 2317 |
func (s *SimpleContext) Get_FLAG() antlr.Token { return s._FLAG } |
| 2318 |
|
| 2319 |
func (s *SimpleContext) Get_STRING() antlr.Token { return s._STRING } |
| 2320 |
|
| 2321 |
func (s *SimpleContext) SetCmd(v antlr.Token) { s.cmd = v } |
| 2322 |
|
| 2323 |
func (s *SimpleContext) Set_FLAG(v antlr.Token) { s._FLAG = v } |
| 2324 |
|
| 2325 |
func (s *SimpleContext) Set_STRING(v antlr.Token) { s._STRING = v } |
| 2326 |
|
| 2327 |
func (s *SimpleContext) GetArgs() []antlr.Token { return s.args } |
| 2328 |
|
| 2329 |
func (s *SimpleContext) SetArgs(v []antlr.Token) { s.args = v } |
| 2330 |
|
| 2331 |
func (s *SimpleContext) COMMAND() antlr.TerminalNode { |
| 2332 |
return s.GetToken(CommandsParserCOMMAND, 0) |
| 2333 |
} |
| 2334 |
|
| 2335 |
func (s *SimpleContext) AllFLAG() []antlr.TerminalNode { |
| 2336 |
return s.GetTokens(CommandsParserFLAG) |
| 2337 |
} |
| 2338 |
|
| 2339 |
func (s *SimpleContext) FLAG(i int) antlr.TerminalNode { |
| 2340 |
return s.GetToken(CommandsParserFLAG, i) |
| 2341 |
} |
| 2342 |
|
| 2343 |
func (s *SimpleContext) AllSTRING() []antlr.TerminalNode { |
| 2344 |
return s.GetTokens(CommandsParserSTRING) |
| 2345 |
} |
| 2346 |
|
| 2347 |
func (s *SimpleContext) STRING(i int) antlr.TerminalNode { |
| 2348 |
return s.GetToken(CommandsParserSTRING, i) |
| 2349 |
} |
| 2350 |
|
| 2351 |
func (s *SimpleContext) GetRuleContext() antlr.RuleContext { |
| 2352 |
return s |
| 2353 |
} |
| 2354 |
|
| 2355 |
func (s *SimpleContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 2356 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 2357 |
} |
| 2358 |
|
| 2359 |
func (s *SimpleContext) EnterRule(listener antlr.ParseTreeListener) { |
| 2360 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 2361 |
listenerT.EnterSimple(s) |
| 2362 |
} |
| 2363 |
} |
| 2364 |
|
| 2365 |
func (s *SimpleContext) ExitRule(listener antlr.ParseTreeListener) { |
| 2366 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 2367 |
listenerT.ExitSimple(s) |
| 2368 |
} |
| 2369 |
} |
| 2370 |
|
| 2371 |
func (s *SimpleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 2372 |
switch t := visitor.(type) { |
| 2373 |
case CommandsVisitor: |
| 2374 |
return t.VisitSimple(s) |
| 2375 |
|
| 2376 |
default: |
| 2377 |
return t.VisitChildren(s) |
| 2378 |
} |
| 2379 |
} |
| 2380 |
|
| 2381 |
func (p *CommandsParser) Simple() (localctx ISimpleContext) { |
| 2382 |
localctx = NewSimpleContext(p, p.GetParserRuleContext(), p.GetState()) |
| 2383 |
p.EnterRule(localctx, 18, CommandsParserRULE_simple) |
| 2384 |
var _la int |
| 2385 |
|
| 2386 |
p.EnterOuterAlt(localctx, 1) |
| 2387 |
{ |
| 2388 |
p.SetState(134) |
| 2389 |
|
| 2390 |
var _m = p.Match(CommandsParserCOMMAND) |
| 2391 |
|
| 2392 |
localctx.(*SimpleContext).cmd = _m |
| 2393 |
if p.HasError() { |
| 2394 |
// Recognition error - abort rule |
| 2395 |
goto errorExit |
| 2396 |
} |
| 2397 |
} |
| 2398 |
p.SetState(139) |
| 2399 |
p.GetErrorHandler().Sync(p) |
| 2400 |
if p.HasError() { |
| 2401 |
goto errorExit |
| 2402 |
} |
| 2403 |
_la = p.GetTokenStream().LA(1) |
| 2404 |
|
| 2405 |
for _la == CommandsParserFLAG || _la == CommandsParserSTRING { |
| 2406 |
p.SetState(137) |
| 2407 |
p.GetErrorHandler().Sync(p) |
| 2408 |
if p.HasError() { |
| 2409 |
goto errorExit |
| 2410 |
} |
| 2411 |
|
| 2412 |
switch p.GetTokenStream().LA(1) { |
| 2413 |
case CommandsParserFLAG: |
| 2414 |
{ |
| 2415 |
p.SetState(135) |
| 2416 |
|
| 2417 |
var _m = p.Match(CommandsParserFLAG) |
| 2418 |
|
| 2419 |
localctx.(*SimpleContext)._FLAG = _m |
| 2420 |
if p.HasError() { |
| 2421 |
// Recognition error - abort rule |
| 2422 |
goto errorExit |
| 2423 |
} |
| 2424 |
} |
| 2425 |
localctx.(*SimpleContext).args = append(localctx.(*SimpleContext).args, localctx.(*SimpleContext)._FLAG) |
| 2426 |
|
| 2427 |
case CommandsParserSTRING: |
| 2428 |
{ |
| 2429 |
p.SetState(136) |
| 2430 |
|
| 2431 |
var _m = p.Match(CommandsParserSTRING) |
| 2432 |
|
| 2433 |
localctx.(*SimpleContext)._STRING = _m |
| 2434 |
if p.HasError() { |
| 2435 |
// Recognition error - abort rule |
| 2436 |
goto errorExit |
| 2437 |
} |
| 2438 |
} |
| 2439 |
localctx.(*SimpleContext).args = append(localctx.(*SimpleContext).args, localctx.(*SimpleContext)._STRING) |
| 2440 |
|
| 2441 |
default: |
| 2442 |
p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) |
| 2443 |
goto errorExit |
| 2444 |
} |
| 2445 |
|
| 2446 |
p.SetState(141) |
| 2447 |
p.GetErrorHandler().Sync(p) |
| 2448 |
if p.HasError() { |
| 2449 |
goto errorExit |
| 2450 |
} |
| 2451 |
_la = p.GetTokenStream().LA(1) |
| 2452 |
} |
| 2453 |
|
| 2454 |
errorExit: |
| 2455 |
if p.HasError() { |
| 2456 |
v := p.GetError() |
| 2457 |
localctx.SetException(v) |
| 2458 |
p.GetErrorHandler().ReportError(p, v) |
| 2459 |
p.GetErrorHandler().Recover(p, v) |
| 2460 |
p.SetError(nil) |
| 2461 |
} |
| 2462 |
p.ExitRule() |
| 2463 |
return localctx |
| 2464 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 2465 |
} |
| 2466 |
|
| 2467 |
// IEmptyContext is an interface to support dynamic dispatch. |
| 2468 |
type IEmptyContext interface { |
| 2469 |
antlr.ParserRuleContext |
| 2470 |
|
| 2471 |
// GetParser returns the parser. |
| 2472 |
GetParser() antlr.Parser |
| 2473 |
// IsEmptyContext differentiates from other interfaces. |
| 2474 |
IsEmptyContext() |
| 2475 |
} |
| 2476 |
|
| 2477 |
type EmptyContext struct { |
| 2478 |
antlr.BaseParserRuleContext |
| 2479 |
parser antlr.Parser |
| 2480 |
} |
| 2481 |
|
| 2482 |
func NewEmptyEmptyContext() *EmptyContext { |
| 2483 |
var p = new(EmptyContext) |
| 2484 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 2485 |
p.RuleIndex = CommandsParserRULE_empty |
| 2486 |
return p |
| 2487 |
} |
| 2488 |
|
| 2489 |
func InitEmptyEmptyContext(p *EmptyContext) { |
| 2490 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 2491 |
p.RuleIndex = CommandsParserRULE_empty |
| 2492 |
} |
| 2493 |
|
| 2494 |
func (*EmptyContext) IsEmptyContext() {} |
| 2495 |
|
| 2496 |
func NewEmptyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EmptyContext { |
| 2497 |
var p = new(EmptyContext) |
| 2498 |
|
| 2499 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 2500 |
|
| 2501 |
p.parser = parser |
| 2502 |
p.RuleIndex = CommandsParserRULE_empty |
| 2503 |
|
| 2504 |
return p |
| 2505 |
} |
| 2506 |
|
| 2507 |
func (s *EmptyContext) GetParser() antlr.Parser { return s.parser } |
| 2508 |
func (s *EmptyContext) GetRuleContext() antlr.RuleContext { |
| 2509 |
return s |
| 2510 |
} |
| 2511 |
|
| 2512 |
func (s *EmptyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 2513 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 2514 |
} |
| 2515 |
|
| 2516 |
func (s *EmptyContext) EnterRule(listener antlr.ParseTreeListener) { |
| 2517 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 2518 |
listenerT.EnterEmpty(s) |
| 2519 |
} |
| 2520 |
} |
| 2521 |
|
| 2522 |
func (s *EmptyContext) ExitRule(listener antlr.ParseTreeListener) { |
| 2523 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 2524 |
listenerT.ExitEmpty(s) |
| 2525 |
} |
| 2526 |
} |
| 2527 |
|
| 2528 |
func (s *EmptyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 2529 |
switch t := visitor.(type) { |
| 2530 |
case CommandsVisitor: |
| 2531 |
return t.VisitEmpty(s) |
| 2532 |
|
| 2533 |
default: |
| 2534 |
return t.VisitChildren(s) |
| 2535 |
} |
| 2536 |
} |
| 2537 |
|
| 2538 |
func (p *CommandsParser) Empty() (localctx IEmptyContext) { |
| 2539 |
localctx = NewEmptyContext(p, p.GetParserRuleContext(), p.GetState()) |
| 2540 |
p.EnterRule(localctx, 20, CommandsParserRULE_empty) |
| 2541 |
p.EnterOuterAlt(localctx, 1) |
| 2542 |
|
| 2543 |
errorExit: |
| 2544 |
if p.HasError() { |
| 2545 |
v := p.GetError() |
| 2546 |
localctx.SetException(v) |
| 2547 |
p.GetErrorHandler().ReportError(p, v) |
| 2548 |
p.GetErrorHandler().Recover(p, v) |
| 2549 |
p.SetError(nil) |
| 2550 |
} |
| 2551 |
p.ExitRule() |
| 2552 |
return localctx |
| 2553 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 2554 |
} |
| 2555 |
|
| 2556 |
// ICompileContext is an interface to support dynamic dispatch. |
| 2557 |
type ICompileContext interface { |
| 2558 |
antlr.ParserRuleContext |
| 2559 |
|
| 2560 |
// GetParser returns the parser. |
| 2561 |
GetParser() antlr.Parser |
| 2562 |
|
| 2563 |
// GetE returns the e rule contexts. |
| 2564 |
GetE() IExprContext |
| 2565 |
|
| 2566 |
// SetE sets the e rule contexts. |
| 2567 |
SetE(IExprContext) |
| 2568 |
|
| 2569 |
// Getter signatures |
| 2570 |
Expr() IExprContext |
| 2571 |
|
| 2572 |
// IsCompileContext differentiates from other interfaces. |
| 2573 |
IsCompileContext() |
| 2574 |
} |
| 2575 |
|
| 2576 |
type CompileContext struct { |
| 2577 |
antlr.BaseParserRuleContext |
| 2578 |
parser antlr.Parser |
| 2579 |
e IExprContext |
| 2580 |
} |
| 2581 |
|
| 2582 |
func NewEmptyCompileContext() *CompileContext { |
| 2583 |
var p = new(CompileContext) |
| 2584 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 2585 |
p.RuleIndex = CommandsParserRULE_compile |
| 2586 |
return p |
| 2587 |
} |
| 2588 |
|
| 2589 |
func InitEmptyCompileContext(p *CompileContext) { |
| 2590 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 2591 |
p.RuleIndex = CommandsParserRULE_compile |
| 2592 |
} |
| 2593 |
|
| 2594 |
func (*CompileContext) IsCompileContext() {} |
| 2595 |
|
| 2596 |
func NewCompileContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CompileContext { |
| 2597 |
var p = new(CompileContext) |
| 2598 |
|
| 2599 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 2600 |
|
| 2601 |
p.parser = parser |
| 2602 |
p.RuleIndex = CommandsParserRULE_compile |
| 2603 |
|
| 2604 |
return p |
| 2605 |
} |
| 2606 |
|
| 2607 |
func (s *CompileContext) GetParser() antlr.Parser { return s.parser } |
| 2608 |
|
| 2609 |
func (s *CompileContext) GetE() IExprContext { return s.e } |
| 2610 |
|
| 2611 |
func (s *CompileContext) SetE(v IExprContext) { s.e = v } |
| 2612 |
|
| 2613 |
func (s *CompileContext) Expr() IExprContext { |
| 2614 |
var t antlr.RuleContext |
| 2615 |
for _, ctx := range s.GetChildren() { |
| 2616 |
if _, ok := ctx.(IExprContext); ok { |
| 2617 |
t = ctx.(antlr.RuleContext) |
| 2618 |
break |
| 2619 |
} |
| 2620 |
} |
| 2621 |
|
| 2622 |
if t == nil { |
| 2623 |
return nil |
| 2624 |
} |
| 2625 |
|
| 2626 |
return t.(IExprContext) |
| 2627 |
} |
| 2628 |
|
| 2629 |
func (s *CompileContext) GetRuleContext() antlr.RuleContext { |
| 2630 |
return s |
| 2631 |
} |
| 2632 |
|
| 2633 |
func (s *CompileContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 2634 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 2635 |
} |
| 2636 |
|
| 2637 |
func (s *CompileContext) EnterRule(listener antlr.ParseTreeListener) { |
| 2638 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 2639 |
listenerT.EnterCompile(s) |
| 2640 |
} |
| 2641 |
} |
| 2642 |
|
| 2643 |
func (s *CompileContext) ExitRule(listener antlr.ParseTreeListener) { |
| 2644 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 2645 |
listenerT.ExitCompile(s) |
| 2646 |
} |
| 2647 |
} |
| 2648 |
|
| 2649 |
func (s *CompileContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 2650 |
switch t := visitor.(type) { |
| 2651 |
case CommandsVisitor: |
| 2652 |
return t.VisitCompile(s) |
| 2653 |
|
| 2654 |
default: |
| 2655 |
return t.VisitChildren(s) |
| 2656 |
} |
| 2657 |
} |
| 2658 |
|
| 2659 |
func (p *CommandsParser) Compile() (localctx ICompileContext) { |
| 2660 |
localctx = NewCompileContext(p, p.GetParserRuleContext(), p.GetState()) |
| 2661 |
p.EnterRule(localctx, 22, CommandsParserRULE_compile) |
| 2662 |
p.EnterOuterAlt(localctx, 1) |
| 2663 |
{ |
| 2664 |
p.SetState(144) |
| 2665 |
p.Match(CommandsParserT__5) |
| 2666 |
if p.HasError() { |
| 2667 |
// Recognition error - abort rule |
| 2668 |
goto errorExit |
| 2669 |
} |
| 2670 |
} |
| 2671 |
{ |
| 2672 |
p.SetState(145) |
| 2673 |
|
| 2674 |
var _x = p.Expr() |
| 2675 |
|
| 2676 |
localctx.(*CompileContext).e = _x |
| 2677 |
} |
| 2678 |
|
| 2679 |
errorExit: |
| 2680 |
if p.HasError() { |
| 2681 |
v := p.GetError() |
| 2682 |
localctx.SetException(v) |
| 2683 |
p.GetErrorHandler().ReportError(p, v) |
| 2684 |
p.GetErrorHandler().Recover(p, v) |
| 2685 |
p.SetError(nil) |
| 2686 |
} |
| 2687 |
p.ExitRule() |
| 2688 |
return localctx |
| 2689 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 2690 |
} |
| 2691 |
|
| 2692 |
// IParseContext is an interface to support dynamic dispatch. |
| 2693 |
type IParseContext interface { |
| 2694 |
antlr.ParserRuleContext |
| 2695 |
|
| 2696 |
// GetParser returns the parser. |
| 2697 |
GetParser() antlr.Parser |
| 2698 |
|
| 2699 |
// GetE returns the e rule contexts. |
| 2700 |
GetE() IExprContext |
| 2701 |
|
| 2702 |
// SetE sets the e rule contexts. |
| 2703 |
SetE(IExprContext) |
| 2704 |
|
| 2705 |
// Getter signatures |
| 2706 |
Expr() IExprContext |
| 2707 |
|
| 2708 |
// IsParseContext differentiates from other interfaces. |
| 2709 |
IsParseContext() |
| 2710 |
} |
| 2711 |
|
| 2712 |
type ParseContext struct { |
| 2713 |
antlr.BaseParserRuleContext |
| 2714 |
parser antlr.Parser |
| 2715 |
e IExprContext |
| 2716 |
} |
| 2717 |
|
| 2718 |
func NewEmptyParseContext() *ParseContext { |
| 2719 |
var p = new(ParseContext) |
| 2720 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 2721 |
p.RuleIndex = CommandsParserRULE_parse |
| 2722 |
return p |
| 2723 |
} |
| 2724 |
|
| 2725 |
func InitEmptyParseContext(p *ParseContext) { |
| 2726 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 2727 |
p.RuleIndex = CommandsParserRULE_parse |
| 2728 |
} |
| 2729 |
|
| 2730 |
func (*ParseContext) IsParseContext() {} |
| 2731 |
|
| 2732 |
func NewParseContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ParseContext { |
| 2733 |
var p = new(ParseContext) |
| 2734 |
|
| 2735 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 2736 |
|
| 2737 |
p.parser = parser |
| 2738 |
p.RuleIndex = CommandsParserRULE_parse |
| 2739 |
|
| 2740 |
return p |
| 2741 |
} |
| 2742 |
|
| 2743 |
func (s *ParseContext) GetParser() antlr.Parser { return s.parser } |
| 2744 |
|
| 2745 |
func (s *ParseContext) GetE() IExprContext { return s.e } |
| 2746 |
|
| 2747 |
func (s *ParseContext) SetE(v IExprContext) { s.e = v } |
| 2748 |
|
| 2749 |
func (s *ParseContext) Expr() IExprContext { |
| 2750 |
var t antlr.RuleContext |
| 2751 |
for _, ctx := range s.GetChildren() { |
| 2752 |
if _, ok := ctx.(IExprContext); ok { |
| 2753 |
t = ctx.(antlr.RuleContext) |
| 2754 |
break |
| 2755 |
} |
| 2756 |
} |
| 2757 |
|
| 2758 |
if t == nil { |
| 2759 |
return nil |
| 2760 |
} |
| 2761 |
|
| 2762 |
return t.(IExprContext) |
| 2763 |
} |
| 2764 |
|
| 2765 |
func (s *ParseContext) GetRuleContext() antlr.RuleContext { |
| 2766 |
return s |
| 2767 |
} |
| 2768 |
|
| 2769 |
func (s *ParseContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 2770 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 2771 |
} |
| 2772 |
|
| 2773 |
func (s *ParseContext) EnterRule(listener antlr.ParseTreeListener) { |
| 2774 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 2775 |
listenerT.EnterParse(s) |
| 2776 |
} |
| 2777 |
} |
| 2778 |
|
| 2779 |
func (s *ParseContext) ExitRule(listener antlr.ParseTreeListener) { |
| 2780 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 2781 |
listenerT.ExitParse(s) |
| 2782 |
} |
| 2783 |
} |
| 2784 |
|
| 2785 |
func (s *ParseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 2786 |
switch t := visitor.(type) { |
| 2787 |
case CommandsVisitor: |
| 2788 |
return t.VisitParse(s) |
| 2789 |
|
| 2790 |
default: |
| 2791 |
return t.VisitChildren(s) |
| 2792 |
} |
| 2793 |
} |
| 2794 |
|
| 2795 |
func (p *CommandsParser) Parse() (localctx IParseContext) { |
| 2796 |
localctx = NewParseContext(p, p.GetParserRuleContext(), p.GetState()) |
| 2797 |
p.EnterRule(localctx, 24, CommandsParserRULE_parse) |
| 2798 |
p.EnterOuterAlt(localctx, 1) |
| 2799 |
{ |
| 2800 |
p.SetState(147) |
| 2801 |
p.Match(CommandsParserT__6) |
| 2802 |
if p.HasError() { |
| 2803 |
// Recognition error - abort rule |
| 2804 |
goto errorExit |
| 2805 |
} |
| 2806 |
} |
| 2807 |
{ |
| 2808 |
p.SetState(148) |
| 2809 |
|
| 2810 |
var _x = p.Expr() |
| 2811 |
|
| 2812 |
localctx.(*ParseContext).e = _x |
| 2813 |
} |
| 2814 |
|
| 2815 |
errorExit: |
| 2816 |
if p.HasError() { |
| 2817 |
v := p.GetError() |
| 2818 |
localctx.SetException(v) |
| 2819 |
p.GetErrorHandler().ReportError(p, v) |
| 2820 |
p.GetErrorHandler().Recover(p, v) |
| 2821 |
p.SetError(nil) |
| 2822 |
} |
| 2823 |
p.ExitRule() |
| 2824 |
return localctx |
| 2825 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 2826 |
} |
| 2827 |
|
| 2828 |
// IExprCmdContext is an interface to support dynamic dispatch. |
| 2829 |
type IExprCmdContext interface { |
| 2830 |
antlr.ParserRuleContext |
| 2831 |
|
| 2832 |
// GetParser returns the parser. |
| 2833 |
GetParser() antlr.Parser |
| 2834 |
|
| 2835 |
// Get_FLAG returns the _FLAG token. |
| 2836 |
Get_FLAG() antlr.Token |
| 2837 |
|
| 2838 |
// Set_FLAG sets the _FLAG token. |
| 2839 |
Set_FLAG(antlr.Token) |
| 2840 |
|
| 2841 |
// GetFlags returns the flags token list. |
| 2842 |
GetFlags() []antlr.Token |
| 2843 |
|
| 2844 |
// SetFlags sets the flags token list. |
| 2845 |
SetFlags([]antlr.Token) |
| 2846 |
|
| 2847 |
// GetE returns the e rule contexts. |
| 2848 |
GetE() IExprContext |
| 2849 |
|
| 2850 |
// SetE sets the e rule contexts. |
| 2851 |
SetE(IExprContext) |
| 2852 |
|
| 2853 |
// Getter signatures |
| 2854 |
Expr() IExprContext |
| 2855 |
AllFLAG() []antlr.TerminalNode |
| 2856 |
FLAG(i int) antlr.TerminalNode |
| 2857 |
|
| 2858 |
// IsExprCmdContext differentiates from other interfaces. |
| 2859 |
IsExprCmdContext() |
| 2860 |
} |
| 2861 |
|
| 2862 |
type ExprCmdContext struct { |
| 2863 |
antlr.BaseParserRuleContext |
| 2864 |
parser antlr.Parser |
| 2865 |
_FLAG antlr.Token |
| 2866 |
flags []antlr.Token |
| 2867 |
e IExprContext |
| 2868 |
} |
| 2869 |
|
| 2870 |
func NewEmptyExprCmdContext() *ExprCmdContext { |
| 2871 |
var p = new(ExprCmdContext) |
| 2872 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 2873 |
p.RuleIndex = CommandsParserRULE_exprCmd |
| 2874 |
return p |
| 2875 |
} |
| 2876 |
|
| 2877 |
func InitEmptyExprCmdContext(p *ExprCmdContext) { |
| 2878 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 2879 |
p.RuleIndex = CommandsParserRULE_exprCmd |
| 2880 |
} |
| 2881 |
|
| 2882 |
func (*ExprCmdContext) IsExprCmdContext() {} |
| 2883 |
|
| 2884 |
func NewExprCmdContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprCmdContext { |
| 2885 |
var p = new(ExprCmdContext) |
| 2886 |
|
| 2887 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 2888 |
|
| 2889 |
p.parser = parser |
| 2890 |
p.RuleIndex = CommandsParserRULE_exprCmd |
| 2891 |
|
| 2892 |
return p |
| 2893 |
} |
| 2894 |
|
| 2895 |
func (s *ExprCmdContext) GetParser() antlr.Parser { return s.parser } |
| 2896 |
|
| 2897 |
func (s *ExprCmdContext) Get_FLAG() antlr.Token { return s._FLAG } |
| 2898 |
|
| 2899 |
func (s *ExprCmdContext) Set_FLAG(v antlr.Token) { s._FLAG = v } |
| 2900 |
|
| 2901 |
func (s *ExprCmdContext) GetFlags() []antlr.Token { return s.flags } |
| 2902 |
|
| 2903 |
func (s *ExprCmdContext) SetFlags(v []antlr.Token) { s.flags = v } |
| 2904 |
|
| 2905 |
func (s *ExprCmdContext) GetE() IExprContext { return s.e } |
| 2906 |
|
| 2907 |
func (s *ExprCmdContext) SetE(v IExprContext) { s.e = v } |
| 2908 |
|
| 2909 |
func (s *ExprCmdContext) Expr() IExprContext { |
| 2910 |
var t antlr.RuleContext |
| 2911 |
for _, ctx := range s.GetChildren() { |
| 2912 |
if _, ok := ctx.(IExprContext); ok { |
| 2913 |
t = ctx.(antlr.RuleContext) |
| 2914 |
break |
| 2915 |
} |
| 2916 |
} |
| 2917 |
|
| 2918 |
if t == nil { |
| 2919 |
return nil |
| 2920 |
} |
| 2921 |
|
| 2922 |
return t.(IExprContext) |
| 2923 |
} |
| 2924 |
|
| 2925 |
func (s *ExprCmdContext) AllFLAG() []antlr.TerminalNode { |
| 2926 |
return s.GetTokens(CommandsParserFLAG) |
| 2927 |
} |
| 2928 |
|
| 2929 |
func (s *ExprCmdContext) FLAG(i int) antlr.TerminalNode { |
| 2930 |
return s.GetToken(CommandsParserFLAG, i) |
| 2931 |
} |
| 2932 |
|
| 2933 |
func (s *ExprCmdContext) GetRuleContext() antlr.RuleContext { |
| 2934 |
return s |
| 2935 |
} |
| 2936 |
|
| 2937 |
func (s *ExprCmdContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 2938 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 2939 |
} |
| 2940 |
|
| 2941 |
func (s *ExprCmdContext) EnterRule(listener antlr.ParseTreeListener) { |
| 2942 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 2943 |
listenerT.EnterExprCmd(s) |
| 2944 |
} |
| 2945 |
} |
| 2946 |
|
| 2947 |
func (s *ExprCmdContext) ExitRule(listener antlr.ParseTreeListener) { |
| 2948 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 2949 |
listenerT.ExitExprCmd(s) |
| 2950 |
} |
| 2951 |
} |
| 2952 |
|
| 2953 |
func (s *ExprCmdContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 2954 |
switch t := visitor.(type) { |
| 2955 |
case CommandsVisitor: |
| 2956 |
return t.VisitExprCmd(s) |
| 2957 |
|
| 2958 |
default: |
| 2959 |
return t.VisitChildren(s) |
| 2960 |
} |
| 2961 |
} |
| 2962 |
|
| 2963 |
func (p *CommandsParser) ExprCmd() (localctx IExprCmdContext) { |
| 2964 |
localctx = NewExprCmdContext(p, p.GetParserRuleContext(), p.GetState()) |
| 2965 |
p.EnterRule(localctx, 26, CommandsParserRULE_exprCmd) |
| 2966 |
var _la int |
| 2967 |
|
| 2968 |
p.EnterOuterAlt(localctx, 1) |
| 2969 |
p.SetState(161) |
| 2970 |
p.GetErrorHandler().Sync(p) |
| 2971 |
if p.HasError() { |
| 2972 |
goto errorExit |
| 2973 |
} |
| 2974 |
_la = p.GetTokenStream().LA(1) |
| 2975 |
|
| 2976 |
if _la == CommandsParserT__7 { |
| 2977 |
{ |
| 2978 |
p.SetState(150) |
| 2979 |
p.Match(CommandsParserT__7) |
| 2980 |
if p.HasError() { |
| 2981 |
// Recognition error - abort rule |
| 2982 |
goto errorExit |
| 2983 |
} |
| 2984 |
} |
| 2985 |
p.SetState(159) |
| 2986 |
p.GetErrorHandler().Sync(p) |
| 2987 |
if p.HasError() { |
| 2988 |
goto errorExit |
| 2989 |
} |
| 2990 |
_la = p.GetTokenStream().LA(1) |
| 2991 |
|
| 2992 |
if _la == CommandsParserFLAG { |
| 2993 |
{ |
| 2994 |
p.SetState(151) |
| 2995 |
|
| 2996 |
var _m = p.Match(CommandsParserFLAG) |
| 2997 |
|
| 2998 |
localctx.(*ExprCmdContext)._FLAG = _m |
| 2999 |
if p.HasError() { |
| 3000 |
// Recognition error - abort rule |
| 3001 |
goto errorExit |
| 3002 |
} |
| 3003 |
} |
| 3004 |
localctx.(*ExprCmdContext).flags = append(localctx.(*ExprCmdContext).flags, localctx.(*ExprCmdContext)._FLAG) |
| 3005 |
p.SetState(155) |
| 3006 |
p.GetErrorHandler().Sync(p) |
| 3007 |
if p.HasError() { |
| 3008 |
goto errorExit |
| 3009 |
} |
| 3010 |
_la = p.GetTokenStream().LA(1) |
| 3011 |
|
| 3012 |
for _la == CommandsParserFLAG { |
| 3013 |
{ |
| 3014 |
p.SetState(152) |
| 3015 |
|
| 3016 |
var _m = p.Match(CommandsParserFLAG) |
| 3017 |
|
| 3018 |
localctx.(*ExprCmdContext)._FLAG = _m |
| 3019 |
if p.HasError() { |
| 3020 |
// Recognition error - abort rule |
| 3021 |
goto errorExit |
| 3022 |
} |
| 3023 |
} |
| 3024 |
localctx.(*ExprCmdContext).flags = append(localctx.(*ExprCmdContext).flags, localctx.(*ExprCmdContext)._FLAG) |
| 3025 |
|
| 3026 |
p.SetState(157) |
| 3027 |
p.GetErrorHandler().Sync(p) |
| 3028 |
if p.HasError() { |
| 3029 |
goto errorExit |
| 3030 |
} |
| 3031 |
_la = p.GetTokenStream().LA(1) |
| 3032 |
} |
| 3033 |
{ |
| 3034 |
p.SetState(158) |
| 3035 |
p.Match(CommandsParserT__8) |
| 3036 |
if p.HasError() { |
| 3037 |
// Recognition error - abort rule |
| 3038 |
goto errorExit |
| 3039 |
} |
| 3040 |
} |
| 3041 |
|
| 3042 |
} |
| 3043 |
|
| 3044 |
} |
| 3045 |
{ |
| 3046 |
p.SetState(163) |
| 3047 |
|
| 3048 |
var _x = p.Expr() |
| 3049 |
|
| 3050 |
localctx.(*ExprCmdContext).e = _x |
| 3051 |
} |
| 3052 |
|
| 3053 |
errorExit: |
| 3054 |
if p.HasError() { |
| 3055 |
v := p.GetError() |
| 3056 |
localctx.SetException(v) |
| 3057 |
p.GetErrorHandler().ReportError(p, v) |
| 3058 |
p.GetErrorHandler().Recover(p, v) |
| 3059 |
p.SetError(nil) |
| 3060 |
} |
| 3061 |
p.ExitRule() |
| 3062 |
return localctx |
| 3063 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 3064 |
} |
| 3065 |
|
| 3066 |
// IQualIdContext is an interface to support dynamic dispatch. |
| 3067 |
type IQualIdContext interface { |
| 3068 |
antlr.ParserRuleContext |
| 3069 |
|
| 3070 |
// GetParser returns the parser. |
| 3071 |
GetParser() antlr.Parser |
| 3072 |
|
| 3073 |
// GetLeadingDot returns the leadingDot token. |
| 3074 |
GetLeadingDot() antlr.Token |
| 3075 |
|
| 3076 |
// GetRid returns the rid token. |
| 3077 |
GetRid() antlr.Token |
| 3078 |
|
| 3079 |
// Get_IDENTIFIER returns the _IDENTIFIER token. |
| 3080 |
Get_IDENTIFIER() antlr.Token |
| 3081 |
|
| 3082 |
// SetLeadingDot sets the leadingDot token. |
| 3083 |
SetLeadingDot(antlr.Token) |
| 3084 |
|
| 3085 |
// SetRid sets the rid token. |
| 3086 |
SetRid(antlr.Token) |
| 3087 |
|
| 3088 |
// Set_IDENTIFIER sets the _IDENTIFIER token. |
| 3089 |
Set_IDENTIFIER(antlr.Token) |
| 3090 |
|
| 3091 |
// GetQualifiers returns the qualifiers token list. |
| 3092 |
GetQualifiers() []antlr.Token |
| 3093 |
|
| 3094 |
// SetQualifiers sets the qualifiers token list. |
| 3095 |
SetQualifiers([]antlr.Token) |
| 3096 |
|
| 3097 |
// Getter signatures |
| 3098 |
AllIDENTIFIER() []antlr.TerminalNode |
| 3099 |
IDENTIFIER(i int) antlr.TerminalNode |
| 3100 |
AllDOT() []antlr.TerminalNode |
| 3101 |
DOT(i int) antlr.TerminalNode |
| 3102 |
|
| 3103 |
// IsQualIdContext differentiates from other interfaces. |
| 3104 |
IsQualIdContext() |
| 3105 |
} |
| 3106 |
|
| 3107 |
type QualIdContext struct { |
| 3108 |
antlr.BaseParserRuleContext |
| 3109 |
parser antlr.Parser |
| 3110 |
leadingDot antlr.Token |
| 3111 |
rid antlr.Token |
| 3112 |
_IDENTIFIER antlr.Token |
| 3113 |
qualifiers []antlr.Token |
| 3114 |
} |
| 3115 |
|
| 3116 |
func NewEmptyQualIdContext() *QualIdContext { |
| 3117 |
var p = new(QualIdContext) |
| 3118 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 3119 |
p.RuleIndex = CommandsParserRULE_qualId |
| 3120 |
return p |
| 3121 |
} |
| 3122 |
|
| 3123 |
func InitEmptyQualIdContext(p *QualIdContext) { |
| 3124 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 3125 |
p.RuleIndex = CommandsParserRULE_qualId |
| 3126 |
} |
| 3127 |
|
| 3128 |
func (*QualIdContext) IsQualIdContext() {} |
| 3129 |
|
| 3130 |
func NewQualIdContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *QualIdContext { |
| 3131 |
var p = new(QualIdContext) |
| 3132 |
|
| 3133 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 3134 |
|
| 3135 |
p.parser = parser |
| 3136 |
p.RuleIndex = CommandsParserRULE_qualId |
| 3137 |
|
| 3138 |
return p |
| 3139 |
} |
| 3140 |
|
| 3141 |
func (s *QualIdContext) GetParser() antlr.Parser { return s.parser } |
| 3142 |
|
| 3143 |
func (s *QualIdContext) GetLeadingDot() antlr.Token { return s.leadingDot } |
| 3144 |
|
| 3145 |
func (s *QualIdContext) GetRid() antlr.Token { return s.rid } |
| 3146 |
|
| 3147 |
func (s *QualIdContext) Get_IDENTIFIER() antlr.Token { return s._IDENTIFIER } |
| 3148 |
|
| 3149 |
func (s *QualIdContext) SetLeadingDot(v antlr.Token) { s.leadingDot = v } |
| 3150 |
|
| 3151 |
func (s *QualIdContext) SetRid(v antlr.Token) { s.rid = v } |
| 3152 |
|
| 3153 |
func (s *QualIdContext) Set_IDENTIFIER(v antlr.Token) { s._IDENTIFIER = v } |
| 3154 |
|
| 3155 |
func (s *QualIdContext) GetQualifiers() []antlr.Token { return s.qualifiers } |
| 3156 |
|
| 3157 |
func (s *QualIdContext) SetQualifiers(v []antlr.Token) { s.qualifiers = v } |
| 3158 |
|
| 3159 |
func (s *QualIdContext) AllIDENTIFIER() []antlr.TerminalNode { |
| 3160 |
return s.GetTokens(CommandsParserIDENTIFIER) |
| 3161 |
} |
| 3162 |
|
| 3163 |
func (s *QualIdContext) IDENTIFIER(i int) antlr.TerminalNode { |
| 3164 |
return s.GetToken(CommandsParserIDENTIFIER, i) |
| 3165 |
} |
| 3166 |
|
| 3167 |
func (s *QualIdContext) AllDOT() []antlr.TerminalNode { |
| 3168 |
return s.GetTokens(CommandsParserDOT) |
| 3169 |
} |
| 3170 |
|
| 3171 |
func (s *QualIdContext) DOT(i int) antlr.TerminalNode { |
| 3172 |
return s.GetToken(CommandsParserDOT, i) |
| 3173 |
} |
| 3174 |
|
| 3175 |
func (s *QualIdContext) GetRuleContext() antlr.RuleContext { |
| 3176 |
return s |
| 3177 |
} |
| 3178 |
|
| 3179 |
func (s *QualIdContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 3180 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 3181 |
} |
| 3182 |
|
| 3183 |
func (s *QualIdContext) EnterRule(listener antlr.ParseTreeListener) { |
| 3184 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 3185 |
listenerT.EnterQualId(s) |
| 3186 |
} |
| 3187 |
} |
| 3188 |
|
| 3189 |
func (s *QualIdContext) ExitRule(listener antlr.ParseTreeListener) { |
| 3190 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 3191 |
listenerT.ExitQualId(s) |
| 3192 |
} |
| 3193 |
} |
| 3194 |
|
| 3195 |
func (s *QualIdContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 3196 |
switch t := visitor.(type) { |
| 3197 |
case CommandsVisitor: |
| 3198 |
return t.VisitQualId(s) |
| 3199 |
|
| 3200 |
default: |
| 3201 |
return t.VisitChildren(s) |
| 3202 |
} |
| 3203 |
} |
| 3204 |
|
| 3205 |
func (p *CommandsParser) QualId() (localctx IQualIdContext) { |
| 3206 |
localctx = NewQualIdContext(p, p.GetParserRuleContext(), p.GetState()) |
| 3207 |
p.EnterRule(localctx, 28, CommandsParserRULE_qualId) |
| 3208 |
var _la int |
| 3209 |
|
| 3210 |
p.EnterOuterAlt(localctx, 1) |
| 3211 |
p.SetState(166) |
| 3212 |
p.GetErrorHandler().Sync(p) |
| 3213 |
if p.HasError() { |
| 3214 |
goto errorExit |
| 3215 |
} |
| 3216 |
_la = p.GetTokenStream().LA(1) |
| 3217 |
|
| 3218 |
if _la == CommandsParserDOT { |
| 3219 |
{ |
| 3220 |
p.SetState(165) |
| 3221 |
|
| 3222 |
var _m = p.Match(CommandsParserDOT) |
| 3223 |
|
| 3224 |
localctx.(*QualIdContext).leadingDot = _m |
| 3225 |
if p.HasError() { |
| 3226 |
// Recognition error - abort rule |
| 3227 |
goto errorExit |
| 3228 |
} |
| 3229 |
} |
| 3230 |
|
| 3231 |
} |
| 3232 |
{ |
| 3233 |
p.SetState(168) |
| 3234 |
|
| 3235 |
var _m = p.Match(CommandsParserIDENTIFIER) |
| 3236 |
|
| 3237 |
localctx.(*QualIdContext).rid = _m |
| 3238 |
if p.HasError() { |
| 3239 |
// Recognition error - abort rule |
| 3240 |
goto errorExit |
| 3241 |
} |
| 3242 |
} |
| 3243 |
p.SetState(173) |
| 3244 |
p.GetErrorHandler().Sync(p) |
| 3245 |
if p.HasError() { |
| 3246 |
goto errorExit |
| 3247 |
} |
| 3248 |
_la = p.GetTokenStream().LA(1) |
| 3249 |
|
| 3250 |
for _la == CommandsParserDOT { |
| 3251 |
{ |
| 3252 |
p.SetState(169) |
| 3253 |
p.Match(CommandsParserDOT) |
| 3254 |
if p.HasError() { |
| 3255 |
// Recognition error - abort rule |
| 3256 |
goto errorExit |
| 3257 |
} |
| 3258 |
} |
| 3259 |
{ |
| 3260 |
p.SetState(170) |
| 3261 |
|
| 3262 |
var _m = p.Match(CommandsParserIDENTIFIER) |
| 3263 |
|
| 3264 |
localctx.(*QualIdContext)._IDENTIFIER = _m |
| 3265 |
if p.HasError() { |
| 3266 |
// Recognition error - abort rule |
| 3267 |
goto errorExit |
| 3268 |
} |
| 3269 |
} |
| 3270 |
localctx.(*QualIdContext).qualifiers = append(localctx.(*QualIdContext).qualifiers, localctx.(*QualIdContext)._IDENTIFIER) |
| 3271 |
|
| 3272 |
p.SetState(175) |
| 3273 |
p.GetErrorHandler().Sync(p) |
| 3274 |
if p.HasError() { |
| 3275 |
goto errorExit |
| 3276 |
} |
| 3277 |
_la = p.GetTokenStream().LA(1) |
| 3278 |
} |
| 3279 |
|
| 3280 |
errorExit: |
| 3281 |
if p.HasError() { |
| 3282 |
v := p.GetError() |
| 3283 |
localctx.SetException(v) |
| 3284 |
p.GetErrorHandler().ReportError(p, v) |
| 3285 |
p.GetErrorHandler().Recover(p, v) |
| 3286 |
p.SetError(nil) |
| 3287 |
} |
| 3288 |
p.ExitRule() |
| 3289 |
return localctx |
| 3290 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 3291 |
} |
| 3292 |
|
| 3293 |
// IStartTypeContext is an interface to support dynamic dispatch. |
| 3294 |
type IStartTypeContext interface { |
| 3295 |
antlr.ParserRuleContext |
| 3296 |
|
| 3297 |
// GetParser returns the parser. |
| 3298 |
GetParser() antlr.Parser |
| 3299 |
|
| 3300 |
// GetT returns the t rule contexts. |
| 3301 |
GetT() ITypeContext |
| 3302 |
|
| 3303 |
// SetT sets the t rule contexts. |
| 3304 |
SetT(ITypeContext) |
| 3305 |
|
| 3306 |
// Getter signatures |
| 3307 |
EOF() antlr.TerminalNode |
| 3308 |
Type_() ITypeContext |
| 3309 |
|
| 3310 |
// IsStartTypeContext differentiates from other interfaces. |
| 3311 |
IsStartTypeContext() |
| 3312 |
} |
| 3313 |
|
| 3314 |
type StartTypeContext struct { |
| 3315 |
antlr.BaseParserRuleContext |
| 3316 |
parser antlr.Parser |
| 3317 |
t ITypeContext |
| 3318 |
} |
| 3319 |
|
| 3320 |
func NewEmptyStartTypeContext() *StartTypeContext { |
| 3321 |
var p = new(StartTypeContext) |
| 3322 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 3323 |
p.RuleIndex = CommandsParserRULE_startType |
| 3324 |
return p |
| 3325 |
} |
| 3326 |
|
| 3327 |
func InitEmptyStartTypeContext(p *StartTypeContext) { |
| 3328 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 3329 |
p.RuleIndex = CommandsParserRULE_startType |
| 3330 |
} |
| 3331 |
|
| 3332 |
func (*StartTypeContext) IsStartTypeContext() {} |
| 3333 |
|
| 3334 |
func NewStartTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StartTypeContext { |
| 3335 |
var p = new(StartTypeContext) |
| 3336 |
|
| 3337 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 3338 |
|
| 3339 |
p.parser = parser |
| 3340 |
p.RuleIndex = CommandsParserRULE_startType |
| 3341 |
|
| 3342 |
return p |
| 3343 |
} |
| 3344 |
|
| 3345 |
func (s *StartTypeContext) GetParser() antlr.Parser { return s.parser } |
| 3346 |
|
| 3347 |
func (s *StartTypeContext) GetT() ITypeContext { return s.t } |
| 3348 |
|
| 3349 |
func (s *StartTypeContext) SetT(v ITypeContext) { s.t = v } |
| 3350 |
|
| 3351 |
func (s *StartTypeContext) EOF() antlr.TerminalNode { |
| 3352 |
return s.GetToken(CommandsParserEOF, 0) |
| 3353 |
} |
| 3354 |
|
| 3355 |
func (s *StartTypeContext) Type_() ITypeContext { |
| 3356 |
var t antlr.RuleContext |
| 3357 |
for _, ctx := range s.GetChildren() { |
| 3358 |
if _, ok := ctx.(ITypeContext); ok { |
| 3359 |
t = ctx.(antlr.RuleContext) |
| 3360 |
break |
| 3361 |
} |
| 3362 |
} |
| 3363 |
|
| 3364 |
if t == nil { |
| 3365 |
return nil |
| 3366 |
} |
| 3367 |
|
| 3368 |
return t.(ITypeContext) |
| 3369 |
} |
| 3370 |
|
| 3371 |
func (s *StartTypeContext) GetRuleContext() antlr.RuleContext { |
| 3372 |
return s |
| 3373 |
} |
| 3374 |
|
| 3375 |
func (s *StartTypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 3376 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 3377 |
} |
| 3378 |
|
| 3379 |
func (s *StartTypeContext) EnterRule(listener antlr.ParseTreeListener) { |
| 3380 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 3381 |
listenerT.EnterStartType(s) |
| 3382 |
} |
| 3383 |
} |
| 3384 |
|
| 3385 |
func (s *StartTypeContext) ExitRule(listener antlr.ParseTreeListener) { |
| 3386 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 3387 |
listenerT.ExitStartType(s) |
| 3388 |
} |
| 3389 |
} |
| 3390 |
|
| 3391 |
func (s *StartTypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 3392 |
switch t := visitor.(type) { |
| 3393 |
case CommandsVisitor: |
| 3394 |
return t.VisitStartType(s) |
| 3395 |
|
| 3396 |
default: |
| 3397 |
return t.VisitChildren(s) |
| 3398 |
} |
| 3399 |
} |
| 3400 |
|
| 3401 |
func (p *CommandsParser) StartType() (localctx IStartTypeContext) { |
| 3402 |
localctx = NewStartTypeContext(p, p.GetParserRuleContext(), p.GetState()) |
| 3403 |
p.EnterRule(localctx, 30, CommandsParserRULE_startType) |
| 3404 |
p.EnterOuterAlt(localctx, 1) |
| 3405 |
{ |
| 3406 |
p.SetState(176) |
| 3407 |
|
| 3408 |
var _x = p.Type_() |
| 3409 |
|
| 3410 |
localctx.(*StartTypeContext).t = _x |
| 3411 |
} |
| 3412 |
{ |
| 3413 |
p.SetState(177) |
| 3414 |
p.Match(CommandsParserEOF) |
| 3415 |
if p.HasError() { |
| 3416 |
// Recognition error - abort rule |
| 3417 |
goto errorExit |
| 3418 |
} |
| 3419 |
} |
| 3420 |
|
| 3421 |
errorExit: |
| 3422 |
if p.HasError() { |
| 3423 |
v := p.GetError() |
| 3424 |
localctx.SetException(v) |
| 3425 |
p.GetErrorHandler().ReportError(p, v) |
| 3426 |
p.GetErrorHandler().Recover(p, v) |
| 3427 |
p.SetError(nil) |
| 3428 |
} |
| 3429 |
p.ExitRule() |
| 3430 |
return localctx |
| 3431 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 3432 |
} |
| 3433 |
|
| 3434 |
// ITypeContext is an interface to support dynamic dispatch. |
| 3435 |
type ITypeContext interface { |
| 3436 |
antlr.ParserRuleContext |
| 3437 |
|
| 3438 |
// GetParser returns the parser. |
| 3439 |
GetParser() antlr.Parser |
| 3440 |
|
| 3441 |
// GetId returns the id rule contexts. |
| 3442 |
GetId() ITypeIdContext |
| 3443 |
|
| 3444 |
// GetParams returns the params rule contexts. |
| 3445 |
GetParams() ITypeParamListContext |
| 3446 |
|
| 3447 |
// SetId sets the id rule contexts. |
| 3448 |
SetId(ITypeIdContext) |
| 3449 |
|
| 3450 |
// SetParams sets the params rule contexts. |
| 3451 |
SetParams(ITypeParamListContext) |
| 3452 |
|
| 3453 |
// Getter signatures |
| 3454 |
TypeId() ITypeIdContext |
| 3455 |
TypeParamList() ITypeParamListContext |
| 3456 |
|
| 3457 |
// IsTypeContext differentiates from other interfaces. |
| 3458 |
IsTypeContext() |
| 3459 |
} |
| 3460 |
|
| 3461 |
type TypeContext struct { |
| 3462 |
antlr.BaseParserRuleContext |
| 3463 |
parser antlr.Parser |
| 3464 |
id ITypeIdContext |
| 3465 |
params ITypeParamListContext |
| 3466 |
} |
| 3467 |
|
| 3468 |
func NewEmptyTypeContext() *TypeContext { |
| 3469 |
var p = new(TypeContext) |
| 3470 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 3471 |
p.RuleIndex = CommandsParserRULE_type |
| 3472 |
return p |
| 3473 |
} |
| 3474 |
|
| 3475 |
func InitEmptyTypeContext(p *TypeContext) { |
| 3476 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 3477 |
p.RuleIndex = CommandsParserRULE_type |
| 3478 |
} |
| 3479 |
|
| 3480 |
func (*TypeContext) IsTypeContext() {} |
| 3481 |
|
| 3482 |
func NewTypeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeContext { |
| 3483 |
var p = new(TypeContext) |
| 3484 |
|
| 3485 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 3486 |
|
| 3487 |
p.parser = parser |
| 3488 |
p.RuleIndex = CommandsParserRULE_type |
| 3489 |
|
| 3490 |
return p |
| 3491 |
} |
| 3492 |
|
| 3493 |
func (s *TypeContext) GetParser() antlr.Parser { return s.parser } |
| 3494 |
|
| 3495 |
func (s *TypeContext) GetId() ITypeIdContext { return s.id } |
| 3496 |
|
| 3497 |
func (s *TypeContext) GetParams() ITypeParamListContext { return s.params } |
| 3498 |
|
| 3499 |
func (s *TypeContext) SetId(v ITypeIdContext) { s.id = v } |
| 3500 |
|
| 3501 |
func (s *TypeContext) SetParams(v ITypeParamListContext) { s.params = v } |
| 3502 |
|
| 3503 |
func (s *TypeContext) TypeId() ITypeIdContext { |
| 3504 |
var t antlr.RuleContext |
| 3505 |
for _, ctx := range s.GetChildren() { |
| 3506 |
if _, ok := ctx.(ITypeIdContext); ok { |
| 3507 |
t = ctx.(antlr.RuleContext) |
| 3508 |
break |
| 3509 |
} |
| 3510 |
} |
| 3511 |
|
| 3512 |
if t == nil { |
| 3513 |
return nil |
| 3514 |
} |
| 3515 |
|
| 3516 |
return t.(ITypeIdContext) |
| 3517 |
} |
| 3518 |
|
| 3519 |
func (s *TypeContext) TypeParamList() ITypeParamListContext { |
| 3520 |
var t antlr.RuleContext |
| 3521 |
for _, ctx := range s.GetChildren() { |
| 3522 |
if _, ok := ctx.(ITypeParamListContext); ok { |
| 3523 |
t = ctx.(antlr.RuleContext) |
| 3524 |
break |
| 3525 |
} |
| 3526 |
} |
| 3527 |
|
| 3528 |
if t == nil { |
| 3529 |
return nil |
| 3530 |
} |
| 3531 |
|
| 3532 |
return t.(ITypeParamListContext) |
| 3533 |
} |
| 3534 |
|
| 3535 |
func (s *TypeContext) GetRuleContext() antlr.RuleContext { |
| 3536 |
return s |
| 3537 |
} |
| 3538 |
|
| 3539 |
func (s *TypeContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 3540 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 3541 |
} |
| 3542 |
|
| 3543 |
func (s *TypeContext) EnterRule(listener antlr.ParseTreeListener) { |
| 3544 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 3545 |
listenerT.EnterType(s) |
| 3546 |
} |
| 3547 |
} |
| 3548 |
|
| 3549 |
func (s *TypeContext) ExitRule(listener antlr.ParseTreeListener) { |
| 3550 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 3551 |
listenerT.ExitType(s) |
| 3552 |
} |
| 3553 |
} |
| 3554 |
|
| 3555 |
func (s *TypeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 3556 |
switch t := visitor.(type) { |
| 3557 |
case CommandsVisitor: |
| 3558 |
return t.VisitType(s) |
| 3559 |
|
| 3560 |
default: |
| 3561 |
return t.VisitChildren(s) |
| 3562 |
} |
| 3563 |
} |
| 3564 |
|
| 3565 |
func (p *CommandsParser) Type_() (localctx ITypeContext) { |
| 3566 |
localctx = NewTypeContext(p, p.GetParserRuleContext(), p.GetState()) |
| 3567 |
p.EnterRule(localctx, 32, CommandsParserRULE_type) |
| 3568 |
var _la int |
| 3569 |
|
| 3570 |
p.EnterOuterAlt(localctx, 1) |
| 3571 |
{ |
| 3572 |
p.SetState(179) |
| 3573 |
|
| 3574 |
var _x = p.TypeId() |
| 3575 |
|
| 3576 |
localctx.(*TypeContext).id = _x |
| 3577 |
} |
| 3578 |
p.SetState(181) |
| 3579 |
p.GetErrorHandler().Sync(p) |
| 3580 |
if p.HasError() { |
| 3581 |
goto errorExit |
| 3582 |
} |
| 3583 |
_la = p.GetTokenStream().LA(1) |
| 3584 |
|
| 3585 |
if _la == CommandsParserLPAREN { |
| 3586 |
{ |
| 3587 |
p.SetState(180) |
| 3588 |
|
| 3589 |
var _x = p.TypeParamList() |
| 3590 |
|
| 3591 |
localctx.(*TypeContext).params = _x |
| 3592 |
} |
| 3593 |
|
| 3594 |
} |
| 3595 |
|
| 3596 |
errorExit: |
| 3597 |
if p.HasError() { |
| 3598 |
v := p.GetError() |
| 3599 |
localctx.SetException(v) |
| 3600 |
p.GetErrorHandler().ReportError(p, v) |
| 3601 |
p.GetErrorHandler().Recover(p, v) |
| 3602 |
p.SetError(nil) |
| 3603 |
} |
| 3604 |
p.ExitRule() |
| 3605 |
return localctx |
| 3606 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 3607 |
} |
| 3608 |
|
| 3609 |
// ITypeIdContext is an interface to support dynamic dispatch. |
| 3610 |
type ITypeIdContext interface { |
| 3611 |
antlr.ParserRuleContext |
| 3612 |
|
| 3613 |
// GetParser returns the parser. |
| 3614 |
GetParser() antlr.Parser |
| 3615 |
|
| 3616 |
// GetLeadingDot returns the leadingDot token. |
| 3617 |
GetLeadingDot() antlr.Token |
| 3618 |
|
| 3619 |
// GetId returns the id token. |
| 3620 |
GetId() antlr.Token |
| 3621 |
|
| 3622 |
// Get_IDENTIFIER returns the _IDENTIFIER token. |
| 3623 |
Get_IDENTIFIER() antlr.Token |
| 3624 |
|
| 3625 |
// SetLeadingDot sets the leadingDot token. |
| 3626 |
SetLeadingDot(antlr.Token) |
| 3627 |
|
| 3628 |
// SetId sets the id token. |
| 3629 |
SetId(antlr.Token) |
| 3630 |
|
| 3631 |
// Set_IDENTIFIER sets the _IDENTIFIER token. |
| 3632 |
Set_IDENTIFIER(antlr.Token) |
| 3633 |
|
| 3634 |
// GetQualifiers returns the qualifiers token list. |
| 3635 |
GetQualifiers() []antlr.Token |
| 3636 |
|
| 3637 |
// SetQualifiers sets the qualifiers token list. |
| 3638 |
SetQualifiers([]antlr.Token) |
| 3639 |
|
| 3640 |
// Getter signatures |
| 3641 |
AllIDENTIFIER() []antlr.TerminalNode |
| 3642 |
IDENTIFIER(i int) antlr.TerminalNode |
| 3643 |
NUL() antlr.TerminalNode |
| 3644 |
AllDOT() []antlr.TerminalNode |
| 3645 |
DOT(i int) antlr.TerminalNode |
| 3646 |
|
| 3647 |
// IsTypeIdContext differentiates from other interfaces. |
| 3648 |
IsTypeIdContext() |
| 3649 |
} |
| 3650 |
|
| 3651 |
type TypeIdContext struct { |
| 3652 |
antlr.BaseParserRuleContext |
| 3653 |
parser antlr.Parser |
| 3654 |
leadingDot antlr.Token |
| 3655 |
id antlr.Token |
| 3656 |
_IDENTIFIER antlr.Token |
| 3657 |
qualifiers []antlr.Token |
| 3658 |
} |
| 3659 |
|
| 3660 |
func NewEmptyTypeIdContext() *TypeIdContext { |
| 3661 |
var p = new(TypeIdContext) |
| 3662 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 3663 |
p.RuleIndex = CommandsParserRULE_typeId |
| 3664 |
return p |
| 3665 |
} |
| 3666 |
|
| 3667 |
func InitEmptyTypeIdContext(p *TypeIdContext) { |
| 3668 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 3669 |
p.RuleIndex = CommandsParserRULE_typeId |
| 3670 |
} |
| 3671 |
|
| 3672 |
func (*TypeIdContext) IsTypeIdContext() {} |
| 3673 |
|
| 3674 |
func NewTypeIdContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeIdContext { |
| 3675 |
var p = new(TypeIdContext) |
| 3676 |
|
| 3677 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 3678 |
|
| 3679 |
p.parser = parser |
| 3680 |
p.RuleIndex = CommandsParserRULE_typeId |
| 3681 |
|
| 3682 |
return p |
| 3683 |
} |
| 3684 |
|
| 3685 |
func (s *TypeIdContext) GetParser() antlr.Parser { return s.parser } |
| 3686 |
|
| 3687 |
func (s *TypeIdContext) GetLeadingDot() antlr.Token { return s.leadingDot } |
| 3688 |
|
| 3689 |
func (s *TypeIdContext) GetId() antlr.Token { return s.id } |
| 3690 |
|
| 3691 |
func (s *TypeIdContext) Get_IDENTIFIER() antlr.Token { return s._IDENTIFIER } |
| 3692 |
|
| 3693 |
func (s *TypeIdContext) SetLeadingDot(v antlr.Token) { s.leadingDot = v } |
| 3694 |
|
| 3695 |
func (s *TypeIdContext) SetId(v antlr.Token) { s.id = v } |
| 3696 |
|
| 3697 |
func (s *TypeIdContext) Set_IDENTIFIER(v antlr.Token) { s._IDENTIFIER = v } |
| 3698 |
|
| 3699 |
func (s *TypeIdContext) GetQualifiers() []antlr.Token { return s.qualifiers } |
| 3700 |
|
| 3701 |
func (s *TypeIdContext) SetQualifiers(v []antlr.Token) { s.qualifiers = v } |
| 3702 |
|
| 3703 |
func (s *TypeIdContext) AllIDENTIFIER() []antlr.TerminalNode { |
| 3704 |
return s.GetTokens(CommandsParserIDENTIFIER) |
| 3705 |
} |
| 3706 |
|
| 3707 |
func (s *TypeIdContext) IDENTIFIER(i int) antlr.TerminalNode { |
| 3708 |
return s.GetToken(CommandsParserIDENTIFIER, i) |
| 3709 |
} |
| 3710 |
|
| 3711 |
func (s *TypeIdContext) NUL() antlr.TerminalNode { |
| 3712 |
return s.GetToken(CommandsParserNUL, 0) |
| 3713 |
} |
| 3714 |
|
| 3715 |
func (s *TypeIdContext) AllDOT() []antlr.TerminalNode { |
| 3716 |
return s.GetTokens(CommandsParserDOT) |
| 3717 |
} |
| 3718 |
|
| 3719 |
func (s *TypeIdContext) DOT(i int) antlr.TerminalNode { |
| 3720 |
return s.GetToken(CommandsParserDOT, i) |
| 3721 |
} |
| 3722 |
|
| 3723 |
func (s *TypeIdContext) GetRuleContext() antlr.RuleContext { |
| 3724 |
return s |
| 3725 |
} |
| 3726 |
|
| 3727 |
func (s *TypeIdContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 3728 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 3729 |
} |
| 3730 |
|
| 3731 |
func (s *TypeIdContext) EnterRule(listener antlr.ParseTreeListener) { |
| 3732 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 3733 |
listenerT.EnterTypeId(s) |
| 3734 |
} |
| 3735 |
} |
| 3736 |
|
| 3737 |
func (s *TypeIdContext) ExitRule(listener antlr.ParseTreeListener) { |
| 3738 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 3739 |
listenerT.ExitTypeId(s) |
| 3740 |
} |
| 3741 |
} |
| 3742 |
|
| 3743 |
func (s *TypeIdContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 3744 |
switch t := visitor.(type) { |
| 3745 |
case CommandsVisitor: |
| 3746 |
return t.VisitTypeId(s) |
| 3747 |
|
| 3748 |
default: |
| 3749 |
return t.VisitChildren(s) |
| 3750 |
} |
| 3751 |
} |
| 3752 |
|
| 3753 |
func (p *CommandsParser) TypeId() (localctx ITypeIdContext) { |
| 3754 |
localctx = NewTypeIdContext(p, p.GetParserRuleContext(), p.GetState()) |
| 3755 |
p.EnterRule(localctx, 34, CommandsParserRULE_typeId) |
| 3756 |
var _la int |
| 3757 |
|
| 3758 |
p.EnterOuterAlt(localctx, 1) |
| 3759 |
p.SetState(184) |
| 3760 |
p.GetErrorHandler().Sync(p) |
| 3761 |
if p.HasError() { |
| 3762 |
goto errorExit |
| 3763 |
} |
| 3764 |
_la = p.GetTokenStream().LA(1) |
| 3765 |
|
| 3766 |
if _la == CommandsParserDOT { |
| 3767 |
{ |
| 3768 |
p.SetState(183) |
| 3769 |
|
| 3770 |
var _m = p.Match(CommandsParserDOT) |
| 3771 |
|
| 3772 |
localctx.(*TypeIdContext).leadingDot = _m |
| 3773 |
if p.HasError() { |
| 3774 |
// Recognition error - abort rule |
| 3775 |
goto errorExit |
| 3776 |
} |
| 3777 |
} |
| 3778 |
|
| 3779 |
} |
| 3780 |
{ |
| 3781 |
p.SetState(186) |
| 3782 |
|
| 3783 |
var _lt = p.GetTokenStream().LT(1) |
| 3784 |
|
| 3785 |
localctx.(*TypeIdContext).id = _lt |
| 3786 |
|
| 3787 |
_la = p.GetTokenStream().LA(1) |
| 3788 |
|
| 3789 |
if !(_la == CommandsParserNUL || _la == CommandsParserIDENTIFIER) { |
| 3790 |
var _ri = p.GetErrorHandler().RecoverInline(p) |
| 3791 |
|
| 3792 |
localctx.(*TypeIdContext).id = _ri |
| 3793 |
} else { |
| 3794 |
p.GetErrorHandler().ReportMatch(p) |
| 3795 |
p.Consume() |
| 3796 |
} |
| 3797 |
} |
| 3798 |
p.SetState(191) |
| 3799 |
p.GetErrorHandler().Sync(p) |
| 3800 |
if p.HasError() { |
| 3801 |
goto errorExit |
| 3802 |
} |
| 3803 |
_la = p.GetTokenStream().LA(1) |
| 3804 |
|
| 3805 |
for _la == CommandsParserDOT { |
| 3806 |
{ |
| 3807 |
p.SetState(187) |
| 3808 |
p.Match(CommandsParserDOT) |
| 3809 |
if p.HasError() { |
| 3810 |
// Recognition error - abort rule |
| 3811 |
goto errorExit |
| 3812 |
} |
| 3813 |
} |
| 3814 |
{ |
| 3815 |
p.SetState(188) |
| 3816 |
|
| 3817 |
var _m = p.Match(CommandsParserIDENTIFIER) |
| 3818 |
|
| 3819 |
localctx.(*TypeIdContext)._IDENTIFIER = _m |
| 3820 |
if p.HasError() { |
| 3821 |
// Recognition error - abort rule |
| 3822 |
goto errorExit |
| 3823 |
} |
| 3824 |
} |
| 3825 |
localctx.(*TypeIdContext).qualifiers = append(localctx.(*TypeIdContext).qualifiers, localctx.(*TypeIdContext)._IDENTIFIER) |
| 3826 |
|
| 3827 |
p.SetState(193) |
| 3828 |
p.GetErrorHandler().Sync(p) |
| 3829 |
if p.HasError() { |
| 3830 |
goto errorExit |
| 3831 |
} |
| 3832 |
_la = p.GetTokenStream().LA(1) |
| 3833 |
} |
| 3834 |
|
| 3835 |
errorExit: |
| 3836 |
if p.HasError() { |
| 3837 |
v := p.GetError() |
| 3838 |
localctx.SetException(v) |
| 3839 |
p.GetErrorHandler().ReportError(p, v) |
| 3840 |
p.GetErrorHandler().Recover(p, v) |
| 3841 |
p.SetError(nil) |
| 3842 |
} |
| 3843 |
p.ExitRule() |
| 3844 |
return localctx |
| 3845 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 3846 |
} |
| 3847 |
|
| 3848 |
// ITypeParamListContext is an interface to support dynamic dispatch. |
| 3849 |
type ITypeParamListContext interface { |
| 3850 |
antlr.ParserRuleContext |
| 3851 |
|
| 3852 |
// GetParser returns the parser. |
| 3853 |
GetParser() antlr.Parser |
| 3854 |
|
| 3855 |
// Get_type returns the _type rule contexts. |
| 3856 |
Get_type() ITypeContext |
| 3857 |
|
| 3858 |
// Set_type sets the _type rule contexts. |
| 3859 |
Set_type(ITypeContext) |
| 3860 |
|
| 3861 |
// GetTypes returns the types rule context list. |
| 3862 |
GetTypes() []ITypeContext |
| 3863 |
|
| 3864 |
// SetTypes sets the types rule context list. |
| 3865 |
SetTypes([]ITypeContext) |
| 3866 |
|
| 3867 |
// Getter signatures |
| 3868 |
LPAREN() antlr.TerminalNode |
| 3869 |
RPAREN() antlr.TerminalNode |
| 3870 |
AllType_() []ITypeContext |
| 3871 |
Type_(i int) ITypeContext |
| 3872 |
AllCOMMA() []antlr.TerminalNode |
| 3873 |
COMMA(i int) antlr.TerminalNode |
| 3874 |
|
| 3875 |
// IsTypeParamListContext differentiates from other interfaces. |
| 3876 |
IsTypeParamListContext() |
| 3877 |
} |
| 3878 |
|
| 3879 |
type TypeParamListContext struct { |
| 3880 |
antlr.BaseParserRuleContext |
| 3881 |
parser antlr.Parser |
| 3882 |
_type ITypeContext |
| 3883 |
types []ITypeContext |
| 3884 |
} |
| 3885 |
|
| 3886 |
func NewEmptyTypeParamListContext() *TypeParamListContext { |
| 3887 |
var p = new(TypeParamListContext) |
| 3888 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 3889 |
p.RuleIndex = CommandsParserRULE_typeParamList |
| 3890 |
return p |
| 3891 |
} |
| 3892 |
|
| 3893 |
func InitEmptyTypeParamListContext(p *TypeParamListContext) { |
| 3894 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 3895 |
p.RuleIndex = CommandsParserRULE_typeParamList |
| 3896 |
} |
| 3897 |
|
| 3898 |
func (*TypeParamListContext) IsTypeParamListContext() {} |
| 3899 |
|
| 3900 |
func NewTypeParamListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TypeParamListContext { |
| 3901 |
var p = new(TypeParamListContext) |
| 3902 |
|
| 3903 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 3904 |
|
| 3905 |
p.parser = parser |
| 3906 |
p.RuleIndex = CommandsParserRULE_typeParamList |
| 3907 |
|
| 3908 |
return p |
| 3909 |
} |
| 3910 |
|
| 3911 |
func (s *TypeParamListContext) GetParser() antlr.Parser { return s.parser } |
| 3912 |
|
| 3913 |
func (s *TypeParamListContext) Get_type() ITypeContext { return s._type } |
| 3914 |
|
| 3915 |
func (s *TypeParamListContext) Set_type(v ITypeContext) { s._type = v } |
| 3916 |
|
| 3917 |
func (s *TypeParamListContext) GetTypes() []ITypeContext { return s.types } |
| 3918 |
|
| 3919 |
func (s *TypeParamListContext) SetTypes(v []ITypeContext) { s.types = v } |
| 3920 |
|
| 3921 |
func (s *TypeParamListContext) LPAREN() antlr.TerminalNode { |
| 3922 |
return s.GetToken(CommandsParserLPAREN, 0) |
| 3923 |
} |
| 3924 |
|
| 3925 |
func (s *TypeParamListContext) RPAREN() antlr.TerminalNode { |
| 3926 |
return s.GetToken(CommandsParserRPAREN, 0) |
| 3927 |
} |
| 3928 |
|
| 3929 |
func (s *TypeParamListContext) AllType_() []ITypeContext { |
| 3930 |
children := s.GetChildren() |
| 3931 |
len := 0 |
| 3932 |
for _, ctx := range children { |
| 3933 |
if _, ok := ctx.(ITypeContext); ok { |
| 3934 |
len++ |
| 3935 |
} |
| 3936 |
} |
| 3937 |
|
| 3938 |
tst := make([]ITypeContext, len) |
| 3939 |
i := 0 |
| 3940 |
for _, ctx := range children { |
| 3941 |
if t, ok := ctx.(ITypeContext); ok { |
| 3942 |
tst[i] = t.(ITypeContext) |
| 3943 |
i++ |
| 3944 |
} |
| 3945 |
} |
| 3946 |
|
| 3947 |
return tst |
| 3948 |
} |
| 3949 |
|
| 3950 |
func (s *TypeParamListContext) Type_(i int) ITypeContext { |
| 3951 |
var t antlr.RuleContext |
| 3952 |
j := 0 |
| 3953 |
for _, ctx := range s.GetChildren() { |
| 3954 |
if _, ok := ctx.(ITypeContext); ok { |
| 3955 |
if j == i { |
| 3956 |
t = ctx.(antlr.RuleContext) |
| 3957 |
break |
| 3958 |
} |
| 3959 |
j++ |
| 3960 |
} |
| 3961 |
} |
| 3962 |
|
| 3963 |
if t == nil { |
| 3964 |
return nil |
| 3965 |
} |
| 3966 |
|
| 3967 |
return t.(ITypeContext) |
| 3968 |
} |
| 3969 |
|
| 3970 |
func (s *TypeParamListContext) AllCOMMA() []antlr.TerminalNode { |
| 3971 |
return s.GetTokens(CommandsParserCOMMA) |
| 3972 |
} |
| 3973 |
|
| 3974 |
func (s *TypeParamListContext) COMMA(i int) antlr.TerminalNode { |
| 3975 |
return s.GetToken(CommandsParserCOMMA, i) |
| 3976 |
} |
| 3977 |
|
| 3978 |
func (s *TypeParamListContext) GetRuleContext() antlr.RuleContext { |
| 3979 |
return s |
| 3980 |
} |
| 3981 |
|
| 3982 |
func (s *TypeParamListContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 3983 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 3984 |
} |
| 3985 |
|
| 3986 |
func (s *TypeParamListContext) EnterRule(listener antlr.ParseTreeListener) { |
| 3987 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 3988 |
listenerT.EnterTypeParamList(s) |
| 3989 |
} |
| 3990 |
} |
| 3991 |
|
| 3992 |
func (s *TypeParamListContext) ExitRule(listener antlr.ParseTreeListener) { |
| 3993 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 3994 |
listenerT.ExitTypeParamList(s) |
| 3995 |
} |
| 3996 |
} |
| 3997 |
|
| 3998 |
func (s *TypeParamListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 3999 |
switch t := visitor.(type) { |
| 4000 |
case CommandsVisitor: |
| 4001 |
return t.VisitTypeParamList(s) |
| 4002 |
|
| 4003 |
default: |
| 4004 |
return t.VisitChildren(s) |
| 4005 |
} |
| 4006 |
} |
| 4007 |
|
| 4008 |
func (p *CommandsParser) TypeParamList() (localctx ITypeParamListContext) { |
| 4009 |
localctx = NewTypeParamListContext(p, p.GetParserRuleContext(), p.GetState()) |
| 4010 |
p.EnterRule(localctx, 36, CommandsParserRULE_typeParamList) |
| 4011 |
var _la int |
| 4012 |
|
| 4013 |
p.EnterOuterAlt(localctx, 1) |
| 4014 |
{ |
| 4015 |
p.SetState(194) |
| 4016 |
p.Match(CommandsParserLPAREN) |
| 4017 |
if p.HasError() { |
| 4018 |
// Recognition error - abort rule |
| 4019 |
goto errorExit |
| 4020 |
} |
| 4021 |
} |
| 4022 |
p.SetState(203) |
| 4023 |
p.GetErrorHandler().Sync(p) |
| 4024 |
if p.HasError() { |
| 4025 |
goto errorExit |
| 4026 |
} |
| 4027 |
_la = p.GetTokenStream().LA(1) |
| 4028 |
|
| 4029 |
if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&565149513547776) != 0 { |
| 4030 |
{ |
| 4031 |
p.SetState(195) |
| 4032 |
|
| 4033 |
var _x = p.Type_() |
| 4034 |
|
| 4035 |
localctx.(*TypeParamListContext)._type = _x |
| 4036 |
} |
| 4037 |
localctx.(*TypeParamListContext).types = append(localctx.(*TypeParamListContext).types, localctx.(*TypeParamListContext)._type) |
| 4038 |
p.SetState(200) |
| 4039 |
p.GetErrorHandler().Sync(p) |
| 4040 |
if p.HasError() { |
| 4041 |
goto errorExit |
| 4042 |
} |
| 4043 |
_la = p.GetTokenStream().LA(1) |
| 4044 |
|
| 4045 |
for _la == CommandsParserCOMMA { |
| 4046 |
{ |
| 4047 |
p.SetState(196) |
| 4048 |
p.Match(CommandsParserCOMMA) |
| 4049 |
if p.HasError() { |
| 4050 |
// Recognition error - abort rule |
| 4051 |
goto errorExit |
| 4052 |
} |
| 4053 |
} |
| 4054 |
{ |
| 4055 |
p.SetState(197) |
| 4056 |
|
| 4057 |
var _x = p.Type_() |
| 4058 |
|
| 4059 |
localctx.(*TypeParamListContext)._type = _x |
| 4060 |
} |
| 4061 |
localctx.(*TypeParamListContext).types = append(localctx.(*TypeParamListContext).types, localctx.(*TypeParamListContext)._type) |
| 4062 |
|
| 4063 |
p.SetState(202) |
| 4064 |
p.GetErrorHandler().Sync(p) |
| 4065 |
if p.HasError() { |
| 4066 |
goto errorExit |
| 4067 |
} |
| 4068 |
_la = p.GetTokenStream().LA(1) |
| 4069 |
} |
| 4070 |
|
| 4071 |
} |
| 4072 |
{ |
| 4073 |
p.SetState(205) |
| 4074 |
p.Match(CommandsParserRPAREN) |
| 4075 |
if p.HasError() { |
| 4076 |
// Recognition error - abort rule |
| 4077 |
goto errorExit |
| 4078 |
} |
| 4079 |
} |
| 4080 |
|
| 4081 |
errorExit: |
| 4082 |
if p.HasError() { |
| 4083 |
v := p.GetError() |
| 4084 |
localctx.SetException(v) |
| 4085 |
p.GetErrorHandler().ReportError(p, v) |
| 4086 |
p.GetErrorHandler().Recover(p, v) |
| 4087 |
p.SetError(nil) |
| 4088 |
} |
| 4089 |
p.ExitRule() |
| 4090 |
return localctx |
| 4091 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 4092 |
} |
| 4093 |
|
| 4094 |
// IStartContext is an interface to support dynamic dispatch. |
| 4095 |
type IStartContext interface { |
| 4096 |
antlr.ParserRuleContext |
| 4097 |
|
| 4098 |
// GetParser returns the parser. |
| 4099 |
GetParser() antlr.Parser |
| 4100 |
|
| 4101 |
// GetE returns the e rule contexts. |
| 4102 |
GetE() IExprContext |
| 4103 |
|
| 4104 |
// SetE sets the e rule contexts. |
| 4105 |
SetE(IExprContext) |
| 4106 |
|
| 4107 |
// Getter signatures |
| 4108 |
EOF() antlr.TerminalNode |
| 4109 |
Expr() IExprContext |
| 4110 |
|
| 4111 |
// IsStartContext differentiates from other interfaces. |
| 4112 |
IsStartContext() |
| 4113 |
} |
| 4114 |
|
| 4115 |
type StartContext struct { |
| 4116 |
antlr.BaseParserRuleContext |
| 4117 |
parser antlr.Parser |
| 4118 |
e IExprContext |
| 4119 |
} |
| 4120 |
|
| 4121 |
func NewEmptyStartContext() *StartContext { |
| 4122 |
var p = new(StartContext) |
| 4123 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 4124 |
p.RuleIndex = CommandsParserRULE_start |
| 4125 |
return p |
| 4126 |
} |
| 4127 |
|
| 4128 |
func InitEmptyStartContext(p *StartContext) { |
| 4129 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 4130 |
p.RuleIndex = CommandsParserRULE_start |
| 4131 |
} |
| 4132 |
|
| 4133 |
func (*StartContext) IsStartContext() {} |
| 4134 |
|
| 4135 |
func NewStartContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StartContext { |
| 4136 |
var p = new(StartContext) |
| 4137 |
|
| 4138 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 4139 |
|
| 4140 |
p.parser = parser |
| 4141 |
p.RuleIndex = CommandsParserRULE_start |
| 4142 |
|
| 4143 |
return p |
| 4144 |
} |
| 4145 |
|
| 4146 |
func (s *StartContext) GetParser() antlr.Parser { return s.parser } |
| 4147 |
|
| 4148 |
func (s *StartContext) GetE() IExprContext { return s.e } |
| 4149 |
|
| 4150 |
func (s *StartContext) SetE(v IExprContext) { s.e = v } |
| 4151 |
|
| 4152 |
func (s *StartContext) EOF() antlr.TerminalNode { |
| 4153 |
return s.GetToken(CommandsParserEOF, 0) |
| 4154 |
} |
| 4155 |
|
| 4156 |
func (s *StartContext) Expr() IExprContext { |
| 4157 |
var t antlr.RuleContext |
| 4158 |
for _, ctx := range s.GetChildren() { |
| 4159 |
if _, ok := ctx.(IExprContext); ok { |
| 4160 |
t = ctx.(antlr.RuleContext) |
| 4161 |
break |
| 4162 |
} |
| 4163 |
} |
| 4164 |
|
| 4165 |
if t == nil { |
| 4166 |
return nil |
| 4167 |
} |
| 4168 |
|
| 4169 |
return t.(IExprContext) |
| 4170 |
} |
| 4171 |
|
| 4172 |
func (s *StartContext) GetRuleContext() antlr.RuleContext { |
| 4173 |
return s |
| 4174 |
} |
| 4175 |
|
| 4176 |
func (s *StartContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 4177 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 4178 |
} |
| 4179 |
|
| 4180 |
func (s *StartContext) EnterRule(listener antlr.ParseTreeListener) { |
| 4181 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 4182 |
listenerT.EnterStart(s) |
| 4183 |
} |
| 4184 |
} |
| 4185 |
|
| 4186 |
func (s *StartContext) ExitRule(listener antlr.ParseTreeListener) { |
| 4187 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 4188 |
listenerT.ExitStart(s) |
| 4189 |
} |
| 4190 |
} |
| 4191 |
|
| 4192 |
func (s *StartContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 4193 |
switch t := visitor.(type) { |
| 4194 |
case CommandsVisitor: |
| 4195 |
return t.VisitStart(s) |
| 4196 |
|
| 4197 |
default: |
| 4198 |
return t.VisitChildren(s) |
| 4199 |
} |
| 4200 |
} |
| 4201 |
|
| 4202 |
func (p *CommandsParser) Start_() (localctx IStartContext) { |
| 4203 |
localctx = NewStartContext(p, p.GetParserRuleContext(), p.GetState()) |
| 4204 |
p.EnterRule(localctx, 38, CommandsParserRULE_start) |
| 4205 |
p.EnterOuterAlt(localctx, 1) |
| 4206 |
{ |
| 4207 |
p.SetState(207) |
| 4208 |
|
| 4209 |
var _x = p.Expr() |
| 4210 |
|
| 4211 |
localctx.(*StartContext).e = _x |
| 4212 |
} |
| 4213 |
{ |
| 4214 |
p.SetState(208) |
| 4215 |
p.Match(CommandsParserEOF) |
| 4216 |
if p.HasError() { |
| 4217 |
// Recognition error - abort rule |
| 4218 |
goto errorExit |
| 4219 |
} |
| 4220 |
} |
| 4221 |
|
| 4222 |
errorExit: |
| 4223 |
if p.HasError() { |
| 4224 |
v := p.GetError() |
| 4225 |
localctx.SetException(v) |
| 4226 |
p.GetErrorHandler().ReportError(p, v) |
| 4227 |
p.GetErrorHandler().Recover(p, v) |
| 4228 |
p.SetError(nil) |
| 4229 |
} |
| 4230 |
p.ExitRule() |
| 4231 |
return localctx |
| 4232 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 4233 |
} |
| 4234 |
|
| 4235 |
// IExprContext is an interface to support dynamic dispatch. |
| 4236 |
type IExprContext interface { |
| 4237 |
antlr.ParserRuleContext |
| 4238 |
|
| 4239 |
// GetParser returns the parser. |
| 4240 |
GetParser() antlr.Parser |
| 4241 |
|
| 4242 |
// GetOp returns the op token. |
| 4243 |
GetOp() antlr.Token |
| 4244 |
|
| 4245 |
// SetOp sets the op token. |
| 4246 |
SetOp(antlr.Token) |
| 4247 |
|
| 4248 |
// GetE returns the e rule contexts. |
| 4249 |
GetE() IConditionalOrContext |
| 4250 |
|
| 4251 |
// GetE1 returns the e1 rule contexts. |
| 4252 |
GetE1() IConditionalOrContext |
| 4253 |
|
| 4254 |
// GetE2 returns the e2 rule contexts. |
| 4255 |
GetE2() IExprContext |
| 4256 |
|
| 4257 |
// SetE sets the e rule contexts. |
| 4258 |
SetE(IConditionalOrContext) |
| 4259 |
|
| 4260 |
// SetE1 sets the e1 rule contexts. |
| 4261 |
SetE1(IConditionalOrContext) |
| 4262 |
|
| 4263 |
// SetE2 sets the e2 rule contexts. |
| 4264 |
SetE2(IExprContext) |
| 4265 |
|
| 4266 |
// Getter signatures |
| 4267 |
AllConditionalOr() []IConditionalOrContext |
| 4268 |
ConditionalOr(i int) IConditionalOrContext |
| 4269 |
COLON() antlr.TerminalNode |
| 4270 |
QUESTIONMARK() antlr.TerminalNode |
| 4271 |
Expr() IExprContext |
| 4272 |
|
| 4273 |
// IsExprContext differentiates from other interfaces. |
| 4274 |
IsExprContext() |
| 4275 |
} |
| 4276 |
|
| 4277 |
type ExprContext struct { |
| 4278 |
antlr.BaseParserRuleContext |
| 4279 |
parser antlr.Parser |
| 4280 |
e IConditionalOrContext |
| 4281 |
op antlr.Token |
| 4282 |
e1 IConditionalOrContext |
| 4283 |
e2 IExprContext |
| 4284 |
} |
| 4285 |
|
| 4286 |
func NewEmptyExprContext() *ExprContext { |
| 4287 |
var p = new(ExprContext) |
| 4288 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 4289 |
p.RuleIndex = CommandsParserRULE_expr |
| 4290 |
return p |
| 4291 |
} |
| 4292 |
|
| 4293 |
func InitEmptyExprContext(p *ExprContext) { |
| 4294 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 4295 |
p.RuleIndex = CommandsParserRULE_expr |
| 4296 |
} |
| 4297 |
|
| 4298 |
func (*ExprContext) IsExprContext() {} |
| 4299 |
|
| 4300 |
func NewExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprContext { |
| 4301 |
var p = new(ExprContext) |
| 4302 |
|
| 4303 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 4304 |
|
| 4305 |
p.parser = parser |
| 4306 |
p.RuleIndex = CommandsParserRULE_expr |
| 4307 |
|
| 4308 |
return p |
| 4309 |
} |
| 4310 |
|
| 4311 |
func (s *ExprContext) GetParser() antlr.Parser { return s.parser } |
| 4312 |
|
| 4313 |
func (s *ExprContext) GetOp() antlr.Token { return s.op } |
| 4314 |
|
| 4315 |
func (s *ExprContext) SetOp(v antlr.Token) { s.op = v } |
| 4316 |
|
| 4317 |
func (s *ExprContext) GetE() IConditionalOrContext { return s.e } |
| 4318 |
|
| 4319 |
func (s *ExprContext) GetE1() IConditionalOrContext { return s.e1 } |
| 4320 |
|
| 4321 |
func (s *ExprContext) GetE2() IExprContext { return s.e2 } |
| 4322 |
|
| 4323 |
func (s *ExprContext) SetE(v IConditionalOrContext) { s.e = v } |
| 4324 |
|
| 4325 |
func (s *ExprContext) SetE1(v IConditionalOrContext) { s.e1 = v } |
| 4326 |
|
| 4327 |
func (s *ExprContext) SetE2(v IExprContext) { s.e2 = v } |
| 4328 |
|
| 4329 |
func (s *ExprContext) AllConditionalOr() []IConditionalOrContext { |
| 4330 |
children := s.GetChildren() |
| 4331 |
len := 0 |
| 4332 |
for _, ctx := range children { |
| 4333 |
if _, ok := ctx.(IConditionalOrContext); ok { |
| 4334 |
len++ |
| 4335 |
} |
| 4336 |
} |
| 4337 |
|
| 4338 |
tst := make([]IConditionalOrContext, len) |
| 4339 |
i := 0 |
| 4340 |
for _, ctx := range children { |
| 4341 |
if t, ok := ctx.(IConditionalOrContext); ok { |
| 4342 |
tst[i] = t.(IConditionalOrContext) |
| 4343 |
i++ |
| 4344 |
} |
| 4345 |
} |
| 4346 |
|
| 4347 |
return tst |
| 4348 |
} |
| 4349 |
|
| 4350 |
func (s *ExprContext) ConditionalOr(i int) IConditionalOrContext { |
| 4351 |
var t antlr.RuleContext |
| 4352 |
j := 0 |
| 4353 |
for _, ctx := range s.GetChildren() { |
| 4354 |
if _, ok := ctx.(IConditionalOrContext); ok { |
| 4355 |
if j == i { |
| 4356 |
t = ctx.(antlr.RuleContext) |
| 4357 |
break |
| 4358 |
} |
| 4359 |
j++ |
| 4360 |
} |
| 4361 |
} |
| 4362 |
|
| 4363 |
if t == nil { |
| 4364 |
return nil |
| 4365 |
} |
| 4366 |
|
| 4367 |
return t.(IConditionalOrContext) |
| 4368 |
} |
| 4369 |
|
| 4370 |
func (s *ExprContext) COLON() antlr.TerminalNode { |
| 4371 |
return s.GetToken(CommandsParserCOLON, 0) |
| 4372 |
} |
| 4373 |
|
| 4374 |
func (s *ExprContext) QUESTIONMARK() antlr.TerminalNode { |
| 4375 |
return s.GetToken(CommandsParserQUESTIONMARK, 0) |
| 4376 |
} |
| 4377 |
|
| 4378 |
func (s *ExprContext) Expr() IExprContext { |
| 4379 |
var t antlr.RuleContext |
| 4380 |
for _, ctx := range s.GetChildren() { |
| 4381 |
if _, ok := ctx.(IExprContext); ok { |
| 4382 |
t = ctx.(antlr.RuleContext) |
| 4383 |
break |
| 4384 |
} |
| 4385 |
} |
| 4386 |
|
| 4387 |
if t == nil { |
| 4388 |
return nil |
| 4389 |
} |
| 4390 |
|
| 4391 |
return t.(IExprContext) |
| 4392 |
} |
| 4393 |
|
| 4394 |
func (s *ExprContext) GetRuleContext() antlr.RuleContext { |
| 4395 |
return s |
| 4396 |
} |
| 4397 |
|
| 4398 |
func (s *ExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 4399 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 4400 |
} |
| 4401 |
|
| 4402 |
func (s *ExprContext) EnterRule(listener antlr.ParseTreeListener) { |
| 4403 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 4404 |
listenerT.EnterExpr(s) |
| 4405 |
} |
| 4406 |
} |
| 4407 |
|
| 4408 |
func (s *ExprContext) ExitRule(listener antlr.ParseTreeListener) { |
| 4409 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 4410 |
listenerT.ExitExpr(s) |
| 4411 |
} |
| 4412 |
} |
| 4413 |
|
| 4414 |
func (s *ExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 4415 |
switch t := visitor.(type) { |
| 4416 |
case CommandsVisitor: |
| 4417 |
return t.VisitExpr(s) |
| 4418 |
|
| 4419 |
default: |
| 4420 |
return t.VisitChildren(s) |
| 4421 |
} |
| 4422 |
} |
| 4423 |
|
| 4424 |
func (p *CommandsParser) Expr() (localctx IExprContext) { |
| 4425 |
localctx = NewExprContext(p, p.GetParserRuleContext(), p.GetState()) |
| 4426 |
p.EnterRule(localctx, 40, CommandsParserRULE_expr) |
| 4427 |
var _la int |
| 4428 |
|
| 4429 |
p.EnterOuterAlt(localctx, 1) |
| 4430 |
{ |
| 4431 |
p.SetState(210) |
| 4432 |
|
| 4433 |
var _x = p.ConditionalOr() |
| 4434 |
|
| 4435 |
localctx.(*ExprContext).e = _x |
| 4436 |
} |
| 4437 |
p.SetState(216) |
| 4438 |
p.GetErrorHandler().Sync(p) |
| 4439 |
if p.HasError() { |
| 4440 |
goto errorExit |
| 4441 |
} |
| 4442 |
_la = p.GetTokenStream().LA(1) |
| 4443 |
|
| 4444 |
if _la == CommandsParserQUESTIONMARK { |
| 4445 |
{ |
| 4446 |
p.SetState(211) |
| 4447 |
|
| 4448 |
var _m = p.Match(CommandsParserQUESTIONMARK) |
| 4449 |
|
| 4450 |
localctx.(*ExprContext).op = _m |
| 4451 |
if p.HasError() { |
| 4452 |
// Recognition error - abort rule |
| 4453 |
goto errorExit |
| 4454 |
} |
| 4455 |
} |
| 4456 |
{ |
| 4457 |
p.SetState(212) |
| 4458 |
|
| 4459 |
var _x = p.ConditionalOr() |
| 4460 |
|
| 4461 |
localctx.(*ExprContext).e1 = _x |
| 4462 |
} |
| 4463 |
{ |
| 4464 |
p.SetState(213) |
| 4465 |
p.Match(CommandsParserCOLON) |
| 4466 |
if p.HasError() { |
| 4467 |
// Recognition error - abort rule |
| 4468 |
goto errorExit |
| 4469 |
} |
| 4470 |
} |
| 4471 |
{ |
| 4472 |
p.SetState(214) |
| 4473 |
|
| 4474 |
var _x = p.Expr() |
| 4475 |
|
| 4476 |
localctx.(*ExprContext).e2 = _x |
| 4477 |
} |
| 4478 |
|
| 4479 |
} |
| 4480 |
|
| 4481 |
errorExit: |
| 4482 |
if p.HasError() { |
| 4483 |
v := p.GetError() |
| 4484 |
localctx.SetException(v) |
| 4485 |
p.GetErrorHandler().ReportError(p, v) |
| 4486 |
p.GetErrorHandler().Recover(p, v) |
| 4487 |
p.SetError(nil) |
| 4488 |
} |
| 4489 |
p.ExitRule() |
| 4490 |
return localctx |
| 4491 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 4492 |
} |
| 4493 |
|
| 4494 |
// IConditionalOrContext is an interface to support dynamic dispatch. |
| 4495 |
type IConditionalOrContext interface { |
| 4496 |
antlr.ParserRuleContext |
| 4497 |
|
| 4498 |
// GetParser returns the parser. |
| 4499 |
GetParser() antlr.Parser |
| 4500 |
|
| 4501 |
// GetS22 returns the s22 token. |
| 4502 |
GetS22() antlr.Token |
| 4503 |
|
| 4504 |
// SetS22 sets the s22 token. |
| 4505 |
SetS22(antlr.Token) |
| 4506 |
|
| 4507 |
// GetOps returns the ops token list. |
| 4508 |
GetOps() []antlr.Token |
| 4509 |
|
| 4510 |
// SetOps sets the ops token list. |
| 4511 |
SetOps([]antlr.Token) |
| 4512 |
|
| 4513 |
// GetE returns the e rule contexts. |
| 4514 |
GetE() IConditionalAndContext |
| 4515 |
|
| 4516 |
// Get_conditionalAnd returns the _conditionalAnd rule contexts. |
| 4517 |
Get_conditionalAnd() IConditionalAndContext |
| 4518 |
|
| 4519 |
// SetE sets the e rule contexts. |
| 4520 |
SetE(IConditionalAndContext) |
| 4521 |
|
| 4522 |
// Set_conditionalAnd sets the _conditionalAnd rule contexts. |
| 4523 |
Set_conditionalAnd(IConditionalAndContext) |
| 4524 |
|
| 4525 |
// GetE1 returns the e1 rule context list. |
| 4526 |
GetE1() []IConditionalAndContext |
| 4527 |
|
| 4528 |
// SetE1 sets the e1 rule context list. |
| 4529 |
SetE1([]IConditionalAndContext) |
| 4530 |
|
| 4531 |
// Getter signatures |
| 4532 |
AllConditionalAnd() []IConditionalAndContext |
| 4533 |
ConditionalAnd(i int) IConditionalAndContext |
| 4534 |
AllLOGICAL_OR() []antlr.TerminalNode |
| 4535 |
LOGICAL_OR(i int) antlr.TerminalNode |
| 4536 |
|
| 4537 |
// IsConditionalOrContext differentiates from other interfaces. |
| 4538 |
IsConditionalOrContext() |
| 4539 |
} |
| 4540 |
|
| 4541 |
type ConditionalOrContext struct { |
| 4542 |
antlr.BaseParserRuleContext |
| 4543 |
parser antlr.Parser |
| 4544 |
e IConditionalAndContext |
| 4545 |
s22 antlr.Token |
| 4546 |
ops []antlr.Token |
| 4547 |
_conditionalAnd IConditionalAndContext |
| 4548 |
e1 []IConditionalAndContext |
| 4549 |
} |
| 4550 |
|
| 4551 |
func NewEmptyConditionalOrContext() *ConditionalOrContext { |
| 4552 |
var p = new(ConditionalOrContext) |
| 4553 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 4554 |
p.RuleIndex = CommandsParserRULE_conditionalOr |
| 4555 |
return p |
| 4556 |
} |
| 4557 |
|
| 4558 |
func InitEmptyConditionalOrContext(p *ConditionalOrContext) { |
| 4559 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 4560 |
p.RuleIndex = CommandsParserRULE_conditionalOr |
| 4561 |
} |
| 4562 |
|
| 4563 |
func (*ConditionalOrContext) IsConditionalOrContext() {} |
| 4564 |
|
| 4565 |
func NewConditionalOrContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConditionalOrContext { |
| 4566 |
var p = new(ConditionalOrContext) |
| 4567 |
|
| 4568 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 4569 |
|
| 4570 |
p.parser = parser |
| 4571 |
p.RuleIndex = CommandsParserRULE_conditionalOr |
| 4572 |
|
| 4573 |
return p |
| 4574 |
} |
| 4575 |
|
| 4576 |
func (s *ConditionalOrContext) GetParser() antlr.Parser { return s.parser } |
| 4577 |
|
| 4578 |
func (s *ConditionalOrContext) GetS22() antlr.Token { return s.s22 } |
| 4579 |
|
| 4580 |
func (s *ConditionalOrContext) SetS22(v antlr.Token) { s.s22 = v } |
| 4581 |
|
| 4582 |
func (s *ConditionalOrContext) GetOps() []antlr.Token { return s.ops } |
| 4583 |
|
| 4584 |
func (s *ConditionalOrContext) SetOps(v []antlr.Token) { s.ops = v } |
| 4585 |
|
| 4586 |
func (s *ConditionalOrContext) GetE() IConditionalAndContext { return s.e } |
| 4587 |
|
| 4588 |
func (s *ConditionalOrContext) Get_conditionalAnd() IConditionalAndContext { return s._conditionalAnd } |
| 4589 |
|
| 4590 |
func (s *ConditionalOrContext) SetE(v IConditionalAndContext) { s.e = v } |
| 4591 |
|
| 4592 |
func (s *ConditionalOrContext) Set_conditionalAnd(v IConditionalAndContext) { s._conditionalAnd = v } |
| 4593 |
|
| 4594 |
func (s *ConditionalOrContext) GetE1() []IConditionalAndContext { return s.e1 } |
| 4595 |
|
| 4596 |
func (s *ConditionalOrContext) SetE1(v []IConditionalAndContext) { s.e1 = v } |
| 4597 |
|
| 4598 |
func (s *ConditionalOrContext) AllConditionalAnd() []IConditionalAndContext { |
| 4599 |
children := s.GetChildren() |
| 4600 |
len := 0 |
| 4601 |
for _, ctx := range children { |
| 4602 |
if _, ok := ctx.(IConditionalAndContext); ok { |
| 4603 |
len++ |
| 4604 |
} |
| 4605 |
} |
| 4606 |
|
| 4607 |
tst := make([]IConditionalAndContext, len) |
| 4608 |
i := 0 |
| 4609 |
for _, ctx := range children { |
| 4610 |
if t, ok := ctx.(IConditionalAndContext); ok { |
| 4611 |
tst[i] = t.(IConditionalAndContext) |
| 4612 |
i++ |
| 4613 |
} |
| 4614 |
} |
| 4615 |
|
| 4616 |
return tst |
| 4617 |
} |
| 4618 |
|
| 4619 |
func (s *ConditionalOrContext) ConditionalAnd(i int) IConditionalAndContext { |
| 4620 |
var t antlr.RuleContext |
| 4621 |
j := 0 |
| 4622 |
for _, ctx := range s.GetChildren() { |
| 4623 |
if _, ok := ctx.(IConditionalAndContext); ok { |
| 4624 |
if j == i { |
| 4625 |
t = ctx.(antlr.RuleContext) |
| 4626 |
break |
| 4627 |
} |
| 4628 |
j++ |
| 4629 |
} |
| 4630 |
} |
| 4631 |
|
| 4632 |
if t == nil { |
| 4633 |
return nil |
| 4634 |
} |
| 4635 |
|
| 4636 |
return t.(IConditionalAndContext) |
| 4637 |
} |
| 4638 |
|
| 4639 |
func (s *ConditionalOrContext) AllLOGICAL_OR() []antlr.TerminalNode { |
| 4640 |
return s.GetTokens(CommandsParserLOGICAL_OR) |
| 4641 |
} |
| 4642 |
|
| 4643 |
func (s *ConditionalOrContext) LOGICAL_OR(i int) antlr.TerminalNode { |
| 4644 |
return s.GetToken(CommandsParserLOGICAL_OR, i) |
| 4645 |
} |
| 4646 |
|
| 4647 |
func (s *ConditionalOrContext) GetRuleContext() antlr.RuleContext { |
| 4648 |
return s |
| 4649 |
} |
| 4650 |
|
| 4651 |
func (s *ConditionalOrContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 4652 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 4653 |
} |
| 4654 |
|
| 4655 |
func (s *ConditionalOrContext) EnterRule(listener antlr.ParseTreeListener) { |
| 4656 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 4657 |
listenerT.EnterConditionalOr(s) |
| 4658 |
} |
| 4659 |
} |
| 4660 |
|
| 4661 |
func (s *ConditionalOrContext) ExitRule(listener antlr.ParseTreeListener) { |
| 4662 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 4663 |
listenerT.ExitConditionalOr(s) |
| 4664 |
} |
| 4665 |
} |
| 4666 |
|
| 4667 |
func (s *ConditionalOrContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 4668 |
switch t := visitor.(type) { |
| 4669 |
case CommandsVisitor: |
| 4670 |
return t.VisitConditionalOr(s) |
| 4671 |
|
| 4672 |
default: |
| 4673 |
return t.VisitChildren(s) |
| 4674 |
} |
| 4675 |
} |
| 4676 |
|
| 4677 |
func (p *CommandsParser) ConditionalOr() (localctx IConditionalOrContext) { |
| 4678 |
localctx = NewConditionalOrContext(p, p.GetParserRuleContext(), p.GetState()) |
| 4679 |
p.EnterRule(localctx, 42, CommandsParserRULE_conditionalOr) |
| 4680 |
var _la int |
| 4681 |
|
| 4682 |
p.EnterOuterAlt(localctx, 1) |
| 4683 |
{ |
| 4684 |
p.SetState(218) |
| 4685 |
|
| 4686 |
var _x = p.ConditionalAnd() |
| 4687 |
|
| 4688 |
localctx.(*ConditionalOrContext).e = _x |
| 4689 |
} |
| 4690 |
p.SetState(223) |
| 4691 |
p.GetErrorHandler().Sync(p) |
| 4692 |
if p.HasError() { |
| 4693 |
goto errorExit |
| 4694 |
} |
| 4695 |
_la = p.GetTokenStream().LA(1) |
| 4696 |
|
| 4697 |
for _la == CommandsParserLOGICAL_OR { |
| 4698 |
{ |
| 4699 |
p.SetState(219) |
| 4700 |
|
| 4701 |
var _m = p.Match(CommandsParserLOGICAL_OR) |
| 4702 |
|
| 4703 |
localctx.(*ConditionalOrContext).s22 = _m |
| 4704 |
if p.HasError() { |
| 4705 |
// Recognition error - abort rule |
| 4706 |
goto errorExit |
| 4707 |
} |
| 4708 |
} |
| 4709 |
localctx.(*ConditionalOrContext).ops = append(localctx.(*ConditionalOrContext).ops, localctx.(*ConditionalOrContext).s22) |
| 4710 |
{ |
| 4711 |
p.SetState(220) |
| 4712 |
|
| 4713 |
var _x = p.ConditionalAnd() |
| 4714 |
|
| 4715 |
localctx.(*ConditionalOrContext)._conditionalAnd = _x |
| 4716 |
} |
| 4717 |
localctx.(*ConditionalOrContext).e1 = append(localctx.(*ConditionalOrContext).e1, localctx.(*ConditionalOrContext)._conditionalAnd) |
| 4718 |
|
| 4719 |
p.SetState(225) |
| 4720 |
p.GetErrorHandler().Sync(p) |
| 4721 |
if p.HasError() { |
| 4722 |
goto errorExit |
| 4723 |
} |
| 4724 |
_la = p.GetTokenStream().LA(1) |
| 4725 |
} |
| 4726 |
|
| 4727 |
errorExit: |
| 4728 |
if p.HasError() { |
| 4729 |
v := p.GetError() |
| 4730 |
localctx.SetException(v) |
| 4731 |
p.GetErrorHandler().ReportError(p, v) |
| 4732 |
p.GetErrorHandler().Recover(p, v) |
| 4733 |
p.SetError(nil) |
| 4734 |
} |
| 4735 |
p.ExitRule() |
| 4736 |
return localctx |
| 4737 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 4738 |
} |
| 4739 |
|
| 4740 |
// IConditionalAndContext is an interface to support dynamic dispatch. |
| 4741 |
type IConditionalAndContext interface { |
| 4742 |
antlr.ParserRuleContext |
| 4743 |
|
| 4744 |
// GetParser returns the parser. |
| 4745 |
GetParser() antlr.Parser |
| 4746 |
|
| 4747 |
// GetS21 returns the s21 token. |
| 4748 |
GetS21() antlr.Token |
| 4749 |
|
| 4750 |
// SetS21 sets the s21 token. |
| 4751 |
SetS21(antlr.Token) |
| 4752 |
|
| 4753 |
// GetOps returns the ops token list. |
| 4754 |
GetOps() []antlr.Token |
| 4755 |
|
| 4756 |
// SetOps sets the ops token list. |
| 4757 |
SetOps([]antlr.Token) |
| 4758 |
|
| 4759 |
// GetE returns the e rule contexts. |
| 4760 |
GetE() IRelationContext |
| 4761 |
|
| 4762 |
// Get_relation returns the _relation rule contexts. |
| 4763 |
Get_relation() IRelationContext |
| 4764 |
|
| 4765 |
// SetE sets the e rule contexts. |
| 4766 |
SetE(IRelationContext) |
| 4767 |
|
| 4768 |
// Set_relation sets the _relation rule contexts. |
| 4769 |
Set_relation(IRelationContext) |
| 4770 |
|
| 4771 |
// GetE1 returns the e1 rule context list. |
| 4772 |
GetE1() []IRelationContext |
| 4773 |
|
| 4774 |
// SetE1 sets the e1 rule context list. |
| 4775 |
SetE1([]IRelationContext) |
| 4776 |
|
| 4777 |
// Getter signatures |
| 4778 |
AllRelation() []IRelationContext |
| 4779 |
Relation(i int) IRelationContext |
| 4780 |
AllLOGICAL_AND() []antlr.TerminalNode |
| 4781 |
LOGICAL_AND(i int) antlr.TerminalNode |
| 4782 |
|
| 4783 |
// IsConditionalAndContext differentiates from other interfaces. |
| 4784 |
IsConditionalAndContext() |
| 4785 |
} |
| 4786 |
|
| 4787 |
type ConditionalAndContext struct { |
| 4788 |
antlr.BaseParserRuleContext |
| 4789 |
parser antlr.Parser |
| 4790 |
e IRelationContext |
| 4791 |
s21 antlr.Token |
| 4792 |
ops []antlr.Token |
| 4793 |
_relation IRelationContext |
| 4794 |
e1 []IRelationContext |
| 4795 |
} |
| 4796 |
|
| 4797 |
func NewEmptyConditionalAndContext() *ConditionalAndContext { |
| 4798 |
var p = new(ConditionalAndContext) |
| 4799 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 4800 |
p.RuleIndex = CommandsParserRULE_conditionalAnd |
| 4801 |
return p |
| 4802 |
} |
| 4803 |
|
| 4804 |
func InitEmptyConditionalAndContext(p *ConditionalAndContext) { |
| 4805 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 4806 |
p.RuleIndex = CommandsParserRULE_conditionalAnd |
| 4807 |
} |
| 4808 |
|
| 4809 |
func (*ConditionalAndContext) IsConditionalAndContext() {} |
| 4810 |
|
| 4811 |
func NewConditionalAndContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConditionalAndContext { |
| 4812 |
var p = new(ConditionalAndContext) |
| 4813 |
|
| 4814 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 4815 |
|
| 4816 |
p.parser = parser |
| 4817 |
p.RuleIndex = CommandsParserRULE_conditionalAnd |
| 4818 |
|
| 4819 |
return p |
| 4820 |
} |
| 4821 |
|
| 4822 |
func (s *ConditionalAndContext) GetParser() antlr.Parser { return s.parser } |
| 4823 |
|
| 4824 |
func (s *ConditionalAndContext) GetS21() antlr.Token { return s.s21 } |
| 4825 |
|
| 4826 |
func (s *ConditionalAndContext) SetS21(v antlr.Token) { s.s21 = v } |
| 4827 |
|
| 4828 |
func (s *ConditionalAndContext) GetOps() []antlr.Token { return s.ops } |
| 4829 |
|
| 4830 |
func (s *ConditionalAndContext) SetOps(v []antlr.Token) { s.ops = v } |
| 4831 |
|
| 4832 |
func (s *ConditionalAndContext) GetE() IRelationContext { return s.e } |
| 4833 |
|
| 4834 |
func (s *ConditionalAndContext) Get_relation() IRelationContext { return s._relation } |
| 4835 |
|
| 4836 |
func (s *ConditionalAndContext) SetE(v IRelationContext) { s.e = v } |
| 4837 |
|
| 4838 |
func (s *ConditionalAndContext) Set_relation(v IRelationContext) { s._relation = v } |
| 4839 |
|
| 4840 |
func (s *ConditionalAndContext) GetE1() []IRelationContext { return s.e1 } |
| 4841 |
|
| 4842 |
func (s *ConditionalAndContext) SetE1(v []IRelationContext) { s.e1 = v } |
| 4843 |
|
| 4844 |
func (s *ConditionalAndContext) AllRelation() []IRelationContext { |
| 4845 |
children := s.GetChildren() |
| 4846 |
len := 0 |
| 4847 |
for _, ctx := range children { |
| 4848 |
if _, ok := ctx.(IRelationContext); ok { |
| 4849 |
len++ |
| 4850 |
} |
| 4851 |
} |
| 4852 |
|
| 4853 |
tst := make([]IRelationContext, len) |
| 4854 |
i := 0 |
| 4855 |
for _, ctx := range children { |
| 4856 |
if t, ok := ctx.(IRelationContext); ok { |
| 4857 |
tst[i] = t.(IRelationContext) |
| 4858 |
i++ |
| 4859 |
} |
| 4860 |
} |
| 4861 |
|
| 4862 |
return tst |
| 4863 |
} |
| 4864 |
|
| 4865 |
func (s *ConditionalAndContext) Relation(i int) IRelationContext { |
| 4866 |
var t antlr.RuleContext |
| 4867 |
j := 0 |
| 4868 |
for _, ctx := range s.GetChildren() { |
| 4869 |
if _, ok := ctx.(IRelationContext); ok { |
| 4870 |
if j == i { |
| 4871 |
t = ctx.(antlr.RuleContext) |
| 4872 |
break |
| 4873 |
} |
| 4874 |
j++ |
| 4875 |
} |
| 4876 |
} |
| 4877 |
|
| 4878 |
if t == nil { |
| 4879 |
return nil |
| 4880 |
} |
| 4881 |
|
| 4882 |
return t.(IRelationContext) |
| 4883 |
} |
| 4884 |
|
| 4885 |
func (s *ConditionalAndContext) AllLOGICAL_AND() []antlr.TerminalNode { |
| 4886 |
return s.GetTokens(CommandsParserLOGICAL_AND) |
| 4887 |
} |
| 4888 |
|
| 4889 |
func (s *ConditionalAndContext) LOGICAL_AND(i int) antlr.TerminalNode { |
| 4890 |
return s.GetToken(CommandsParserLOGICAL_AND, i) |
| 4891 |
} |
| 4892 |
|
| 4893 |
func (s *ConditionalAndContext) GetRuleContext() antlr.RuleContext { |
| 4894 |
return s |
| 4895 |
} |
| 4896 |
|
| 4897 |
func (s *ConditionalAndContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 4898 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 4899 |
} |
| 4900 |
|
| 4901 |
func (s *ConditionalAndContext) EnterRule(listener antlr.ParseTreeListener) { |
| 4902 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 4903 |
listenerT.EnterConditionalAnd(s) |
| 4904 |
} |
| 4905 |
} |
| 4906 |
|
| 4907 |
func (s *ConditionalAndContext) ExitRule(listener antlr.ParseTreeListener) { |
| 4908 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 4909 |
listenerT.ExitConditionalAnd(s) |
| 4910 |
} |
| 4911 |
} |
| 4912 |
|
| 4913 |
func (s *ConditionalAndContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 4914 |
switch t := visitor.(type) { |
| 4915 |
case CommandsVisitor: |
| 4916 |
return t.VisitConditionalAnd(s) |
| 4917 |
|
| 4918 |
default: |
| 4919 |
return t.VisitChildren(s) |
| 4920 |
} |
| 4921 |
} |
| 4922 |
|
| 4923 |
func (p *CommandsParser) ConditionalAnd() (localctx IConditionalAndContext) { |
| 4924 |
localctx = NewConditionalAndContext(p, p.GetParserRuleContext(), p.GetState()) |
| 4925 |
p.EnterRule(localctx, 44, CommandsParserRULE_conditionalAnd) |
| 4926 |
var _la int |
| 4927 |
|
| 4928 |
p.EnterOuterAlt(localctx, 1) |
| 4929 |
{ |
| 4930 |
p.SetState(226) |
| 4931 |
|
| 4932 |
var _x = p.relation(0) |
| 4933 |
|
| 4934 |
localctx.(*ConditionalAndContext).e = _x |
| 4935 |
} |
| 4936 |
p.SetState(231) |
| 4937 |
p.GetErrorHandler().Sync(p) |
| 4938 |
if p.HasError() { |
| 4939 |
goto errorExit |
| 4940 |
} |
| 4941 |
_la = p.GetTokenStream().LA(1) |
| 4942 |
|
| 4943 |
for _la == CommandsParserLOGICAL_AND { |
| 4944 |
{ |
| 4945 |
p.SetState(227) |
| 4946 |
|
| 4947 |
var _m = p.Match(CommandsParserLOGICAL_AND) |
| 4948 |
|
| 4949 |
localctx.(*ConditionalAndContext).s21 = _m |
| 4950 |
if p.HasError() { |
| 4951 |
// Recognition error - abort rule |
| 4952 |
goto errorExit |
| 4953 |
} |
| 4954 |
} |
| 4955 |
localctx.(*ConditionalAndContext).ops = append(localctx.(*ConditionalAndContext).ops, localctx.(*ConditionalAndContext).s21) |
| 4956 |
{ |
| 4957 |
p.SetState(228) |
| 4958 |
|
| 4959 |
var _x = p.relation(0) |
| 4960 |
|
| 4961 |
localctx.(*ConditionalAndContext)._relation = _x |
| 4962 |
} |
| 4963 |
localctx.(*ConditionalAndContext).e1 = append(localctx.(*ConditionalAndContext).e1, localctx.(*ConditionalAndContext)._relation) |
| 4964 |
|
| 4965 |
p.SetState(233) |
| 4966 |
p.GetErrorHandler().Sync(p) |
| 4967 |
if p.HasError() { |
| 4968 |
goto errorExit |
| 4969 |
} |
| 4970 |
_la = p.GetTokenStream().LA(1) |
| 4971 |
} |
| 4972 |
|
| 4973 |
errorExit: |
| 4974 |
if p.HasError() { |
| 4975 |
v := p.GetError() |
| 4976 |
localctx.SetException(v) |
| 4977 |
p.GetErrorHandler().ReportError(p, v) |
| 4978 |
p.GetErrorHandler().Recover(p, v) |
| 4979 |
p.SetError(nil) |
| 4980 |
} |
| 4981 |
p.ExitRule() |
| 4982 |
return localctx |
| 4983 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 4984 |
} |
| 4985 |
|
| 4986 |
// IRelationContext is an interface to support dynamic dispatch. |
| 4987 |
type IRelationContext interface { |
| 4988 |
antlr.ParserRuleContext |
| 4989 |
|
| 4990 |
// GetParser returns the parser. |
| 4991 |
GetParser() antlr.Parser |
| 4992 |
|
| 4993 |
// GetOp returns the op token. |
| 4994 |
GetOp() antlr.Token |
| 4995 |
|
| 4996 |
// SetOp sets the op token. |
| 4997 |
SetOp(antlr.Token) |
| 4998 |
|
| 4999 |
// Getter signatures |
| 5000 |
Calc() ICalcContext |
| 5001 |
AllRelation() []IRelationContext |
| 5002 |
Relation(i int) IRelationContext |
| 5003 |
LESS() antlr.TerminalNode |
| 5004 |
LESS_EQUALS() antlr.TerminalNode |
| 5005 |
GREATER_EQUALS() antlr.TerminalNode |
| 5006 |
GREATER() antlr.TerminalNode |
| 5007 |
EQUALS() antlr.TerminalNode |
| 5008 |
NOT_EQUALS() antlr.TerminalNode |
| 5009 |
IN() antlr.TerminalNode |
| 5010 |
|
| 5011 |
// IsRelationContext differentiates from other interfaces. |
| 5012 |
IsRelationContext() |
| 5013 |
} |
| 5014 |
|
| 5015 |
type RelationContext struct { |
| 5016 |
antlr.BaseParserRuleContext |
| 5017 |
parser antlr.Parser |
| 5018 |
op antlr.Token |
| 5019 |
} |
| 5020 |
|
| 5021 |
func NewEmptyRelationContext() *RelationContext { |
| 5022 |
var p = new(RelationContext) |
| 5023 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 5024 |
p.RuleIndex = CommandsParserRULE_relation |
| 5025 |
return p |
| 5026 |
} |
| 5027 |
|
| 5028 |
func InitEmptyRelationContext(p *RelationContext) { |
| 5029 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 5030 |
p.RuleIndex = CommandsParserRULE_relation |
| 5031 |
} |
| 5032 |
|
| 5033 |
func (*RelationContext) IsRelationContext() {} |
| 5034 |
|
| 5035 |
func NewRelationContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RelationContext { |
| 5036 |
var p = new(RelationContext) |
| 5037 |
|
| 5038 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 5039 |
|
| 5040 |
p.parser = parser |
| 5041 |
p.RuleIndex = CommandsParserRULE_relation |
| 5042 |
|
| 5043 |
return p |
| 5044 |
} |
| 5045 |
|
| 5046 |
func (s *RelationContext) GetParser() antlr.Parser { return s.parser } |
| 5047 |
|
| 5048 |
func (s *RelationContext) GetOp() antlr.Token { return s.op } |
| 5049 |
|
| 5050 |
func (s *RelationContext) SetOp(v antlr.Token) { s.op = v } |
| 5051 |
|
| 5052 |
func (s *RelationContext) Calc() ICalcContext { |
| 5053 |
var t antlr.RuleContext |
| 5054 |
for _, ctx := range s.GetChildren() { |
| 5055 |
if _, ok := ctx.(ICalcContext); ok { |
| 5056 |
t = ctx.(antlr.RuleContext) |
| 5057 |
break |
| 5058 |
} |
| 5059 |
} |
| 5060 |
|
| 5061 |
if t == nil { |
| 5062 |
return nil |
| 5063 |
} |
| 5064 |
|
| 5065 |
return t.(ICalcContext) |
| 5066 |
} |
| 5067 |
|
| 5068 |
func (s *RelationContext) AllRelation() []IRelationContext { |
| 5069 |
children := s.GetChildren() |
| 5070 |
len := 0 |
| 5071 |
for _, ctx := range children { |
| 5072 |
if _, ok := ctx.(IRelationContext); ok { |
| 5073 |
len++ |
| 5074 |
} |
| 5075 |
} |
| 5076 |
|
| 5077 |
tst := make([]IRelationContext, len) |
| 5078 |
i := 0 |
| 5079 |
for _, ctx := range children { |
| 5080 |
if t, ok := ctx.(IRelationContext); ok { |
| 5081 |
tst[i] = t.(IRelationContext) |
| 5082 |
i++ |
| 5083 |
} |
| 5084 |
} |
| 5085 |
|
| 5086 |
return tst |
| 5087 |
} |
| 5088 |
|
| 5089 |
func (s *RelationContext) Relation(i int) IRelationContext { |
| 5090 |
var t antlr.RuleContext |
| 5091 |
j := 0 |
| 5092 |
for _, ctx := range s.GetChildren() { |
| 5093 |
if _, ok := ctx.(IRelationContext); ok { |
| 5094 |
if j == i { |
| 5095 |
t = ctx.(antlr.RuleContext) |
| 5096 |
break |
| 5097 |
} |
| 5098 |
j++ |
| 5099 |
} |
| 5100 |
} |
| 5101 |
|
| 5102 |
if t == nil { |
| 5103 |
return nil |
| 5104 |
} |
| 5105 |
|
| 5106 |
return t.(IRelationContext) |
| 5107 |
} |
| 5108 |
|
| 5109 |
func (s *RelationContext) LESS() antlr.TerminalNode { |
| 5110 |
return s.GetToken(CommandsParserLESS, 0) |
| 5111 |
} |
| 5112 |
|
| 5113 |
func (s *RelationContext) LESS_EQUALS() antlr.TerminalNode { |
| 5114 |
return s.GetToken(CommandsParserLESS_EQUALS, 0) |
| 5115 |
} |
| 5116 |
|
| 5117 |
func (s *RelationContext) GREATER_EQUALS() antlr.TerminalNode { |
| 5118 |
return s.GetToken(CommandsParserGREATER_EQUALS, 0) |
| 5119 |
} |
| 5120 |
|
| 5121 |
func (s *RelationContext) GREATER() antlr.TerminalNode { |
| 5122 |
return s.GetToken(CommandsParserGREATER, 0) |
| 5123 |
} |
| 5124 |
|
| 5125 |
func (s *RelationContext) EQUALS() antlr.TerminalNode { |
| 5126 |
return s.GetToken(CommandsParserEQUALS, 0) |
| 5127 |
} |
| 5128 |
|
| 5129 |
func (s *RelationContext) NOT_EQUALS() antlr.TerminalNode { |
| 5130 |
return s.GetToken(CommandsParserNOT_EQUALS, 0) |
| 5131 |
} |
| 5132 |
|
| 5133 |
func (s *RelationContext) IN() antlr.TerminalNode { |
| 5134 |
return s.GetToken(CommandsParserIN, 0) |
| 5135 |
} |
| 5136 |
|
| 5137 |
func (s *RelationContext) GetRuleContext() antlr.RuleContext { |
| 5138 |
return s |
| 5139 |
} |
| 5140 |
|
| 5141 |
func (s *RelationContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 5142 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 5143 |
} |
| 5144 |
|
| 5145 |
func (s *RelationContext) EnterRule(listener antlr.ParseTreeListener) { |
| 5146 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 5147 |
listenerT.EnterRelation(s) |
| 5148 |
} |
| 5149 |
} |
| 5150 |
|
| 5151 |
func (s *RelationContext) ExitRule(listener antlr.ParseTreeListener) { |
| 5152 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 5153 |
listenerT.ExitRelation(s) |
| 5154 |
} |
| 5155 |
} |
| 5156 |
|
| 5157 |
func (s *RelationContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 5158 |
switch t := visitor.(type) { |
| 5159 |
case CommandsVisitor: |
| 5160 |
return t.VisitRelation(s) |
| 5161 |
|
| 5162 |
default: |
| 5163 |
return t.VisitChildren(s) |
| 5164 |
} |
| 5165 |
} |
| 5166 |
|
| 5167 |
func (p *CommandsParser) Relation() (localctx IRelationContext) { |
| 5168 |
return p.relation(0) |
| 5169 |
} |
| 5170 |
|
| 5171 |
func (p *CommandsParser) relation(_p int) (localctx IRelationContext) { |
| 5172 |
var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() |
| 5173 |
|
| 5174 |
_parentState := p.GetState() |
| 5175 |
localctx = NewRelationContext(p, p.GetParserRuleContext(), _parentState) |
| 5176 |
var _prevctx IRelationContext = localctx |
| 5177 |
var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. |
| 5178 |
_startState := 46 |
| 5179 |
p.EnterRecursionRule(localctx, 46, CommandsParserRULE_relation, _p) |
| 5180 |
var _la int |
| 5181 |
|
| 5182 |
var _alt int |
| 5183 |
|
| 5184 |
p.EnterOuterAlt(localctx, 1) |
| 5185 |
{ |
| 5186 |
p.SetState(235) |
| 5187 |
p.calc(0) |
| 5188 |
} |
| 5189 |
|
| 5190 |
p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) |
| 5191 |
p.SetState(242) |
| 5192 |
p.GetErrorHandler().Sync(p) |
| 5193 |
if p.HasError() { |
| 5194 |
goto errorExit |
| 5195 |
} |
| 5196 |
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 22, p.GetParserRuleContext()) |
| 5197 |
if p.HasError() { |
| 5198 |
goto errorExit |
| 5199 |
} |
| 5200 |
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { |
| 5201 |
if _alt == 1 { |
| 5202 |
if p.GetParseListeners() != nil { |
| 5203 |
p.TriggerExitRuleEvent() |
| 5204 |
} |
| 5205 |
_prevctx = localctx |
| 5206 |
localctx = NewRelationContext(p, _parentctx, _parentState) |
| 5207 |
p.PushNewRecursionContext(localctx, _startState, CommandsParserRULE_relation) |
| 5208 |
p.SetState(237) |
| 5209 |
|
| 5210 |
if !(p.Precpred(p.GetParserRuleContext(), 1)) { |
| 5211 |
p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", "")) |
| 5212 |
goto errorExit |
| 5213 |
} |
| 5214 |
{ |
| 5215 |
p.SetState(238) |
| 5216 |
|
| 5217 |
var _lt = p.GetTokenStream().LT(1) |
| 5218 |
|
| 5219 |
localctx.(*RelationContext).op = _lt |
| 5220 |
|
| 5221 |
_la = p.GetTokenStream().LA(1) |
| 5222 |
|
| 5223 |
if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&2080768) != 0) { |
| 5224 |
var _ri = p.GetErrorHandler().RecoverInline(p) |
| 5225 |
|
| 5226 |
localctx.(*RelationContext).op = _ri |
| 5227 |
} else { |
| 5228 |
p.GetErrorHandler().ReportMatch(p) |
| 5229 |
p.Consume() |
| 5230 |
} |
| 5231 |
} |
| 5232 |
{ |
| 5233 |
p.SetState(239) |
| 5234 |
p.relation(2) |
| 5235 |
} |
| 5236 |
|
| 5237 |
} |
| 5238 |
p.SetState(244) |
| 5239 |
p.GetErrorHandler().Sync(p) |
| 5240 |
if p.HasError() { |
| 5241 |
goto errorExit |
| 5242 |
} |
| 5243 |
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 22, p.GetParserRuleContext()) |
| 5244 |
if p.HasError() { |
| 5245 |
goto errorExit |
| 5246 |
} |
| 5247 |
} |
| 5248 |
|
| 5249 |
errorExit: |
| 5250 |
if p.HasError() { |
| 5251 |
v := p.GetError() |
| 5252 |
localctx.SetException(v) |
| 5253 |
p.GetErrorHandler().ReportError(p, v) |
| 5254 |
p.GetErrorHandler().Recover(p, v) |
| 5255 |
p.SetError(nil) |
| 5256 |
} |
| 5257 |
p.UnrollRecursionContexts(_parentctx) |
| 5258 |
return localctx |
| 5259 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 5260 |
} |
| 5261 |
|
| 5262 |
// ICalcContext is an interface to support dynamic dispatch. |
| 5263 |
type ICalcContext interface { |
| 5264 |
antlr.ParserRuleContext |
| 5265 |
|
| 5266 |
// GetParser returns the parser. |
| 5267 |
GetParser() antlr.Parser |
| 5268 |
|
| 5269 |
// GetOp returns the op token. |
| 5270 |
GetOp() antlr.Token |
| 5271 |
|
| 5272 |
// SetOp sets the op token. |
| 5273 |
SetOp(antlr.Token) |
| 5274 |
|
| 5275 |
// Getter signatures |
| 5276 |
Unary() IUnaryContext |
| 5277 |
AllCalc() []ICalcContext |
| 5278 |
Calc(i int) ICalcContext |
| 5279 |
STAR() antlr.TerminalNode |
| 5280 |
SLASH() antlr.TerminalNode |
| 5281 |
PERCENT() antlr.TerminalNode |
| 5282 |
PLUS() antlr.TerminalNode |
| 5283 |
MINUS() antlr.TerminalNode |
| 5284 |
|
| 5285 |
// IsCalcContext differentiates from other interfaces. |
| 5286 |
IsCalcContext() |
| 5287 |
} |
| 5288 |
|
| 5289 |
type CalcContext struct { |
| 5290 |
antlr.BaseParserRuleContext |
| 5291 |
parser antlr.Parser |
| 5292 |
op antlr.Token |
| 5293 |
} |
| 5294 |
|
| 5295 |
func NewEmptyCalcContext() *CalcContext { |
| 5296 |
var p = new(CalcContext) |
| 5297 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 5298 |
p.RuleIndex = CommandsParserRULE_calc |
| 5299 |
return p |
| 5300 |
} |
| 5301 |
|
| 5302 |
func InitEmptyCalcContext(p *CalcContext) { |
| 5303 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 5304 |
p.RuleIndex = CommandsParserRULE_calc |
| 5305 |
} |
| 5306 |
|
| 5307 |
func (*CalcContext) IsCalcContext() {} |
| 5308 |
|
| 5309 |
func NewCalcContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CalcContext { |
| 5310 |
var p = new(CalcContext) |
| 5311 |
|
| 5312 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 5313 |
|
| 5314 |
p.parser = parser |
| 5315 |
p.RuleIndex = CommandsParserRULE_calc |
| 5316 |
|
| 5317 |
return p |
| 5318 |
} |
| 5319 |
|
| 5320 |
func (s *CalcContext) GetParser() antlr.Parser { return s.parser } |
| 5321 |
|
| 5322 |
func (s *CalcContext) GetOp() antlr.Token { return s.op } |
| 5323 |
|
| 5324 |
func (s *CalcContext) SetOp(v antlr.Token) { s.op = v } |
| 5325 |
|
| 5326 |
func (s *CalcContext) Unary() IUnaryContext { |
| 5327 |
var t antlr.RuleContext |
| 5328 |
for _, ctx := range s.GetChildren() { |
| 5329 |
if _, ok := ctx.(IUnaryContext); ok { |
| 5330 |
t = ctx.(antlr.RuleContext) |
| 5331 |
break |
| 5332 |
} |
| 5333 |
} |
| 5334 |
|
| 5335 |
if t == nil { |
| 5336 |
return nil |
| 5337 |
} |
| 5338 |
|
| 5339 |
return t.(IUnaryContext) |
| 5340 |
} |
| 5341 |
|
| 5342 |
func (s *CalcContext) AllCalc() []ICalcContext { |
| 5343 |
children := s.GetChildren() |
| 5344 |
len := 0 |
| 5345 |
for _, ctx := range children { |
| 5346 |
if _, ok := ctx.(ICalcContext); ok { |
| 5347 |
len++ |
| 5348 |
} |
| 5349 |
} |
| 5350 |
|
| 5351 |
tst := make([]ICalcContext, len) |
| 5352 |
i := 0 |
| 5353 |
for _, ctx := range children { |
| 5354 |
if t, ok := ctx.(ICalcContext); ok { |
| 5355 |
tst[i] = t.(ICalcContext) |
| 5356 |
i++ |
| 5357 |
} |
| 5358 |
} |
| 5359 |
|
| 5360 |
return tst |
| 5361 |
} |
| 5362 |
|
| 5363 |
func (s *CalcContext) Calc(i int) ICalcContext { |
| 5364 |
var t antlr.RuleContext |
| 5365 |
j := 0 |
| 5366 |
for _, ctx := range s.GetChildren() { |
| 5367 |
if _, ok := ctx.(ICalcContext); ok { |
| 5368 |
if j == i { |
| 5369 |
t = ctx.(antlr.RuleContext) |
| 5370 |
break |
| 5371 |
} |
| 5372 |
j++ |
| 5373 |
} |
| 5374 |
} |
| 5375 |
|
| 5376 |
if t == nil { |
| 5377 |
return nil |
| 5378 |
} |
| 5379 |
|
| 5380 |
return t.(ICalcContext) |
| 5381 |
} |
| 5382 |
|
| 5383 |
func (s *CalcContext) STAR() antlr.TerminalNode { |
| 5384 |
return s.GetToken(CommandsParserSTAR, 0) |
| 5385 |
} |
| 5386 |
|
| 5387 |
func (s *CalcContext) SLASH() antlr.TerminalNode { |
| 5388 |
return s.GetToken(CommandsParserSLASH, 0) |
| 5389 |
} |
| 5390 |
|
| 5391 |
func (s *CalcContext) PERCENT() antlr.TerminalNode { |
| 5392 |
return s.GetToken(CommandsParserPERCENT, 0) |
| 5393 |
} |
| 5394 |
|
| 5395 |
func (s *CalcContext) PLUS() antlr.TerminalNode { |
| 5396 |
return s.GetToken(CommandsParserPLUS, 0) |
| 5397 |
} |
| 5398 |
|
| 5399 |
func (s *CalcContext) MINUS() antlr.TerminalNode { |
| 5400 |
return s.GetToken(CommandsParserMINUS, 0) |
| 5401 |
} |
| 5402 |
|
| 5403 |
func (s *CalcContext) GetRuleContext() antlr.RuleContext { |
| 5404 |
return s |
| 5405 |
} |
| 5406 |
|
| 5407 |
func (s *CalcContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 5408 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 5409 |
} |
| 5410 |
|
| 5411 |
func (s *CalcContext) EnterRule(listener antlr.ParseTreeListener) { |
| 5412 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 5413 |
listenerT.EnterCalc(s) |
| 5414 |
} |
| 5415 |
} |
| 5416 |
|
| 5417 |
func (s *CalcContext) ExitRule(listener antlr.ParseTreeListener) { |
| 5418 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 5419 |
listenerT.ExitCalc(s) |
| 5420 |
} |
| 5421 |
} |
| 5422 |
|
| 5423 |
func (s *CalcContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 5424 |
switch t := visitor.(type) { |
| 5425 |
case CommandsVisitor: |
| 5426 |
return t.VisitCalc(s) |
| 5427 |
|
| 5428 |
default: |
| 5429 |
return t.VisitChildren(s) |
| 5430 |
} |
| 5431 |
} |
| 5432 |
|
| 5433 |
func (p *CommandsParser) Calc() (localctx ICalcContext) { |
| 5434 |
return p.calc(0) |
| 5435 |
} |
| 5436 |
|
| 5437 |
func (p *CommandsParser) calc(_p int) (localctx ICalcContext) { |
| 5438 |
var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() |
| 5439 |
|
| 5440 |
_parentState := p.GetState() |
| 5441 |
localctx = NewCalcContext(p, p.GetParserRuleContext(), _parentState) |
| 5442 |
var _prevctx ICalcContext = localctx |
| 5443 |
var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. |
| 5444 |
_startState := 48 |
| 5445 |
p.EnterRecursionRule(localctx, 48, CommandsParserRULE_calc, _p) |
| 5446 |
var _la int |
| 5447 |
|
| 5448 |
var _alt int |
| 5449 |
|
| 5450 |
p.EnterOuterAlt(localctx, 1) |
| 5451 |
{ |
| 5452 |
p.SetState(246) |
| 5453 |
p.Unary() |
| 5454 |
} |
| 5455 |
|
| 5456 |
p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) |
| 5457 |
p.SetState(256) |
| 5458 |
p.GetErrorHandler().Sync(p) |
| 5459 |
if p.HasError() { |
| 5460 |
goto errorExit |
| 5461 |
} |
| 5462 |
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 24, p.GetParserRuleContext()) |
| 5463 |
if p.HasError() { |
| 5464 |
goto errorExit |
| 5465 |
} |
| 5466 |
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { |
| 5467 |
if _alt == 1 { |
| 5468 |
if p.GetParseListeners() != nil { |
| 5469 |
p.TriggerExitRuleEvent() |
| 5470 |
} |
| 5471 |
_prevctx = localctx |
| 5472 |
p.SetState(254) |
| 5473 |
p.GetErrorHandler().Sync(p) |
| 5474 |
if p.HasError() { |
| 5475 |
goto errorExit |
| 5476 |
} |
| 5477 |
|
| 5478 |
switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 23, p.GetParserRuleContext()) { |
| 5479 |
case 1: |
| 5480 |
localctx = NewCalcContext(p, _parentctx, _parentState) |
| 5481 |
p.PushNewRecursionContext(localctx, _startState, CommandsParserRULE_calc) |
| 5482 |
p.SetState(248) |
| 5483 |
|
| 5484 |
if !(p.Precpred(p.GetParserRuleContext(), 2)) { |
| 5485 |
p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) |
| 5486 |
goto errorExit |
| 5487 |
} |
| 5488 |
{ |
| 5489 |
p.SetState(249) |
| 5490 |
|
| 5491 |
var _lt = p.GetTokenStream().LT(1) |
| 5492 |
|
| 5493 |
localctx.(*CalcContext).op = _lt |
| 5494 |
|
| 5495 |
_la = p.GetTokenStream().LA(1) |
| 5496 |
|
| 5497 |
if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&481036337152) != 0) { |
| 5498 |
var _ri = p.GetErrorHandler().RecoverInline(p) |
| 5499 |
|
| 5500 |
localctx.(*CalcContext).op = _ri |
| 5501 |
} else { |
| 5502 |
p.GetErrorHandler().ReportMatch(p) |
| 5503 |
p.Consume() |
| 5504 |
} |
| 5505 |
} |
| 5506 |
{ |
| 5507 |
p.SetState(250) |
| 5508 |
p.calc(3) |
| 5509 |
} |
| 5510 |
|
| 5511 |
case 2: |
| 5512 |
localctx = NewCalcContext(p, _parentctx, _parentState) |
| 5513 |
p.PushNewRecursionContext(localctx, _startState, CommandsParserRULE_calc) |
| 5514 |
p.SetState(251) |
| 5515 |
|
| 5516 |
if !(p.Precpred(p.GetParserRuleContext(), 1)) { |
| 5517 |
p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", "")) |
| 5518 |
goto errorExit |
| 5519 |
} |
| 5520 |
{ |
| 5521 |
p.SetState(252) |
| 5522 |
|
| 5523 |
var _lt = p.GetTokenStream().LT(1) |
| 5524 |
|
| 5525 |
localctx.(*CalcContext).op = _lt |
| 5526 |
|
| 5527 |
_la = p.GetTokenStream().LA(1) |
| 5528 |
|
| 5529 |
if !(_la == CommandsParserMINUS || _la == CommandsParserPLUS) { |
| 5530 |
var _ri = p.GetErrorHandler().RecoverInline(p) |
| 5531 |
|
| 5532 |
localctx.(*CalcContext).op = _ri |
| 5533 |
} else { |
| 5534 |
p.GetErrorHandler().ReportMatch(p) |
| 5535 |
p.Consume() |
| 5536 |
} |
| 5537 |
} |
| 5538 |
{ |
| 5539 |
p.SetState(253) |
| 5540 |
p.calc(2) |
| 5541 |
} |
| 5542 |
|
| 5543 |
case antlr.ATNInvalidAltNumber: |
| 5544 |
goto errorExit |
| 5545 |
} |
| 5546 |
|
| 5547 |
} |
| 5548 |
p.SetState(258) |
| 5549 |
p.GetErrorHandler().Sync(p) |
| 5550 |
if p.HasError() { |
| 5551 |
goto errorExit |
| 5552 |
} |
| 5553 |
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 24, p.GetParserRuleContext()) |
| 5554 |
if p.HasError() { |
| 5555 |
goto errorExit |
| 5556 |
} |
| 5557 |
} |
| 5558 |
|
| 5559 |
errorExit: |
| 5560 |
if p.HasError() { |
| 5561 |
v := p.GetError() |
| 5562 |
localctx.SetException(v) |
| 5563 |
p.GetErrorHandler().ReportError(p, v) |
| 5564 |
p.GetErrorHandler().Recover(p, v) |
| 5565 |
p.SetError(nil) |
| 5566 |
} |
| 5567 |
p.UnrollRecursionContexts(_parentctx) |
| 5568 |
return localctx |
| 5569 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 5570 |
} |
| 5571 |
|
| 5572 |
// IUnaryContext is an interface to support dynamic dispatch. |
| 5573 |
type IUnaryContext interface { |
| 5574 |
antlr.ParserRuleContext |
| 5575 |
|
| 5576 |
// GetParser returns the parser. |
| 5577 |
GetParser() antlr.Parser |
| 5578 |
// IsUnaryContext differentiates from other interfaces. |
| 5579 |
IsUnaryContext() |
| 5580 |
} |
| 5581 |
|
| 5582 |
type UnaryContext struct { |
| 5583 |
antlr.BaseParserRuleContext |
| 5584 |
parser antlr.Parser |
| 5585 |
} |
| 5586 |
|
| 5587 |
func NewEmptyUnaryContext() *UnaryContext { |
| 5588 |
var p = new(UnaryContext) |
| 5589 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 5590 |
p.RuleIndex = CommandsParserRULE_unary |
| 5591 |
return p |
| 5592 |
} |
| 5593 |
|
| 5594 |
func InitEmptyUnaryContext(p *UnaryContext) { |
| 5595 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 5596 |
p.RuleIndex = CommandsParserRULE_unary |
| 5597 |
} |
| 5598 |
|
| 5599 |
func (*UnaryContext) IsUnaryContext() {} |
| 5600 |
|
| 5601 |
func NewUnaryContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *UnaryContext { |
| 5602 |
var p = new(UnaryContext) |
| 5603 |
|
| 5604 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 5605 |
|
| 5606 |
p.parser = parser |
| 5607 |
p.RuleIndex = CommandsParserRULE_unary |
| 5608 |
|
| 5609 |
return p |
| 5610 |
} |
| 5611 |
|
| 5612 |
func (s *UnaryContext) GetParser() antlr.Parser { return s.parser } |
| 5613 |
|
| 5614 |
func (s *UnaryContext) CopyAll(ctx *UnaryContext) { |
| 5615 |
s.CopyFrom(&ctx.BaseParserRuleContext) |
| 5616 |
} |
| 5617 |
|
| 5618 |
func (s *UnaryContext) GetRuleContext() antlr.RuleContext { |
| 5619 |
return s |
| 5620 |
} |
| 5621 |
|
| 5622 |
func (s *UnaryContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 5623 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 5624 |
} |
| 5625 |
|
| 5626 |
type LogicalNotContext struct { |
| 5627 |
UnaryContext |
| 5628 |
s32 antlr.Token |
| 5629 |
ops []antlr.Token |
| 5630 |
} |
| 5631 |
|
| 5632 |
func NewLogicalNotContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LogicalNotContext { |
| 5633 |
var p = new(LogicalNotContext) |
| 5634 |
|
| 5635 |
InitEmptyUnaryContext(&p.UnaryContext) |
| 5636 |
p.parser = parser |
| 5637 |
p.CopyAll(ctx.(*UnaryContext)) |
| 5638 |
|
| 5639 |
return p |
| 5640 |
} |
| 5641 |
|
| 5642 |
func (s *LogicalNotContext) GetS32() antlr.Token { return s.s32 } |
| 5643 |
|
| 5644 |
func (s *LogicalNotContext) SetS32(v antlr.Token) { s.s32 = v } |
| 5645 |
|
| 5646 |
func (s *LogicalNotContext) GetOps() []antlr.Token { return s.ops } |
| 5647 |
|
| 5648 |
func (s *LogicalNotContext) SetOps(v []antlr.Token) { s.ops = v } |
| 5649 |
|
| 5650 |
func (s *LogicalNotContext) GetRuleContext() antlr.RuleContext { |
| 5651 |
return s |
| 5652 |
} |
| 5653 |
|
| 5654 |
func (s *LogicalNotContext) Member() IMemberContext { |
| 5655 |
var t antlr.RuleContext |
| 5656 |
for _, ctx := range s.GetChildren() { |
| 5657 |
if _, ok := ctx.(IMemberContext); ok { |
| 5658 |
t = ctx.(antlr.RuleContext) |
| 5659 |
break |
| 5660 |
} |
| 5661 |
} |
| 5662 |
|
| 5663 |
if t == nil { |
| 5664 |
return nil |
| 5665 |
} |
| 5666 |
|
| 5667 |
return t.(IMemberContext) |
| 5668 |
} |
| 5669 |
|
| 5670 |
func (s *LogicalNotContext) AllEXCLAM() []antlr.TerminalNode { |
| 5671 |
return s.GetTokens(CommandsParserEXCLAM) |
| 5672 |
} |
| 5673 |
|
| 5674 |
func (s *LogicalNotContext) EXCLAM(i int) antlr.TerminalNode { |
| 5675 |
return s.GetToken(CommandsParserEXCLAM, i) |
| 5676 |
} |
| 5677 |
|
| 5678 |
func (s *LogicalNotContext) EnterRule(listener antlr.ParseTreeListener) { |
| 5679 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 5680 |
listenerT.EnterLogicalNot(s) |
| 5681 |
} |
| 5682 |
} |
| 5683 |
|
| 5684 |
func (s *LogicalNotContext) ExitRule(listener antlr.ParseTreeListener) { |
| 5685 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 5686 |
listenerT.ExitLogicalNot(s) |
| 5687 |
} |
| 5688 |
} |
| 5689 |
|
| 5690 |
func (s *LogicalNotContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 5691 |
switch t := visitor.(type) { |
| 5692 |
case CommandsVisitor: |
| 5693 |
return t.VisitLogicalNot(s) |
| 5694 |
|
| 5695 |
default: |
| 5696 |
return t.VisitChildren(s) |
| 5697 |
} |
| 5698 |
} |
| 5699 |
|
| 5700 |
type MemberExprContext struct { |
| 5701 |
UnaryContext |
| 5702 |
} |
| 5703 |
|
| 5704 |
func NewMemberExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *MemberExprContext { |
| 5705 |
var p = new(MemberExprContext) |
| 5706 |
|
| 5707 |
InitEmptyUnaryContext(&p.UnaryContext) |
| 5708 |
p.parser = parser |
| 5709 |
p.CopyAll(ctx.(*UnaryContext)) |
| 5710 |
|
| 5711 |
return p |
| 5712 |
} |
| 5713 |
|
| 5714 |
func (s *MemberExprContext) GetRuleContext() antlr.RuleContext { |
| 5715 |
return s |
| 5716 |
} |
| 5717 |
|
| 5718 |
func (s *MemberExprContext) Member() IMemberContext { |
| 5719 |
var t antlr.RuleContext |
| 5720 |
for _, ctx := range s.GetChildren() { |
| 5721 |
if _, ok := ctx.(IMemberContext); ok { |
| 5722 |
t = ctx.(antlr.RuleContext) |
| 5723 |
break |
| 5724 |
} |
| 5725 |
} |
| 5726 |
|
| 5727 |
if t == nil { |
| 5728 |
return nil |
| 5729 |
} |
| 5730 |
|
| 5731 |
return t.(IMemberContext) |
| 5732 |
} |
| 5733 |
|
| 5734 |
func (s *MemberExprContext) EnterRule(listener antlr.ParseTreeListener) { |
| 5735 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 5736 |
listenerT.EnterMemberExpr(s) |
| 5737 |
} |
| 5738 |
} |
| 5739 |
|
| 5740 |
func (s *MemberExprContext) ExitRule(listener antlr.ParseTreeListener) { |
| 5741 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 5742 |
listenerT.ExitMemberExpr(s) |
| 5743 |
} |
| 5744 |
} |
| 5745 |
|
| 5746 |
func (s *MemberExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 5747 |
switch t := visitor.(type) { |
| 5748 |
case CommandsVisitor: |
| 5749 |
return t.VisitMemberExpr(s) |
| 5750 |
|
| 5751 |
default: |
| 5752 |
return t.VisitChildren(s) |
| 5753 |
} |
| 5754 |
} |
| 5755 |
|
| 5756 |
type NegateContext struct { |
| 5757 |
UnaryContext |
| 5758 |
s31 antlr.Token |
| 5759 |
ops []antlr.Token |
| 5760 |
} |
| 5761 |
|
| 5762 |
func NewNegateContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NegateContext { |
| 5763 |
var p = new(NegateContext) |
| 5764 |
|
| 5765 |
InitEmptyUnaryContext(&p.UnaryContext) |
| 5766 |
p.parser = parser |
| 5767 |
p.CopyAll(ctx.(*UnaryContext)) |
| 5768 |
|
| 5769 |
return p |
| 5770 |
} |
| 5771 |
|
| 5772 |
func (s *NegateContext) GetS31() antlr.Token { return s.s31 } |
| 5773 |
|
| 5774 |
func (s *NegateContext) SetS31(v antlr.Token) { s.s31 = v } |
| 5775 |
|
| 5776 |
func (s *NegateContext) GetOps() []antlr.Token { return s.ops } |
| 5777 |
|
| 5778 |
func (s *NegateContext) SetOps(v []antlr.Token) { s.ops = v } |
| 5779 |
|
| 5780 |
func (s *NegateContext) GetRuleContext() antlr.RuleContext { |
| 5781 |
return s |
| 5782 |
} |
| 5783 |
|
| 5784 |
func (s *NegateContext) Member() IMemberContext { |
| 5785 |
var t antlr.RuleContext |
| 5786 |
for _, ctx := range s.GetChildren() { |
| 5787 |
if _, ok := ctx.(IMemberContext); ok { |
| 5788 |
t = ctx.(antlr.RuleContext) |
| 5789 |
break |
| 5790 |
} |
| 5791 |
} |
| 5792 |
|
| 5793 |
if t == nil { |
| 5794 |
return nil |
| 5795 |
} |
| 5796 |
|
| 5797 |
return t.(IMemberContext) |
| 5798 |
} |
| 5799 |
|
| 5800 |
func (s *NegateContext) AllMINUS() []antlr.TerminalNode { |
| 5801 |
return s.GetTokens(CommandsParserMINUS) |
| 5802 |
} |
| 5803 |
|
| 5804 |
func (s *NegateContext) MINUS(i int) antlr.TerminalNode { |
| 5805 |
return s.GetToken(CommandsParserMINUS, i) |
| 5806 |
} |
| 5807 |
|
| 5808 |
func (s *NegateContext) EnterRule(listener antlr.ParseTreeListener) { |
| 5809 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 5810 |
listenerT.EnterNegate(s) |
| 5811 |
} |
| 5812 |
} |
| 5813 |
|
| 5814 |
func (s *NegateContext) ExitRule(listener antlr.ParseTreeListener) { |
| 5815 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 5816 |
listenerT.ExitNegate(s) |
| 5817 |
} |
| 5818 |
} |
| 5819 |
|
| 5820 |
func (s *NegateContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 5821 |
switch t := visitor.(type) { |
| 5822 |
case CommandsVisitor: |
| 5823 |
return t.VisitNegate(s) |
| 5824 |
|
| 5825 |
default: |
| 5826 |
return t.VisitChildren(s) |
| 5827 |
} |
| 5828 |
} |
| 5829 |
|
| 5830 |
func (p *CommandsParser) Unary() (localctx IUnaryContext) { |
| 5831 |
localctx = NewUnaryContext(p, p.GetParserRuleContext(), p.GetState()) |
| 5832 |
p.EnterRule(localctx, 50, CommandsParserRULE_unary) |
| 5833 |
var _la int |
| 5834 |
|
| 5835 |
var _alt int |
| 5836 |
|
| 5837 |
p.SetState(272) |
| 5838 |
p.GetErrorHandler().Sync(p) |
| 5839 |
if p.HasError() { |
| 5840 |
goto errorExit |
| 5841 |
} |
| 5842 |
|
| 5843 |
switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 27, p.GetParserRuleContext()) { |
| 5844 |
case 1: |
| 5845 |
localctx = NewMemberExprContext(p, localctx) |
| 5846 |
p.EnterOuterAlt(localctx, 1) |
| 5847 |
{ |
| 5848 |
p.SetState(259) |
| 5849 |
p.member(0) |
| 5850 |
} |
| 5851 |
|
| 5852 |
case 2: |
| 5853 |
localctx = NewLogicalNotContext(p, localctx) |
| 5854 |
p.EnterOuterAlt(localctx, 2) |
| 5855 |
p.SetState(261) |
| 5856 |
p.GetErrorHandler().Sync(p) |
| 5857 |
if p.HasError() { |
| 5858 |
goto errorExit |
| 5859 |
} |
| 5860 |
_la = p.GetTokenStream().LA(1) |
| 5861 |
|
| 5862 |
for ok := true; ok; ok = _la == CommandsParserEXCLAM { |
| 5863 |
{ |
| 5864 |
p.SetState(260) |
| 5865 |
|
| 5866 |
var _m = p.Match(CommandsParserEXCLAM) |
| 5867 |
|
| 5868 |
localctx.(*LogicalNotContext).s32 = _m |
| 5869 |
if p.HasError() { |
| 5870 |
// Recognition error - abort rule |
| 5871 |
goto errorExit |
| 5872 |
} |
| 5873 |
} |
| 5874 |
localctx.(*LogicalNotContext).ops = append(localctx.(*LogicalNotContext).ops, localctx.(*LogicalNotContext).s32) |
| 5875 |
|
| 5876 |
p.SetState(263) |
| 5877 |
p.GetErrorHandler().Sync(p) |
| 5878 |
if p.HasError() { |
| 5879 |
goto errorExit |
| 5880 |
} |
| 5881 |
_la = p.GetTokenStream().LA(1) |
| 5882 |
} |
| 5883 |
{ |
| 5884 |
p.SetState(265) |
| 5885 |
p.member(0) |
| 5886 |
} |
| 5887 |
|
| 5888 |
case 3: |
| 5889 |
localctx = NewNegateContext(p, localctx) |
| 5890 |
p.EnterOuterAlt(localctx, 3) |
| 5891 |
p.SetState(267) |
| 5892 |
p.GetErrorHandler().Sync(p) |
| 5893 |
if p.HasError() { |
| 5894 |
goto errorExit |
| 5895 |
} |
| 5896 |
_alt = 1 |
| 5897 |
for ok := true; ok; ok = _alt != 2 && _alt != antlr.ATNInvalidAltNumber { |
| 5898 |
switch _alt { |
| 5899 |
case 1: |
| 5900 |
{ |
| 5901 |
p.SetState(266) |
| 5902 |
|
| 5903 |
var _m = p.Match(CommandsParserMINUS) |
| 5904 |
|
| 5905 |
localctx.(*NegateContext).s31 = _m |
| 5906 |
if p.HasError() { |
| 5907 |
// Recognition error - abort rule |
| 5908 |
goto errorExit |
| 5909 |
} |
| 5910 |
} |
| 5911 |
localctx.(*NegateContext).ops = append(localctx.(*NegateContext).ops, localctx.(*NegateContext).s31) |
| 5912 |
|
| 5913 |
default: |
| 5914 |
p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) |
| 5915 |
goto errorExit |
| 5916 |
} |
| 5917 |
|
| 5918 |
p.SetState(269) |
| 5919 |
p.GetErrorHandler().Sync(p) |
| 5920 |
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 26, p.GetParserRuleContext()) |
| 5921 |
if p.HasError() { |
| 5922 |
goto errorExit |
| 5923 |
} |
| 5924 |
} |
| 5925 |
{ |
| 5926 |
p.SetState(271) |
| 5927 |
p.member(0) |
| 5928 |
} |
| 5929 |
|
| 5930 |
case antlr.ATNInvalidAltNumber: |
| 5931 |
goto errorExit |
| 5932 |
} |
| 5933 |
|
| 5934 |
errorExit: |
| 5935 |
if p.HasError() { |
| 5936 |
v := p.GetError() |
| 5937 |
localctx.SetException(v) |
| 5938 |
p.GetErrorHandler().ReportError(p, v) |
| 5939 |
p.GetErrorHandler().Recover(p, v) |
| 5940 |
p.SetError(nil) |
| 5941 |
} |
| 5942 |
p.ExitRule() |
| 5943 |
return localctx |
| 5944 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 5945 |
} |
| 5946 |
|
| 5947 |
// IMemberContext is an interface to support dynamic dispatch. |
| 5948 |
type IMemberContext interface { |
| 5949 |
antlr.ParserRuleContext |
| 5950 |
|
| 5951 |
// GetParser returns the parser. |
| 5952 |
GetParser() antlr.Parser |
| 5953 |
// IsMemberContext differentiates from other interfaces. |
| 5954 |
IsMemberContext() |
| 5955 |
} |
| 5956 |
|
| 5957 |
type MemberContext struct { |
| 5958 |
antlr.BaseParserRuleContext |
| 5959 |
parser antlr.Parser |
| 5960 |
} |
| 5961 |
|
| 5962 |
func NewEmptyMemberContext() *MemberContext { |
| 5963 |
var p = new(MemberContext) |
| 5964 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 5965 |
p.RuleIndex = CommandsParserRULE_member |
| 5966 |
return p |
| 5967 |
} |
| 5968 |
|
| 5969 |
func InitEmptyMemberContext(p *MemberContext) { |
| 5970 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 5971 |
p.RuleIndex = CommandsParserRULE_member |
| 5972 |
} |
| 5973 |
|
| 5974 |
func (*MemberContext) IsMemberContext() {} |
| 5975 |
|
| 5976 |
func NewMemberContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MemberContext { |
| 5977 |
var p = new(MemberContext) |
| 5978 |
|
| 5979 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 5980 |
|
| 5981 |
p.parser = parser |
| 5982 |
p.RuleIndex = CommandsParserRULE_member |
| 5983 |
|
| 5984 |
return p |
| 5985 |
} |
| 5986 |
|
| 5987 |
func (s *MemberContext) GetParser() antlr.Parser { return s.parser } |
| 5988 |
|
| 5989 |
func (s *MemberContext) CopyAll(ctx *MemberContext) { |
| 5990 |
s.CopyFrom(&ctx.BaseParserRuleContext) |
| 5991 |
} |
| 5992 |
|
| 5993 |
func (s *MemberContext) GetRuleContext() antlr.RuleContext { |
| 5994 |
return s |
| 5995 |
} |
| 5996 |
|
| 5997 |
func (s *MemberContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 5998 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 5999 |
} |
| 6000 |
|
| 6001 |
type MemberCallContext struct { |
| 6002 |
MemberContext |
| 6003 |
op antlr.Token |
| 6004 |
id antlr.Token |
| 6005 |
open antlr.Token |
| 6006 |
args IExprListContext |
| 6007 |
} |
| 6008 |
|
| 6009 |
func NewMemberCallContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *MemberCallContext { |
| 6010 |
var p = new(MemberCallContext) |
| 6011 |
|
| 6012 |
InitEmptyMemberContext(&p.MemberContext) |
| 6013 |
p.parser = parser |
| 6014 |
p.CopyAll(ctx.(*MemberContext)) |
| 6015 |
|
| 6016 |
return p |
| 6017 |
} |
| 6018 |
|
| 6019 |
func (s *MemberCallContext) GetOp() antlr.Token { return s.op } |
| 6020 |
|
| 6021 |
func (s *MemberCallContext) GetId() antlr.Token { return s.id } |
| 6022 |
|
| 6023 |
func (s *MemberCallContext) GetOpen() antlr.Token { return s.open } |
| 6024 |
|
| 6025 |
func (s *MemberCallContext) SetOp(v antlr.Token) { s.op = v } |
| 6026 |
|
| 6027 |
func (s *MemberCallContext) SetId(v antlr.Token) { s.id = v } |
| 6028 |
|
| 6029 |
func (s *MemberCallContext) SetOpen(v antlr.Token) { s.open = v } |
| 6030 |
|
| 6031 |
func (s *MemberCallContext) GetArgs() IExprListContext { return s.args } |
| 6032 |
|
| 6033 |
func (s *MemberCallContext) SetArgs(v IExprListContext) { s.args = v } |
| 6034 |
|
| 6035 |
func (s *MemberCallContext) GetRuleContext() antlr.RuleContext { |
| 6036 |
return s |
| 6037 |
} |
| 6038 |
|
| 6039 |
func (s *MemberCallContext) Member() IMemberContext { |
| 6040 |
var t antlr.RuleContext |
| 6041 |
for _, ctx := range s.GetChildren() { |
| 6042 |
if _, ok := ctx.(IMemberContext); ok { |
| 6043 |
t = ctx.(antlr.RuleContext) |
| 6044 |
break |
| 6045 |
} |
| 6046 |
} |
| 6047 |
|
| 6048 |
if t == nil { |
| 6049 |
return nil |
| 6050 |
} |
| 6051 |
|
| 6052 |
return t.(IMemberContext) |
| 6053 |
} |
| 6054 |
|
| 6055 |
func (s *MemberCallContext) RPAREN() antlr.TerminalNode { |
| 6056 |
return s.GetToken(CommandsParserRPAREN, 0) |
| 6057 |
} |
| 6058 |
|
| 6059 |
func (s *MemberCallContext) DOT() antlr.TerminalNode { |
| 6060 |
return s.GetToken(CommandsParserDOT, 0) |
| 6061 |
} |
| 6062 |
|
| 6063 |
func (s *MemberCallContext) IDENTIFIER() antlr.TerminalNode { |
| 6064 |
return s.GetToken(CommandsParserIDENTIFIER, 0) |
| 6065 |
} |
| 6066 |
|
| 6067 |
func (s *MemberCallContext) LPAREN() antlr.TerminalNode { |
| 6068 |
return s.GetToken(CommandsParserLPAREN, 0) |
| 6069 |
} |
| 6070 |
|
| 6071 |
func (s *MemberCallContext) ExprList() IExprListContext { |
| 6072 |
var t antlr.RuleContext |
| 6073 |
for _, ctx := range s.GetChildren() { |
| 6074 |
if _, ok := ctx.(IExprListContext); ok { |
| 6075 |
t = ctx.(antlr.RuleContext) |
| 6076 |
break |
| 6077 |
} |
| 6078 |
} |
| 6079 |
|
| 6080 |
if t == nil { |
| 6081 |
return nil |
| 6082 |
} |
| 6083 |
|
| 6084 |
return t.(IExprListContext) |
| 6085 |
} |
| 6086 |
|
| 6087 |
func (s *MemberCallContext) EnterRule(listener antlr.ParseTreeListener) { |
| 6088 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 6089 |
listenerT.EnterMemberCall(s) |
| 6090 |
} |
| 6091 |
} |
| 6092 |
|
| 6093 |
func (s *MemberCallContext) ExitRule(listener antlr.ParseTreeListener) { |
| 6094 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 6095 |
listenerT.ExitMemberCall(s) |
| 6096 |
} |
| 6097 |
} |
| 6098 |
|
| 6099 |
func (s *MemberCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 6100 |
switch t := visitor.(type) { |
| 6101 |
case CommandsVisitor: |
| 6102 |
return t.VisitMemberCall(s) |
| 6103 |
|
| 6104 |
default: |
| 6105 |
return t.VisitChildren(s) |
| 6106 |
} |
| 6107 |
} |
| 6108 |
|
| 6109 |
type SelectContext struct { |
| 6110 |
MemberContext |
| 6111 |
op antlr.Token |
| 6112 |
opt antlr.Token |
| 6113 |
id IEscapeIdentContext |
| 6114 |
} |
| 6115 |
|
| 6116 |
func NewSelectContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SelectContext { |
| 6117 |
var p = new(SelectContext) |
| 6118 |
|
| 6119 |
InitEmptyMemberContext(&p.MemberContext) |
| 6120 |
p.parser = parser |
| 6121 |
p.CopyAll(ctx.(*MemberContext)) |
| 6122 |
|
| 6123 |
return p |
| 6124 |
} |
| 6125 |
|
| 6126 |
func (s *SelectContext) GetOp() antlr.Token { return s.op } |
| 6127 |
|
| 6128 |
func (s *SelectContext) GetOpt() antlr.Token { return s.opt } |
| 6129 |
|
| 6130 |
func (s *SelectContext) SetOp(v antlr.Token) { s.op = v } |
| 6131 |
|
| 6132 |
func (s *SelectContext) SetOpt(v antlr.Token) { s.opt = v } |
| 6133 |
|
| 6134 |
func (s *SelectContext) GetId() IEscapeIdentContext { return s.id } |
| 6135 |
|
| 6136 |
func (s *SelectContext) SetId(v IEscapeIdentContext) { s.id = v } |
| 6137 |
|
| 6138 |
func (s *SelectContext) GetRuleContext() antlr.RuleContext { |
| 6139 |
return s |
| 6140 |
} |
| 6141 |
|
| 6142 |
func (s *SelectContext) Member() IMemberContext { |
| 6143 |
var t antlr.RuleContext |
| 6144 |
for _, ctx := range s.GetChildren() { |
| 6145 |
if _, ok := ctx.(IMemberContext); ok { |
| 6146 |
t = ctx.(antlr.RuleContext) |
| 6147 |
break |
| 6148 |
} |
| 6149 |
} |
| 6150 |
|
| 6151 |
if t == nil { |
| 6152 |
return nil |
| 6153 |
} |
| 6154 |
|
| 6155 |
return t.(IMemberContext) |
| 6156 |
} |
| 6157 |
|
| 6158 |
func (s *SelectContext) DOT() antlr.TerminalNode { |
| 6159 |
return s.GetToken(CommandsParserDOT, 0) |
| 6160 |
} |
| 6161 |
|
| 6162 |
func (s *SelectContext) EscapeIdent() IEscapeIdentContext { |
| 6163 |
var t antlr.RuleContext |
| 6164 |
for _, ctx := range s.GetChildren() { |
| 6165 |
if _, ok := ctx.(IEscapeIdentContext); ok { |
| 6166 |
t = ctx.(antlr.RuleContext) |
| 6167 |
break |
| 6168 |
} |
| 6169 |
} |
| 6170 |
|
| 6171 |
if t == nil { |
| 6172 |
return nil |
| 6173 |
} |
| 6174 |
|
| 6175 |
return t.(IEscapeIdentContext) |
| 6176 |
} |
| 6177 |
|
| 6178 |
func (s *SelectContext) QUESTIONMARK() antlr.TerminalNode { |
| 6179 |
return s.GetToken(CommandsParserQUESTIONMARK, 0) |
| 6180 |
} |
| 6181 |
|
| 6182 |
func (s *SelectContext) EnterRule(listener antlr.ParseTreeListener) { |
| 6183 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 6184 |
listenerT.EnterSelect(s) |
| 6185 |
} |
| 6186 |
} |
| 6187 |
|
| 6188 |
func (s *SelectContext) ExitRule(listener antlr.ParseTreeListener) { |
| 6189 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 6190 |
listenerT.ExitSelect(s) |
| 6191 |
} |
| 6192 |
} |
| 6193 |
|
| 6194 |
func (s *SelectContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 6195 |
switch t := visitor.(type) { |
| 6196 |
case CommandsVisitor: |
| 6197 |
return t.VisitSelect(s) |
| 6198 |
|
| 6199 |
default: |
| 6200 |
return t.VisitChildren(s) |
| 6201 |
} |
| 6202 |
} |
| 6203 |
|
| 6204 |
type PrimaryExprContext struct { |
| 6205 |
MemberContext |
| 6206 |
} |
| 6207 |
|
| 6208 |
func NewPrimaryExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PrimaryExprContext { |
| 6209 |
var p = new(PrimaryExprContext) |
| 6210 |
|
| 6211 |
InitEmptyMemberContext(&p.MemberContext) |
| 6212 |
p.parser = parser |
| 6213 |
p.CopyAll(ctx.(*MemberContext)) |
| 6214 |
|
| 6215 |
return p |
| 6216 |
} |
| 6217 |
|
| 6218 |
func (s *PrimaryExprContext) GetRuleContext() antlr.RuleContext { |
| 6219 |
return s |
| 6220 |
} |
| 6221 |
|
| 6222 |
func (s *PrimaryExprContext) Primary() IPrimaryContext { |
| 6223 |
var t antlr.RuleContext |
| 6224 |
for _, ctx := range s.GetChildren() { |
| 6225 |
if _, ok := ctx.(IPrimaryContext); ok { |
| 6226 |
t = ctx.(antlr.RuleContext) |
| 6227 |
break |
| 6228 |
} |
| 6229 |
} |
| 6230 |
|
| 6231 |
if t == nil { |
| 6232 |
return nil |
| 6233 |
} |
| 6234 |
|
| 6235 |
return t.(IPrimaryContext) |
| 6236 |
} |
| 6237 |
|
| 6238 |
func (s *PrimaryExprContext) EnterRule(listener antlr.ParseTreeListener) { |
| 6239 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 6240 |
listenerT.EnterPrimaryExpr(s) |
| 6241 |
} |
| 6242 |
} |
| 6243 |
|
| 6244 |
func (s *PrimaryExprContext) ExitRule(listener antlr.ParseTreeListener) { |
| 6245 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 6246 |
listenerT.ExitPrimaryExpr(s) |
| 6247 |
} |
| 6248 |
} |
| 6249 |
|
| 6250 |
func (s *PrimaryExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 6251 |
switch t := visitor.(type) { |
| 6252 |
case CommandsVisitor: |
| 6253 |
return t.VisitPrimaryExpr(s) |
| 6254 |
|
| 6255 |
default: |
| 6256 |
return t.VisitChildren(s) |
| 6257 |
} |
| 6258 |
} |
| 6259 |
|
| 6260 |
type IndexContext struct { |
| 6261 |
MemberContext |
| 6262 |
op antlr.Token |
| 6263 |
opt antlr.Token |
| 6264 |
index IExprContext |
| 6265 |
} |
| 6266 |
|
| 6267 |
func NewIndexContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IndexContext { |
| 6268 |
var p = new(IndexContext) |
| 6269 |
|
| 6270 |
InitEmptyMemberContext(&p.MemberContext) |
| 6271 |
p.parser = parser |
| 6272 |
p.CopyAll(ctx.(*MemberContext)) |
| 6273 |
|
| 6274 |
return p |
| 6275 |
} |
| 6276 |
|
| 6277 |
func (s *IndexContext) GetOp() antlr.Token { return s.op } |
| 6278 |
|
| 6279 |
func (s *IndexContext) GetOpt() antlr.Token { return s.opt } |
| 6280 |
|
| 6281 |
func (s *IndexContext) SetOp(v antlr.Token) { s.op = v } |
| 6282 |
|
| 6283 |
func (s *IndexContext) SetOpt(v antlr.Token) { s.opt = v } |
| 6284 |
|
| 6285 |
func (s *IndexContext) GetIndex() IExprContext { return s.index } |
| 6286 |
|
| 6287 |
func (s *IndexContext) SetIndex(v IExprContext) { s.index = v } |
| 6288 |
|
| 6289 |
func (s *IndexContext) GetRuleContext() antlr.RuleContext { |
| 6290 |
return s |
| 6291 |
} |
| 6292 |
|
| 6293 |
func (s *IndexContext) Member() IMemberContext { |
| 6294 |
var t antlr.RuleContext |
| 6295 |
for _, ctx := range s.GetChildren() { |
| 6296 |
if _, ok := ctx.(IMemberContext); ok { |
| 6297 |
t = ctx.(antlr.RuleContext) |
| 6298 |
break |
| 6299 |
} |
| 6300 |
} |
| 6301 |
|
| 6302 |
if t == nil { |
| 6303 |
return nil |
| 6304 |
} |
| 6305 |
|
| 6306 |
return t.(IMemberContext) |
| 6307 |
} |
| 6308 |
|
| 6309 |
func (s *IndexContext) RPRACKET() antlr.TerminalNode { |
| 6310 |
return s.GetToken(CommandsParserRPRACKET, 0) |
| 6311 |
} |
| 6312 |
|
| 6313 |
func (s *IndexContext) LBRACKET() antlr.TerminalNode { |
| 6314 |
return s.GetToken(CommandsParserLBRACKET, 0) |
| 6315 |
} |
| 6316 |
|
| 6317 |
func (s *IndexContext) Expr() IExprContext { |
| 6318 |
var t antlr.RuleContext |
| 6319 |
for _, ctx := range s.GetChildren() { |
| 6320 |
if _, ok := ctx.(IExprContext); ok { |
| 6321 |
t = ctx.(antlr.RuleContext) |
| 6322 |
break |
| 6323 |
} |
| 6324 |
} |
| 6325 |
|
| 6326 |
if t == nil { |
| 6327 |
return nil |
| 6328 |
} |
| 6329 |
|
| 6330 |
return t.(IExprContext) |
| 6331 |
} |
| 6332 |
|
| 6333 |
func (s *IndexContext) QUESTIONMARK() antlr.TerminalNode { |
| 6334 |
return s.GetToken(CommandsParserQUESTIONMARK, 0) |
| 6335 |
} |
| 6336 |
|
| 6337 |
func (s *IndexContext) EnterRule(listener antlr.ParseTreeListener) { |
| 6338 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 6339 |
listenerT.EnterIndex(s) |
| 6340 |
} |
| 6341 |
} |
| 6342 |
|
| 6343 |
func (s *IndexContext) ExitRule(listener antlr.ParseTreeListener) { |
| 6344 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 6345 |
listenerT.ExitIndex(s) |
| 6346 |
} |
| 6347 |
} |
| 6348 |
|
| 6349 |
func (s *IndexContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 6350 |
switch t := visitor.(type) { |
| 6351 |
case CommandsVisitor: |
| 6352 |
return t.VisitIndex(s) |
| 6353 |
|
| 6354 |
default: |
| 6355 |
return t.VisitChildren(s) |
| 6356 |
} |
| 6357 |
} |
| 6358 |
|
| 6359 |
func (p *CommandsParser) Member() (localctx IMemberContext) { |
| 6360 |
return p.member(0) |
| 6361 |
} |
| 6362 |
|
| 6363 |
func (p *CommandsParser) member(_p int) (localctx IMemberContext) { |
| 6364 |
var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() |
| 6365 |
|
| 6366 |
_parentState := p.GetState() |
| 6367 |
localctx = NewMemberContext(p, p.GetParserRuleContext(), _parentState) |
| 6368 |
var _prevctx IMemberContext = localctx |
| 6369 |
var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. |
| 6370 |
_startState := 52 |
| 6371 |
p.EnterRecursionRule(localctx, 52, CommandsParserRULE_member, _p) |
| 6372 |
var _la int |
| 6373 |
|
| 6374 |
var _alt int |
| 6375 |
|
| 6376 |
p.EnterOuterAlt(localctx, 1) |
| 6377 |
localctx = NewPrimaryExprContext(p, localctx) |
| 6378 |
p.SetParserRuleContext(localctx) |
| 6379 |
_prevctx = localctx |
| 6380 |
|
| 6381 |
{ |
| 6382 |
p.SetState(275) |
| 6383 |
p.Primary() |
| 6384 |
} |
| 6385 |
|
| 6386 |
p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) |
| 6387 |
p.SetState(301) |
| 6388 |
p.GetErrorHandler().Sync(p) |
| 6389 |
if p.HasError() { |
| 6390 |
goto errorExit |
| 6391 |
} |
| 6392 |
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 32, p.GetParserRuleContext()) |
| 6393 |
if p.HasError() { |
| 6394 |
goto errorExit |
| 6395 |
} |
| 6396 |
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { |
| 6397 |
if _alt == 1 { |
| 6398 |
if p.GetParseListeners() != nil { |
| 6399 |
p.TriggerExitRuleEvent() |
| 6400 |
} |
| 6401 |
_prevctx = localctx |
| 6402 |
p.SetState(299) |
| 6403 |
p.GetErrorHandler().Sync(p) |
| 6404 |
if p.HasError() { |
| 6405 |
goto errorExit |
| 6406 |
} |
| 6407 |
|
| 6408 |
switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 31, p.GetParserRuleContext()) { |
| 6409 |
case 1: |
| 6410 |
localctx = NewSelectContext(p, NewMemberContext(p, _parentctx, _parentState)) |
| 6411 |
p.PushNewRecursionContext(localctx, _startState, CommandsParserRULE_member) |
| 6412 |
p.SetState(277) |
| 6413 |
|
| 6414 |
if !(p.Precpred(p.GetParserRuleContext(), 3)) { |
| 6415 |
p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) |
| 6416 |
goto errorExit |
| 6417 |
} |
| 6418 |
{ |
| 6419 |
p.SetState(278) |
| 6420 |
|
| 6421 |
var _m = p.Match(CommandsParserDOT) |
| 6422 |
|
| 6423 |
localctx.(*SelectContext).op = _m |
| 6424 |
if p.HasError() { |
| 6425 |
// Recognition error - abort rule |
| 6426 |
goto errorExit |
| 6427 |
} |
| 6428 |
} |
| 6429 |
p.SetState(280) |
| 6430 |
p.GetErrorHandler().Sync(p) |
| 6431 |
if p.HasError() { |
| 6432 |
goto errorExit |
| 6433 |
} |
| 6434 |
_la = p.GetTokenStream().LA(1) |
| 6435 |
|
| 6436 |
if _la == CommandsParserQUESTIONMARK { |
| 6437 |
{ |
| 6438 |
p.SetState(279) |
| 6439 |
|
| 6440 |
var _m = p.Match(CommandsParserQUESTIONMARK) |
| 6441 |
|
| 6442 |
localctx.(*SelectContext).opt = _m |
| 6443 |
if p.HasError() { |
| 6444 |
// Recognition error - abort rule |
| 6445 |
goto errorExit |
| 6446 |
} |
| 6447 |
} |
| 6448 |
|
| 6449 |
} |
| 6450 |
{ |
| 6451 |
p.SetState(282) |
| 6452 |
|
| 6453 |
var _x = p.EscapeIdent() |
| 6454 |
|
| 6455 |
localctx.(*SelectContext).id = _x |
| 6456 |
} |
| 6457 |
|
| 6458 |
case 2: |
| 6459 |
localctx = NewMemberCallContext(p, NewMemberContext(p, _parentctx, _parentState)) |
| 6460 |
p.PushNewRecursionContext(localctx, _startState, CommandsParserRULE_member) |
| 6461 |
p.SetState(283) |
| 6462 |
|
| 6463 |
if !(p.Precpred(p.GetParserRuleContext(), 2)) { |
| 6464 |
p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 2)", "")) |
| 6465 |
goto errorExit |
| 6466 |
} |
| 6467 |
{ |
| 6468 |
p.SetState(284) |
| 6469 |
|
| 6470 |
var _m = p.Match(CommandsParserDOT) |
| 6471 |
|
| 6472 |
localctx.(*MemberCallContext).op = _m |
| 6473 |
if p.HasError() { |
| 6474 |
// Recognition error - abort rule |
| 6475 |
goto errorExit |
| 6476 |
} |
| 6477 |
} |
| 6478 |
{ |
| 6479 |
p.SetState(285) |
| 6480 |
|
| 6481 |
var _m = p.Match(CommandsParserIDENTIFIER) |
| 6482 |
|
| 6483 |
localctx.(*MemberCallContext).id = _m |
| 6484 |
if p.HasError() { |
| 6485 |
// Recognition error - abort rule |
| 6486 |
goto errorExit |
| 6487 |
} |
| 6488 |
} |
| 6489 |
{ |
| 6490 |
p.SetState(286) |
| 6491 |
|
| 6492 |
var _m = p.Match(CommandsParserLPAREN) |
| 6493 |
|
| 6494 |
localctx.(*MemberCallContext).open = _m |
| 6495 |
if p.HasError() { |
| 6496 |
// Recognition error - abort rule |
| 6497 |
goto errorExit |
| 6498 |
} |
| 6499 |
} |
| 6500 |
p.SetState(288) |
| 6501 |
p.GetErrorHandler().Sync(p) |
| 6502 |
if p.HasError() { |
| 6503 |
goto errorExit |
| 6504 |
} |
| 6505 |
_la = p.GetTokenStream().LA(1) |
| 6506 |
|
| 6507 |
if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1112163166978048) != 0 { |
| 6508 |
{ |
| 6509 |
p.SetState(287) |
| 6510 |
|
| 6511 |
var _x = p.ExprList() |
| 6512 |
|
| 6513 |
localctx.(*MemberCallContext).args = _x |
| 6514 |
} |
| 6515 |
|
| 6516 |
} |
| 6517 |
{ |
| 6518 |
p.SetState(290) |
| 6519 |
p.Match(CommandsParserRPAREN) |
| 6520 |
if p.HasError() { |
| 6521 |
// Recognition error - abort rule |
| 6522 |
goto errorExit |
| 6523 |
} |
| 6524 |
} |
| 6525 |
|
| 6526 |
case 3: |
| 6527 |
localctx = NewIndexContext(p, NewMemberContext(p, _parentctx, _parentState)) |
| 6528 |
p.PushNewRecursionContext(localctx, _startState, CommandsParserRULE_member) |
| 6529 |
p.SetState(291) |
| 6530 |
|
| 6531 |
if !(p.Precpred(p.GetParserRuleContext(), 1)) { |
| 6532 |
p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", "")) |
| 6533 |
goto errorExit |
| 6534 |
} |
| 6535 |
{ |
| 6536 |
p.SetState(292) |
| 6537 |
|
| 6538 |
var _m = p.Match(CommandsParserLBRACKET) |
| 6539 |
|
| 6540 |
localctx.(*IndexContext).op = _m |
| 6541 |
if p.HasError() { |
| 6542 |
// Recognition error - abort rule |
| 6543 |
goto errorExit |
| 6544 |
} |
| 6545 |
} |
| 6546 |
p.SetState(294) |
| 6547 |
p.GetErrorHandler().Sync(p) |
| 6548 |
if p.HasError() { |
| 6549 |
goto errorExit |
| 6550 |
} |
| 6551 |
_la = p.GetTokenStream().LA(1) |
| 6552 |
|
| 6553 |
if _la == CommandsParserQUESTIONMARK { |
| 6554 |
{ |
| 6555 |
p.SetState(293) |
| 6556 |
|
| 6557 |
var _m = p.Match(CommandsParserQUESTIONMARK) |
| 6558 |
|
| 6559 |
localctx.(*IndexContext).opt = _m |
| 6560 |
if p.HasError() { |
| 6561 |
// Recognition error - abort rule |
| 6562 |
goto errorExit |
| 6563 |
} |
| 6564 |
} |
| 6565 |
|
| 6566 |
} |
| 6567 |
{ |
| 6568 |
p.SetState(296) |
| 6569 |
|
| 6570 |
var _x = p.Expr() |
| 6571 |
|
| 6572 |
localctx.(*IndexContext).index = _x |
| 6573 |
} |
| 6574 |
{ |
| 6575 |
p.SetState(297) |
| 6576 |
p.Match(CommandsParserRPRACKET) |
| 6577 |
if p.HasError() { |
| 6578 |
// Recognition error - abort rule |
| 6579 |
goto errorExit |
| 6580 |
} |
| 6581 |
} |
| 6582 |
|
| 6583 |
case antlr.ATNInvalidAltNumber: |
| 6584 |
goto errorExit |
| 6585 |
} |
| 6586 |
|
| 6587 |
} |
| 6588 |
p.SetState(303) |
| 6589 |
p.GetErrorHandler().Sync(p) |
| 6590 |
if p.HasError() { |
| 6591 |
goto errorExit |
| 6592 |
} |
| 6593 |
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 32, p.GetParserRuleContext()) |
| 6594 |
if p.HasError() { |
| 6595 |
goto errorExit |
| 6596 |
} |
| 6597 |
} |
| 6598 |
|
| 6599 |
errorExit: |
| 6600 |
if p.HasError() { |
| 6601 |
v := p.GetError() |
| 6602 |
localctx.SetException(v) |
| 6603 |
p.GetErrorHandler().ReportError(p, v) |
| 6604 |
p.GetErrorHandler().Recover(p, v) |
| 6605 |
p.SetError(nil) |
| 6606 |
} |
| 6607 |
p.UnrollRecursionContexts(_parentctx) |
| 6608 |
return localctx |
| 6609 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 6610 |
} |
| 6611 |
|
| 6612 |
// IPrimaryContext is an interface to support dynamic dispatch. |
| 6613 |
type IPrimaryContext interface { |
| 6614 |
antlr.ParserRuleContext |
| 6615 |
|
| 6616 |
// GetParser returns the parser. |
| 6617 |
GetParser() antlr.Parser |
| 6618 |
// IsPrimaryContext differentiates from other interfaces. |
| 6619 |
IsPrimaryContext() |
| 6620 |
} |
| 6621 |
|
| 6622 |
type PrimaryContext struct { |
| 6623 |
antlr.BaseParserRuleContext |
| 6624 |
parser antlr.Parser |
| 6625 |
} |
| 6626 |
|
| 6627 |
func NewEmptyPrimaryContext() *PrimaryContext { |
| 6628 |
var p = new(PrimaryContext) |
| 6629 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 6630 |
p.RuleIndex = CommandsParserRULE_primary |
| 6631 |
return p |
| 6632 |
} |
| 6633 |
|
| 6634 |
func InitEmptyPrimaryContext(p *PrimaryContext) { |
| 6635 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 6636 |
p.RuleIndex = CommandsParserRULE_primary |
| 6637 |
} |
| 6638 |
|
| 6639 |
func (*PrimaryContext) IsPrimaryContext() {} |
| 6640 |
|
| 6641 |
func NewPrimaryContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PrimaryContext { |
| 6642 |
var p = new(PrimaryContext) |
| 6643 |
|
| 6644 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 6645 |
|
| 6646 |
p.parser = parser |
| 6647 |
p.RuleIndex = CommandsParserRULE_primary |
| 6648 |
|
| 6649 |
return p |
| 6650 |
} |
| 6651 |
|
| 6652 |
func (s *PrimaryContext) GetParser() antlr.Parser { return s.parser } |
| 6653 |
|
| 6654 |
func (s *PrimaryContext) CopyAll(ctx *PrimaryContext) { |
| 6655 |
s.CopyFrom(&ctx.BaseParserRuleContext) |
| 6656 |
} |
| 6657 |
|
| 6658 |
func (s *PrimaryContext) GetRuleContext() antlr.RuleContext { |
| 6659 |
return s |
| 6660 |
} |
| 6661 |
|
| 6662 |
func (s *PrimaryContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 6663 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 6664 |
} |
| 6665 |
|
| 6666 |
type CreateListContext struct { |
| 6667 |
PrimaryContext |
| 6668 |
op antlr.Token |
| 6669 |
elems IListInitContext |
| 6670 |
} |
| 6671 |
|
| 6672 |
func NewCreateListContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateListContext { |
| 6673 |
var p = new(CreateListContext) |
| 6674 |
|
| 6675 |
InitEmptyPrimaryContext(&p.PrimaryContext) |
| 6676 |
p.parser = parser |
| 6677 |
p.CopyAll(ctx.(*PrimaryContext)) |
| 6678 |
|
| 6679 |
return p |
| 6680 |
} |
| 6681 |
|
| 6682 |
func (s *CreateListContext) GetOp() antlr.Token { return s.op } |
| 6683 |
|
| 6684 |
func (s *CreateListContext) SetOp(v antlr.Token) { s.op = v } |
| 6685 |
|
| 6686 |
func (s *CreateListContext) GetElems() IListInitContext { return s.elems } |
| 6687 |
|
| 6688 |
func (s *CreateListContext) SetElems(v IListInitContext) { s.elems = v } |
| 6689 |
|
| 6690 |
func (s *CreateListContext) GetRuleContext() antlr.RuleContext { |
| 6691 |
return s |
| 6692 |
} |
| 6693 |
|
| 6694 |
func (s *CreateListContext) RPRACKET() antlr.TerminalNode { |
| 6695 |
return s.GetToken(CommandsParserRPRACKET, 0) |
| 6696 |
} |
| 6697 |
|
| 6698 |
func (s *CreateListContext) LBRACKET() antlr.TerminalNode { |
| 6699 |
return s.GetToken(CommandsParserLBRACKET, 0) |
| 6700 |
} |
| 6701 |
|
| 6702 |
func (s *CreateListContext) COMMA() antlr.TerminalNode { |
| 6703 |
return s.GetToken(CommandsParserCOMMA, 0) |
| 6704 |
} |
| 6705 |
|
| 6706 |
func (s *CreateListContext) ListInit() IListInitContext { |
| 6707 |
var t antlr.RuleContext |
| 6708 |
for _, ctx := range s.GetChildren() { |
| 6709 |
if _, ok := ctx.(IListInitContext); ok { |
| 6710 |
t = ctx.(antlr.RuleContext) |
| 6711 |
break |
| 6712 |
} |
| 6713 |
} |
| 6714 |
|
| 6715 |
if t == nil { |
| 6716 |
return nil |
| 6717 |
} |
| 6718 |
|
| 6719 |
return t.(IListInitContext) |
| 6720 |
} |
| 6721 |
|
| 6722 |
func (s *CreateListContext) EnterRule(listener antlr.ParseTreeListener) { |
| 6723 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 6724 |
listenerT.EnterCreateList(s) |
| 6725 |
} |
| 6726 |
} |
| 6727 |
|
| 6728 |
func (s *CreateListContext) ExitRule(listener antlr.ParseTreeListener) { |
| 6729 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 6730 |
listenerT.ExitCreateList(s) |
| 6731 |
} |
| 6732 |
} |
| 6733 |
|
| 6734 |
func (s *CreateListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 6735 |
switch t := visitor.(type) { |
| 6736 |
case CommandsVisitor: |
| 6737 |
return t.VisitCreateList(s) |
| 6738 |
|
| 6739 |
default: |
| 6740 |
return t.VisitChildren(s) |
| 6741 |
} |
| 6742 |
} |
| 6743 |
|
| 6744 |
type IdentContext struct { |
| 6745 |
PrimaryContext |
| 6746 |
leadingDot antlr.Token |
| 6747 |
id antlr.Token |
| 6748 |
} |
| 6749 |
|
| 6750 |
func NewIdentContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IdentContext { |
| 6751 |
var p = new(IdentContext) |
| 6752 |
|
| 6753 |
InitEmptyPrimaryContext(&p.PrimaryContext) |
| 6754 |
p.parser = parser |
| 6755 |
p.CopyAll(ctx.(*PrimaryContext)) |
| 6756 |
|
| 6757 |
return p |
| 6758 |
} |
| 6759 |
|
| 6760 |
func (s *IdentContext) GetLeadingDot() antlr.Token { return s.leadingDot } |
| 6761 |
|
| 6762 |
func (s *IdentContext) GetId() antlr.Token { return s.id } |
| 6763 |
|
| 6764 |
func (s *IdentContext) SetLeadingDot(v antlr.Token) { s.leadingDot = v } |
| 6765 |
|
| 6766 |
func (s *IdentContext) SetId(v antlr.Token) { s.id = v } |
| 6767 |
|
| 6768 |
func (s *IdentContext) GetRuleContext() antlr.RuleContext { |
| 6769 |
return s |
| 6770 |
} |
| 6771 |
|
| 6772 |
func (s *IdentContext) IDENTIFIER() antlr.TerminalNode { |
| 6773 |
return s.GetToken(CommandsParserIDENTIFIER, 0) |
| 6774 |
} |
| 6775 |
|
| 6776 |
func (s *IdentContext) DOT() antlr.TerminalNode { |
| 6777 |
return s.GetToken(CommandsParserDOT, 0) |
| 6778 |
} |
| 6779 |
|
| 6780 |
func (s *IdentContext) EnterRule(listener antlr.ParseTreeListener) { |
| 6781 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 6782 |
listenerT.EnterIdent(s) |
| 6783 |
} |
| 6784 |
} |
| 6785 |
|
| 6786 |
func (s *IdentContext) ExitRule(listener antlr.ParseTreeListener) { |
| 6787 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 6788 |
listenerT.ExitIdent(s) |
| 6789 |
} |
| 6790 |
} |
| 6791 |
|
| 6792 |
func (s *IdentContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 6793 |
switch t := visitor.(type) { |
| 6794 |
case CommandsVisitor: |
| 6795 |
return t.VisitIdent(s) |
| 6796 |
|
| 6797 |
default: |
| 6798 |
return t.VisitChildren(s) |
| 6799 |
} |
| 6800 |
} |
| 6801 |
|
| 6802 |
type CreateStructContext struct { |
| 6803 |
PrimaryContext |
| 6804 |
op antlr.Token |
| 6805 |
entries IMapInitializerListContext |
| 6806 |
} |
| 6807 |
|
| 6808 |
func NewCreateStructContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateStructContext { |
| 6809 |
var p = new(CreateStructContext) |
| 6810 |
|
| 6811 |
InitEmptyPrimaryContext(&p.PrimaryContext) |
| 6812 |
p.parser = parser |
| 6813 |
p.CopyAll(ctx.(*PrimaryContext)) |
| 6814 |
|
| 6815 |
return p |
| 6816 |
} |
| 6817 |
|
| 6818 |
func (s *CreateStructContext) GetOp() antlr.Token { return s.op } |
| 6819 |
|
| 6820 |
func (s *CreateStructContext) SetOp(v antlr.Token) { s.op = v } |
| 6821 |
|
| 6822 |
func (s *CreateStructContext) GetEntries() IMapInitializerListContext { return s.entries } |
| 6823 |
|
| 6824 |
func (s *CreateStructContext) SetEntries(v IMapInitializerListContext) { s.entries = v } |
| 6825 |
|
| 6826 |
func (s *CreateStructContext) GetRuleContext() antlr.RuleContext { |
| 6827 |
return s |
| 6828 |
} |
| 6829 |
|
| 6830 |
func (s *CreateStructContext) RBRACE() antlr.TerminalNode { |
| 6831 |
return s.GetToken(CommandsParserRBRACE, 0) |
| 6832 |
} |
| 6833 |
|
| 6834 |
func (s *CreateStructContext) LBRACE() antlr.TerminalNode { |
| 6835 |
return s.GetToken(CommandsParserLBRACE, 0) |
| 6836 |
} |
| 6837 |
|
| 6838 |
func (s *CreateStructContext) COMMA() antlr.TerminalNode { |
| 6839 |
return s.GetToken(CommandsParserCOMMA, 0) |
| 6840 |
} |
| 6841 |
|
| 6842 |
func (s *CreateStructContext) MapInitializerList() IMapInitializerListContext { |
| 6843 |
var t antlr.RuleContext |
| 6844 |
for _, ctx := range s.GetChildren() { |
| 6845 |
if _, ok := ctx.(IMapInitializerListContext); ok { |
| 6846 |
t = ctx.(antlr.RuleContext) |
| 6847 |
break |
| 6848 |
} |
| 6849 |
} |
| 6850 |
|
| 6851 |
if t == nil { |
| 6852 |
return nil |
| 6853 |
} |
| 6854 |
|
| 6855 |
return t.(IMapInitializerListContext) |
| 6856 |
} |
| 6857 |
|
| 6858 |
func (s *CreateStructContext) EnterRule(listener antlr.ParseTreeListener) { |
| 6859 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 6860 |
listenerT.EnterCreateStruct(s) |
| 6861 |
} |
| 6862 |
} |
| 6863 |
|
| 6864 |
func (s *CreateStructContext) ExitRule(listener antlr.ParseTreeListener) { |
| 6865 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 6866 |
listenerT.ExitCreateStruct(s) |
| 6867 |
} |
| 6868 |
} |
| 6869 |
|
| 6870 |
func (s *CreateStructContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 6871 |
switch t := visitor.(type) { |
| 6872 |
case CommandsVisitor: |
| 6873 |
return t.VisitCreateStruct(s) |
| 6874 |
|
| 6875 |
default: |
| 6876 |
return t.VisitChildren(s) |
| 6877 |
} |
| 6878 |
} |
| 6879 |
|
| 6880 |
type ConstantLiteralContext struct { |
| 6881 |
PrimaryContext |
| 6882 |
} |
| 6883 |
|
| 6884 |
func NewConstantLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConstantLiteralContext { |
| 6885 |
var p = new(ConstantLiteralContext) |
| 6886 |
|
| 6887 |
InitEmptyPrimaryContext(&p.PrimaryContext) |
| 6888 |
p.parser = parser |
| 6889 |
p.CopyAll(ctx.(*PrimaryContext)) |
| 6890 |
|
| 6891 |
return p |
| 6892 |
} |
| 6893 |
|
| 6894 |
func (s *ConstantLiteralContext) GetRuleContext() antlr.RuleContext { |
| 6895 |
return s |
| 6896 |
} |
| 6897 |
|
| 6898 |
func (s *ConstantLiteralContext) Literal() ILiteralContext { |
| 6899 |
var t antlr.RuleContext |
| 6900 |
for _, ctx := range s.GetChildren() { |
| 6901 |
if _, ok := ctx.(ILiteralContext); ok { |
| 6902 |
t = ctx.(antlr.RuleContext) |
| 6903 |
break |
| 6904 |
} |
| 6905 |
} |
| 6906 |
|
| 6907 |
if t == nil { |
| 6908 |
return nil |
| 6909 |
} |
| 6910 |
|
| 6911 |
return t.(ILiteralContext) |
| 6912 |
} |
| 6913 |
|
| 6914 |
func (s *ConstantLiteralContext) EnterRule(listener antlr.ParseTreeListener) { |
| 6915 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 6916 |
listenerT.EnterConstantLiteral(s) |
| 6917 |
} |
| 6918 |
} |
| 6919 |
|
| 6920 |
func (s *ConstantLiteralContext) ExitRule(listener antlr.ParseTreeListener) { |
| 6921 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 6922 |
listenerT.ExitConstantLiteral(s) |
| 6923 |
} |
| 6924 |
} |
| 6925 |
|
| 6926 |
func (s *ConstantLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 6927 |
switch t := visitor.(type) { |
| 6928 |
case CommandsVisitor: |
| 6929 |
return t.VisitConstantLiteral(s) |
| 6930 |
|
| 6931 |
default: |
| 6932 |
return t.VisitChildren(s) |
| 6933 |
} |
| 6934 |
} |
| 6935 |
|
| 6936 |
type NestedContext struct { |
| 6937 |
PrimaryContext |
| 6938 |
e IExprContext |
| 6939 |
} |
| 6940 |
|
| 6941 |
func NewNestedContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NestedContext { |
| 6942 |
var p = new(NestedContext) |
| 6943 |
|
| 6944 |
InitEmptyPrimaryContext(&p.PrimaryContext) |
| 6945 |
p.parser = parser |
| 6946 |
p.CopyAll(ctx.(*PrimaryContext)) |
| 6947 |
|
| 6948 |
return p |
| 6949 |
} |
| 6950 |
|
| 6951 |
func (s *NestedContext) GetE() IExprContext { return s.e } |
| 6952 |
|
| 6953 |
func (s *NestedContext) SetE(v IExprContext) { s.e = v } |
| 6954 |
|
| 6955 |
func (s *NestedContext) GetRuleContext() antlr.RuleContext { |
| 6956 |
return s |
| 6957 |
} |
| 6958 |
|
| 6959 |
func (s *NestedContext) LPAREN() antlr.TerminalNode { |
| 6960 |
return s.GetToken(CommandsParserLPAREN, 0) |
| 6961 |
} |
| 6962 |
|
| 6963 |
func (s *NestedContext) RPAREN() antlr.TerminalNode { |
| 6964 |
return s.GetToken(CommandsParserRPAREN, 0) |
| 6965 |
} |
| 6966 |
|
| 6967 |
func (s *NestedContext) Expr() IExprContext { |
| 6968 |
var t antlr.RuleContext |
| 6969 |
for _, ctx := range s.GetChildren() { |
| 6970 |
if _, ok := ctx.(IExprContext); ok { |
| 6971 |
t = ctx.(antlr.RuleContext) |
| 6972 |
break |
| 6973 |
} |
| 6974 |
} |
| 6975 |
|
| 6976 |
if t == nil { |
| 6977 |
return nil |
| 6978 |
} |
| 6979 |
|
| 6980 |
return t.(IExprContext) |
| 6981 |
} |
| 6982 |
|
| 6983 |
func (s *NestedContext) EnterRule(listener antlr.ParseTreeListener) { |
| 6984 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 6985 |
listenerT.EnterNested(s) |
| 6986 |
} |
| 6987 |
} |
| 6988 |
|
| 6989 |
func (s *NestedContext) ExitRule(listener antlr.ParseTreeListener) { |
| 6990 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 6991 |
listenerT.ExitNested(s) |
| 6992 |
} |
| 6993 |
} |
| 6994 |
|
| 6995 |
func (s *NestedContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 6996 |
switch t := visitor.(type) { |
| 6997 |
case CommandsVisitor: |
| 6998 |
return t.VisitNested(s) |
| 6999 |
|
| 7000 |
default: |
| 7001 |
return t.VisitChildren(s) |
| 7002 |
} |
| 7003 |
} |
| 7004 |
|
| 7005 |
type CreateMessageContext struct { |
| 7006 |
PrimaryContext |
| 7007 |
leadingDot antlr.Token |
| 7008 |
_IDENTIFIER antlr.Token |
| 7009 |
ids []antlr.Token |
| 7010 |
s29 antlr.Token |
| 7011 |
ops []antlr.Token |
| 7012 |
op antlr.Token |
| 7013 |
entries IFieldInitializerListContext |
| 7014 |
} |
| 7015 |
|
| 7016 |
func NewCreateMessageContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateMessageContext { |
| 7017 |
var p = new(CreateMessageContext) |
| 7018 |
|
| 7019 |
InitEmptyPrimaryContext(&p.PrimaryContext) |
| 7020 |
p.parser = parser |
| 7021 |
p.CopyAll(ctx.(*PrimaryContext)) |
| 7022 |
|
| 7023 |
return p |
| 7024 |
} |
| 7025 |
|
| 7026 |
func (s *CreateMessageContext) GetLeadingDot() antlr.Token { return s.leadingDot } |
| 7027 |
|
| 7028 |
func (s *CreateMessageContext) Get_IDENTIFIER() antlr.Token { return s._IDENTIFIER } |
| 7029 |
|
| 7030 |
func (s *CreateMessageContext) GetS29() antlr.Token { return s.s29 } |
| 7031 |
|
| 7032 |
func (s *CreateMessageContext) GetOp() antlr.Token { return s.op } |
| 7033 |
|
| 7034 |
func (s *CreateMessageContext) SetLeadingDot(v antlr.Token) { s.leadingDot = v } |
| 7035 |
|
| 7036 |
func (s *CreateMessageContext) Set_IDENTIFIER(v antlr.Token) { s._IDENTIFIER = v } |
| 7037 |
|
| 7038 |
func (s *CreateMessageContext) SetS29(v antlr.Token) { s.s29 = v } |
| 7039 |
|
| 7040 |
func (s *CreateMessageContext) SetOp(v antlr.Token) { s.op = v } |
| 7041 |
|
| 7042 |
func (s *CreateMessageContext) GetIds() []antlr.Token { return s.ids } |
| 7043 |
|
| 7044 |
func (s *CreateMessageContext) GetOps() []antlr.Token { return s.ops } |
| 7045 |
|
| 7046 |
func (s *CreateMessageContext) SetIds(v []antlr.Token) { s.ids = v } |
| 7047 |
|
| 7048 |
func (s *CreateMessageContext) SetOps(v []antlr.Token) { s.ops = v } |
| 7049 |
|
| 7050 |
func (s *CreateMessageContext) GetEntries() IFieldInitializerListContext { return s.entries } |
| 7051 |
|
| 7052 |
func (s *CreateMessageContext) SetEntries(v IFieldInitializerListContext) { s.entries = v } |
| 7053 |
|
| 7054 |
func (s *CreateMessageContext) GetRuleContext() antlr.RuleContext { |
| 7055 |
return s |
| 7056 |
} |
| 7057 |
|
| 7058 |
func (s *CreateMessageContext) RBRACE() antlr.TerminalNode { |
| 7059 |
return s.GetToken(CommandsParserRBRACE, 0) |
| 7060 |
} |
| 7061 |
|
| 7062 |
func (s *CreateMessageContext) AllIDENTIFIER() []antlr.TerminalNode { |
| 7063 |
return s.GetTokens(CommandsParserIDENTIFIER) |
| 7064 |
} |
| 7065 |
|
| 7066 |
func (s *CreateMessageContext) IDENTIFIER(i int) antlr.TerminalNode { |
| 7067 |
return s.GetToken(CommandsParserIDENTIFIER, i) |
| 7068 |
} |
| 7069 |
|
| 7070 |
func (s *CreateMessageContext) LBRACE() antlr.TerminalNode { |
| 7071 |
return s.GetToken(CommandsParserLBRACE, 0) |
| 7072 |
} |
| 7073 |
|
| 7074 |
func (s *CreateMessageContext) COMMA() antlr.TerminalNode { |
| 7075 |
return s.GetToken(CommandsParserCOMMA, 0) |
| 7076 |
} |
| 7077 |
|
| 7078 |
func (s *CreateMessageContext) AllDOT() []antlr.TerminalNode { |
| 7079 |
return s.GetTokens(CommandsParserDOT) |
| 7080 |
} |
| 7081 |
|
| 7082 |
func (s *CreateMessageContext) DOT(i int) antlr.TerminalNode { |
| 7083 |
return s.GetToken(CommandsParserDOT, i) |
| 7084 |
} |
| 7085 |
|
| 7086 |
func (s *CreateMessageContext) FieldInitializerList() IFieldInitializerListContext { |
| 7087 |
var t antlr.RuleContext |
| 7088 |
for _, ctx := range s.GetChildren() { |
| 7089 |
if _, ok := ctx.(IFieldInitializerListContext); ok { |
| 7090 |
t = ctx.(antlr.RuleContext) |
| 7091 |
break |
| 7092 |
} |
| 7093 |
} |
| 7094 |
|
| 7095 |
if t == nil { |
| 7096 |
return nil |
| 7097 |
} |
| 7098 |
|
| 7099 |
return t.(IFieldInitializerListContext) |
| 7100 |
} |
| 7101 |
|
| 7102 |
func (s *CreateMessageContext) EnterRule(listener antlr.ParseTreeListener) { |
| 7103 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 7104 |
listenerT.EnterCreateMessage(s) |
| 7105 |
} |
| 7106 |
} |
| 7107 |
|
| 7108 |
func (s *CreateMessageContext) ExitRule(listener antlr.ParseTreeListener) { |
| 7109 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 7110 |
listenerT.ExitCreateMessage(s) |
| 7111 |
} |
| 7112 |
} |
| 7113 |
|
| 7114 |
func (s *CreateMessageContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 7115 |
switch t := visitor.(type) { |
| 7116 |
case CommandsVisitor: |
| 7117 |
return t.VisitCreateMessage(s) |
| 7118 |
|
| 7119 |
default: |
| 7120 |
return t.VisitChildren(s) |
| 7121 |
} |
| 7122 |
} |
| 7123 |
|
| 7124 |
type GlobalCallContext struct { |
| 7125 |
PrimaryContext |
| 7126 |
leadingDot antlr.Token |
| 7127 |
id antlr.Token |
| 7128 |
op antlr.Token |
| 7129 |
args IExprListContext |
| 7130 |
} |
| 7131 |
|
| 7132 |
func NewGlobalCallContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *GlobalCallContext { |
| 7133 |
var p = new(GlobalCallContext) |
| 7134 |
|
| 7135 |
InitEmptyPrimaryContext(&p.PrimaryContext) |
| 7136 |
p.parser = parser |
| 7137 |
p.CopyAll(ctx.(*PrimaryContext)) |
| 7138 |
|
| 7139 |
return p |
| 7140 |
} |
| 7141 |
|
| 7142 |
func (s *GlobalCallContext) GetLeadingDot() antlr.Token { return s.leadingDot } |
| 7143 |
|
| 7144 |
func (s *GlobalCallContext) GetId() antlr.Token { return s.id } |
| 7145 |
|
| 7146 |
func (s *GlobalCallContext) GetOp() antlr.Token { return s.op } |
| 7147 |
|
| 7148 |
func (s *GlobalCallContext) SetLeadingDot(v antlr.Token) { s.leadingDot = v } |
| 7149 |
|
| 7150 |
func (s *GlobalCallContext) SetId(v antlr.Token) { s.id = v } |
| 7151 |
|
| 7152 |
func (s *GlobalCallContext) SetOp(v antlr.Token) { s.op = v } |
| 7153 |
|
| 7154 |
func (s *GlobalCallContext) GetArgs() IExprListContext { return s.args } |
| 7155 |
|
| 7156 |
func (s *GlobalCallContext) SetArgs(v IExprListContext) { s.args = v } |
| 7157 |
|
| 7158 |
func (s *GlobalCallContext) GetRuleContext() antlr.RuleContext { |
| 7159 |
return s |
| 7160 |
} |
| 7161 |
|
| 7162 |
func (s *GlobalCallContext) IDENTIFIER() antlr.TerminalNode { |
| 7163 |
return s.GetToken(CommandsParserIDENTIFIER, 0) |
| 7164 |
} |
| 7165 |
|
| 7166 |
func (s *GlobalCallContext) RPAREN() antlr.TerminalNode { |
| 7167 |
return s.GetToken(CommandsParserRPAREN, 0) |
| 7168 |
} |
| 7169 |
|
| 7170 |
func (s *GlobalCallContext) LPAREN() antlr.TerminalNode { |
| 7171 |
return s.GetToken(CommandsParserLPAREN, 0) |
| 7172 |
} |
| 7173 |
|
| 7174 |
func (s *GlobalCallContext) DOT() antlr.TerminalNode { |
| 7175 |
return s.GetToken(CommandsParserDOT, 0) |
| 7176 |
} |
| 7177 |
|
| 7178 |
func (s *GlobalCallContext) ExprList() IExprListContext { |
| 7179 |
var t antlr.RuleContext |
| 7180 |
for _, ctx := range s.GetChildren() { |
| 7181 |
if _, ok := ctx.(IExprListContext); ok { |
| 7182 |
t = ctx.(antlr.RuleContext) |
| 7183 |
break |
| 7184 |
} |
| 7185 |
} |
| 7186 |
|
| 7187 |
if t == nil { |
| 7188 |
return nil |
| 7189 |
} |
| 7190 |
|
| 7191 |
return t.(IExprListContext) |
| 7192 |
} |
| 7193 |
|
| 7194 |
func (s *GlobalCallContext) EnterRule(listener antlr.ParseTreeListener) { |
| 7195 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 7196 |
listenerT.EnterGlobalCall(s) |
| 7197 |
} |
| 7198 |
} |
| 7199 |
|
| 7200 |
func (s *GlobalCallContext) ExitRule(listener antlr.ParseTreeListener) { |
| 7201 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 7202 |
listenerT.ExitGlobalCall(s) |
| 7203 |
} |
| 7204 |
} |
| 7205 |
|
| 7206 |
func (s *GlobalCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 7207 |
switch t := visitor.(type) { |
| 7208 |
case CommandsVisitor: |
| 7209 |
return t.VisitGlobalCall(s) |
| 7210 |
|
| 7211 |
default: |
| 7212 |
return t.VisitChildren(s) |
| 7213 |
} |
| 7214 |
} |
| 7215 |
|
| 7216 |
func (p *CommandsParser) Primary() (localctx IPrimaryContext) { |
| 7217 |
localctx = NewPrimaryContext(p, p.GetParserRuleContext(), p.GetState()) |
| 7218 |
p.EnterRule(localctx, 54, CommandsParserRULE_primary) |
| 7219 |
var _la int |
| 7220 |
|
| 7221 |
p.SetState(357) |
| 7222 |
p.GetErrorHandler().Sync(p) |
| 7223 |
if p.HasError() { |
| 7224 |
goto errorExit |
| 7225 |
} |
| 7226 |
|
| 7227 |
switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 44, p.GetParserRuleContext()) { |
| 7228 |
case 1: |
| 7229 |
localctx = NewIdentContext(p, localctx) |
| 7230 |
p.EnterOuterAlt(localctx, 1) |
| 7231 |
p.SetState(305) |
| 7232 |
p.GetErrorHandler().Sync(p) |
| 7233 |
if p.HasError() { |
| 7234 |
goto errorExit |
| 7235 |
} |
| 7236 |
_la = p.GetTokenStream().LA(1) |
| 7237 |
|
| 7238 |
if _la == CommandsParserDOT { |
| 7239 |
{ |
| 7240 |
p.SetState(304) |
| 7241 |
|
| 7242 |
var _m = p.Match(CommandsParserDOT) |
| 7243 |
|
| 7244 |
localctx.(*IdentContext).leadingDot = _m |
| 7245 |
if p.HasError() { |
| 7246 |
// Recognition error - abort rule |
| 7247 |
goto errorExit |
| 7248 |
} |
| 7249 |
} |
| 7250 |
|
| 7251 |
} |
| 7252 |
{ |
| 7253 |
p.SetState(307) |
| 7254 |
|
| 7255 |
var _m = p.Match(CommandsParserIDENTIFIER) |
| 7256 |
|
| 7257 |
localctx.(*IdentContext).id = _m |
| 7258 |
if p.HasError() { |
| 7259 |
// Recognition error - abort rule |
| 7260 |
goto errorExit |
| 7261 |
} |
| 7262 |
} |
| 7263 |
|
| 7264 |
case 2: |
| 7265 |
localctx = NewGlobalCallContext(p, localctx) |
| 7266 |
p.EnterOuterAlt(localctx, 2) |
| 7267 |
p.SetState(309) |
| 7268 |
p.GetErrorHandler().Sync(p) |
| 7269 |
if p.HasError() { |
| 7270 |
goto errorExit |
| 7271 |
} |
| 7272 |
_la = p.GetTokenStream().LA(1) |
| 7273 |
|
| 7274 |
if _la == CommandsParserDOT { |
| 7275 |
{ |
| 7276 |
p.SetState(308) |
| 7277 |
|
| 7278 |
var _m = p.Match(CommandsParserDOT) |
| 7279 |
|
| 7280 |
localctx.(*GlobalCallContext).leadingDot = _m |
| 7281 |
if p.HasError() { |
| 7282 |
// Recognition error - abort rule |
| 7283 |
goto errorExit |
| 7284 |
} |
| 7285 |
} |
| 7286 |
|
| 7287 |
} |
| 7288 |
{ |
| 7289 |
p.SetState(311) |
| 7290 |
|
| 7291 |
var _m = p.Match(CommandsParserIDENTIFIER) |
| 7292 |
|
| 7293 |
localctx.(*GlobalCallContext).id = _m |
| 7294 |
if p.HasError() { |
| 7295 |
// Recognition error - abort rule |
| 7296 |
goto errorExit |
| 7297 |
} |
| 7298 |
} |
| 7299 |
|
| 7300 |
{ |
| 7301 |
p.SetState(312) |
| 7302 |
|
| 7303 |
var _m = p.Match(CommandsParserLPAREN) |
| 7304 |
|
| 7305 |
localctx.(*GlobalCallContext).op = _m |
| 7306 |
if p.HasError() { |
| 7307 |
// Recognition error - abort rule |
| 7308 |
goto errorExit |
| 7309 |
} |
| 7310 |
} |
| 7311 |
p.SetState(314) |
| 7312 |
p.GetErrorHandler().Sync(p) |
| 7313 |
if p.HasError() { |
| 7314 |
goto errorExit |
| 7315 |
} |
| 7316 |
_la = p.GetTokenStream().LA(1) |
| 7317 |
|
| 7318 |
if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1112163166978048) != 0 { |
| 7319 |
{ |
| 7320 |
p.SetState(313) |
| 7321 |
|
| 7322 |
var _x = p.ExprList() |
| 7323 |
|
| 7324 |
localctx.(*GlobalCallContext).args = _x |
| 7325 |
} |
| 7326 |
|
| 7327 |
} |
| 7328 |
{ |
| 7329 |
p.SetState(316) |
| 7330 |
p.Match(CommandsParserRPAREN) |
| 7331 |
if p.HasError() { |
| 7332 |
// Recognition error - abort rule |
| 7333 |
goto errorExit |
| 7334 |
} |
| 7335 |
} |
| 7336 |
|
| 7337 |
case 3: |
| 7338 |
localctx = NewNestedContext(p, localctx) |
| 7339 |
p.EnterOuterAlt(localctx, 3) |
| 7340 |
{ |
| 7341 |
p.SetState(317) |
| 7342 |
p.Match(CommandsParserLPAREN) |
| 7343 |
if p.HasError() { |
| 7344 |
// Recognition error - abort rule |
| 7345 |
goto errorExit |
| 7346 |
} |
| 7347 |
} |
| 7348 |
{ |
| 7349 |
p.SetState(318) |
| 7350 |
|
| 7351 |
var _x = p.Expr() |
| 7352 |
|
| 7353 |
localctx.(*NestedContext).e = _x |
| 7354 |
} |
| 7355 |
{ |
| 7356 |
p.SetState(319) |
| 7357 |
p.Match(CommandsParserRPAREN) |
| 7358 |
if p.HasError() { |
| 7359 |
// Recognition error - abort rule |
| 7360 |
goto errorExit |
| 7361 |
} |
| 7362 |
} |
| 7363 |
|
| 7364 |
case 4: |
| 7365 |
localctx = NewCreateListContext(p, localctx) |
| 7366 |
p.EnterOuterAlt(localctx, 4) |
| 7367 |
{ |
| 7368 |
p.SetState(321) |
| 7369 |
|
| 7370 |
var _m = p.Match(CommandsParserLBRACKET) |
| 7371 |
|
| 7372 |
localctx.(*CreateListContext).op = _m |
| 7373 |
if p.HasError() { |
| 7374 |
// Recognition error - abort rule |
| 7375 |
goto errorExit |
| 7376 |
} |
| 7377 |
} |
| 7378 |
p.SetState(323) |
| 7379 |
p.GetErrorHandler().Sync(p) |
| 7380 |
if p.HasError() { |
| 7381 |
goto errorExit |
| 7382 |
} |
| 7383 |
_la = p.GetTokenStream().LA(1) |
| 7384 |
|
| 7385 |
if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1112171756912640) != 0 { |
| 7386 |
{ |
| 7387 |
p.SetState(322) |
| 7388 |
|
| 7389 |
var _x = p.ListInit() |
| 7390 |
|
| 7391 |
localctx.(*CreateListContext).elems = _x |
| 7392 |
} |
| 7393 |
|
| 7394 |
} |
| 7395 |
p.SetState(326) |
| 7396 |
p.GetErrorHandler().Sync(p) |
| 7397 |
if p.HasError() { |
| 7398 |
goto errorExit |
| 7399 |
} |
| 7400 |
_la = p.GetTokenStream().LA(1) |
| 7401 |
|
| 7402 |
if _la == CommandsParserCOMMA { |
| 7403 |
{ |
| 7404 |
p.SetState(325) |
| 7405 |
p.Match(CommandsParserCOMMA) |
| 7406 |
if p.HasError() { |
| 7407 |
// Recognition error - abort rule |
| 7408 |
goto errorExit |
| 7409 |
} |
| 7410 |
} |
| 7411 |
|
| 7412 |
} |
| 7413 |
{ |
| 7414 |
p.SetState(328) |
| 7415 |
p.Match(CommandsParserRPRACKET) |
| 7416 |
if p.HasError() { |
| 7417 |
// Recognition error - abort rule |
| 7418 |
goto errorExit |
| 7419 |
} |
| 7420 |
} |
| 7421 |
|
| 7422 |
case 5: |
| 7423 |
localctx = NewCreateStructContext(p, localctx) |
| 7424 |
p.EnterOuterAlt(localctx, 5) |
| 7425 |
{ |
| 7426 |
p.SetState(329) |
| 7427 |
|
| 7428 |
var _m = p.Match(CommandsParserLBRACE) |
| 7429 |
|
| 7430 |
localctx.(*CreateStructContext).op = _m |
| 7431 |
if p.HasError() { |
| 7432 |
// Recognition error - abort rule |
| 7433 |
goto errorExit |
| 7434 |
} |
| 7435 |
} |
| 7436 |
p.SetState(331) |
| 7437 |
p.GetErrorHandler().Sync(p) |
| 7438 |
if p.HasError() { |
| 7439 |
goto errorExit |
| 7440 |
} |
| 7441 |
_la = p.GetTokenStream().LA(1) |
| 7442 |
|
| 7443 |
if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1112171756912640) != 0 { |
| 7444 |
{ |
| 7445 |
p.SetState(330) |
| 7446 |
|
| 7447 |
var _x = p.MapInitializerList() |
| 7448 |
|
| 7449 |
localctx.(*CreateStructContext).entries = _x |
| 7450 |
} |
| 7451 |
|
| 7452 |
} |
| 7453 |
p.SetState(334) |
| 7454 |
p.GetErrorHandler().Sync(p) |
| 7455 |
if p.HasError() { |
| 7456 |
goto errorExit |
| 7457 |
} |
| 7458 |
_la = p.GetTokenStream().LA(1) |
| 7459 |
|
| 7460 |
if _la == CommandsParserCOMMA { |
| 7461 |
{ |
| 7462 |
p.SetState(333) |
| 7463 |
p.Match(CommandsParserCOMMA) |
| 7464 |
if p.HasError() { |
| 7465 |
// Recognition error - abort rule |
| 7466 |
goto errorExit |
| 7467 |
} |
| 7468 |
} |
| 7469 |
|
| 7470 |
} |
| 7471 |
{ |
| 7472 |
p.SetState(336) |
| 7473 |
p.Match(CommandsParserRBRACE) |
| 7474 |
if p.HasError() { |
| 7475 |
// Recognition error - abort rule |
| 7476 |
goto errorExit |
| 7477 |
} |
| 7478 |
} |
| 7479 |
|
| 7480 |
case 6: |
| 7481 |
localctx = NewCreateMessageContext(p, localctx) |
| 7482 |
p.EnterOuterAlt(localctx, 6) |
| 7483 |
p.SetState(338) |
| 7484 |
p.GetErrorHandler().Sync(p) |
| 7485 |
if p.HasError() { |
| 7486 |
goto errorExit |
| 7487 |
} |
| 7488 |
_la = p.GetTokenStream().LA(1) |
| 7489 |
|
| 7490 |
if _la == CommandsParserDOT { |
| 7491 |
{ |
| 7492 |
p.SetState(337) |
| 7493 |
|
| 7494 |
var _m = p.Match(CommandsParserDOT) |
| 7495 |
|
| 7496 |
localctx.(*CreateMessageContext).leadingDot = _m |
| 7497 |
if p.HasError() { |
| 7498 |
// Recognition error - abort rule |
| 7499 |
goto errorExit |
| 7500 |
} |
| 7501 |
} |
| 7502 |
|
| 7503 |
} |
| 7504 |
{ |
| 7505 |
p.SetState(340) |
| 7506 |
|
| 7507 |
var _m = p.Match(CommandsParserIDENTIFIER) |
| 7508 |
|
| 7509 |
localctx.(*CreateMessageContext)._IDENTIFIER = _m |
| 7510 |
if p.HasError() { |
| 7511 |
// Recognition error - abort rule |
| 7512 |
goto errorExit |
| 7513 |
} |
| 7514 |
} |
| 7515 |
localctx.(*CreateMessageContext).ids = append(localctx.(*CreateMessageContext).ids, localctx.(*CreateMessageContext)._IDENTIFIER) |
| 7516 |
p.SetState(345) |
| 7517 |
p.GetErrorHandler().Sync(p) |
| 7518 |
if p.HasError() { |
| 7519 |
goto errorExit |
| 7520 |
} |
| 7521 |
_la = p.GetTokenStream().LA(1) |
| 7522 |
|
| 7523 |
for _la == CommandsParserDOT { |
| 7524 |
{ |
| 7525 |
p.SetState(341) |
| 7526 |
|
| 7527 |
var _m = p.Match(CommandsParserDOT) |
| 7528 |
|
| 7529 |
localctx.(*CreateMessageContext).s29 = _m |
| 7530 |
if p.HasError() { |
| 7531 |
// Recognition error - abort rule |
| 7532 |
goto errorExit |
| 7533 |
} |
| 7534 |
} |
| 7535 |
localctx.(*CreateMessageContext).ops = append(localctx.(*CreateMessageContext).ops, localctx.(*CreateMessageContext).s29) |
| 7536 |
{ |
| 7537 |
p.SetState(342) |
| 7538 |
|
| 7539 |
var _m = p.Match(CommandsParserIDENTIFIER) |
| 7540 |
|
| 7541 |
localctx.(*CreateMessageContext)._IDENTIFIER = _m |
| 7542 |
if p.HasError() { |
| 7543 |
// Recognition error - abort rule |
| 7544 |
goto errorExit |
| 7545 |
} |
| 7546 |
} |
| 7547 |
localctx.(*CreateMessageContext).ids = append(localctx.(*CreateMessageContext).ids, localctx.(*CreateMessageContext)._IDENTIFIER) |
| 7548 |
|
| 7549 |
p.SetState(347) |
| 7550 |
p.GetErrorHandler().Sync(p) |
| 7551 |
if p.HasError() { |
| 7552 |
goto errorExit |
| 7553 |
} |
| 7554 |
_la = p.GetTokenStream().LA(1) |
| 7555 |
} |
| 7556 |
{ |
| 7557 |
p.SetState(348) |
| 7558 |
|
| 7559 |
var _m = p.Match(CommandsParserLBRACE) |
| 7560 |
|
| 7561 |
localctx.(*CreateMessageContext).op = _m |
| 7562 |
if p.HasError() { |
| 7563 |
// Recognition error - abort rule |
| 7564 |
goto errorExit |
| 7565 |
} |
| 7566 |
} |
| 7567 |
p.SetState(350) |
| 7568 |
p.GetErrorHandler().Sync(p) |
| 7569 |
if p.HasError() { |
| 7570 |
goto errorExit |
| 7571 |
} |
| 7572 |
_la = p.GetTokenStream().LA(1) |
| 7573 |
|
| 7574 |
if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1688858450198528) != 0 { |
| 7575 |
{ |
| 7576 |
p.SetState(349) |
| 7577 |
|
| 7578 |
var _x = p.FieldInitializerList() |
| 7579 |
|
| 7580 |
localctx.(*CreateMessageContext).entries = _x |
| 7581 |
} |
| 7582 |
|
| 7583 |
} |
| 7584 |
p.SetState(353) |
| 7585 |
p.GetErrorHandler().Sync(p) |
| 7586 |
if p.HasError() { |
| 7587 |
goto errorExit |
| 7588 |
} |
| 7589 |
_la = p.GetTokenStream().LA(1) |
| 7590 |
|
| 7591 |
if _la == CommandsParserCOMMA { |
| 7592 |
{ |
| 7593 |
p.SetState(352) |
| 7594 |
p.Match(CommandsParserCOMMA) |
| 7595 |
if p.HasError() { |
| 7596 |
// Recognition error - abort rule |
| 7597 |
goto errorExit |
| 7598 |
} |
| 7599 |
} |
| 7600 |
|
| 7601 |
} |
| 7602 |
{ |
| 7603 |
p.SetState(355) |
| 7604 |
p.Match(CommandsParserRBRACE) |
| 7605 |
if p.HasError() { |
| 7606 |
// Recognition error - abort rule |
| 7607 |
goto errorExit |
| 7608 |
} |
| 7609 |
} |
| 7610 |
|
| 7611 |
case 7: |
| 7612 |
localctx = NewConstantLiteralContext(p, localctx) |
| 7613 |
p.EnterOuterAlt(localctx, 7) |
| 7614 |
{ |
| 7615 |
p.SetState(356) |
| 7616 |
p.Literal() |
| 7617 |
} |
| 7618 |
|
| 7619 |
case antlr.ATNInvalidAltNumber: |
| 7620 |
goto errorExit |
| 7621 |
} |
| 7622 |
|
| 7623 |
errorExit: |
| 7624 |
if p.HasError() { |
| 7625 |
v := p.GetError() |
| 7626 |
localctx.SetException(v) |
| 7627 |
p.GetErrorHandler().ReportError(p, v) |
| 7628 |
p.GetErrorHandler().Recover(p, v) |
| 7629 |
p.SetError(nil) |
| 7630 |
} |
| 7631 |
p.ExitRule() |
| 7632 |
return localctx |
| 7633 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 7634 |
} |
| 7635 |
|
| 7636 |
// IExprListContext is an interface to support dynamic dispatch. |
| 7637 |
type IExprListContext interface { |
| 7638 |
antlr.ParserRuleContext |
| 7639 |
|
| 7640 |
// GetParser returns the parser. |
| 7641 |
GetParser() antlr.Parser |
| 7642 |
|
| 7643 |
// Get_expr returns the _expr rule contexts. |
| 7644 |
Get_expr() IExprContext |
| 7645 |
|
| 7646 |
// Set_expr sets the _expr rule contexts. |
| 7647 |
Set_expr(IExprContext) |
| 7648 |
|
| 7649 |
// GetE returns the e rule context list. |
| 7650 |
GetE() []IExprContext |
| 7651 |
|
| 7652 |
// SetE sets the e rule context list. |
| 7653 |
SetE([]IExprContext) |
| 7654 |
|
| 7655 |
// Getter signatures |
| 7656 |
AllExpr() []IExprContext |
| 7657 |
Expr(i int) IExprContext |
| 7658 |
AllCOMMA() []antlr.TerminalNode |
| 7659 |
COMMA(i int) antlr.TerminalNode |
| 7660 |
|
| 7661 |
// IsExprListContext differentiates from other interfaces. |
| 7662 |
IsExprListContext() |
| 7663 |
} |
| 7664 |
|
| 7665 |
type ExprListContext struct { |
| 7666 |
antlr.BaseParserRuleContext |
| 7667 |
parser antlr.Parser |
| 7668 |
_expr IExprContext |
| 7669 |
e []IExprContext |
| 7670 |
} |
| 7671 |
|
| 7672 |
func NewEmptyExprListContext() *ExprListContext { |
| 7673 |
var p = new(ExprListContext) |
| 7674 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 7675 |
p.RuleIndex = CommandsParserRULE_exprList |
| 7676 |
return p |
| 7677 |
} |
| 7678 |
|
| 7679 |
func InitEmptyExprListContext(p *ExprListContext) { |
| 7680 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 7681 |
p.RuleIndex = CommandsParserRULE_exprList |
| 7682 |
} |
| 7683 |
|
| 7684 |
func (*ExprListContext) IsExprListContext() {} |
| 7685 |
|
| 7686 |
func NewExprListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprListContext { |
| 7687 |
var p = new(ExprListContext) |
| 7688 |
|
| 7689 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 7690 |
|
| 7691 |
p.parser = parser |
| 7692 |
p.RuleIndex = CommandsParserRULE_exprList |
| 7693 |
|
| 7694 |
return p |
| 7695 |
} |
| 7696 |
|
| 7697 |
func (s *ExprListContext) GetParser() antlr.Parser { return s.parser } |
| 7698 |
|
| 7699 |
func (s *ExprListContext) Get_expr() IExprContext { return s._expr } |
| 7700 |
|
| 7701 |
func (s *ExprListContext) Set_expr(v IExprContext) { s._expr = v } |
| 7702 |
|
| 7703 |
func (s *ExprListContext) GetE() []IExprContext { return s.e } |
| 7704 |
|
| 7705 |
func (s *ExprListContext) SetE(v []IExprContext) { s.e = v } |
| 7706 |
|
| 7707 |
func (s *ExprListContext) AllExpr() []IExprContext { |
| 7708 |
children := s.GetChildren() |
| 7709 |
len := 0 |
| 7710 |
for _, ctx := range children { |
| 7711 |
if _, ok := ctx.(IExprContext); ok { |
| 7712 |
len++ |
| 7713 |
} |
| 7714 |
} |
| 7715 |
|
| 7716 |
tst := make([]IExprContext, len) |
| 7717 |
i := 0 |
| 7718 |
for _, ctx := range children { |
| 7719 |
if t, ok := ctx.(IExprContext); ok { |
| 7720 |
tst[i] = t.(IExprContext) |
| 7721 |
i++ |
| 7722 |
} |
| 7723 |
} |
| 7724 |
|
| 7725 |
return tst |
| 7726 |
} |
| 7727 |
|
| 7728 |
func (s *ExprListContext) Expr(i int) IExprContext { |
| 7729 |
var t antlr.RuleContext |
| 7730 |
j := 0 |
| 7731 |
for _, ctx := range s.GetChildren() { |
| 7732 |
if _, ok := ctx.(IExprContext); ok { |
| 7733 |
if j == i { |
| 7734 |
t = ctx.(antlr.RuleContext) |
| 7735 |
break |
| 7736 |
} |
| 7737 |
j++ |
| 7738 |
} |
| 7739 |
} |
| 7740 |
|
| 7741 |
if t == nil { |
| 7742 |
return nil |
| 7743 |
} |
| 7744 |
|
| 7745 |
return t.(IExprContext) |
| 7746 |
} |
| 7747 |
|
| 7748 |
func (s *ExprListContext) AllCOMMA() []antlr.TerminalNode { |
| 7749 |
return s.GetTokens(CommandsParserCOMMA) |
| 7750 |
} |
| 7751 |
|
| 7752 |
func (s *ExprListContext) COMMA(i int) antlr.TerminalNode { |
| 7753 |
return s.GetToken(CommandsParserCOMMA, i) |
| 7754 |
} |
| 7755 |
|
| 7756 |
func (s *ExprListContext) GetRuleContext() antlr.RuleContext { |
| 7757 |
return s |
| 7758 |
} |
| 7759 |
|
| 7760 |
func (s *ExprListContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 7761 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 7762 |
} |
| 7763 |
|
| 7764 |
func (s *ExprListContext) EnterRule(listener antlr.ParseTreeListener) { |
| 7765 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 7766 |
listenerT.EnterExprList(s) |
| 7767 |
} |
| 7768 |
} |
| 7769 |
|
| 7770 |
func (s *ExprListContext) ExitRule(listener antlr.ParseTreeListener) { |
| 7771 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 7772 |
listenerT.ExitExprList(s) |
| 7773 |
} |
| 7774 |
} |
| 7775 |
|
| 7776 |
func (s *ExprListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 7777 |
switch t := visitor.(type) { |
| 7778 |
case CommandsVisitor: |
| 7779 |
return t.VisitExprList(s) |
| 7780 |
|
| 7781 |
default: |
| 7782 |
return t.VisitChildren(s) |
| 7783 |
} |
| 7784 |
} |
| 7785 |
|
| 7786 |
func (p *CommandsParser) ExprList() (localctx IExprListContext) { |
| 7787 |
localctx = NewExprListContext(p, p.GetParserRuleContext(), p.GetState()) |
| 7788 |
p.EnterRule(localctx, 56, CommandsParserRULE_exprList) |
| 7789 |
var _la int |
| 7790 |
|
| 7791 |
p.EnterOuterAlt(localctx, 1) |
| 7792 |
{ |
| 7793 |
p.SetState(359) |
| 7794 |
|
| 7795 |
var _x = p.Expr() |
| 7796 |
|
| 7797 |
localctx.(*ExprListContext)._expr = _x |
| 7798 |
} |
| 7799 |
localctx.(*ExprListContext).e = append(localctx.(*ExprListContext).e, localctx.(*ExprListContext)._expr) |
| 7800 |
p.SetState(364) |
| 7801 |
p.GetErrorHandler().Sync(p) |
| 7802 |
if p.HasError() { |
| 7803 |
goto errorExit |
| 7804 |
} |
| 7805 |
_la = p.GetTokenStream().LA(1) |
| 7806 |
|
| 7807 |
for _la == CommandsParserCOMMA { |
| 7808 |
{ |
| 7809 |
p.SetState(360) |
| 7810 |
p.Match(CommandsParserCOMMA) |
| 7811 |
if p.HasError() { |
| 7812 |
// Recognition error - abort rule |
| 7813 |
goto errorExit |
| 7814 |
} |
| 7815 |
} |
| 7816 |
{ |
| 7817 |
p.SetState(361) |
| 7818 |
|
| 7819 |
var _x = p.Expr() |
| 7820 |
|
| 7821 |
localctx.(*ExprListContext)._expr = _x |
| 7822 |
} |
| 7823 |
localctx.(*ExprListContext).e = append(localctx.(*ExprListContext).e, localctx.(*ExprListContext)._expr) |
| 7824 |
|
| 7825 |
p.SetState(366) |
| 7826 |
p.GetErrorHandler().Sync(p) |
| 7827 |
if p.HasError() { |
| 7828 |
goto errorExit |
| 7829 |
} |
| 7830 |
_la = p.GetTokenStream().LA(1) |
| 7831 |
} |
| 7832 |
|
| 7833 |
errorExit: |
| 7834 |
if p.HasError() { |
| 7835 |
v := p.GetError() |
| 7836 |
localctx.SetException(v) |
| 7837 |
p.GetErrorHandler().ReportError(p, v) |
| 7838 |
p.GetErrorHandler().Recover(p, v) |
| 7839 |
p.SetError(nil) |
| 7840 |
} |
| 7841 |
p.ExitRule() |
| 7842 |
return localctx |
| 7843 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 7844 |
} |
| 7845 |
|
| 7846 |
// IListInitContext is an interface to support dynamic dispatch. |
| 7847 |
type IListInitContext interface { |
| 7848 |
antlr.ParserRuleContext |
| 7849 |
|
| 7850 |
// GetParser returns the parser. |
| 7851 |
GetParser() antlr.Parser |
| 7852 |
|
| 7853 |
// Get_optExpr returns the _optExpr rule contexts. |
| 7854 |
Get_optExpr() IOptExprContext |
| 7855 |
|
| 7856 |
// Set_optExpr sets the _optExpr rule contexts. |
| 7857 |
Set_optExpr(IOptExprContext) |
| 7858 |
|
| 7859 |
// GetElems returns the elems rule context list. |
| 7860 |
GetElems() []IOptExprContext |
| 7861 |
|
| 7862 |
// SetElems sets the elems rule context list. |
| 7863 |
SetElems([]IOptExprContext) |
| 7864 |
|
| 7865 |
// Getter signatures |
| 7866 |
AllOptExpr() []IOptExprContext |
| 7867 |
OptExpr(i int) IOptExprContext |
| 7868 |
AllCOMMA() []antlr.TerminalNode |
| 7869 |
COMMA(i int) antlr.TerminalNode |
| 7870 |
|
| 7871 |
// IsListInitContext differentiates from other interfaces. |
| 7872 |
IsListInitContext() |
| 7873 |
} |
| 7874 |
|
| 7875 |
type ListInitContext struct { |
| 7876 |
antlr.BaseParserRuleContext |
| 7877 |
parser antlr.Parser |
| 7878 |
_optExpr IOptExprContext |
| 7879 |
elems []IOptExprContext |
| 7880 |
} |
| 7881 |
|
| 7882 |
func NewEmptyListInitContext() *ListInitContext { |
| 7883 |
var p = new(ListInitContext) |
| 7884 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 7885 |
p.RuleIndex = CommandsParserRULE_listInit |
| 7886 |
return p |
| 7887 |
} |
| 7888 |
|
| 7889 |
func InitEmptyListInitContext(p *ListInitContext) { |
| 7890 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 7891 |
p.RuleIndex = CommandsParserRULE_listInit |
| 7892 |
} |
| 7893 |
|
| 7894 |
func (*ListInitContext) IsListInitContext() {} |
| 7895 |
|
| 7896 |
func NewListInitContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ListInitContext { |
| 7897 |
var p = new(ListInitContext) |
| 7898 |
|
| 7899 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 7900 |
|
| 7901 |
p.parser = parser |
| 7902 |
p.RuleIndex = CommandsParserRULE_listInit |
| 7903 |
|
| 7904 |
return p |
| 7905 |
} |
| 7906 |
|
| 7907 |
func (s *ListInitContext) GetParser() antlr.Parser { return s.parser } |
| 7908 |
|
| 7909 |
func (s *ListInitContext) Get_optExpr() IOptExprContext { return s._optExpr } |
| 7910 |
|
| 7911 |
func (s *ListInitContext) Set_optExpr(v IOptExprContext) { s._optExpr = v } |
| 7912 |
|
| 7913 |
func (s *ListInitContext) GetElems() []IOptExprContext { return s.elems } |
| 7914 |
|
| 7915 |
func (s *ListInitContext) SetElems(v []IOptExprContext) { s.elems = v } |
| 7916 |
|
| 7917 |
func (s *ListInitContext) AllOptExpr() []IOptExprContext { |
| 7918 |
children := s.GetChildren() |
| 7919 |
len := 0 |
| 7920 |
for _, ctx := range children { |
| 7921 |
if _, ok := ctx.(IOptExprContext); ok { |
| 7922 |
len++ |
| 7923 |
} |
| 7924 |
} |
| 7925 |
|
| 7926 |
tst := make([]IOptExprContext, len) |
| 7927 |
i := 0 |
| 7928 |
for _, ctx := range children { |
| 7929 |
if t, ok := ctx.(IOptExprContext); ok { |
| 7930 |
tst[i] = t.(IOptExprContext) |
| 7931 |
i++ |
| 7932 |
} |
| 7933 |
} |
| 7934 |
|
| 7935 |
return tst |
| 7936 |
} |
| 7937 |
|
| 7938 |
func (s *ListInitContext) OptExpr(i int) IOptExprContext { |
| 7939 |
var t antlr.RuleContext |
| 7940 |
j := 0 |
| 7941 |
for _, ctx := range s.GetChildren() { |
| 7942 |
if _, ok := ctx.(IOptExprContext); ok { |
| 7943 |
if j == i { |
| 7944 |
t = ctx.(antlr.RuleContext) |
| 7945 |
break |
| 7946 |
} |
| 7947 |
j++ |
| 7948 |
} |
| 7949 |
} |
| 7950 |
|
| 7951 |
if t == nil { |
| 7952 |
return nil |
| 7953 |
} |
| 7954 |
|
| 7955 |
return t.(IOptExprContext) |
| 7956 |
} |
| 7957 |
|
| 7958 |
func (s *ListInitContext) AllCOMMA() []antlr.TerminalNode { |
| 7959 |
return s.GetTokens(CommandsParserCOMMA) |
| 7960 |
} |
| 7961 |
|
| 7962 |
func (s *ListInitContext) COMMA(i int) antlr.TerminalNode { |
| 7963 |
return s.GetToken(CommandsParserCOMMA, i) |
| 7964 |
} |
| 7965 |
|
| 7966 |
func (s *ListInitContext) GetRuleContext() antlr.RuleContext { |
| 7967 |
return s |
| 7968 |
} |
| 7969 |
|
| 7970 |
func (s *ListInitContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 7971 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 7972 |
} |
| 7973 |
|
| 7974 |
func (s *ListInitContext) EnterRule(listener antlr.ParseTreeListener) { |
| 7975 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 7976 |
listenerT.EnterListInit(s) |
| 7977 |
} |
| 7978 |
} |
| 7979 |
|
| 7980 |
func (s *ListInitContext) ExitRule(listener antlr.ParseTreeListener) { |
| 7981 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 7982 |
listenerT.ExitListInit(s) |
| 7983 |
} |
| 7984 |
} |
| 7985 |
|
| 7986 |
func (s *ListInitContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 7987 |
switch t := visitor.(type) { |
| 7988 |
case CommandsVisitor: |
| 7989 |
return t.VisitListInit(s) |
| 7990 |
|
| 7991 |
default: |
| 7992 |
return t.VisitChildren(s) |
| 7993 |
} |
| 7994 |
} |
| 7995 |
|
| 7996 |
func (p *CommandsParser) ListInit() (localctx IListInitContext) { |
| 7997 |
localctx = NewListInitContext(p, p.GetParserRuleContext(), p.GetState()) |
| 7998 |
p.EnterRule(localctx, 58, CommandsParserRULE_listInit) |
| 7999 |
var _alt int |
| 8000 |
|
| 8001 |
p.EnterOuterAlt(localctx, 1) |
| 8002 |
{ |
| 8003 |
p.SetState(367) |
| 8004 |
|
| 8005 |
var _x = p.OptExpr() |
| 8006 |
|
| 8007 |
localctx.(*ListInitContext)._optExpr = _x |
| 8008 |
} |
| 8009 |
localctx.(*ListInitContext).elems = append(localctx.(*ListInitContext).elems, localctx.(*ListInitContext)._optExpr) |
| 8010 |
p.SetState(372) |
| 8011 |
p.GetErrorHandler().Sync(p) |
| 8012 |
if p.HasError() { |
| 8013 |
goto errorExit |
| 8014 |
} |
| 8015 |
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 46, p.GetParserRuleContext()) |
| 8016 |
if p.HasError() { |
| 8017 |
goto errorExit |
| 8018 |
} |
| 8019 |
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { |
| 8020 |
if _alt == 1 { |
| 8021 |
{ |
| 8022 |
p.SetState(368) |
| 8023 |
p.Match(CommandsParserCOMMA) |
| 8024 |
if p.HasError() { |
| 8025 |
// Recognition error - abort rule |
| 8026 |
goto errorExit |
| 8027 |
} |
| 8028 |
} |
| 8029 |
{ |
| 8030 |
p.SetState(369) |
| 8031 |
|
| 8032 |
var _x = p.OptExpr() |
| 8033 |
|
| 8034 |
localctx.(*ListInitContext)._optExpr = _x |
| 8035 |
} |
| 8036 |
localctx.(*ListInitContext).elems = append(localctx.(*ListInitContext).elems, localctx.(*ListInitContext)._optExpr) |
| 8037 |
|
| 8038 |
} |
| 8039 |
p.SetState(374) |
| 8040 |
p.GetErrorHandler().Sync(p) |
| 8041 |
if p.HasError() { |
| 8042 |
goto errorExit |
| 8043 |
} |
| 8044 |
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 46, p.GetParserRuleContext()) |
| 8045 |
if p.HasError() { |
| 8046 |
goto errorExit |
| 8047 |
} |
| 8048 |
} |
| 8049 |
|
| 8050 |
errorExit: |
| 8051 |
if p.HasError() { |
| 8052 |
v := p.GetError() |
| 8053 |
localctx.SetException(v) |
| 8054 |
p.GetErrorHandler().ReportError(p, v) |
| 8055 |
p.GetErrorHandler().Recover(p, v) |
| 8056 |
p.SetError(nil) |
| 8057 |
} |
| 8058 |
p.ExitRule() |
| 8059 |
return localctx |
| 8060 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 8061 |
} |
| 8062 |
|
| 8063 |
// IFieldInitializerListContext is an interface to support dynamic dispatch. |
| 8064 |
type IFieldInitializerListContext interface { |
| 8065 |
antlr.ParserRuleContext |
| 8066 |
|
| 8067 |
// GetParser returns the parser. |
| 8068 |
GetParser() antlr.Parser |
| 8069 |
|
| 8070 |
// GetS34 returns the s34 token. |
| 8071 |
GetS34() antlr.Token |
| 8072 |
|
| 8073 |
// SetS34 sets the s34 token. |
| 8074 |
SetS34(antlr.Token) |
| 8075 |
|
| 8076 |
// GetCols returns the cols token list. |
| 8077 |
GetCols() []antlr.Token |
| 8078 |
|
| 8079 |
// SetCols sets the cols token list. |
| 8080 |
SetCols([]antlr.Token) |
| 8081 |
|
| 8082 |
// Get_optField returns the _optField rule contexts. |
| 8083 |
Get_optField() IOptFieldContext |
| 8084 |
|
| 8085 |
// Get_expr returns the _expr rule contexts. |
| 8086 |
Get_expr() IExprContext |
| 8087 |
|
| 8088 |
// Set_optField sets the _optField rule contexts. |
| 8089 |
Set_optField(IOptFieldContext) |
| 8090 |
|
| 8091 |
// Set_expr sets the _expr rule contexts. |
| 8092 |
Set_expr(IExprContext) |
| 8093 |
|
| 8094 |
// GetFields returns the fields rule context list. |
| 8095 |
GetFields() []IOptFieldContext |
| 8096 |
|
| 8097 |
// GetValues returns the values rule context list. |
| 8098 |
GetValues() []IExprContext |
| 8099 |
|
| 8100 |
// SetFields sets the fields rule context list. |
| 8101 |
SetFields([]IOptFieldContext) |
| 8102 |
|
| 8103 |
// SetValues sets the values rule context list. |
| 8104 |
SetValues([]IExprContext) |
| 8105 |
|
| 8106 |
// Getter signatures |
| 8107 |
AllOptField() []IOptFieldContext |
| 8108 |
OptField(i int) IOptFieldContext |
| 8109 |
AllCOLON() []antlr.TerminalNode |
| 8110 |
COLON(i int) antlr.TerminalNode |
| 8111 |
AllExpr() []IExprContext |
| 8112 |
Expr(i int) IExprContext |
| 8113 |
AllCOMMA() []antlr.TerminalNode |
| 8114 |
COMMA(i int) antlr.TerminalNode |
| 8115 |
|
| 8116 |
// IsFieldInitializerListContext differentiates from other interfaces. |
| 8117 |
IsFieldInitializerListContext() |
| 8118 |
} |
| 8119 |
|
| 8120 |
type FieldInitializerListContext struct { |
| 8121 |
antlr.BaseParserRuleContext |
| 8122 |
parser antlr.Parser |
| 8123 |
_optField IOptFieldContext |
| 8124 |
fields []IOptFieldContext |
| 8125 |
s34 antlr.Token |
| 8126 |
cols []antlr.Token |
| 8127 |
_expr IExprContext |
| 8128 |
values []IExprContext |
| 8129 |
} |
| 8130 |
|
| 8131 |
func NewEmptyFieldInitializerListContext() *FieldInitializerListContext { |
| 8132 |
var p = new(FieldInitializerListContext) |
| 8133 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 8134 |
p.RuleIndex = CommandsParserRULE_fieldInitializerList |
| 8135 |
return p |
| 8136 |
} |
| 8137 |
|
| 8138 |
func InitEmptyFieldInitializerListContext(p *FieldInitializerListContext) { |
| 8139 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 8140 |
p.RuleIndex = CommandsParserRULE_fieldInitializerList |
| 8141 |
} |
| 8142 |
|
| 8143 |
func (*FieldInitializerListContext) IsFieldInitializerListContext() {} |
| 8144 |
|
| 8145 |
func NewFieldInitializerListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FieldInitializerListContext { |
| 8146 |
var p = new(FieldInitializerListContext) |
| 8147 |
|
| 8148 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 8149 |
|
| 8150 |
p.parser = parser |
| 8151 |
p.RuleIndex = CommandsParserRULE_fieldInitializerList |
| 8152 |
|
| 8153 |
return p |
| 8154 |
} |
| 8155 |
|
| 8156 |
func (s *FieldInitializerListContext) GetParser() antlr.Parser { return s.parser } |
| 8157 |
|
| 8158 |
func (s *FieldInitializerListContext) GetS34() antlr.Token { return s.s34 } |
| 8159 |
|
| 8160 |
func (s *FieldInitializerListContext) SetS34(v antlr.Token) { s.s34 = v } |
| 8161 |
|
| 8162 |
func (s *FieldInitializerListContext) GetCols() []antlr.Token { return s.cols } |
| 8163 |
|
| 8164 |
func (s *FieldInitializerListContext) SetCols(v []antlr.Token) { s.cols = v } |
| 8165 |
|
| 8166 |
func (s *FieldInitializerListContext) Get_optField() IOptFieldContext { return s._optField } |
| 8167 |
|
| 8168 |
func (s *FieldInitializerListContext) Get_expr() IExprContext { return s._expr } |
| 8169 |
|
| 8170 |
func (s *FieldInitializerListContext) Set_optField(v IOptFieldContext) { s._optField = v } |
| 8171 |
|
| 8172 |
func (s *FieldInitializerListContext) Set_expr(v IExprContext) { s._expr = v } |
| 8173 |
|
| 8174 |
func (s *FieldInitializerListContext) GetFields() []IOptFieldContext { return s.fields } |
| 8175 |
|
| 8176 |
func (s *FieldInitializerListContext) GetValues() []IExprContext { return s.values } |
| 8177 |
|
| 8178 |
func (s *FieldInitializerListContext) SetFields(v []IOptFieldContext) { s.fields = v } |
| 8179 |
|
| 8180 |
func (s *FieldInitializerListContext) SetValues(v []IExprContext) { s.values = v } |
| 8181 |
|
| 8182 |
func (s *FieldInitializerListContext) AllOptField() []IOptFieldContext { |
| 8183 |
children := s.GetChildren() |
| 8184 |
len := 0 |
| 8185 |
for _, ctx := range children { |
| 8186 |
if _, ok := ctx.(IOptFieldContext); ok { |
| 8187 |
len++ |
| 8188 |
} |
| 8189 |
} |
| 8190 |
|
| 8191 |
tst := make([]IOptFieldContext, len) |
| 8192 |
i := 0 |
| 8193 |
for _, ctx := range children { |
| 8194 |
if t, ok := ctx.(IOptFieldContext); ok { |
| 8195 |
tst[i] = t.(IOptFieldContext) |
| 8196 |
i++ |
| 8197 |
} |
| 8198 |
} |
| 8199 |
|
| 8200 |
return tst |
| 8201 |
} |
| 8202 |
|
| 8203 |
func (s *FieldInitializerListContext) OptField(i int) IOptFieldContext { |
| 8204 |
var t antlr.RuleContext |
| 8205 |
j := 0 |
| 8206 |
for _, ctx := range s.GetChildren() { |
| 8207 |
if _, ok := ctx.(IOptFieldContext); ok { |
| 8208 |
if j == i { |
| 8209 |
t = ctx.(antlr.RuleContext) |
| 8210 |
break |
| 8211 |
} |
| 8212 |
j++ |
| 8213 |
} |
| 8214 |
} |
| 8215 |
|
| 8216 |
if t == nil { |
| 8217 |
return nil |
| 8218 |
} |
| 8219 |
|
| 8220 |
return t.(IOptFieldContext) |
| 8221 |
} |
| 8222 |
|
| 8223 |
func (s *FieldInitializerListContext) AllCOLON() []antlr.TerminalNode { |
| 8224 |
return s.GetTokens(CommandsParserCOLON) |
| 8225 |
} |
| 8226 |
|
| 8227 |
func (s *FieldInitializerListContext) COLON(i int) antlr.TerminalNode { |
| 8228 |
return s.GetToken(CommandsParserCOLON, i) |
| 8229 |
} |
| 8230 |
|
| 8231 |
func (s *FieldInitializerListContext) AllExpr() []IExprContext { |
| 8232 |
children := s.GetChildren() |
| 8233 |
len := 0 |
| 8234 |
for _, ctx := range children { |
| 8235 |
if _, ok := ctx.(IExprContext); ok { |
| 8236 |
len++ |
| 8237 |
} |
| 8238 |
} |
| 8239 |
|
| 8240 |
tst := make([]IExprContext, len) |
| 8241 |
i := 0 |
| 8242 |
for _, ctx := range children { |
| 8243 |
if t, ok := ctx.(IExprContext); ok { |
| 8244 |
tst[i] = t.(IExprContext) |
| 8245 |
i++ |
| 8246 |
} |
| 8247 |
} |
| 8248 |
|
| 8249 |
return tst |
| 8250 |
} |
| 8251 |
|
| 8252 |
func (s *FieldInitializerListContext) Expr(i int) IExprContext { |
| 8253 |
var t antlr.RuleContext |
| 8254 |
j := 0 |
| 8255 |
for _, ctx := range s.GetChildren() { |
| 8256 |
if _, ok := ctx.(IExprContext); ok { |
| 8257 |
if j == i { |
| 8258 |
t = ctx.(antlr.RuleContext) |
| 8259 |
break |
| 8260 |
} |
| 8261 |
j++ |
| 8262 |
} |
| 8263 |
} |
| 8264 |
|
| 8265 |
if t == nil { |
| 8266 |
return nil |
| 8267 |
} |
| 8268 |
|
| 8269 |
return t.(IExprContext) |
| 8270 |
} |
| 8271 |
|
| 8272 |
func (s *FieldInitializerListContext) AllCOMMA() []antlr.TerminalNode { |
| 8273 |
return s.GetTokens(CommandsParserCOMMA) |
| 8274 |
} |
| 8275 |
|
| 8276 |
func (s *FieldInitializerListContext) COMMA(i int) antlr.TerminalNode { |
| 8277 |
return s.GetToken(CommandsParserCOMMA, i) |
| 8278 |
} |
| 8279 |
|
| 8280 |
func (s *FieldInitializerListContext) GetRuleContext() antlr.RuleContext { |
| 8281 |
return s |
| 8282 |
} |
| 8283 |
|
| 8284 |
func (s *FieldInitializerListContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 8285 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 8286 |
} |
| 8287 |
|
| 8288 |
func (s *FieldInitializerListContext) EnterRule(listener antlr.ParseTreeListener) { |
| 8289 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 8290 |
listenerT.EnterFieldInitializerList(s) |
| 8291 |
} |
| 8292 |
} |
| 8293 |
|
| 8294 |
func (s *FieldInitializerListContext) ExitRule(listener antlr.ParseTreeListener) { |
| 8295 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 8296 |
listenerT.ExitFieldInitializerList(s) |
| 8297 |
} |
| 8298 |
} |
| 8299 |
|
| 8300 |
func (s *FieldInitializerListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 8301 |
switch t := visitor.(type) { |
| 8302 |
case CommandsVisitor: |
| 8303 |
return t.VisitFieldInitializerList(s) |
| 8304 |
|
| 8305 |
default: |
| 8306 |
return t.VisitChildren(s) |
| 8307 |
} |
| 8308 |
} |
| 8309 |
|
| 8310 |
func (p *CommandsParser) FieldInitializerList() (localctx IFieldInitializerListContext) { |
| 8311 |
localctx = NewFieldInitializerListContext(p, p.GetParserRuleContext(), p.GetState()) |
| 8312 |
p.EnterRule(localctx, 60, CommandsParserRULE_fieldInitializerList) |
| 8313 |
var _alt int |
| 8314 |
|
| 8315 |
p.EnterOuterAlt(localctx, 1) |
| 8316 |
{ |
| 8317 |
p.SetState(375) |
| 8318 |
|
| 8319 |
var _x = p.OptField() |
| 8320 |
|
| 8321 |
localctx.(*FieldInitializerListContext)._optField = _x |
| 8322 |
} |
| 8323 |
localctx.(*FieldInitializerListContext).fields = append(localctx.(*FieldInitializerListContext).fields, localctx.(*FieldInitializerListContext)._optField) |
| 8324 |
{ |
| 8325 |
p.SetState(376) |
| 8326 |
|
| 8327 |
var _m = p.Match(CommandsParserCOLON) |
| 8328 |
|
| 8329 |
localctx.(*FieldInitializerListContext).s34 = _m |
| 8330 |
if p.HasError() { |
| 8331 |
// Recognition error - abort rule |
| 8332 |
goto errorExit |
| 8333 |
} |
| 8334 |
} |
| 8335 |
localctx.(*FieldInitializerListContext).cols = append(localctx.(*FieldInitializerListContext).cols, localctx.(*FieldInitializerListContext).s34) |
| 8336 |
{ |
| 8337 |
p.SetState(377) |
| 8338 |
|
| 8339 |
var _x = p.Expr() |
| 8340 |
|
| 8341 |
localctx.(*FieldInitializerListContext)._expr = _x |
| 8342 |
} |
| 8343 |
localctx.(*FieldInitializerListContext).values = append(localctx.(*FieldInitializerListContext).values, localctx.(*FieldInitializerListContext)._expr) |
| 8344 |
p.SetState(385) |
| 8345 |
p.GetErrorHandler().Sync(p) |
| 8346 |
if p.HasError() { |
| 8347 |
goto errorExit |
| 8348 |
} |
| 8349 |
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 47, p.GetParserRuleContext()) |
| 8350 |
if p.HasError() { |
| 8351 |
goto errorExit |
| 8352 |
} |
| 8353 |
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { |
| 8354 |
if _alt == 1 { |
| 8355 |
{ |
| 8356 |
p.SetState(378) |
| 8357 |
p.Match(CommandsParserCOMMA) |
| 8358 |
if p.HasError() { |
| 8359 |
// Recognition error - abort rule |
| 8360 |
goto errorExit |
| 8361 |
} |
| 8362 |
} |
| 8363 |
{ |
| 8364 |
p.SetState(379) |
| 8365 |
|
| 8366 |
var _x = p.OptField() |
| 8367 |
|
| 8368 |
localctx.(*FieldInitializerListContext)._optField = _x |
| 8369 |
} |
| 8370 |
localctx.(*FieldInitializerListContext).fields = append(localctx.(*FieldInitializerListContext).fields, localctx.(*FieldInitializerListContext)._optField) |
| 8371 |
{ |
| 8372 |
p.SetState(380) |
| 8373 |
|
| 8374 |
var _m = p.Match(CommandsParserCOLON) |
| 8375 |
|
| 8376 |
localctx.(*FieldInitializerListContext).s34 = _m |
| 8377 |
if p.HasError() { |
| 8378 |
// Recognition error - abort rule |
| 8379 |
goto errorExit |
| 8380 |
} |
| 8381 |
} |
| 8382 |
localctx.(*FieldInitializerListContext).cols = append(localctx.(*FieldInitializerListContext).cols, localctx.(*FieldInitializerListContext).s34) |
| 8383 |
{ |
| 8384 |
p.SetState(381) |
| 8385 |
|
| 8386 |
var _x = p.Expr() |
| 8387 |
|
| 8388 |
localctx.(*FieldInitializerListContext)._expr = _x |
| 8389 |
} |
| 8390 |
localctx.(*FieldInitializerListContext).values = append(localctx.(*FieldInitializerListContext).values, localctx.(*FieldInitializerListContext)._expr) |
| 8391 |
|
| 8392 |
} |
| 8393 |
p.SetState(387) |
| 8394 |
p.GetErrorHandler().Sync(p) |
| 8395 |
if p.HasError() { |
| 8396 |
goto errorExit |
| 8397 |
} |
| 8398 |
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 47, p.GetParserRuleContext()) |
| 8399 |
if p.HasError() { |
| 8400 |
goto errorExit |
| 8401 |
} |
| 8402 |
} |
| 8403 |
|
| 8404 |
errorExit: |
| 8405 |
if p.HasError() { |
| 8406 |
v := p.GetError() |
| 8407 |
localctx.SetException(v) |
| 8408 |
p.GetErrorHandler().ReportError(p, v) |
| 8409 |
p.GetErrorHandler().Recover(p, v) |
| 8410 |
p.SetError(nil) |
| 8411 |
} |
| 8412 |
p.ExitRule() |
| 8413 |
return localctx |
| 8414 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 8415 |
} |
| 8416 |
|
| 8417 |
// IOptFieldContext is an interface to support dynamic dispatch. |
| 8418 |
type IOptFieldContext interface { |
| 8419 |
antlr.ParserRuleContext |
| 8420 |
|
| 8421 |
// GetParser returns the parser. |
| 8422 |
GetParser() antlr.Parser |
| 8423 |
|
| 8424 |
// GetOpt returns the opt token. |
| 8425 |
GetOpt() antlr.Token |
| 8426 |
|
| 8427 |
// SetOpt sets the opt token. |
| 8428 |
SetOpt(antlr.Token) |
| 8429 |
|
| 8430 |
// Getter signatures |
| 8431 |
EscapeIdent() IEscapeIdentContext |
| 8432 |
QUESTIONMARK() antlr.TerminalNode |
| 8433 |
|
| 8434 |
// IsOptFieldContext differentiates from other interfaces. |
| 8435 |
IsOptFieldContext() |
| 8436 |
} |
| 8437 |
|
| 8438 |
type OptFieldContext struct { |
| 8439 |
antlr.BaseParserRuleContext |
| 8440 |
parser antlr.Parser |
| 8441 |
opt antlr.Token |
| 8442 |
} |
| 8443 |
|
| 8444 |
func NewEmptyOptFieldContext() *OptFieldContext { |
| 8445 |
var p = new(OptFieldContext) |
| 8446 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 8447 |
p.RuleIndex = CommandsParserRULE_optField |
| 8448 |
return p |
| 8449 |
} |
| 8450 |
|
| 8451 |
func InitEmptyOptFieldContext(p *OptFieldContext) { |
| 8452 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 8453 |
p.RuleIndex = CommandsParserRULE_optField |
| 8454 |
} |
| 8455 |
|
| 8456 |
func (*OptFieldContext) IsOptFieldContext() {} |
| 8457 |
|
| 8458 |
func NewOptFieldContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OptFieldContext { |
| 8459 |
var p = new(OptFieldContext) |
| 8460 |
|
| 8461 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 8462 |
|
| 8463 |
p.parser = parser |
| 8464 |
p.RuleIndex = CommandsParserRULE_optField |
| 8465 |
|
| 8466 |
return p |
| 8467 |
} |
| 8468 |
|
| 8469 |
func (s *OptFieldContext) GetParser() antlr.Parser { return s.parser } |
| 8470 |
|
| 8471 |
func (s *OptFieldContext) GetOpt() antlr.Token { return s.opt } |
| 8472 |
|
| 8473 |
func (s *OptFieldContext) SetOpt(v antlr.Token) { s.opt = v } |
| 8474 |
|
| 8475 |
func (s *OptFieldContext) EscapeIdent() IEscapeIdentContext { |
| 8476 |
var t antlr.RuleContext |
| 8477 |
for _, ctx := range s.GetChildren() { |
| 8478 |
if _, ok := ctx.(IEscapeIdentContext); ok { |
| 8479 |
t = ctx.(antlr.RuleContext) |
| 8480 |
break |
| 8481 |
} |
| 8482 |
} |
| 8483 |
|
| 8484 |
if t == nil { |
| 8485 |
return nil |
| 8486 |
} |
| 8487 |
|
| 8488 |
return t.(IEscapeIdentContext) |
| 8489 |
} |
| 8490 |
|
| 8491 |
func (s *OptFieldContext) QUESTIONMARK() antlr.TerminalNode { |
| 8492 |
return s.GetToken(CommandsParserQUESTIONMARK, 0) |
| 8493 |
} |
| 8494 |
|
| 8495 |
func (s *OptFieldContext) GetRuleContext() antlr.RuleContext { |
| 8496 |
return s |
| 8497 |
} |
| 8498 |
|
| 8499 |
func (s *OptFieldContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 8500 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 8501 |
} |
| 8502 |
|
| 8503 |
func (s *OptFieldContext) EnterRule(listener antlr.ParseTreeListener) { |
| 8504 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 8505 |
listenerT.EnterOptField(s) |
| 8506 |
} |
| 8507 |
} |
| 8508 |
|
| 8509 |
func (s *OptFieldContext) ExitRule(listener antlr.ParseTreeListener) { |
| 8510 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 8511 |
listenerT.ExitOptField(s) |
| 8512 |
} |
| 8513 |
} |
| 8514 |
|
| 8515 |
func (s *OptFieldContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 8516 |
switch t := visitor.(type) { |
| 8517 |
case CommandsVisitor: |
| 8518 |
return t.VisitOptField(s) |
| 8519 |
|
| 8520 |
default: |
| 8521 |
return t.VisitChildren(s) |
| 8522 |
} |
| 8523 |
} |
| 8524 |
|
| 8525 |
func (p *CommandsParser) OptField() (localctx IOptFieldContext) { |
| 8526 |
localctx = NewOptFieldContext(p, p.GetParserRuleContext(), p.GetState()) |
| 8527 |
p.EnterRule(localctx, 62, CommandsParserRULE_optField) |
| 8528 |
var _la int |
| 8529 |
|
| 8530 |
p.EnterOuterAlt(localctx, 1) |
| 8531 |
p.SetState(389) |
| 8532 |
p.GetErrorHandler().Sync(p) |
| 8533 |
if p.HasError() { |
| 8534 |
goto errorExit |
| 8535 |
} |
| 8536 |
_la = p.GetTokenStream().LA(1) |
| 8537 |
|
| 8538 |
if _la == CommandsParserQUESTIONMARK { |
| 8539 |
{ |
| 8540 |
p.SetState(388) |
| 8541 |
|
| 8542 |
var _m = p.Match(CommandsParserQUESTIONMARK) |
| 8543 |
|
| 8544 |
localctx.(*OptFieldContext).opt = _m |
| 8545 |
if p.HasError() { |
| 8546 |
// Recognition error - abort rule |
| 8547 |
goto errorExit |
| 8548 |
} |
| 8549 |
} |
| 8550 |
|
| 8551 |
} |
| 8552 |
{ |
| 8553 |
p.SetState(391) |
| 8554 |
p.EscapeIdent() |
| 8555 |
} |
| 8556 |
|
| 8557 |
errorExit: |
| 8558 |
if p.HasError() { |
| 8559 |
v := p.GetError() |
| 8560 |
localctx.SetException(v) |
| 8561 |
p.GetErrorHandler().ReportError(p, v) |
| 8562 |
p.GetErrorHandler().Recover(p, v) |
| 8563 |
p.SetError(nil) |
| 8564 |
} |
| 8565 |
p.ExitRule() |
| 8566 |
return localctx |
| 8567 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 8568 |
} |
| 8569 |
|
| 8570 |
// IMapInitializerListContext is an interface to support dynamic dispatch. |
| 8571 |
type IMapInitializerListContext interface { |
| 8572 |
antlr.ParserRuleContext |
| 8573 |
|
| 8574 |
// GetParser returns the parser. |
| 8575 |
GetParser() antlr.Parser |
| 8576 |
|
| 8577 |
// GetS34 returns the s34 token. |
| 8578 |
GetS34() antlr.Token |
| 8579 |
|
| 8580 |
// SetS34 sets the s34 token. |
| 8581 |
SetS34(antlr.Token) |
| 8582 |
|
| 8583 |
// GetCols returns the cols token list. |
| 8584 |
GetCols() []antlr.Token |
| 8585 |
|
| 8586 |
// SetCols sets the cols token list. |
| 8587 |
SetCols([]antlr.Token) |
| 8588 |
|
| 8589 |
// Get_optExpr returns the _optExpr rule contexts. |
| 8590 |
Get_optExpr() IOptExprContext |
| 8591 |
|
| 8592 |
// Get_expr returns the _expr rule contexts. |
| 8593 |
Get_expr() IExprContext |
| 8594 |
|
| 8595 |
// Set_optExpr sets the _optExpr rule contexts. |
| 8596 |
Set_optExpr(IOptExprContext) |
| 8597 |
|
| 8598 |
// Set_expr sets the _expr rule contexts. |
| 8599 |
Set_expr(IExprContext) |
| 8600 |
|
| 8601 |
// GetKeys returns the keys rule context list. |
| 8602 |
GetKeys() []IOptExprContext |
| 8603 |
|
| 8604 |
// GetValues returns the values rule context list. |
| 8605 |
GetValues() []IExprContext |
| 8606 |
|
| 8607 |
// SetKeys sets the keys rule context list. |
| 8608 |
SetKeys([]IOptExprContext) |
| 8609 |
|
| 8610 |
// SetValues sets the values rule context list. |
| 8611 |
SetValues([]IExprContext) |
| 8612 |
|
| 8613 |
// Getter signatures |
| 8614 |
AllOptExpr() []IOptExprContext |
| 8615 |
OptExpr(i int) IOptExprContext |
| 8616 |
AllCOLON() []antlr.TerminalNode |
| 8617 |
COLON(i int) antlr.TerminalNode |
| 8618 |
AllExpr() []IExprContext |
| 8619 |
Expr(i int) IExprContext |
| 8620 |
AllCOMMA() []antlr.TerminalNode |
| 8621 |
COMMA(i int) antlr.TerminalNode |
| 8622 |
|
| 8623 |
// IsMapInitializerListContext differentiates from other interfaces. |
| 8624 |
IsMapInitializerListContext() |
| 8625 |
} |
| 8626 |
|
| 8627 |
type MapInitializerListContext struct { |
| 8628 |
antlr.BaseParserRuleContext |
| 8629 |
parser antlr.Parser |
| 8630 |
_optExpr IOptExprContext |
| 8631 |
keys []IOptExprContext |
| 8632 |
s34 antlr.Token |
| 8633 |
cols []antlr.Token |
| 8634 |
_expr IExprContext |
| 8635 |
values []IExprContext |
| 8636 |
} |
| 8637 |
|
| 8638 |
func NewEmptyMapInitializerListContext() *MapInitializerListContext { |
| 8639 |
var p = new(MapInitializerListContext) |
| 8640 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 8641 |
p.RuleIndex = CommandsParserRULE_mapInitializerList |
| 8642 |
return p |
| 8643 |
} |
| 8644 |
|
| 8645 |
func InitEmptyMapInitializerListContext(p *MapInitializerListContext) { |
| 8646 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 8647 |
p.RuleIndex = CommandsParserRULE_mapInitializerList |
| 8648 |
} |
| 8649 |
|
| 8650 |
func (*MapInitializerListContext) IsMapInitializerListContext() {} |
| 8651 |
|
| 8652 |
func NewMapInitializerListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MapInitializerListContext { |
| 8653 |
var p = new(MapInitializerListContext) |
| 8654 |
|
| 8655 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 8656 |
|
| 8657 |
p.parser = parser |
| 8658 |
p.RuleIndex = CommandsParserRULE_mapInitializerList |
| 8659 |
|
| 8660 |
return p |
| 8661 |
} |
| 8662 |
|
| 8663 |
func (s *MapInitializerListContext) GetParser() antlr.Parser { return s.parser } |
| 8664 |
|
| 8665 |
func (s *MapInitializerListContext) GetS34() antlr.Token { return s.s34 } |
| 8666 |
|
| 8667 |
func (s *MapInitializerListContext) SetS34(v antlr.Token) { s.s34 = v } |
| 8668 |
|
| 8669 |
func (s *MapInitializerListContext) GetCols() []antlr.Token { return s.cols } |
| 8670 |
|
| 8671 |
func (s *MapInitializerListContext) SetCols(v []antlr.Token) { s.cols = v } |
| 8672 |
|
| 8673 |
func (s *MapInitializerListContext) Get_optExpr() IOptExprContext { return s._optExpr } |
| 8674 |
|
| 8675 |
func (s *MapInitializerListContext) Get_expr() IExprContext { return s._expr } |
| 8676 |
|
| 8677 |
func (s *MapInitializerListContext) Set_optExpr(v IOptExprContext) { s._optExpr = v } |
| 8678 |
|
| 8679 |
func (s *MapInitializerListContext) Set_expr(v IExprContext) { s._expr = v } |
| 8680 |
|
| 8681 |
func (s *MapInitializerListContext) GetKeys() []IOptExprContext { return s.keys } |
| 8682 |
|
| 8683 |
func (s *MapInitializerListContext) GetValues() []IExprContext { return s.values } |
| 8684 |
|
| 8685 |
func (s *MapInitializerListContext) SetKeys(v []IOptExprContext) { s.keys = v } |
| 8686 |
|
| 8687 |
func (s *MapInitializerListContext) SetValues(v []IExprContext) { s.values = v } |
| 8688 |
|
| 8689 |
func (s *MapInitializerListContext) AllOptExpr() []IOptExprContext { |
| 8690 |
children := s.GetChildren() |
| 8691 |
len := 0 |
| 8692 |
for _, ctx := range children { |
| 8693 |
if _, ok := ctx.(IOptExprContext); ok { |
| 8694 |
len++ |
| 8695 |
} |
| 8696 |
} |
| 8697 |
|
| 8698 |
tst := make([]IOptExprContext, len) |
| 8699 |
i := 0 |
| 8700 |
for _, ctx := range children { |
| 8701 |
if t, ok := ctx.(IOptExprContext); ok { |
| 8702 |
tst[i] = t.(IOptExprContext) |
| 8703 |
i++ |
| 8704 |
} |
| 8705 |
} |
| 8706 |
|
| 8707 |
return tst |
| 8708 |
} |
| 8709 |
|
| 8710 |
func (s *MapInitializerListContext) OptExpr(i int) IOptExprContext { |
| 8711 |
var t antlr.RuleContext |
| 8712 |
j := 0 |
| 8713 |
for _, ctx := range s.GetChildren() { |
| 8714 |
if _, ok := ctx.(IOptExprContext); ok { |
| 8715 |
if j == i { |
| 8716 |
t = ctx.(antlr.RuleContext) |
| 8717 |
break |
| 8718 |
} |
| 8719 |
j++ |
| 8720 |
} |
| 8721 |
} |
| 8722 |
|
| 8723 |
if t == nil { |
| 8724 |
return nil |
| 8725 |
} |
| 8726 |
|
| 8727 |
return t.(IOptExprContext) |
| 8728 |
} |
| 8729 |
|
| 8730 |
func (s *MapInitializerListContext) AllCOLON() []antlr.TerminalNode { |
| 8731 |
return s.GetTokens(CommandsParserCOLON) |
| 8732 |
} |
| 8733 |
|
| 8734 |
func (s *MapInitializerListContext) COLON(i int) antlr.TerminalNode { |
| 8735 |
return s.GetToken(CommandsParserCOLON, i) |
| 8736 |
} |
| 8737 |
|
| 8738 |
func (s *MapInitializerListContext) AllExpr() []IExprContext { |
| 8739 |
children := s.GetChildren() |
| 8740 |
len := 0 |
| 8741 |
for _, ctx := range children { |
| 8742 |
if _, ok := ctx.(IExprContext); ok { |
| 8743 |
len++ |
| 8744 |
} |
| 8745 |
} |
| 8746 |
|
| 8747 |
tst := make([]IExprContext, len) |
| 8748 |
i := 0 |
| 8749 |
for _, ctx := range children { |
| 8750 |
if t, ok := ctx.(IExprContext); ok { |
| 8751 |
tst[i] = t.(IExprContext) |
| 8752 |
i++ |
| 8753 |
} |
| 8754 |
} |
| 8755 |
|
| 8756 |
return tst |
| 8757 |
} |
| 8758 |
|
| 8759 |
func (s *MapInitializerListContext) Expr(i int) IExprContext { |
| 8760 |
var t antlr.RuleContext |
| 8761 |
j := 0 |
| 8762 |
for _, ctx := range s.GetChildren() { |
| 8763 |
if _, ok := ctx.(IExprContext); ok { |
| 8764 |
if j == i { |
| 8765 |
t = ctx.(antlr.RuleContext) |
| 8766 |
break |
| 8767 |
} |
| 8768 |
j++ |
| 8769 |
} |
| 8770 |
} |
| 8771 |
|
| 8772 |
if t == nil { |
| 8773 |
return nil |
| 8774 |
} |
| 8775 |
|
| 8776 |
return t.(IExprContext) |
| 8777 |
} |
| 8778 |
|
| 8779 |
func (s *MapInitializerListContext) AllCOMMA() []antlr.TerminalNode { |
| 8780 |
return s.GetTokens(CommandsParserCOMMA) |
| 8781 |
} |
| 8782 |
|
| 8783 |
func (s *MapInitializerListContext) COMMA(i int) antlr.TerminalNode { |
| 8784 |
return s.GetToken(CommandsParserCOMMA, i) |
| 8785 |
} |
| 8786 |
|
| 8787 |
func (s *MapInitializerListContext) GetRuleContext() antlr.RuleContext { |
| 8788 |
return s |
| 8789 |
} |
| 8790 |
|
| 8791 |
func (s *MapInitializerListContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 8792 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 8793 |
} |
| 8794 |
|
| 8795 |
func (s *MapInitializerListContext) EnterRule(listener antlr.ParseTreeListener) { |
| 8796 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 8797 |
listenerT.EnterMapInitializerList(s) |
| 8798 |
} |
| 8799 |
} |
| 8800 |
|
| 8801 |
func (s *MapInitializerListContext) ExitRule(listener antlr.ParseTreeListener) { |
| 8802 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 8803 |
listenerT.ExitMapInitializerList(s) |
| 8804 |
} |
| 8805 |
} |
| 8806 |
|
| 8807 |
func (s *MapInitializerListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 8808 |
switch t := visitor.(type) { |
| 8809 |
case CommandsVisitor: |
| 8810 |
return t.VisitMapInitializerList(s) |
| 8811 |
|
| 8812 |
default: |
| 8813 |
return t.VisitChildren(s) |
| 8814 |
} |
| 8815 |
} |
| 8816 |
|
| 8817 |
func (p *CommandsParser) MapInitializerList() (localctx IMapInitializerListContext) { |
| 8818 |
localctx = NewMapInitializerListContext(p, p.GetParserRuleContext(), p.GetState()) |
| 8819 |
p.EnterRule(localctx, 64, CommandsParserRULE_mapInitializerList) |
| 8820 |
var _alt int |
| 8821 |
|
| 8822 |
p.EnterOuterAlt(localctx, 1) |
| 8823 |
{ |
| 8824 |
p.SetState(393) |
| 8825 |
|
| 8826 |
var _x = p.OptExpr() |
| 8827 |
|
| 8828 |
localctx.(*MapInitializerListContext)._optExpr = _x |
| 8829 |
} |
| 8830 |
localctx.(*MapInitializerListContext).keys = append(localctx.(*MapInitializerListContext).keys, localctx.(*MapInitializerListContext)._optExpr) |
| 8831 |
{ |
| 8832 |
p.SetState(394) |
| 8833 |
|
| 8834 |
var _m = p.Match(CommandsParserCOLON) |
| 8835 |
|
| 8836 |
localctx.(*MapInitializerListContext).s34 = _m |
| 8837 |
if p.HasError() { |
| 8838 |
// Recognition error - abort rule |
| 8839 |
goto errorExit |
| 8840 |
} |
| 8841 |
} |
| 8842 |
localctx.(*MapInitializerListContext).cols = append(localctx.(*MapInitializerListContext).cols, localctx.(*MapInitializerListContext).s34) |
| 8843 |
{ |
| 8844 |
p.SetState(395) |
| 8845 |
|
| 8846 |
var _x = p.Expr() |
| 8847 |
|
| 8848 |
localctx.(*MapInitializerListContext)._expr = _x |
| 8849 |
} |
| 8850 |
localctx.(*MapInitializerListContext).values = append(localctx.(*MapInitializerListContext).values, localctx.(*MapInitializerListContext)._expr) |
| 8851 |
p.SetState(403) |
| 8852 |
p.GetErrorHandler().Sync(p) |
| 8853 |
if p.HasError() { |
| 8854 |
goto errorExit |
| 8855 |
} |
| 8856 |
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 49, p.GetParserRuleContext()) |
| 8857 |
if p.HasError() { |
| 8858 |
goto errorExit |
| 8859 |
} |
| 8860 |
for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { |
| 8861 |
if _alt == 1 { |
| 8862 |
{ |
| 8863 |
p.SetState(396) |
| 8864 |
p.Match(CommandsParserCOMMA) |
| 8865 |
if p.HasError() { |
| 8866 |
// Recognition error - abort rule |
| 8867 |
goto errorExit |
| 8868 |
} |
| 8869 |
} |
| 8870 |
{ |
| 8871 |
p.SetState(397) |
| 8872 |
|
| 8873 |
var _x = p.OptExpr() |
| 8874 |
|
| 8875 |
localctx.(*MapInitializerListContext)._optExpr = _x |
| 8876 |
} |
| 8877 |
localctx.(*MapInitializerListContext).keys = append(localctx.(*MapInitializerListContext).keys, localctx.(*MapInitializerListContext)._optExpr) |
| 8878 |
{ |
| 8879 |
p.SetState(398) |
| 8880 |
|
| 8881 |
var _m = p.Match(CommandsParserCOLON) |
| 8882 |
|
| 8883 |
localctx.(*MapInitializerListContext).s34 = _m |
| 8884 |
if p.HasError() { |
| 8885 |
// Recognition error - abort rule |
| 8886 |
goto errorExit |
| 8887 |
} |
| 8888 |
} |
| 8889 |
localctx.(*MapInitializerListContext).cols = append(localctx.(*MapInitializerListContext).cols, localctx.(*MapInitializerListContext).s34) |
| 8890 |
{ |
| 8891 |
p.SetState(399) |
| 8892 |
|
| 8893 |
var _x = p.Expr() |
| 8894 |
|
| 8895 |
localctx.(*MapInitializerListContext)._expr = _x |
| 8896 |
} |
| 8897 |
localctx.(*MapInitializerListContext).values = append(localctx.(*MapInitializerListContext).values, localctx.(*MapInitializerListContext)._expr) |
| 8898 |
|
| 8899 |
} |
| 8900 |
p.SetState(405) |
| 8901 |
p.GetErrorHandler().Sync(p) |
| 8902 |
if p.HasError() { |
| 8903 |
goto errorExit |
| 8904 |
} |
| 8905 |
_alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 49, p.GetParserRuleContext()) |
| 8906 |
if p.HasError() { |
| 8907 |
goto errorExit |
| 8908 |
} |
| 8909 |
} |
| 8910 |
|
| 8911 |
errorExit: |
| 8912 |
if p.HasError() { |
| 8913 |
v := p.GetError() |
| 8914 |
localctx.SetException(v) |
| 8915 |
p.GetErrorHandler().ReportError(p, v) |
| 8916 |
p.GetErrorHandler().Recover(p, v) |
| 8917 |
p.SetError(nil) |
| 8918 |
} |
| 8919 |
p.ExitRule() |
| 8920 |
return localctx |
| 8921 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 8922 |
} |
| 8923 |
|
| 8924 |
// IEscapeIdentContext is an interface to support dynamic dispatch. |
| 8925 |
type IEscapeIdentContext interface { |
| 8926 |
antlr.ParserRuleContext |
| 8927 |
|
| 8928 |
// GetParser returns the parser. |
| 8929 |
GetParser() antlr.Parser |
| 8930 |
// IsEscapeIdentContext differentiates from other interfaces. |
| 8931 |
IsEscapeIdentContext() |
| 8932 |
} |
| 8933 |
|
| 8934 |
type EscapeIdentContext struct { |
| 8935 |
antlr.BaseParserRuleContext |
| 8936 |
parser antlr.Parser |
| 8937 |
} |
| 8938 |
|
| 8939 |
func NewEmptyEscapeIdentContext() *EscapeIdentContext { |
| 8940 |
var p = new(EscapeIdentContext) |
| 8941 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 8942 |
p.RuleIndex = CommandsParserRULE_escapeIdent |
| 8943 |
return p |
| 8944 |
} |
| 8945 |
|
| 8946 |
func InitEmptyEscapeIdentContext(p *EscapeIdentContext) { |
| 8947 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 8948 |
p.RuleIndex = CommandsParserRULE_escapeIdent |
| 8949 |
} |
| 8950 |
|
| 8951 |
func (*EscapeIdentContext) IsEscapeIdentContext() {} |
| 8952 |
|
| 8953 |
func NewEscapeIdentContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EscapeIdentContext { |
| 8954 |
var p = new(EscapeIdentContext) |
| 8955 |
|
| 8956 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 8957 |
|
| 8958 |
p.parser = parser |
| 8959 |
p.RuleIndex = CommandsParserRULE_escapeIdent |
| 8960 |
|
| 8961 |
return p |
| 8962 |
} |
| 8963 |
|
| 8964 |
func (s *EscapeIdentContext) GetParser() antlr.Parser { return s.parser } |
| 8965 |
|
| 8966 |
func (s *EscapeIdentContext) CopyAll(ctx *EscapeIdentContext) { |
| 8967 |
s.CopyFrom(&ctx.BaseParserRuleContext) |
| 8968 |
} |
| 8969 |
|
| 8970 |
func (s *EscapeIdentContext) GetRuleContext() antlr.RuleContext { |
| 8971 |
return s |
| 8972 |
} |
| 8973 |
|
| 8974 |
func (s *EscapeIdentContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 8975 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 8976 |
} |
| 8977 |
|
| 8978 |
type EscapedIdentifierContext struct { |
| 8979 |
EscapeIdentContext |
| 8980 |
id antlr.Token |
| 8981 |
} |
| 8982 |
|
| 8983 |
func NewEscapedIdentifierContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *EscapedIdentifierContext { |
| 8984 |
var p = new(EscapedIdentifierContext) |
| 8985 |
|
| 8986 |
InitEmptyEscapeIdentContext(&p.EscapeIdentContext) |
| 8987 |
p.parser = parser |
| 8988 |
p.CopyAll(ctx.(*EscapeIdentContext)) |
| 8989 |
|
| 8990 |
return p |
| 8991 |
} |
| 8992 |
|
| 8993 |
func (s *EscapedIdentifierContext) GetId() antlr.Token { return s.id } |
| 8994 |
|
| 8995 |
func (s *EscapedIdentifierContext) SetId(v antlr.Token) { s.id = v } |
| 8996 |
|
| 8997 |
func (s *EscapedIdentifierContext) GetRuleContext() antlr.RuleContext { |
| 8998 |
return s |
| 8999 |
} |
| 9000 |
|
| 9001 |
func (s *EscapedIdentifierContext) ESC_IDENTIFIER() antlr.TerminalNode { |
| 9002 |
return s.GetToken(CommandsParserESC_IDENTIFIER, 0) |
| 9003 |
} |
| 9004 |
|
| 9005 |
func (s *EscapedIdentifierContext) EnterRule(listener antlr.ParseTreeListener) { |
| 9006 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9007 |
listenerT.EnterEscapedIdentifier(s) |
| 9008 |
} |
| 9009 |
} |
| 9010 |
|
| 9011 |
func (s *EscapedIdentifierContext) ExitRule(listener antlr.ParseTreeListener) { |
| 9012 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9013 |
listenerT.ExitEscapedIdentifier(s) |
| 9014 |
} |
| 9015 |
} |
| 9016 |
|
| 9017 |
func (s *EscapedIdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 9018 |
switch t := visitor.(type) { |
| 9019 |
case CommandsVisitor: |
| 9020 |
return t.VisitEscapedIdentifier(s) |
| 9021 |
|
| 9022 |
default: |
| 9023 |
return t.VisitChildren(s) |
| 9024 |
} |
| 9025 |
} |
| 9026 |
|
| 9027 |
type SimpleIdentifierContext struct { |
| 9028 |
EscapeIdentContext |
| 9029 |
id antlr.Token |
| 9030 |
} |
| 9031 |
|
| 9032 |
func NewSimpleIdentifierContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *SimpleIdentifierContext { |
| 9033 |
var p = new(SimpleIdentifierContext) |
| 9034 |
|
| 9035 |
InitEmptyEscapeIdentContext(&p.EscapeIdentContext) |
| 9036 |
p.parser = parser |
| 9037 |
p.CopyAll(ctx.(*EscapeIdentContext)) |
| 9038 |
|
| 9039 |
return p |
| 9040 |
} |
| 9041 |
|
| 9042 |
func (s *SimpleIdentifierContext) GetId() antlr.Token { return s.id } |
| 9043 |
|
| 9044 |
func (s *SimpleIdentifierContext) SetId(v antlr.Token) { s.id = v } |
| 9045 |
|
| 9046 |
func (s *SimpleIdentifierContext) GetRuleContext() antlr.RuleContext { |
| 9047 |
return s |
| 9048 |
} |
| 9049 |
|
| 9050 |
func (s *SimpleIdentifierContext) IDENTIFIER() antlr.TerminalNode { |
| 9051 |
return s.GetToken(CommandsParserIDENTIFIER, 0) |
| 9052 |
} |
| 9053 |
|
| 9054 |
func (s *SimpleIdentifierContext) EnterRule(listener antlr.ParseTreeListener) { |
| 9055 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9056 |
listenerT.EnterSimpleIdentifier(s) |
| 9057 |
} |
| 9058 |
} |
| 9059 |
|
| 9060 |
func (s *SimpleIdentifierContext) ExitRule(listener antlr.ParseTreeListener) { |
| 9061 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9062 |
listenerT.ExitSimpleIdentifier(s) |
| 9063 |
} |
| 9064 |
} |
| 9065 |
|
| 9066 |
func (s *SimpleIdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 9067 |
switch t := visitor.(type) { |
| 9068 |
case CommandsVisitor: |
| 9069 |
return t.VisitSimpleIdentifier(s) |
| 9070 |
|
| 9071 |
default: |
| 9072 |
return t.VisitChildren(s) |
| 9073 |
} |
| 9074 |
} |
| 9075 |
|
| 9076 |
func (p *CommandsParser) EscapeIdent() (localctx IEscapeIdentContext) { |
| 9077 |
localctx = NewEscapeIdentContext(p, p.GetParserRuleContext(), p.GetState()) |
| 9078 |
p.EnterRule(localctx, 66, CommandsParserRULE_escapeIdent) |
| 9079 |
p.SetState(408) |
| 9080 |
p.GetErrorHandler().Sync(p) |
| 9081 |
if p.HasError() { |
| 9082 |
goto errorExit |
| 9083 |
} |
| 9084 |
|
| 9085 |
switch p.GetTokenStream().LA(1) { |
| 9086 |
case CommandsParserIDENTIFIER: |
| 9087 |
localctx = NewSimpleIdentifierContext(p, localctx) |
| 9088 |
p.EnterOuterAlt(localctx, 1) |
| 9089 |
{ |
| 9090 |
p.SetState(406) |
| 9091 |
|
| 9092 |
var _m = p.Match(CommandsParserIDENTIFIER) |
| 9093 |
|
| 9094 |
localctx.(*SimpleIdentifierContext).id = _m |
| 9095 |
if p.HasError() { |
| 9096 |
// Recognition error - abort rule |
| 9097 |
goto errorExit |
| 9098 |
} |
| 9099 |
} |
| 9100 |
|
| 9101 |
case CommandsParserESC_IDENTIFIER: |
| 9102 |
localctx = NewEscapedIdentifierContext(p, localctx) |
| 9103 |
p.EnterOuterAlt(localctx, 2) |
| 9104 |
{ |
| 9105 |
p.SetState(407) |
| 9106 |
|
| 9107 |
var _m = p.Match(CommandsParserESC_IDENTIFIER) |
| 9108 |
|
| 9109 |
localctx.(*EscapedIdentifierContext).id = _m |
| 9110 |
if p.HasError() { |
| 9111 |
// Recognition error - abort rule |
| 9112 |
goto errorExit |
| 9113 |
} |
| 9114 |
} |
| 9115 |
|
| 9116 |
default: |
| 9117 |
p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) |
| 9118 |
goto errorExit |
| 9119 |
} |
| 9120 |
|
| 9121 |
errorExit: |
| 9122 |
if p.HasError() { |
| 9123 |
v := p.GetError() |
| 9124 |
localctx.SetException(v) |
| 9125 |
p.GetErrorHandler().ReportError(p, v) |
| 9126 |
p.GetErrorHandler().Recover(p, v) |
| 9127 |
p.SetError(nil) |
| 9128 |
} |
| 9129 |
p.ExitRule() |
| 9130 |
return localctx |
| 9131 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 9132 |
} |
| 9133 |
|
| 9134 |
// IOptExprContext is an interface to support dynamic dispatch. |
| 9135 |
type IOptExprContext interface { |
| 9136 |
antlr.ParserRuleContext |
| 9137 |
|
| 9138 |
// GetParser returns the parser. |
| 9139 |
GetParser() antlr.Parser |
| 9140 |
|
| 9141 |
// GetOpt returns the opt token. |
| 9142 |
GetOpt() antlr.Token |
| 9143 |
|
| 9144 |
// SetOpt sets the opt token. |
| 9145 |
SetOpt(antlr.Token) |
| 9146 |
|
| 9147 |
// GetE returns the e rule contexts. |
| 9148 |
GetE() IExprContext |
| 9149 |
|
| 9150 |
// SetE sets the e rule contexts. |
| 9151 |
SetE(IExprContext) |
| 9152 |
|
| 9153 |
// Getter signatures |
| 9154 |
Expr() IExprContext |
| 9155 |
QUESTIONMARK() antlr.TerminalNode |
| 9156 |
|
| 9157 |
// IsOptExprContext differentiates from other interfaces. |
| 9158 |
IsOptExprContext() |
| 9159 |
} |
| 9160 |
|
| 9161 |
type OptExprContext struct { |
| 9162 |
antlr.BaseParserRuleContext |
| 9163 |
parser antlr.Parser |
| 9164 |
opt antlr.Token |
| 9165 |
e IExprContext |
| 9166 |
} |
| 9167 |
|
| 9168 |
func NewEmptyOptExprContext() *OptExprContext { |
| 9169 |
var p = new(OptExprContext) |
| 9170 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 9171 |
p.RuleIndex = CommandsParserRULE_optExpr |
| 9172 |
return p |
| 9173 |
} |
| 9174 |
|
| 9175 |
func InitEmptyOptExprContext(p *OptExprContext) { |
| 9176 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 9177 |
p.RuleIndex = CommandsParserRULE_optExpr |
| 9178 |
} |
| 9179 |
|
| 9180 |
func (*OptExprContext) IsOptExprContext() {} |
| 9181 |
|
| 9182 |
func NewOptExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OptExprContext { |
| 9183 |
var p = new(OptExprContext) |
| 9184 |
|
| 9185 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 9186 |
|
| 9187 |
p.parser = parser |
| 9188 |
p.RuleIndex = CommandsParserRULE_optExpr |
| 9189 |
|
| 9190 |
return p |
| 9191 |
} |
| 9192 |
|
| 9193 |
func (s *OptExprContext) GetParser() antlr.Parser { return s.parser } |
| 9194 |
|
| 9195 |
func (s *OptExprContext) GetOpt() antlr.Token { return s.opt } |
| 9196 |
|
| 9197 |
func (s *OptExprContext) SetOpt(v antlr.Token) { s.opt = v } |
| 9198 |
|
| 9199 |
func (s *OptExprContext) GetE() IExprContext { return s.e } |
| 9200 |
|
| 9201 |
func (s *OptExprContext) SetE(v IExprContext) { s.e = v } |
| 9202 |
|
| 9203 |
func (s *OptExprContext) Expr() IExprContext { |
| 9204 |
var t antlr.RuleContext |
| 9205 |
for _, ctx := range s.GetChildren() { |
| 9206 |
if _, ok := ctx.(IExprContext); ok { |
| 9207 |
t = ctx.(antlr.RuleContext) |
| 9208 |
break |
| 9209 |
} |
| 9210 |
} |
| 9211 |
|
| 9212 |
if t == nil { |
| 9213 |
return nil |
| 9214 |
} |
| 9215 |
|
| 9216 |
return t.(IExprContext) |
| 9217 |
} |
| 9218 |
|
| 9219 |
func (s *OptExprContext) QUESTIONMARK() antlr.TerminalNode { |
| 9220 |
return s.GetToken(CommandsParserQUESTIONMARK, 0) |
| 9221 |
} |
| 9222 |
|
| 9223 |
func (s *OptExprContext) GetRuleContext() antlr.RuleContext { |
| 9224 |
return s |
| 9225 |
} |
| 9226 |
|
| 9227 |
func (s *OptExprContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 9228 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 9229 |
} |
| 9230 |
|
| 9231 |
func (s *OptExprContext) EnterRule(listener antlr.ParseTreeListener) { |
| 9232 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9233 |
listenerT.EnterOptExpr(s) |
| 9234 |
} |
| 9235 |
} |
| 9236 |
|
| 9237 |
func (s *OptExprContext) ExitRule(listener antlr.ParseTreeListener) { |
| 9238 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9239 |
listenerT.ExitOptExpr(s) |
| 9240 |
} |
| 9241 |
} |
| 9242 |
|
| 9243 |
func (s *OptExprContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 9244 |
switch t := visitor.(type) { |
| 9245 |
case CommandsVisitor: |
| 9246 |
return t.VisitOptExpr(s) |
| 9247 |
|
| 9248 |
default: |
| 9249 |
return t.VisitChildren(s) |
| 9250 |
} |
| 9251 |
} |
| 9252 |
|
| 9253 |
func (p *CommandsParser) OptExpr() (localctx IOptExprContext) { |
| 9254 |
localctx = NewOptExprContext(p, p.GetParserRuleContext(), p.GetState()) |
| 9255 |
p.EnterRule(localctx, 68, CommandsParserRULE_optExpr) |
| 9256 |
var _la int |
| 9257 |
|
| 9258 |
p.EnterOuterAlt(localctx, 1) |
| 9259 |
p.SetState(411) |
| 9260 |
p.GetErrorHandler().Sync(p) |
| 9261 |
if p.HasError() { |
| 9262 |
goto errorExit |
| 9263 |
} |
| 9264 |
_la = p.GetTokenStream().LA(1) |
| 9265 |
|
| 9266 |
if _la == CommandsParserQUESTIONMARK { |
| 9267 |
{ |
| 9268 |
p.SetState(410) |
| 9269 |
|
| 9270 |
var _m = p.Match(CommandsParserQUESTIONMARK) |
| 9271 |
|
| 9272 |
localctx.(*OptExprContext).opt = _m |
| 9273 |
if p.HasError() { |
| 9274 |
// Recognition error - abort rule |
| 9275 |
goto errorExit |
| 9276 |
} |
| 9277 |
} |
| 9278 |
|
| 9279 |
} |
| 9280 |
{ |
| 9281 |
p.SetState(413) |
| 9282 |
|
| 9283 |
var _x = p.Expr() |
| 9284 |
|
| 9285 |
localctx.(*OptExprContext).e = _x |
| 9286 |
} |
| 9287 |
|
| 9288 |
errorExit: |
| 9289 |
if p.HasError() { |
| 9290 |
v := p.GetError() |
| 9291 |
localctx.SetException(v) |
| 9292 |
p.GetErrorHandler().ReportError(p, v) |
| 9293 |
p.GetErrorHandler().Recover(p, v) |
| 9294 |
p.SetError(nil) |
| 9295 |
} |
| 9296 |
p.ExitRule() |
| 9297 |
return localctx |
| 9298 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 9299 |
} |
| 9300 |
|
| 9301 |
// ILiteralContext is an interface to support dynamic dispatch. |
| 9302 |
type ILiteralContext interface { |
| 9303 |
antlr.ParserRuleContext |
| 9304 |
|
| 9305 |
// GetParser returns the parser. |
| 9306 |
GetParser() antlr.Parser |
| 9307 |
// IsLiteralContext differentiates from other interfaces. |
| 9308 |
IsLiteralContext() |
| 9309 |
} |
| 9310 |
|
| 9311 |
type LiteralContext struct { |
| 9312 |
antlr.BaseParserRuleContext |
| 9313 |
parser antlr.Parser |
| 9314 |
} |
| 9315 |
|
| 9316 |
func NewEmptyLiteralContext() *LiteralContext { |
| 9317 |
var p = new(LiteralContext) |
| 9318 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 9319 |
p.RuleIndex = CommandsParserRULE_literal |
| 9320 |
return p |
| 9321 |
} |
| 9322 |
|
| 9323 |
func InitEmptyLiteralContext(p *LiteralContext) { |
| 9324 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) |
| 9325 |
p.RuleIndex = CommandsParserRULE_literal |
| 9326 |
} |
| 9327 |
|
| 9328 |
func (*LiteralContext) IsLiteralContext() {} |
| 9329 |
|
| 9330 |
func NewLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LiteralContext { |
| 9331 |
var p = new(LiteralContext) |
| 9332 |
|
| 9333 |
antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) |
| 9334 |
|
| 9335 |
p.parser = parser |
| 9336 |
p.RuleIndex = CommandsParserRULE_literal |
| 9337 |
|
| 9338 |
return p |
| 9339 |
} |
| 9340 |
|
| 9341 |
func (s *LiteralContext) GetParser() antlr.Parser { return s.parser } |
| 9342 |
|
| 9343 |
func (s *LiteralContext) CopyAll(ctx *LiteralContext) { |
| 9344 |
s.CopyFrom(&ctx.BaseParserRuleContext) |
| 9345 |
} |
| 9346 |
|
| 9347 |
func (s *LiteralContext) GetRuleContext() antlr.RuleContext { |
| 9348 |
return s |
| 9349 |
} |
| 9350 |
|
| 9351 |
func (s *LiteralContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { |
| 9352 |
return antlr.TreesStringTree(s, ruleNames, recog) |
| 9353 |
} |
| 9354 |
|
| 9355 |
type BytesContext struct { |
| 9356 |
LiteralContext |
| 9357 |
tok antlr.Token |
| 9358 |
} |
| 9359 |
|
| 9360 |
func NewBytesContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BytesContext { |
| 9361 |
var p = new(BytesContext) |
| 9362 |
|
| 9363 |
InitEmptyLiteralContext(&p.LiteralContext) |
| 9364 |
p.parser = parser |
| 9365 |
p.CopyAll(ctx.(*LiteralContext)) |
| 9366 |
|
| 9367 |
return p |
| 9368 |
} |
| 9369 |
|
| 9370 |
func (s *BytesContext) GetTok() antlr.Token { return s.tok } |
| 9371 |
|
| 9372 |
func (s *BytesContext) SetTok(v antlr.Token) { s.tok = v } |
| 9373 |
|
| 9374 |
func (s *BytesContext) GetRuleContext() antlr.RuleContext { |
| 9375 |
return s |
| 9376 |
} |
| 9377 |
|
| 9378 |
func (s *BytesContext) BYTES() antlr.TerminalNode { |
| 9379 |
return s.GetToken(CommandsParserBYTES, 0) |
| 9380 |
} |
| 9381 |
|
| 9382 |
func (s *BytesContext) EnterRule(listener antlr.ParseTreeListener) { |
| 9383 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9384 |
listenerT.EnterBytes(s) |
| 9385 |
} |
| 9386 |
} |
| 9387 |
|
| 9388 |
func (s *BytesContext) ExitRule(listener antlr.ParseTreeListener) { |
| 9389 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9390 |
listenerT.ExitBytes(s) |
| 9391 |
} |
| 9392 |
} |
| 9393 |
|
| 9394 |
func (s *BytesContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 9395 |
switch t := visitor.(type) { |
| 9396 |
case CommandsVisitor: |
| 9397 |
return t.VisitBytes(s) |
| 9398 |
|
| 9399 |
default: |
| 9400 |
return t.VisitChildren(s) |
| 9401 |
} |
| 9402 |
} |
| 9403 |
|
| 9404 |
type UintContext struct { |
| 9405 |
LiteralContext |
| 9406 |
tok antlr.Token |
| 9407 |
} |
| 9408 |
|
| 9409 |
func NewUintContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *UintContext { |
| 9410 |
var p = new(UintContext) |
| 9411 |
|
| 9412 |
InitEmptyLiteralContext(&p.LiteralContext) |
| 9413 |
p.parser = parser |
| 9414 |
p.CopyAll(ctx.(*LiteralContext)) |
| 9415 |
|
| 9416 |
return p |
| 9417 |
} |
| 9418 |
|
| 9419 |
func (s *UintContext) GetTok() antlr.Token { return s.tok } |
| 9420 |
|
| 9421 |
func (s *UintContext) SetTok(v antlr.Token) { s.tok = v } |
| 9422 |
|
| 9423 |
func (s *UintContext) GetRuleContext() antlr.RuleContext { |
| 9424 |
return s |
| 9425 |
} |
| 9426 |
|
| 9427 |
func (s *UintContext) NUM_UINT() antlr.TerminalNode { |
| 9428 |
return s.GetToken(CommandsParserNUM_UINT, 0) |
| 9429 |
} |
| 9430 |
|
| 9431 |
func (s *UintContext) EnterRule(listener antlr.ParseTreeListener) { |
| 9432 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9433 |
listenerT.EnterUint(s) |
| 9434 |
} |
| 9435 |
} |
| 9436 |
|
| 9437 |
func (s *UintContext) ExitRule(listener antlr.ParseTreeListener) { |
| 9438 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9439 |
listenerT.ExitUint(s) |
| 9440 |
} |
| 9441 |
} |
| 9442 |
|
| 9443 |
func (s *UintContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 9444 |
switch t := visitor.(type) { |
| 9445 |
case CommandsVisitor: |
| 9446 |
return t.VisitUint(s) |
| 9447 |
|
| 9448 |
default: |
| 9449 |
return t.VisitChildren(s) |
| 9450 |
} |
| 9451 |
} |
| 9452 |
|
| 9453 |
type NullContext struct { |
| 9454 |
LiteralContext |
| 9455 |
tok antlr.Token |
| 9456 |
} |
| 9457 |
|
| 9458 |
func NewNullContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NullContext { |
| 9459 |
var p = new(NullContext) |
| 9460 |
|
| 9461 |
InitEmptyLiteralContext(&p.LiteralContext) |
| 9462 |
p.parser = parser |
| 9463 |
p.CopyAll(ctx.(*LiteralContext)) |
| 9464 |
|
| 9465 |
return p |
| 9466 |
} |
| 9467 |
|
| 9468 |
func (s *NullContext) GetTok() antlr.Token { return s.tok } |
| 9469 |
|
| 9470 |
func (s *NullContext) SetTok(v antlr.Token) { s.tok = v } |
| 9471 |
|
| 9472 |
func (s *NullContext) GetRuleContext() antlr.RuleContext { |
| 9473 |
return s |
| 9474 |
} |
| 9475 |
|
| 9476 |
func (s *NullContext) NUL() antlr.TerminalNode { |
| 9477 |
return s.GetToken(CommandsParserNUL, 0) |
| 9478 |
} |
| 9479 |
|
| 9480 |
func (s *NullContext) EnterRule(listener antlr.ParseTreeListener) { |
| 9481 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9482 |
listenerT.EnterNull(s) |
| 9483 |
} |
| 9484 |
} |
| 9485 |
|
| 9486 |
func (s *NullContext) ExitRule(listener antlr.ParseTreeListener) { |
| 9487 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9488 |
listenerT.ExitNull(s) |
| 9489 |
} |
| 9490 |
} |
| 9491 |
|
| 9492 |
func (s *NullContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 9493 |
switch t := visitor.(type) { |
| 9494 |
case CommandsVisitor: |
| 9495 |
return t.VisitNull(s) |
| 9496 |
|
| 9497 |
default: |
| 9498 |
return t.VisitChildren(s) |
| 9499 |
} |
| 9500 |
} |
| 9501 |
|
| 9502 |
type BoolFalseContext struct { |
| 9503 |
LiteralContext |
| 9504 |
tok antlr.Token |
| 9505 |
} |
| 9506 |
|
| 9507 |
func NewBoolFalseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BoolFalseContext { |
| 9508 |
var p = new(BoolFalseContext) |
| 9509 |
|
| 9510 |
InitEmptyLiteralContext(&p.LiteralContext) |
| 9511 |
p.parser = parser |
| 9512 |
p.CopyAll(ctx.(*LiteralContext)) |
| 9513 |
|
| 9514 |
return p |
| 9515 |
} |
| 9516 |
|
| 9517 |
func (s *BoolFalseContext) GetTok() antlr.Token { return s.tok } |
| 9518 |
|
| 9519 |
func (s *BoolFalseContext) SetTok(v antlr.Token) { s.tok = v } |
| 9520 |
|
| 9521 |
func (s *BoolFalseContext) GetRuleContext() antlr.RuleContext { |
| 9522 |
return s |
| 9523 |
} |
| 9524 |
|
| 9525 |
func (s *BoolFalseContext) CEL_FALSE() antlr.TerminalNode { |
| 9526 |
return s.GetToken(CommandsParserCEL_FALSE, 0) |
| 9527 |
} |
| 9528 |
|
| 9529 |
func (s *BoolFalseContext) EnterRule(listener antlr.ParseTreeListener) { |
| 9530 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9531 |
listenerT.EnterBoolFalse(s) |
| 9532 |
} |
| 9533 |
} |
| 9534 |
|
| 9535 |
func (s *BoolFalseContext) ExitRule(listener antlr.ParseTreeListener) { |
| 9536 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9537 |
listenerT.ExitBoolFalse(s) |
| 9538 |
} |
| 9539 |
} |
| 9540 |
|
| 9541 |
func (s *BoolFalseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 9542 |
switch t := visitor.(type) { |
| 9543 |
case CommandsVisitor: |
| 9544 |
return t.VisitBoolFalse(s) |
| 9545 |
|
| 9546 |
default: |
| 9547 |
return t.VisitChildren(s) |
| 9548 |
} |
| 9549 |
} |
| 9550 |
|
| 9551 |
type StringContext struct { |
| 9552 |
LiteralContext |
| 9553 |
tok antlr.Token |
| 9554 |
} |
| 9555 |
|
| 9556 |
func NewStringContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *StringContext { |
| 9557 |
var p = new(StringContext) |
| 9558 |
|
| 9559 |
InitEmptyLiteralContext(&p.LiteralContext) |
| 9560 |
p.parser = parser |
| 9561 |
p.CopyAll(ctx.(*LiteralContext)) |
| 9562 |
|
| 9563 |
return p |
| 9564 |
} |
| 9565 |
|
| 9566 |
func (s *StringContext) GetTok() antlr.Token { return s.tok } |
| 9567 |
|
| 9568 |
func (s *StringContext) SetTok(v antlr.Token) { s.tok = v } |
| 9569 |
|
| 9570 |
func (s *StringContext) GetRuleContext() antlr.RuleContext { |
| 9571 |
return s |
| 9572 |
} |
| 9573 |
|
| 9574 |
func (s *StringContext) STRING() antlr.TerminalNode { |
| 9575 |
return s.GetToken(CommandsParserSTRING, 0) |
| 9576 |
} |
| 9577 |
|
| 9578 |
func (s *StringContext) EnterRule(listener antlr.ParseTreeListener) { |
| 9579 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9580 |
listenerT.EnterString(s) |
| 9581 |
} |
| 9582 |
} |
| 9583 |
|
| 9584 |
func (s *StringContext) ExitRule(listener antlr.ParseTreeListener) { |
| 9585 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9586 |
listenerT.ExitString(s) |
| 9587 |
} |
| 9588 |
} |
| 9589 |
|
| 9590 |
func (s *StringContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 9591 |
switch t := visitor.(type) { |
| 9592 |
case CommandsVisitor: |
| 9593 |
return t.VisitString(s) |
| 9594 |
|
| 9595 |
default: |
| 9596 |
return t.VisitChildren(s) |
| 9597 |
} |
| 9598 |
} |
| 9599 |
|
| 9600 |
type DoubleContext struct { |
| 9601 |
LiteralContext |
| 9602 |
sign antlr.Token |
| 9603 |
tok antlr.Token |
| 9604 |
} |
| 9605 |
|
| 9606 |
func NewDoubleContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DoubleContext { |
| 9607 |
var p = new(DoubleContext) |
| 9608 |
|
| 9609 |
InitEmptyLiteralContext(&p.LiteralContext) |
| 9610 |
p.parser = parser |
| 9611 |
p.CopyAll(ctx.(*LiteralContext)) |
| 9612 |
|
| 9613 |
return p |
| 9614 |
} |
| 9615 |
|
| 9616 |
func (s *DoubleContext) GetSign() antlr.Token { return s.sign } |
| 9617 |
|
| 9618 |
func (s *DoubleContext) GetTok() antlr.Token { return s.tok } |
| 9619 |
|
| 9620 |
func (s *DoubleContext) SetSign(v antlr.Token) { s.sign = v } |
| 9621 |
|
| 9622 |
func (s *DoubleContext) SetTok(v antlr.Token) { s.tok = v } |
| 9623 |
|
| 9624 |
func (s *DoubleContext) GetRuleContext() antlr.RuleContext { |
| 9625 |
return s |
| 9626 |
} |
| 9627 |
|
| 9628 |
func (s *DoubleContext) NUM_FLOAT() antlr.TerminalNode { |
| 9629 |
return s.GetToken(CommandsParserNUM_FLOAT, 0) |
| 9630 |
} |
| 9631 |
|
| 9632 |
func (s *DoubleContext) MINUS() antlr.TerminalNode { |
| 9633 |
return s.GetToken(CommandsParserMINUS, 0) |
| 9634 |
} |
| 9635 |
|
| 9636 |
func (s *DoubleContext) EnterRule(listener antlr.ParseTreeListener) { |
| 9637 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9638 |
listenerT.EnterDouble(s) |
| 9639 |
} |
| 9640 |
} |
| 9641 |
|
| 9642 |
func (s *DoubleContext) ExitRule(listener antlr.ParseTreeListener) { |
| 9643 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9644 |
listenerT.ExitDouble(s) |
| 9645 |
} |
| 9646 |
} |
| 9647 |
|
| 9648 |
func (s *DoubleContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 9649 |
switch t := visitor.(type) { |
| 9650 |
case CommandsVisitor: |
| 9651 |
return t.VisitDouble(s) |
| 9652 |
|
| 9653 |
default: |
| 9654 |
return t.VisitChildren(s) |
| 9655 |
} |
| 9656 |
} |
| 9657 |
|
| 9658 |
type BoolTrueContext struct { |
| 9659 |
LiteralContext |
| 9660 |
tok antlr.Token |
| 9661 |
} |
| 9662 |
|
| 9663 |
func NewBoolTrueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BoolTrueContext { |
| 9664 |
var p = new(BoolTrueContext) |
| 9665 |
|
| 9666 |
InitEmptyLiteralContext(&p.LiteralContext) |
| 9667 |
p.parser = parser |
| 9668 |
p.CopyAll(ctx.(*LiteralContext)) |
| 9669 |
|
| 9670 |
return p |
| 9671 |
} |
| 9672 |
|
| 9673 |
func (s *BoolTrueContext) GetTok() antlr.Token { return s.tok } |
| 9674 |
|
| 9675 |
func (s *BoolTrueContext) SetTok(v antlr.Token) { s.tok = v } |
| 9676 |
|
| 9677 |
func (s *BoolTrueContext) GetRuleContext() antlr.RuleContext { |
| 9678 |
return s |
| 9679 |
} |
| 9680 |
|
| 9681 |
func (s *BoolTrueContext) CEL_TRUE() antlr.TerminalNode { |
| 9682 |
return s.GetToken(CommandsParserCEL_TRUE, 0) |
| 9683 |
} |
| 9684 |
|
| 9685 |
func (s *BoolTrueContext) EnterRule(listener antlr.ParseTreeListener) { |
| 9686 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9687 |
listenerT.EnterBoolTrue(s) |
| 9688 |
} |
| 9689 |
} |
| 9690 |
|
| 9691 |
func (s *BoolTrueContext) ExitRule(listener antlr.ParseTreeListener) { |
| 9692 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9693 |
listenerT.ExitBoolTrue(s) |
| 9694 |
} |
| 9695 |
} |
| 9696 |
|
| 9697 |
func (s *BoolTrueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 9698 |
switch t := visitor.(type) { |
| 9699 |
case CommandsVisitor: |
| 9700 |
return t.VisitBoolTrue(s) |
| 9701 |
|
| 9702 |
default: |
| 9703 |
return t.VisitChildren(s) |
| 9704 |
} |
| 9705 |
} |
| 9706 |
|
| 9707 |
type IntContext struct { |
| 9708 |
LiteralContext |
| 9709 |
sign antlr.Token |
| 9710 |
tok antlr.Token |
| 9711 |
} |
| 9712 |
|
| 9713 |
func NewIntContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IntContext { |
| 9714 |
var p = new(IntContext) |
| 9715 |
|
| 9716 |
InitEmptyLiteralContext(&p.LiteralContext) |
| 9717 |
p.parser = parser |
| 9718 |
p.CopyAll(ctx.(*LiteralContext)) |
| 9719 |
|
| 9720 |
return p |
| 9721 |
} |
| 9722 |
|
| 9723 |
func (s *IntContext) GetSign() antlr.Token { return s.sign } |
| 9724 |
|
| 9725 |
func (s *IntContext) GetTok() antlr.Token { return s.tok } |
| 9726 |
|
| 9727 |
func (s *IntContext) SetSign(v antlr.Token) { s.sign = v } |
| 9728 |
|
| 9729 |
func (s *IntContext) SetTok(v antlr.Token) { s.tok = v } |
| 9730 |
|
| 9731 |
func (s *IntContext) GetRuleContext() antlr.RuleContext { |
| 9732 |
return s |
| 9733 |
} |
| 9734 |
|
| 9735 |
func (s *IntContext) NUM_INT() antlr.TerminalNode { |
| 9736 |
return s.GetToken(CommandsParserNUM_INT, 0) |
| 9737 |
} |
| 9738 |
|
| 9739 |
func (s *IntContext) MINUS() antlr.TerminalNode { |
| 9740 |
return s.GetToken(CommandsParserMINUS, 0) |
| 9741 |
} |
| 9742 |
|
| 9743 |
func (s *IntContext) EnterRule(listener antlr.ParseTreeListener) { |
| 9744 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9745 |
listenerT.EnterInt(s) |
| 9746 |
} |
| 9747 |
} |
| 9748 |
|
| 9749 |
func (s *IntContext) ExitRule(listener antlr.ParseTreeListener) { |
| 9750 |
if listenerT, ok := listener.(CommandsListener); ok { |
| 9751 |
listenerT.ExitInt(s) |
| 9752 |
} |
| 9753 |
} |
| 9754 |
|
| 9755 |
func (s *IntContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { |
| 9756 |
switch t := visitor.(type) { |
| 9757 |
case CommandsVisitor: |
| 9758 |
return t.VisitInt(s) |
| 9759 |
|
| 9760 |
default: |
| 9761 |
return t.VisitChildren(s) |
| 9762 |
} |
| 9763 |
} |
| 9764 |
|
| 9765 |
func (p *CommandsParser) Literal() (localctx ILiteralContext) { |
| 9766 |
localctx = NewLiteralContext(p, p.GetParserRuleContext(), p.GetState()) |
| 9767 |
p.EnterRule(localctx, 70, CommandsParserRULE_literal) |
| 9768 |
var _la int |
| 9769 |
|
| 9770 |
p.SetState(429) |
| 9771 |
p.GetErrorHandler().Sync(p) |
| 9772 |
if p.HasError() { |
| 9773 |
goto errorExit |
| 9774 |
} |
| 9775 |
|
| 9776 |
switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 54, p.GetParserRuleContext()) { |
| 9777 |
case 1: |
| 9778 |
localctx = NewIntContext(p, localctx) |
| 9779 |
p.EnterOuterAlt(localctx, 1) |
| 9780 |
p.SetState(416) |
| 9781 |
p.GetErrorHandler().Sync(p) |
| 9782 |
if p.HasError() { |
| 9783 |
goto errorExit |
| 9784 |
} |
| 9785 |
_la = p.GetTokenStream().LA(1) |
| 9786 |
|
| 9787 |
if _la == CommandsParserMINUS { |
| 9788 |
{ |
| 9789 |
p.SetState(415) |
| 9790 |
|
| 9791 |
var _m = p.Match(CommandsParserMINUS) |
| 9792 |
|
| 9793 |
localctx.(*IntContext).sign = _m |
| 9794 |
if p.HasError() { |
| 9795 |
// Recognition error - abort rule |
| 9796 |
goto errorExit |
| 9797 |
} |
| 9798 |
} |
| 9799 |
|
| 9800 |
} |
| 9801 |
{ |
| 9802 |
p.SetState(418) |
| 9803 |
|
| 9804 |
var _m = p.Match(CommandsParserNUM_INT) |
| 9805 |
|
| 9806 |
localctx.(*IntContext).tok = _m |
| 9807 |
if p.HasError() { |
| 9808 |
// Recognition error - abort rule |
| 9809 |
goto errorExit |
| 9810 |
} |
| 9811 |
} |
| 9812 |
|
| 9813 |
case 2: |
| 9814 |
localctx = NewUintContext(p, localctx) |
| 9815 |
p.EnterOuterAlt(localctx, 2) |
| 9816 |
{ |
| 9817 |
p.SetState(419) |
| 9818 |
|
| 9819 |
var _m = p.Match(CommandsParserNUM_UINT) |
| 9820 |
|
| 9821 |
localctx.(*UintContext).tok = _m |
| 9822 |
if p.HasError() { |
| 9823 |
// Recognition error - abort rule |
| 9824 |
goto errorExit |
| 9825 |
} |
| 9826 |
} |
| 9827 |
|
| 9828 |
case 3: |
| 9829 |
localctx = NewDoubleContext(p, localctx) |
| 9830 |
p.EnterOuterAlt(localctx, 3) |
| 9831 |
p.SetState(421) |
| 9832 |
p.GetErrorHandler().Sync(p) |
| 9833 |
if p.HasError() { |
| 9834 |
goto errorExit |
| 9835 |
} |
| 9836 |
_la = p.GetTokenStream().LA(1) |
| 9837 |
|
| 9838 |
if _la == CommandsParserMINUS { |
| 9839 |
{ |
| 9840 |
p.SetState(420) |
| 9841 |
|
| 9842 |
var _m = p.Match(CommandsParserMINUS) |
| 9843 |
|
| 9844 |
localctx.(*DoubleContext).sign = _m |
| 9845 |
if p.HasError() { |
| 9846 |
// Recognition error - abort rule |
| 9847 |
goto errorExit |
| 9848 |
} |
| 9849 |
} |
| 9850 |
|
| 9851 |
} |
| 9852 |
{ |
| 9853 |
p.SetState(423) |
| 9854 |
|
| 9855 |
var _m = p.Match(CommandsParserNUM_FLOAT) |
| 9856 |
|
| 9857 |
localctx.(*DoubleContext).tok = _m |
| 9858 |
if p.HasError() { |
| 9859 |
// Recognition error - abort rule |
| 9860 |
goto errorExit |
| 9861 |
} |
| 9862 |
} |
| 9863 |
|
| 9864 |
case 4: |
| 9865 |
localctx = NewStringContext(p, localctx) |
| 9866 |
p.EnterOuterAlt(localctx, 4) |
| 9867 |
{ |
| 9868 |
p.SetState(424) |
| 9869 |
|
| 9870 |
var _m = p.Match(CommandsParserSTRING) |
| 9871 |
|
| 9872 |
localctx.(*StringContext).tok = _m |
| 9873 |
if p.HasError() { |
| 9874 |
// Recognition error - abort rule |
| 9875 |
goto errorExit |
| 9876 |
} |
| 9877 |
} |
| 9878 |
|
| 9879 |
case 5: |
| 9880 |
localctx = NewBytesContext(p, localctx) |
| 9881 |
p.EnterOuterAlt(localctx, 5) |
| 9882 |
{ |
| 9883 |
p.SetState(425) |
| 9884 |
|
| 9885 |
var _m = p.Match(CommandsParserBYTES) |
| 9886 |
|
| 9887 |
localctx.(*BytesContext).tok = _m |
| 9888 |
if p.HasError() { |
| 9889 |
// Recognition error - abort rule |
| 9890 |
goto errorExit |
| 9891 |
} |
| 9892 |
} |
| 9893 |
|
| 9894 |
case 6: |
| 9895 |
localctx = NewBoolTrueContext(p, localctx) |
| 9896 |
p.EnterOuterAlt(localctx, 6) |
| 9897 |
{ |
| 9898 |
p.SetState(426) |
| 9899 |
|
| 9900 |
var _m = p.Match(CommandsParserCEL_TRUE) |
| 9901 |
|
| 9902 |
localctx.(*BoolTrueContext).tok = _m |
| 9903 |
if p.HasError() { |
| 9904 |
// Recognition error - abort rule |
| 9905 |
goto errorExit |
| 9906 |
} |
| 9907 |
} |
| 9908 |
|
| 9909 |
case 7: |
| 9910 |
localctx = NewBoolFalseContext(p, localctx) |
| 9911 |
p.EnterOuterAlt(localctx, 7) |
| 9912 |
{ |
| 9913 |
p.SetState(427) |
| 9914 |
|
| 9915 |
var _m = p.Match(CommandsParserCEL_FALSE) |
| 9916 |
|
| 9917 |
localctx.(*BoolFalseContext).tok = _m |
| 9918 |
if p.HasError() { |
| 9919 |
// Recognition error - abort rule |
| 9920 |
goto errorExit |
| 9921 |
} |
| 9922 |
} |
| 9923 |
|
| 9924 |
case 8: |
| 9925 |
localctx = NewNullContext(p, localctx) |
| 9926 |
p.EnterOuterAlt(localctx, 8) |
| 9927 |
{ |
| 9928 |
p.SetState(428) |
| 9929 |
|
| 9930 |
var _m = p.Match(CommandsParserNUL) |
| 9931 |
|
| 9932 |
localctx.(*NullContext).tok = _m |
| 9933 |
if p.HasError() { |
| 9934 |
// Recognition error - abort rule |
| 9935 |
goto errorExit |
| 9936 |
} |
| 9937 |
} |
| 9938 |
|
| 9939 |
case antlr.ATNInvalidAltNumber: |
| 9940 |
goto errorExit |
| 9941 |
} |
| 9942 |
|
| 9943 |
errorExit: |
| 9944 |
if p.HasError() { |
| 9945 |
v := p.GetError() |
| 9946 |
localctx.SetException(v) |
| 9947 |
p.GetErrorHandler().ReportError(p, v) |
| 9948 |
p.GetErrorHandler().Recover(p, v) |
| 9949 |
p.SetError(nil) |
| 9950 |
} |
| 9951 |
p.ExitRule() |
| 9952 |
return localctx |
| 9953 |
goto errorExit // Trick to prevent compiler error if the label is not used |
| 9954 |
} |
| 9955 |
|
| 9956 |
func (p *CommandsParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool { |
| 9957 |
switch ruleIndex { |
| 9958 |
case 23: |
| 9959 |
var t *RelationContext = nil |
| 9960 |
if localctx != nil { |
| 9961 |
t = localctx.(*RelationContext) |
| 9962 |
} |
| 9963 |
return p.Relation_Sempred(t, predIndex) |
| 9964 |
|
| 9965 |
case 24: |
| 9966 |
var t *CalcContext = nil |
| 9967 |
if localctx != nil { |
| 9968 |
t = localctx.(*CalcContext) |
| 9969 |
} |
| 9970 |
return p.Calc_Sempred(t, predIndex) |
| 9971 |
|
| 9972 |
case 26: |
| 9973 |
var t *MemberContext = nil |
| 9974 |
if localctx != nil { |
| 9975 |
t = localctx.(*MemberContext) |
| 9976 |
} |
| 9977 |
return p.Member_Sempred(t, predIndex) |
| 9978 |
|
| 9979 |
default: |
| 9980 |
panic("No predicate with index: " + fmt.Sprint(ruleIndex)) |
| 9981 |
} |
| 9982 |
} |
| 9983 |
|
| 9984 |
func (p *CommandsParser) Relation_Sempred(localctx antlr.RuleContext, predIndex int) bool { |
| 9985 |
switch predIndex { |
| 9986 |
case 0: |
| 9987 |
return p.Precpred(p.GetParserRuleContext(), 1) |
| 9988 |
|
| 9989 |
default: |
| 9990 |
panic("No predicate with index: " + fmt.Sprint(predIndex)) |
| 9991 |
} |
| 9992 |
} |
| 9993 |
|
| 9994 |
func (p *CommandsParser) Calc_Sempred(localctx antlr.RuleContext, predIndex int) bool { |
| 9995 |
switch predIndex { |
| 9996 |
case 1: |
| 9997 |
return p.Precpred(p.GetParserRuleContext(), 2) |
| 9998 |
|
| 9999 |
case 2: |
| 10000 |
return p.Precpred(p.GetParserRuleContext(), 1) |
| 10001 |
|
| 10002 |
default: |
| 10003 |
panic("No predicate with index: " + fmt.Sprint(predIndex)) |
| 10004 |
} |
| 10005 |
} |
| 10006 |
|
| 10007 |
func (p *CommandsParser) Member_Sempred(localctx antlr.RuleContext, predIndex int) bool { |
| 10008 |
switch predIndex { |
| 10009 |
case 3: |
| 10010 |
return p.Precpred(p.GetParserRuleContext(), 3) |
| 10011 |
|
| 10012 |
case 4: |
| 10013 |
return p.Precpred(p.GetParserRuleContext(), 2) |
| 10014 |
|
| 10015 |
case 5: |
| 10016 |
return p.Precpred(p.GetParserRuleContext(), 1) |
| 10017 |
|
| 10018 |
default: |
| 10019 |
panic("No predicate with index: " + fmt.Sprint(predIndex)) |
| 10020 |
} |
| 10021 |
} |