1
- // Generated from src/grammar/CashScript.g4 by ANTLR 4.7.3 -SNAPSHOT
1
+ // Generated from src/grammar/CashScript.g4 by ANTLR 4.9.0 -SNAPSHOT
2
2
3
3
4
4
import { ATN } from "antlr4ts/atn/ATN" ;
@@ -154,6 +154,10 @@ export class CashScriptParser extends Parser {
154
154
// @Override
155
155
public get serializedATN ( ) : string { return CashScriptParser . _serializedATN ; }
156
156
157
+ protected createFailedPredicateException ( predicate ?: string , message ?: string ) : FailedPredicateException {
158
+ return new FailedPredicateException ( this , predicate , message ) ;
159
+ }
160
+
157
161
constructor ( input : TokenStream ) {
158
162
super ( input ) ;
159
163
this . _interp = new ParserATNSimulator ( CashScriptParser . _ATN , this ) ;
@@ -1180,7 +1184,7 @@ export class CashScriptParser extends Parser {
1180
1184
this . pushNewRecursionContext ( _localctx , _startState , CashScriptParser . RULE_expression ) ;
1181
1185
this . state = 230 ;
1182
1186
if ( ! ( this . precpred ( this . _ctx , 13 ) ) ) {
1183
- throw new FailedPredicateException ( this , "this.precpred(this._ctx, 13)" ) ;
1187
+ throw this . createFailedPredicateException ( "this.precpred(this._ctx, 13)" ) ;
1184
1188
}
1185
1189
this . state = 231 ;
1186
1190
( _localctx as BinaryOpContext ) . _op = this . _input . LT ( 1 ) ;
@@ -1207,7 +1211,7 @@ export class CashScriptParser extends Parser {
1207
1211
this . pushNewRecursionContext ( _localctx , _startState , CashScriptParser . RULE_expression ) ;
1208
1212
this . state = 233 ;
1209
1213
if ( ! ( this . precpred ( this . _ctx , 12 ) ) ) {
1210
- throw new FailedPredicateException ( this , "this.precpred(this._ctx, 12)" ) ;
1214
+ throw this . createFailedPredicateException ( "this.precpred(this._ctx, 12)" ) ;
1211
1215
}
1212
1216
this . state = 234 ;
1213
1217
( _localctx as BinaryOpContext ) . _op = this . _input . LT ( 1 ) ;
@@ -1234,7 +1238,7 @@ export class CashScriptParser extends Parser {
1234
1238
this . pushNewRecursionContext ( _localctx , _startState , CashScriptParser . RULE_expression ) ;
1235
1239
this . state = 236 ;
1236
1240
if ( ! ( this . precpred ( this . _ctx , 11 ) ) ) {
1237
- throw new FailedPredicateException ( this , "this.precpred(this._ctx, 11)" ) ;
1241
+ throw this . createFailedPredicateException ( "this.precpred(this._ctx, 11)" ) ;
1238
1242
}
1239
1243
this . state = 237 ;
1240
1244
( _localctx as BinaryOpContext ) . _op = this . _input . LT ( 1 ) ;
@@ -1261,7 +1265,7 @@ export class CashScriptParser extends Parser {
1261
1265
this . pushNewRecursionContext ( _localctx , _startState , CashScriptParser . RULE_expression ) ;
1262
1266
this . state = 239 ;
1263
1267
if ( ! ( this . precpred ( this . _ctx , 10 ) ) ) {
1264
- throw new FailedPredicateException ( this , "this.precpred(this._ctx, 10)" ) ;
1268
+ throw this . createFailedPredicateException ( "this.precpred(this._ctx, 10)" ) ;
1265
1269
}
1266
1270
this . state = 240 ;
1267
1271
( _localctx as BinaryOpContext ) . _op = this . _input . LT ( 1 ) ;
@@ -1288,7 +1292,7 @@ export class CashScriptParser extends Parser {
1288
1292
this . pushNewRecursionContext ( _localctx , _startState , CashScriptParser . RULE_expression ) ;
1289
1293
this . state = 242 ;
1290
1294
if ( ! ( this . precpred ( this . _ctx , 9 ) ) ) {
1291
- throw new FailedPredicateException ( this , "this.precpred(this._ctx, 9)" ) ;
1295
+ throw this . createFailedPredicateException ( "this.precpred(this._ctx, 9)" ) ;
1292
1296
}
1293
1297
this . state = 243 ;
1294
1298
( _localctx as BinaryOpContext ) . _op = this . match ( CashScriptParser . T__33 ) ;
@@ -1304,7 +1308,7 @@ export class CashScriptParser extends Parser {
1304
1308
this . pushNewRecursionContext ( _localctx , _startState , CashScriptParser . RULE_expression ) ;
1305
1309
this . state = 245 ;
1306
1310
if ( ! ( this . precpred ( this . _ctx , 8 ) ) ) {
1307
- throw new FailedPredicateException ( this , "this.precpred(this._ctx, 8)" ) ;
1311
+ throw this . createFailedPredicateException ( "this.precpred(this._ctx, 8)" ) ;
1308
1312
}
1309
1313
this . state = 246 ;
1310
1314
( _localctx as BinaryOpContext ) . _op = this . match ( CashScriptParser . T__3 ) ;
@@ -1320,7 +1324,7 @@ export class CashScriptParser extends Parser {
1320
1324
this . pushNewRecursionContext ( _localctx , _startState , CashScriptParser . RULE_expression ) ;
1321
1325
this . state = 248 ;
1322
1326
if ( ! ( this . precpred ( this . _ctx , 7 ) ) ) {
1323
- throw new FailedPredicateException ( this , "this.precpred(this._ctx, 7)" ) ;
1327
+ throw this . createFailedPredicateException ( "this.precpred(this._ctx, 7)" ) ;
1324
1328
}
1325
1329
this . state = 249 ;
1326
1330
( _localctx as BinaryOpContext ) . _op = this . match ( CashScriptParser . T__34 ) ;
@@ -1336,7 +1340,7 @@ export class CashScriptParser extends Parser {
1336
1340
this . pushNewRecursionContext ( _localctx , _startState , CashScriptParser . RULE_expression ) ;
1337
1341
this . state = 251 ;
1338
1342
if ( ! ( this . precpred ( this . _ctx , 6 ) ) ) {
1339
- throw new FailedPredicateException ( this , "this.precpred(this._ctx, 6)" ) ;
1343
+ throw this . createFailedPredicateException ( "this.precpred(this._ctx, 6)" ) ;
1340
1344
}
1341
1345
this . state = 252 ;
1342
1346
( _localctx as BinaryOpContext ) . _op = this . match ( CashScriptParser . T__35 ) ;
@@ -1352,7 +1356,7 @@ export class CashScriptParser extends Parser {
1352
1356
this . pushNewRecursionContext ( _localctx , _startState , CashScriptParser . RULE_expression ) ;
1353
1357
this . state = 254 ;
1354
1358
if ( ! ( this . precpred ( this . _ctx , 5 ) ) ) {
1355
- throw new FailedPredicateException ( this , "this.precpred(this._ctx, 5)" ) ;
1359
+ throw this . createFailedPredicateException ( "this.precpred(this._ctx, 5)" ) ;
1356
1360
}
1357
1361
this . state = 255 ;
1358
1362
( _localctx as BinaryOpContext ) . _op = this . match ( CashScriptParser . T__36 ) ;
@@ -1367,7 +1371,7 @@ export class CashScriptParser extends Parser {
1367
1371
this . pushNewRecursionContext ( _localctx , _startState , CashScriptParser . RULE_expression ) ;
1368
1372
this . state = 257 ;
1369
1373
if ( ! ( this . precpred ( this . _ctx , 17 ) ) ) {
1370
- throw new FailedPredicateException ( this , "this.precpred(this._ctx, 17)" ) ;
1374
+ throw this . createFailedPredicateException ( "this.precpred(this._ctx, 17)" ) ;
1371
1375
}
1372
1376
this . state = 258 ;
1373
1377
this . match ( CashScriptParser . T__21 ) ;
@@ -1384,7 +1388,7 @@ export class CashScriptParser extends Parser {
1384
1388
this . pushNewRecursionContext ( _localctx , _startState , CashScriptParser . RULE_expression ) ;
1385
1389
this . state = 261 ;
1386
1390
if ( ! ( this . precpred ( this . _ctx , 16 ) ) ) {
1387
- throw new FailedPredicateException ( this , "this.precpred(this._ctx, 16)" ) ;
1391
+ throw this . createFailedPredicateException ( "this.precpred(this._ctx, 16)" ) ;
1388
1392
}
1389
1393
this . state = 262 ;
1390
1394
( _localctx as UnaryOpContext ) . _op = this . _input . LT ( 1 ) ;
@@ -1409,7 +1413,7 @@ export class CashScriptParser extends Parser {
1409
1413
this . pushNewRecursionContext ( _localctx , _startState , CashScriptParser . RULE_expression ) ;
1410
1414
this . state = 263 ;
1411
1415
if ( ! ( this . precpred ( this . _ctx , 14 ) ) ) {
1412
- throw new FailedPredicateException ( this , "this.precpred(this._ctx, 14)" ) ;
1416
+ throw this . createFailedPredicateException ( "this.precpred(this._ctx, 14)" ) ;
1413
1417
}
1414
1418
this . state = 264 ;
1415
1419
( _localctx as BinaryOpContext ) . _op = this . match ( CashScriptParser . T__27 ) ;
@@ -2341,8 +2345,8 @@ export class RequireStatementContext extends ParserRuleContext {
2341
2345
2342
2346
2343
2347
export class IfStatementContext extends ParserRuleContext {
2344
- public _ifBlock : BlockContext ;
2345
- public _elseBlock : BlockContext ;
2348
+ public _ifBlock ! : BlockContext ;
2349
+ public _elseBlock ! : BlockContext ;
2346
2350
public expression ( ) : ExpressionContext {
2347
2351
return this . getRuleContext ( 0 , ExpressionContext ) ;
2348
2352
}
@@ -2494,8 +2498,8 @@ export class ParenthesisedContext extends ExpressionContext {
2494
2498
}
2495
2499
}
2496
2500
export class CastContext extends ExpressionContext {
2497
- public _castable : ExpressionContext ;
2498
- public _size : ExpressionContext ;
2501
+ public _castable ! : ExpressionContext ;
2502
+ public _size ! : ExpressionContext ;
2499
2503
public typeName ( ) : TypeNameContext {
2500
2504
return this . getRuleContext ( 0 , TypeNameContext ) ;
2501
2505
}
@@ -2593,7 +2597,7 @@ export class InstantiationContext extends ExpressionContext {
2593
2597
}
2594
2598
}
2595
2599
export class TupleIndexOpContext extends ExpressionContext {
2596
- public _index : Token ;
2600
+ public _index ! : Token ;
2597
2601
public expression ( ) : ExpressionContext {
2598
2602
return this . getRuleContext ( 0 , ExpressionContext ) ;
2599
2603
}
@@ -2624,7 +2628,7 @@ export class TupleIndexOpContext extends ExpressionContext {
2624
2628
}
2625
2629
}
2626
2630
export class UnaryOpContext extends ExpressionContext {
2627
- public _op : Token ;
2631
+ public _op ! : Token ;
2628
2632
public expression ( ) : ExpressionContext {
2629
2633
return this . getRuleContext ( 0 , ExpressionContext ) ;
2630
2634
}
@@ -2654,9 +2658,9 @@ export class UnaryOpContext extends ExpressionContext {
2654
2658
}
2655
2659
}
2656
2660
export class BinaryOpContext extends ExpressionContext {
2657
- public _left : ExpressionContext ;
2658
- public _op : Token ;
2659
- public _right : ExpressionContext ;
2661
+ public _left ! : ExpressionContext ;
2662
+ public _op ! : Token ;
2663
+ public _right ! : ExpressionContext ;
2660
2664
public expression ( ) : ExpressionContext [ ] ;
2661
2665
public expression ( i : number ) : ExpressionContext ;
2662
2666
public expression ( i ?: number ) : ExpressionContext | ExpressionContext [ ] {
0 commit comments