@dseict/psc-interpreter 0.0.2 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,6 @@
1
- // Generated from ./PSCParser.g4 by ANTLR 4.13.2
1
+ // Generated from ./PSCParser.g4 by ANTLR 4.13.0
2
2
  // noinspection ES6UnusedImports,JSUnusedGlobalSymbols,JSUnusedLocalSymbols
3
- import { ATN, ATNDeserializer, DecisionState, DFA, FailedPredicateException, RecognitionException, NoViableAltException, BailErrorStrategy, Parser, ParserATNSimulator, RuleContext, ParserRuleContext, PredictionMode, PredictionContextCache, TerminalNode, RuleNode, Token, TokenStream, Interval, IntervalSet } from 'antlr4';
4
- import PSCParserVisitor from "./PSCParserVisitor.js";
3
+ import { ATN, ATNDeserializer, DFA, FailedPredicateException, RecognitionException, NoViableAltException, BailErrorStrategy, Parser, ParserATNSimulator, ParserRuleContext, PredictionMode, PredictionContextCache, RuleNode, Token, Interval, IntervalSet } from 'antlr4';
5
4
  export default class PSCParser extends Parser {
6
5
  static INDENT = 1;
7
6
  static DEDENT = 2;
@@ -162,7 +161,7 @@ export default class PSCParser extends Parser {
162
161
  }
163
162
  // @RuleVersion(0)
164
163
  program() {
165
- let localctx = new ProgramContext(this, this._ctx, this.state);
164
+ const localctx = new ProgramContext(this, this._ctx, this.state);
166
165
  this.enterRule(localctx, 0, PSCParser.RULE_program);
167
166
  let _la;
168
167
  try {
@@ -212,7 +211,7 @@ export default class PSCParser extends Parser {
212
211
  }
213
212
  // @RuleVersion(0)
214
213
  addOp() {
215
- let localctx = new AddOpContext(this, this._ctx, this.state);
214
+ const localctx = new AddOpContext(this, this._ctx, this.state);
216
215
  this.enterRule(localctx, 2, PSCParser.RULE_addOp);
217
216
  let _la;
218
217
  try {
@@ -246,7 +245,7 @@ export default class PSCParser extends Parser {
246
245
  }
247
246
  // @RuleVersion(0)
248
247
  mulOp() {
249
- let localctx = new MulOpContext(this, this._ctx, this.state);
248
+ const localctx = new MulOpContext(this, this._ctx, this.state);
250
249
  this.enterRule(localctx, 4, PSCParser.RULE_mulOp);
251
250
  let _la;
252
251
  try {
@@ -280,7 +279,7 @@ export default class PSCParser extends Parser {
280
279
  }
281
280
  // @RuleVersion(0)
282
281
  expOp() {
283
- let localctx = new ExpOpContext(this, this._ctx, this.state);
282
+ const localctx = new ExpOpContext(this, this._ctx, this.state);
284
283
  this.enterRule(localctx, 6, PSCParser.RULE_expOp);
285
284
  try {
286
285
  this.enterOuterAlt(localctx, 1);
@@ -306,7 +305,7 @@ export default class PSCParser extends Parser {
306
305
  }
307
306
  // @RuleVersion(0)
308
307
  compOp() {
309
- let localctx = new CompOpContext(this, this._ctx, this.state);
308
+ const localctx = new CompOpContext(this, this._ctx, this.state);
310
309
  this.enterRule(localctx, 8, PSCParser.RULE_compOp);
311
310
  let _la;
312
311
  try {
@@ -340,7 +339,7 @@ export default class PSCParser extends Parser {
340
339
  }
341
340
  // @RuleVersion(0)
342
341
  expr() {
343
- let localctx = new ExprContext(this, this._ctx, this.state);
342
+ const localctx = new ExprContext(this, this._ctx, this.state);
344
343
  this.enterRule(localctx, 10, PSCParser.RULE_expr);
345
344
  try {
346
345
  this.enterOuterAlt(localctx, 1);
@@ -366,7 +365,7 @@ export default class PSCParser extends Parser {
366
365
  }
367
366
  // @RuleVersion(0)
368
367
  orExpr() {
369
- let localctx = new OrExprContext(this, this._ctx, this.state);
368
+ const localctx = new OrExprContext(this, this._ctx, this.state);
370
369
  this.enterRule(localctx, 12, PSCParser.RULE_orExpr);
371
370
  let _la;
372
371
  try {
@@ -409,7 +408,7 @@ export default class PSCParser extends Parser {
409
408
  }
410
409
  // @RuleVersion(0)
411
410
  andExpr() {
412
- let localctx = new AndExprContext(this, this._ctx, this.state);
411
+ const localctx = new AndExprContext(this, this._ctx, this.state);
413
412
  this.enterRule(localctx, 14, PSCParser.RULE_andExpr);
414
413
  let _la;
415
414
  try {
@@ -452,7 +451,7 @@ export default class PSCParser extends Parser {
452
451
  }
453
452
  // @RuleVersion(0)
454
453
  compExpr() {
455
- let localctx = new CompExprContext(this, this._ctx, this.state);
454
+ const localctx = new CompExprContext(this, this._ctx, this.state);
456
455
  this.enterRule(localctx, 16, PSCParser.RULE_compExpr);
457
456
  let _la;
458
457
  try {
@@ -495,7 +494,7 @@ export default class PSCParser extends Parser {
495
494
  }
496
495
  // @RuleVersion(0)
497
496
  addExpr() {
498
- let localctx = new AddExprContext(this, this._ctx, this.state);
497
+ const localctx = new AddExprContext(this, this._ctx, this.state);
499
498
  this.enterRule(localctx, 18, PSCParser.RULE_addExpr);
500
499
  let _la;
501
500
  try {
@@ -538,7 +537,7 @@ export default class PSCParser extends Parser {
538
537
  }
539
538
  // @RuleVersion(0)
540
539
  mulExpr() {
541
- let localctx = new MulExprContext(this, this._ctx, this.state);
540
+ const localctx = new MulExprContext(this, this._ctx, this.state);
542
541
  this.enterRule(localctx, 20, PSCParser.RULE_mulExpr);
543
542
  let _la;
544
543
  try {
@@ -581,7 +580,7 @@ export default class PSCParser extends Parser {
581
580
  }
582
581
  // @RuleVersion(0)
583
582
  expExpr() {
584
- let localctx = new ExpExprContext(this, this._ctx, this.state);
583
+ const localctx = new ExpExprContext(this, this._ctx, this.state);
585
584
  this.enterRule(localctx, 22, PSCParser.RULE_expExpr);
586
585
  let _la;
587
586
  try {
@@ -624,7 +623,7 @@ export default class PSCParser extends Parser {
624
623
  }
625
624
  // @RuleVersion(0)
626
625
  unaryExpr() {
627
- let localctx = new UnaryExprContext(this, this._ctx, this.state);
626
+ const localctx = new UnaryExprContext(this, this._ctx, this.state);
628
627
  this.enterRule(localctx, 24, PSCParser.RULE_unaryExpr);
629
628
  let _la;
630
629
  try {
@@ -675,7 +674,7 @@ export default class PSCParser extends Parser {
675
674
  }
676
675
  // @RuleVersion(0)
677
676
  notExpr() {
678
- let localctx = new NotExprContext(this, this._ctx, this.state);
677
+ const localctx = new NotExprContext(this, this._ctx, this.state);
679
678
  this.enterRule(localctx, 26, PSCParser.RULE_notExpr);
680
679
  let _la;
681
680
  try {
@@ -719,11 +718,11 @@ export default class PSCParser extends Parser {
719
718
  if (_p === undefined) {
720
719
  _p = 0;
721
720
  }
722
- let _parentctx = this._ctx;
723
- let _parentState = this.state;
721
+ const _parentctx = this._ctx;
722
+ const _parentState = this.state;
724
723
  let localctx = new PrimaryExprContext(this, this._ctx, _parentState);
725
724
  let _prevctx = localctx;
726
- let _startState = 28;
725
+ const _startState = 28;
727
726
  this.enterRecursionRule(localctx, 28, PSCParser.RULE_primaryExpr, _p);
728
727
  let _la;
729
728
  try {
@@ -845,7 +844,7 @@ export default class PSCParser extends Parser {
845
844
  }
846
845
  // @RuleVersion(0)
847
846
  groupExpr() {
848
- let localctx = new GroupExprContext(this, this._ctx, this.state);
847
+ const localctx = new GroupExprContext(this, this._ctx, this.state);
849
848
  this.enterRule(localctx, 30, PSCParser.RULE_groupExpr);
850
849
  try {
851
850
  this.state = 197;
@@ -899,7 +898,7 @@ export default class PSCParser extends Parser {
899
898
  }
900
899
  // @RuleVersion(0)
901
900
  atom() {
902
- let localctx = new AtomContext(this, this._ctx, this.state);
901
+ const localctx = new AtomContext(this, this._ctx, this.state);
903
902
  this.enterRule(localctx, 32, PSCParser.RULE_atom);
904
903
  try {
905
904
  this.state = 201;
@@ -946,7 +945,7 @@ export default class PSCParser extends Parser {
946
945
  }
947
946
  // @RuleVersion(0)
948
947
  lits() {
949
- let localctx = new LitsContext(this, this._ctx, this.state);
948
+ const localctx = new LitsContext(this, this._ctx, this.state);
950
949
  this.enterRule(localctx, 34, PSCParser.RULE_lits);
951
950
  try {
952
951
  this.state = 209;
@@ -1013,7 +1012,7 @@ export default class PSCParser extends Parser {
1013
1012
  }
1014
1013
  // @RuleVersion(0)
1015
1014
  intLits() {
1016
- let localctx = new IntLitsContext(this, this._ctx, this.state);
1015
+ const localctx = new IntLitsContext(this, this._ctx, this.state);
1017
1016
  this.enterRule(localctx, 36, PSCParser.RULE_intLits);
1018
1017
  let _la;
1019
1018
  try {
@@ -1049,7 +1048,7 @@ export default class PSCParser extends Parser {
1049
1048
  }
1050
1049
  // @RuleVersion(0)
1051
1050
  floatLits() {
1052
- let localctx = new FloatLitsContext(this, this._ctx, this.state);
1051
+ const localctx = new FloatLitsContext(this, this._ctx, this.state);
1053
1052
  this.enterRule(localctx, 38, PSCParser.RULE_floatLits);
1054
1053
  let _la;
1055
1054
  try {
@@ -1085,7 +1084,7 @@ export default class PSCParser extends Parser {
1085
1084
  }
1086
1085
  // @RuleVersion(0)
1087
1086
  arrayLits() {
1088
- let localctx = new ArrayLitsContext(this, this._ctx, this.state);
1087
+ const localctx = new ArrayLitsContext(this, this._ctx, this.state);
1089
1088
  this.enterRule(localctx, 40, PSCParser.RULE_arrayLits);
1090
1089
  let _la;
1091
1090
  try {
@@ -1139,7 +1138,7 @@ export default class PSCParser extends Parser {
1139
1138
  }
1140
1139
  // @RuleVersion(0)
1141
1140
  stmts() {
1142
- let localctx = new StmtsContext(this, this._ctx, this.state);
1141
+ const localctx = new StmtsContext(this, this._ctx, this.state);
1143
1142
  this.enterRule(localctx, 42, PSCParser.RULE_stmts);
1144
1143
  let _la;
1145
1144
  try {
@@ -1225,7 +1224,7 @@ export default class PSCParser extends Parser {
1225
1224
  }
1226
1225
  // @RuleVersion(0)
1227
1226
  stmt() {
1228
- let localctx = new StmtContext(this, this._ctx, this.state);
1227
+ const localctx = new StmtContext(this, this._ctx, this.state);
1229
1228
  this.enterRule(localctx, 44, PSCParser.RULE_stmt);
1230
1229
  try {
1231
1230
  this.state = 268;
@@ -1320,7 +1319,7 @@ export default class PSCParser extends Parser {
1320
1319
  }
1321
1320
  // @RuleVersion(0)
1322
1321
  block() {
1323
- let localctx = new BlockContext(this, this._ctx, this.state);
1322
+ const localctx = new BlockContext(this, this._ctx, this.state);
1324
1323
  this.enterRule(localctx, 46, PSCParser.RULE_block);
1325
1324
  try {
1326
1325
  this.enterOuterAlt(localctx, 1);
@@ -1350,7 +1349,7 @@ export default class PSCParser extends Parser {
1350
1349
  }
1351
1350
  // @RuleVersion(0)
1352
1351
  ifStmt() {
1353
- let localctx = new IfStmtContext(this, this._ctx, this.state);
1352
+ const localctx = new IfStmtContext(this, this._ctx, this.state);
1354
1353
  this.enterRule(localctx, 48, PSCParser.RULE_ifStmt);
1355
1354
  try {
1356
1355
  this.enterOuterAlt(localctx, 1);
@@ -1408,7 +1407,7 @@ export default class PSCParser extends Parser {
1408
1407
  }
1409
1408
  // @RuleVersion(0)
1410
1409
  whileStmt() {
1411
- let localctx = new WhileStmtContext(this, this._ctx, this.state);
1410
+ const localctx = new WhileStmtContext(this, this._ctx, this.state);
1412
1411
  this.enterRule(localctx, 50, PSCParser.RULE_whileStmt);
1413
1412
  try {
1414
1413
  this.enterOuterAlt(localctx, 1);
@@ -1440,7 +1439,7 @@ export default class PSCParser extends Parser {
1440
1439
  }
1441
1440
  // @RuleVersion(0)
1442
1441
  doWhileStmt() {
1443
- let localctx = new DoWhileStmtContext(this, this._ctx, this.state);
1442
+ const localctx = new DoWhileStmtContext(this, this._ctx, this.state);
1444
1443
  this.enterRule(localctx, 52, PSCParser.RULE_doWhileStmt);
1445
1444
  try {
1446
1445
  this.enterOuterAlt(localctx, 1);
@@ -1476,7 +1475,7 @@ export default class PSCParser extends Parser {
1476
1475
  }
1477
1476
  // @RuleVersion(0)
1478
1477
  repeatUntilStmt() {
1479
- let localctx = new RepeatUntilStmtContext(this, this._ctx, this.state);
1478
+ const localctx = new RepeatUntilStmtContext(this, this._ctx, this.state);
1480
1479
  this.enterRule(localctx, 54, PSCParser.RULE_repeatUntilStmt);
1481
1480
  try {
1482
1481
  this.enterOuterAlt(localctx, 1);
@@ -1512,7 +1511,7 @@ export default class PSCParser extends Parser {
1512
1511
  }
1513
1512
  // @RuleVersion(0)
1514
1513
  forStmt() {
1515
- let localctx = new ForStmtContext(this, this._ctx, this.state);
1514
+ const localctx = new ForStmtContext(this, this._ctx, this.state);
1516
1515
  this.enterRule(localctx, 56, PSCParser.RULE_forStmt);
1517
1516
  let _la;
1518
1517
  try {
@@ -1562,7 +1561,7 @@ export default class PSCParser extends Parser {
1562
1561
  }
1563
1562
  // @RuleVersion(0)
1564
1563
  asmStmt() {
1565
- let localctx = new AsmStmtContext(this, this._ctx, this.state);
1564
+ const localctx = new AsmStmtContext(this, this._ctx, this.state);
1566
1565
  this.enterRule(localctx, 58, PSCParser.RULE_asmStmt);
1567
1566
  try {
1568
1567
  this.enterOuterAlt(localctx, 1);
@@ -1595,11 +1594,11 @@ export default class PSCParser extends Parser {
1595
1594
  if (_p === undefined) {
1596
1595
  _p = 0;
1597
1596
  }
1598
- let _parentctx = this._ctx;
1599
- let _parentState = this.state;
1597
+ const _parentctx = this._ctx;
1598
+ const _parentState = this.state;
1600
1599
  let localctx = new LvalueContext(this, this._ctx, _parentState);
1601
1600
  let _prevctx = localctx;
1602
- let _startState = 60;
1601
+ const _startState = 60;
1603
1602
  this.enterRecursionRule(localctx, 60, PSCParser.RULE_lvalue, _p);
1604
1603
  let _la;
1605
1604
  try {
@@ -1676,7 +1675,7 @@ export default class PSCParser extends Parser {
1676
1675
  }
1677
1676
  // @RuleVersion(0)
1678
1677
  inputStmt() {
1679
- let localctx = new InputStmtContext(this, this._ctx, this.state);
1678
+ const localctx = new InputStmtContext(this, this._ctx, this.state);
1680
1679
  this.enterRule(localctx, 62, PSCParser.RULE_inputStmt);
1681
1680
  try {
1682
1681
  this.enterOuterAlt(localctx, 1);
@@ -1704,7 +1703,7 @@ export default class PSCParser extends Parser {
1704
1703
  }
1705
1704
  // @RuleVersion(0)
1706
1705
  outputStmt() {
1707
- let localctx = new OutputStmtContext(this, this._ctx, this.state);
1706
+ const localctx = new OutputStmtContext(this, this._ctx, this.state);
1708
1707
  this.enterRule(localctx, 64, PSCParser.RULE_outputStmt);
1709
1708
  try {
1710
1709
  this.enterOuterAlt(localctx, 1);
@@ -1732,7 +1731,7 @@ export default class PSCParser extends Parser {
1732
1731
  }
1733
1732
  // @RuleVersion(0)
1734
1733
  subprogram() {
1735
- let localctx = new SubprogramContext(this, this._ctx, this.state);
1734
+ const localctx = new SubprogramContext(this, this._ctx, this.state);
1736
1735
  this.enterRule(localctx, 66, PSCParser.RULE_subprogram);
1737
1736
  let _la;
1738
1737
  try {
@@ -1794,7 +1793,7 @@ export default class PSCParser extends Parser {
1794
1793
  }
1795
1794
  // @RuleVersion(0)
1796
1795
  returnStmt() {
1797
- let localctx = new ReturnStmtContext(this, this._ctx, this.state);
1796
+ const localctx = new ReturnStmtContext(this, this._ctx, this.state);
1798
1797
  this.enterRule(localctx, 68, PSCParser.RULE_returnStmt);
1799
1798
  try {
1800
1799
  this.enterOuterAlt(localctx, 1);