tzo 1.0.15 → 1.0.19
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.
- package/dist/{cjs → browser}/cli.d.ts +0 -0
- package/dist/{cjs → browser}/cli.js +6 -5
- package/dist/browser/cli.js.map +1 -0
- package/dist/browser/concisetext/ConciseTextLexer.d.ts +30 -0
- package/dist/browser/concisetext/ConciseTextLexer.js +123 -0
- package/dist/browser/concisetext/ConciseTextLexer.js.map +1 -0
- package/dist/browser/concisetext/ConciseTextListener.d.ts +14 -0
- package/dist/browser/concisetext/ConciseTextListener.js +36 -0
- package/dist/browser/concisetext/ConciseTextListener.js.map +1 -0
- package/dist/browser/concisetext/ConciseTextParser.d.ts +99 -0
- package/dist/browser/concisetext/ConciseTextParser.js +439 -0
- package/dist/browser/concisetext/ConciseTextParser.js.map +1 -0
- package/dist/{cjs → browser}/getStackParams.d.ts +1 -1
- package/dist/{cjs → browser}/getStackParams.js +1 -0
- package/dist/browser/getStackParams.js.map +1 -0
- package/dist/browser/index.d.ts +5 -0
- package/dist/{cjs → browser}/index.js +6 -5
- package/dist/browser/index.js.map +1 -0
- package/dist/{cjs → browser}/interfaces.d.ts +1 -1
- package/dist/{cjs → browser}/interfaces.js +1 -0
- package/dist/browser/interfaces.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/and.d.ts +1 -1
- package/dist/browser/opcodes/and.js +9 -0
- package/dist/browser/opcodes/and.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/charCode.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/charCode.js +3 -2
- package/dist/browser/opcodes/charCode.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/closeBrace.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/closeBrace.js +2 -1
- package/dist/browser/opcodes/closeBrace.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/concat.d.ts +1 -1
- package/dist/browser/opcodes/concat.js +9 -0
- package/dist/browser/opcodes/concat.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/delContext.d.ts +1 -1
- package/dist/browser/opcodes/delContext.js +9 -0
- package/dist/browser/opcodes/delContext.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/dup.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/dup.js +3 -2
- package/dist/browser/opcodes/dup.js.map +1 -0
- package/dist/browser/opcodes/eq.d.ts +3 -0
- package/dist/browser/opcodes/eq.js +10 -0
- package/dist/browser/opcodes/eq.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/exit.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/exit.js +1 -0
- package/dist/browser/opcodes/exit.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/getContext.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/getContext.js +3 -2
- package/dist/browser/opcodes/getContext.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/goto.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/goto.js +3 -2
- package/dist/browser/opcodes/goto.js.map +1 -0
- package/dist/browser/opcodes/gt.d.ts +3 -0
- package/dist/{cjs → browser}/opcodes/gt.js +3 -2
- package/dist/browser/opcodes/gt.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/hasContext.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/hasContext.js +3 -2
- package/dist/browser/opcodes/hasContext.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/jgz.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/jgz.js +3 -2
- package/dist/browser/opcodes/jgz.js.map +1 -0
- package/dist/browser/opcodes/jz.d.ts +3 -0
- package/dist/{cjs → browser}/opcodes/jz.js +3 -2
- package/dist/browser/opcodes/jz.js.map +1 -0
- package/dist/browser/opcodes/lt.d.ts +3 -0
- package/dist/{cjs → browser}/opcodes/lt.js +3 -2
- package/dist/browser/opcodes/lt.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/min.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/min.js +3 -2
- package/dist/browser/opcodes/min.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/mul.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/mul.js +3 -2
- package/dist/browser/opcodes/mul.js.map +1 -0
- package/dist/{mjs → browser}/opcodes/nop.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/nop.js +1 -0
- package/dist/browser/opcodes/nop.js.map +1 -0
- package/dist/{mjs → browser}/opcodes/not.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/not.js +3 -2
- package/dist/browser/opcodes/not.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/openBrace.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/openBrace.js +2 -1
- package/dist/browser/opcodes/openBrace.js.map +1 -0
- package/dist/browser/opcodes/or.d.ts +3 -0
- package/dist/browser/opcodes/or.js +9 -0
- package/dist/browser/opcodes/or.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/pause.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/pause.js +1 -0
- package/dist/browser/opcodes/pause.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/plus.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/plus.js +3 -2
- package/dist/browser/opcodes/plus.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/pop.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/pop.js +1 -0
- package/dist/browser/opcodes/pop.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/ppc.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/ppc.js +1 -0
- package/dist/browser/opcodes/ppc.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/randInt.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/randInt.js +3 -2
- package/dist/browser/opcodes/randInt.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/rconcat.d.ts +1 -1
- package/dist/browser/opcodes/rconcat.js +9 -0
- package/dist/browser/opcodes/rconcat.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/setContext.d.ts +1 -1
- package/dist/browser/opcodes/setContext.js +9 -0
- package/dist/browser/opcodes/setContext.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/stacksize.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/stacksize.js +1 -0
- package/dist/browser/opcodes/stacksize.js.map +1 -0
- package/dist/{cjs → browser}/opcodes/stdout.d.ts +1 -1
- package/dist/{cjs → browser}/opcodes/stdout.js +1 -0
- package/dist/browser/opcodes/stdout.js.map +1 -0
- package/dist/{cjs → browser}/util/builder.d.ts +0 -0
- package/dist/{cjs → browser}/util/builder.js +1 -0
- package/dist/browser/util/builder.js.map +1 -0
- package/dist/{cjs → browser}/util/fix_antlr_grammar_ts.d.ts +0 -0
- package/dist/{cjs → browser}/util/fix_antlr_grammar_ts.js +1 -0
- package/dist/browser/util/fix_antlr_grammar_ts.js.map +1 -0
- package/dist/{mjs → browser}/util/tokenizer.d.ts +2 -2
- package/dist/{cjs → browser}/util/tokenizer.js +18 -16
- package/dist/browser/util/tokenizer.js.map +1 -0
- package/dist/{cjs → browser}/vm.d.ts +1 -1
- package/dist/{cjs → browser}/vm.js +64 -63
- package/dist/browser/vm.js.map +1 -0
- package/dist/{cjs → browser}/vm.test.d.ts +0 -0
- package/dist/{cjs → browser}/vm.test.js +2 -1
- package/dist/browser/vm.test.js.map +1 -0
- package/dist/{mjs → node}/cli.d.ts +0 -0
- package/dist/node/cli.js +35 -0
- package/dist/node/cli.js.map +1 -0
- package/dist/node/concisetext/ConciseTextLexer.d.ts +30 -0
- package/dist/node/concisetext/ConciseTextLexer.js +123 -0
- package/dist/node/concisetext/ConciseTextLexer.js.map +1 -0
- package/dist/node/concisetext/ConciseTextListener.d.ts +14 -0
- package/dist/node/concisetext/ConciseTextListener.js +36 -0
- package/dist/node/concisetext/ConciseTextListener.js.map +1 -0
- package/dist/node/concisetext/ConciseTextParser.d.ts +99 -0
- package/dist/node/concisetext/ConciseTextParser.js +439 -0
- package/dist/node/concisetext/ConciseTextParser.js.map +1 -0
- package/dist/{mjs → node}/getStackParams.d.ts +1 -1
- package/dist/{mjs → node}/getStackParams.js +6 -1
- package/dist/node/getStackParams.js.map +1 -0
- package/dist/node/index.d.ts +5 -0
- package/dist/node/index.js +18 -0
- package/dist/node/index.js.map +1 -0
- package/dist/{mjs → node}/interfaces.d.ts +1 -1
- package/dist/node/interfaces.js +3 -0
- package/dist/node/interfaces.js.map +1 -0
- package/dist/{mjs → node}/opcodes/and.d.ts +1 -1
- package/dist/node/opcodes/and.js +9 -0
- package/dist/node/opcodes/and.js.map +1 -0
- package/dist/{mjs → node}/opcodes/charCode.d.ts +1 -1
- package/dist/node/opcodes/charCode.js +10 -0
- package/dist/node/opcodes/charCode.js.map +1 -0
- package/dist/{mjs → node}/opcodes/closeBrace.d.ts +1 -1
- package/dist/node/opcodes/closeBrace.js +7 -0
- package/dist/node/opcodes/closeBrace.js.map +1 -0
- package/dist/{mjs → node}/opcodes/concat.d.ts +1 -1
- package/dist/node/opcodes/concat.js +9 -0
- package/dist/node/opcodes/concat.js.map +1 -0
- package/dist/{mjs → node}/opcodes/delContext.d.ts +1 -1
- package/dist/node/opcodes/delContext.js +9 -0
- package/dist/node/opcodes/delContext.js.map +1 -0
- package/dist/{mjs → node}/opcodes/dup.d.ts +1 -1
- package/dist/node/opcodes/dup.js +13 -0
- package/dist/node/opcodes/dup.js.map +1 -0
- package/dist/node/opcodes/eq.d.ts +3 -0
- package/dist/node/opcodes/eq.js +10 -0
- package/dist/node/opcodes/eq.js.map +1 -0
- package/dist/{mjs → node}/opcodes/exit.d.ts +1 -1
- package/dist/node/opcodes/exit.js +7 -0
- package/dist/node/opcodes/exit.js.map +1 -0
- package/dist/{mjs → node}/opcodes/getContext.d.ts +1 -1
- package/dist/node/opcodes/getContext.js +13 -0
- package/dist/node/opcodes/getContext.js.map +1 -0
- package/dist/{mjs → node}/opcodes/goto.d.ts +1 -1
- package/dist/{mjs → node}/opcodes/goto.js +6 -3
- package/dist/node/opcodes/goto.js.map +1 -0
- package/dist/node/opcodes/gt.d.ts +3 -0
- package/dist/node/opcodes/gt.js +10 -0
- package/dist/node/opcodes/gt.js.map +1 -0
- package/dist/{mjs → node}/opcodes/hasContext.d.ts +1 -1
- package/dist/node/opcodes/hasContext.js +14 -0
- package/dist/node/opcodes/hasContext.js.map +1 -0
- package/dist/{mjs → node}/opcodes/jgz.d.ts +1 -1
- package/dist/node/opcodes/jgz.js +11 -0
- package/dist/node/opcodes/jgz.js.map +1 -0
- package/dist/node/opcodes/jz.d.ts +3 -0
- package/dist/node/opcodes/jz.js +11 -0
- package/dist/node/opcodes/jz.js.map +1 -0
- package/dist/node/opcodes/lt.d.ts +3 -0
- package/dist/node/opcodes/lt.js +10 -0
- package/dist/node/opcodes/lt.js.map +1 -0
- package/dist/{mjs → node}/opcodes/min.d.ts +1 -1
- package/dist/node/opcodes/min.js +11 -0
- package/dist/node/opcodes/min.js.map +1 -0
- package/dist/{mjs → node}/opcodes/mul.d.ts +1 -1
- package/dist/node/opcodes/mul.js +11 -0
- package/dist/node/opcodes/mul.js.map +1 -0
- package/dist/{cjs → node}/opcodes/nop.d.ts +1 -1
- package/dist/node/opcodes/nop.js +10 -0
- package/dist/node/opcodes/nop.js.map +1 -0
- package/dist/{cjs → node}/opcodes/not.d.ts +1 -1
- package/dist/node/opcodes/not.js +17 -0
- package/dist/node/opcodes/not.js.map +1 -0
- package/dist/{mjs → node}/opcodes/openBrace.d.ts +1 -1
- package/dist/{mjs → node}/opcodes/openBrace.js +5 -2
- package/dist/node/opcodes/openBrace.js.map +1 -0
- package/dist/node/opcodes/or.d.ts +3 -0
- package/dist/node/opcodes/or.js +9 -0
- package/dist/node/opcodes/or.js.map +1 -0
- package/dist/{mjs → node}/opcodes/pause.d.ts +1 -1
- package/dist/node/opcodes/pause.js +7 -0
- package/dist/node/opcodes/pause.js.map +1 -0
- package/dist/{mjs → node}/opcodes/plus.d.ts +1 -1
- package/dist/node/opcodes/plus.js +11 -0
- package/dist/node/opcodes/plus.js.map +1 -0
- package/dist/{mjs → node}/opcodes/pop.d.ts +1 -1
- package/dist/node/opcodes/pop.js +7 -0
- package/dist/node/opcodes/pop.js.map +1 -0
- package/dist/{mjs → node}/opcodes/ppc.d.ts +1 -1
- package/dist/{mjs → node}/opcodes/ppc.js +4 -1
- package/dist/node/opcodes/ppc.js.map +1 -0
- package/dist/{mjs → node}/opcodes/randInt.d.ts +1 -1
- package/dist/node/opcodes/randInt.js +10 -0
- package/dist/node/opcodes/randInt.js.map +1 -0
- package/dist/{mjs → node}/opcodes/rconcat.d.ts +1 -1
- package/dist/node/opcodes/rconcat.js +9 -0
- package/dist/node/opcodes/rconcat.js.map +1 -0
- package/dist/{mjs → node}/opcodes/setContext.d.ts +1 -1
- package/dist/node/opcodes/setContext.js +9 -0
- package/dist/node/opcodes/setContext.js.map +1 -0
- package/dist/{mjs → node}/opcodes/stacksize.d.ts +1 -1
- package/dist/node/opcodes/stacksize.js +7 -0
- package/dist/node/opcodes/stacksize.js.map +1 -0
- package/dist/{mjs → node}/opcodes/stdout.d.ts +1 -1
- package/dist/node/opcodes/stdout.js +7 -0
- package/dist/node/opcodes/stdout.js.map +1 -0
- package/dist/{mjs → node}/util/builder.d.ts +0 -0
- package/dist/{mjs → node}/util/builder.js +6 -1
- package/dist/node/util/builder.js.map +1 -0
- package/dist/{mjs → node}/util/fix_antlr_grammar_ts.d.ts +0 -0
- package/dist/{mjs → node}/util/fix_antlr_grammar_ts.js +1 -0
- package/dist/node/util/fix_antlr_grammar_ts.js.map +1 -0
- package/dist/{cjs → node}/util/tokenizer.d.ts +2 -2
- package/dist/{mjs → node}/util/tokenizer.js +37 -28
- package/dist/node/util/tokenizer.js.map +1 -0
- package/dist/{mjs → node}/vm.d.ts +1 -1
- package/dist/{mjs → node}/vm.js +76 -70
- package/dist/node/vm.js.map +1 -0
- package/dist/{mjs → node}/vm.test.d.ts +0 -0
- package/dist/{mjs → node}/vm.test.js +18 -12
- package/dist/node/vm.test.js.map +1 -0
- package/package.json +12 -17
- package/tsconfig-browser.json +9 -0
- package/tsconfig.json +26 -5
- package/cjs_package.json +0 -3
- package/dist/cjs/concisetext/ConciseTextLexer.d.ts +0 -34
- package/dist/cjs/concisetext/ConciseTextLexer.js +0 -144
- package/dist/cjs/concisetext/ConciseTextListener.d.ts +0 -51
- package/dist/cjs/concisetext/ConciseTextListener.js +0 -4
- package/dist/cjs/concisetext/ConciseTextParser.d.ts +0 -100
- package/dist/cjs/concisetext/ConciseTextParser.js +0 -464
- package/dist/cjs/concisetext/ConciseTextVisitor.d.ts +0 -38
- package/dist/cjs/concisetext/ConciseTextVisitor.js +0 -4
- package/dist/cjs/index.d.ts +0 -5
- package/dist/cjs/opcodes/and.js +0 -8
- package/dist/cjs/opcodes/concat.js +0 -8
- package/dist/cjs/opcodes/delContext.js +0 -8
- package/dist/cjs/opcodes/eq.d.ts +0 -3
- package/dist/cjs/opcodes/eq.js +0 -9
- package/dist/cjs/opcodes/gt.d.ts +0 -3
- package/dist/cjs/opcodes/jz.d.ts +0 -3
- package/dist/cjs/opcodes/lt.d.ts +0 -3
- package/dist/cjs/opcodes/or.d.ts +0 -3
- package/dist/cjs/opcodes/or.js +0 -8
- package/dist/cjs/opcodes/rconcat.js +0 -8
- package/dist/cjs/opcodes/setContext.js +0 -8
- package/dist/cjs/package.json +0 -3
- package/dist/mjs/cli.js +0 -29
- package/dist/mjs/concisetext/ConciseTextLexer.d.ts +0 -34
- package/dist/mjs/concisetext/ConciseTextLexer.js +0 -121
- package/dist/mjs/concisetext/ConciseTextListener.d.ts +0 -51
- package/dist/mjs/concisetext/ConciseTextListener.js +0 -3
- package/dist/mjs/concisetext/ConciseTextParser.d.ts +0 -100
- package/dist/mjs/concisetext/ConciseTextParser.js +0 -437
- package/dist/mjs/concisetext/ConciseTextVisitor.d.ts +0 -38
- package/dist/mjs/concisetext/ConciseTextVisitor.js +0 -3
- package/dist/mjs/index.d.ts +0 -5
- package/dist/mjs/index.js +0 -5
- package/dist/mjs/interfaces.js +0 -1
- package/dist/mjs/opcodes/and.js +0 -6
- package/dist/mjs/opcodes/charCode.js +0 -7
- package/dist/mjs/opcodes/closeBrace.js +0 -4
- package/dist/mjs/opcodes/concat.js +0 -6
- package/dist/mjs/opcodes/delContext.js +0 -6
- package/dist/mjs/opcodes/dup.js +0 -10
- package/dist/mjs/opcodes/eq.d.ts +0 -3
- package/dist/mjs/opcodes/eq.js +0 -7
- package/dist/mjs/opcodes/exit.js +0 -4
- package/dist/mjs/opcodes/getContext.js +0 -10
- package/dist/mjs/opcodes/gt.d.ts +0 -3
- package/dist/mjs/opcodes/gt.js +0 -7
- package/dist/mjs/opcodes/hasContext.js +0 -11
- package/dist/mjs/opcodes/jgz.js +0 -8
- package/dist/mjs/opcodes/jz.d.ts +0 -3
- package/dist/mjs/opcodes/jz.js +0 -8
- package/dist/mjs/opcodes/lt.d.ts +0 -3
- package/dist/mjs/opcodes/lt.js +0 -7
- package/dist/mjs/opcodes/min.js +0 -8
- package/dist/mjs/opcodes/mul.js +0 -8
- package/dist/mjs/opcodes/nop.js +0 -7
- package/dist/mjs/opcodes/not.js +0 -14
- package/dist/mjs/opcodes/or.d.ts +0 -3
- package/dist/mjs/opcodes/or.js +0 -6
- package/dist/mjs/opcodes/pause.js +0 -4
- package/dist/mjs/opcodes/plus.js +0 -8
- package/dist/mjs/opcodes/pop.js +0 -4
- package/dist/mjs/opcodes/randInt.js +0 -7
- package/dist/mjs/opcodes/rconcat.js +0 -6
- package/dist/mjs/opcodes/setContext.js +0 -6
- package/dist/mjs/opcodes/stacksize.js +0 -4
- package/dist/mjs/opcodes/stdout.js +0 -4
- package/dist/mjs/package.json +0 -3
- package/mjs_package.json +0 -3
- package/tsconfig-base.json +0 -34
- package/tsconfig-cjs.json +0 -8
|
@@ -1,464 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
// Generated from src/grammars/ConciseText.g4 by ANTLR 4.9.0-SNAPSHOT
|
|
4
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
-
if (k2 === undefined) k2 = k;
|
|
6
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
7
|
-
}) : (function(o, m, k, k2) {
|
|
8
|
-
if (k2 === undefined) k2 = k;
|
|
9
|
-
o[k2] = m[k];
|
|
10
|
-
}));
|
|
11
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
12
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
13
|
-
}) : function(o, v) {
|
|
14
|
-
o["default"] = v;
|
|
15
|
-
});
|
|
16
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
17
|
-
if (mod && mod.__esModule) return mod;
|
|
18
|
-
var result = {};
|
|
19
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
20
|
-
__setModuleDefault(result, mod);
|
|
21
|
-
return result;
|
|
22
|
-
};
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.InvokeFunctionContext = exports.PushStringContext = exports.PushNumberContext = exports.InstructionsContext = exports.ConciseTextParser = void 0;
|
|
25
|
-
const ATNDeserializer_1 = require("antlr4ts/atn/ATNDeserializer");
|
|
26
|
-
const FailedPredicateException_1 = require("antlr4ts/FailedPredicateException");
|
|
27
|
-
const NoViableAltException_1 = require("antlr4ts/NoViableAltException");
|
|
28
|
-
const Parser_1 = require("antlr4ts/Parser");
|
|
29
|
-
const ParserRuleContext_1 = require("antlr4ts/ParserRuleContext");
|
|
30
|
-
const ParserATNSimulator_1 = require("antlr4ts/atn/ParserATNSimulator");
|
|
31
|
-
const RecognitionException_1 = require("antlr4ts/RecognitionException");
|
|
32
|
-
const VocabularyImpl_1 = require("antlr4ts/VocabularyImpl");
|
|
33
|
-
const Utils = __importStar(require("antlr4ts/misc/Utils"));
|
|
34
|
-
class ConciseTextParser extends Parser_1.Parser {
|
|
35
|
-
constructor(input) {
|
|
36
|
-
super(input);
|
|
37
|
-
this._interp = new ParserATNSimulator_1.ParserATNSimulator(ConciseTextParser._ATN, this);
|
|
38
|
-
}
|
|
39
|
-
// @Override
|
|
40
|
-
// @NotNull
|
|
41
|
-
get vocabulary() {
|
|
42
|
-
return ConciseTextParser.VOCABULARY;
|
|
43
|
-
}
|
|
44
|
-
// tslint:enable:no-trailing-whitespace
|
|
45
|
-
// @Override
|
|
46
|
-
get grammarFileName() { return "ConciseText.g4"; }
|
|
47
|
-
// @Override
|
|
48
|
-
get ruleNames() { return ConciseTextParser.ruleNames; }
|
|
49
|
-
// @Override
|
|
50
|
-
get serializedATN() { return ConciseTextParser._serializedATN; }
|
|
51
|
-
createFailedPredicateException(predicate, message) {
|
|
52
|
-
return new FailedPredicateException_1.FailedPredicateException(this, predicate, message);
|
|
53
|
-
}
|
|
54
|
-
// @RuleVersion(0)
|
|
55
|
-
instructions() {
|
|
56
|
-
let _localctx = new InstructionsContext(this._ctx, this.state);
|
|
57
|
-
this.enterRule(_localctx, 0, ConciseTextParser.RULE_instructions);
|
|
58
|
-
let _la;
|
|
59
|
-
try {
|
|
60
|
-
this.enterOuterAlt(_localctx, 1);
|
|
61
|
-
{
|
|
62
|
-
this.state = 14;
|
|
63
|
-
this._errHandler.sync(this);
|
|
64
|
-
_la = this._input.LA(1);
|
|
65
|
-
while ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << ConciseTextParser.NUMBER) | (1 << ConciseTextParser.STRING) | (1 << ConciseTextParser.WORD) | (1 << ConciseTextParser.WHITESPACE))) !== 0)) {
|
|
66
|
-
{
|
|
67
|
-
this.state = 12;
|
|
68
|
-
this._errHandler.sync(this);
|
|
69
|
-
switch (this._input.LA(1)) {
|
|
70
|
-
case ConciseTextParser.NUMBER:
|
|
71
|
-
{
|
|
72
|
-
this.state = 8;
|
|
73
|
-
this.pushNumber();
|
|
74
|
-
}
|
|
75
|
-
break;
|
|
76
|
-
case ConciseTextParser.STRING:
|
|
77
|
-
{
|
|
78
|
-
this.state = 9;
|
|
79
|
-
this.pushString();
|
|
80
|
-
}
|
|
81
|
-
break;
|
|
82
|
-
case ConciseTextParser.WORD:
|
|
83
|
-
{
|
|
84
|
-
this.state = 10;
|
|
85
|
-
this.invokeFunction();
|
|
86
|
-
}
|
|
87
|
-
break;
|
|
88
|
-
case ConciseTextParser.WHITESPACE:
|
|
89
|
-
{
|
|
90
|
-
this.state = 11;
|
|
91
|
-
this.match(ConciseTextParser.WHITESPACE);
|
|
92
|
-
}
|
|
93
|
-
break;
|
|
94
|
-
default:
|
|
95
|
-
throw new NoViableAltException_1.NoViableAltException(this);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
this.state = 16;
|
|
99
|
-
this._errHandler.sync(this);
|
|
100
|
-
_la = this._input.LA(1);
|
|
101
|
-
}
|
|
102
|
-
this.state = 17;
|
|
103
|
-
this.match(ConciseTextParser.EOF);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
catch (re) {
|
|
107
|
-
if (re instanceof RecognitionException_1.RecognitionException) {
|
|
108
|
-
_localctx.exception = re;
|
|
109
|
-
this._errHandler.reportError(this, re);
|
|
110
|
-
this._errHandler.recover(this, re);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
throw re;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
finally {
|
|
117
|
-
this.exitRule();
|
|
118
|
-
}
|
|
119
|
-
return _localctx;
|
|
120
|
-
}
|
|
121
|
-
// @RuleVersion(0)
|
|
122
|
-
pushNumber() {
|
|
123
|
-
let _localctx = new PushNumberContext(this._ctx, this.state);
|
|
124
|
-
this.enterRule(_localctx, 2, ConciseTextParser.RULE_pushNumber);
|
|
125
|
-
try {
|
|
126
|
-
this.enterOuterAlt(_localctx, 1);
|
|
127
|
-
{
|
|
128
|
-
this.state = 19;
|
|
129
|
-
_localctx._number = this.match(ConciseTextParser.NUMBER);
|
|
130
|
-
this.state = 23;
|
|
131
|
-
this._errHandler.sync(this);
|
|
132
|
-
switch (this.interpreter.adaptivePredict(this._input, 2, this._ctx)) {
|
|
133
|
-
case 1:
|
|
134
|
-
{
|
|
135
|
-
this.state = 20;
|
|
136
|
-
this.match(ConciseTextParser.WHITESPACE);
|
|
137
|
-
this.state = 21;
|
|
138
|
-
this.match(ConciseTextParser.LABEL_START);
|
|
139
|
-
this.state = 22;
|
|
140
|
-
_localctx._label = this.match(ConciseTextParser.WORD);
|
|
141
|
-
}
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
catch (re) {
|
|
147
|
-
if (re instanceof RecognitionException_1.RecognitionException) {
|
|
148
|
-
_localctx.exception = re;
|
|
149
|
-
this._errHandler.reportError(this, re);
|
|
150
|
-
this._errHandler.recover(this, re);
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
throw re;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
finally {
|
|
157
|
-
this.exitRule();
|
|
158
|
-
}
|
|
159
|
-
return _localctx;
|
|
160
|
-
}
|
|
161
|
-
// @RuleVersion(0)
|
|
162
|
-
pushString() {
|
|
163
|
-
let _localctx = new PushStringContext(this._ctx, this.state);
|
|
164
|
-
this.enterRule(_localctx, 4, ConciseTextParser.RULE_pushString);
|
|
165
|
-
try {
|
|
166
|
-
this.enterOuterAlt(_localctx, 1);
|
|
167
|
-
{
|
|
168
|
-
this.state = 25;
|
|
169
|
-
_localctx._string = this.match(ConciseTextParser.STRING);
|
|
170
|
-
this.state = 29;
|
|
171
|
-
this._errHandler.sync(this);
|
|
172
|
-
switch (this.interpreter.adaptivePredict(this._input, 3, this._ctx)) {
|
|
173
|
-
case 1:
|
|
174
|
-
{
|
|
175
|
-
this.state = 26;
|
|
176
|
-
this.match(ConciseTextParser.WHITESPACE);
|
|
177
|
-
this.state = 27;
|
|
178
|
-
this.match(ConciseTextParser.LABEL_START);
|
|
179
|
-
this.state = 28;
|
|
180
|
-
_localctx._label = this.match(ConciseTextParser.WORD);
|
|
181
|
-
}
|
|
182
|
-
break;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
catch (re) {
|
|
187
|
-
if (re instanceof RecognitionException_1.RecognitionException) {
|
|
188
|
-
_localctx.exception = re;
|
|
189
|
-
this._errHandler.reportError(this, re);
|
|
190
|
-
this._errHandler.recover(this, re);
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
throw re;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
finally {
|
|
197
|
-
this.exitRule();
|
|
198
|
-
}
|
|
199
|
-
return _localctx;
|
|
200
|
-
}
|
|
201
|
-
// @RuleVersion(0)
|
|
202
|
-
invokeFunction() {
|
|
203
|
-
let _localctx = new InvokeFunctionContext(this._ctx, this.state);
|
|
204
|
-
this.enterRule(_localctx, 6, ConciseTextParser.RULE_invokeFunction);
|
|
205
|
-
try {
|
|
206
|
-
this.enterOuterAlt(_localctx, 1);
|
|
207
|
-
{
|
|
208
|
-
this.state = 31;
|
|
209
|
-
_localctx._opcode = this.match(ConciseTextParser.WORD);
|
|
210
|
-
this.state = 35;
|
|
211
|
-
this._errHandler.sync(this);
|
|
212
|
-
switch (this.interpreter.adaptivePredict(this._input, 4, this._ctx)) {
|
|
213
|
-
case 1:
|
|
214
|
-
{
|
|
215
|
-
this.state = 32;
|
|
216
|
-
this.match(ConciseTextParser.WHITESPACE);
|
|
217
|
-
this.state = 33;
|
|
218
|
-
this.match(ConciseTextParser.LABEL_START);
|
|
219
|
-
this.state = 34;
|
|
220
|
-
_localctx._label = this.match(ConciseTextParser.WORD);
|
|
221
|
-
}
|
|
222
|
-
break;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
catch (re) {
|
|
227
|
-
if (re instanceof RecognitionException_1.RecognitionException) {
|
|
228
|
-
_localctx.exception = re;
|
|
229
|
-
this._errHandler.reportError(this, re);
|
|
230
|
-
this._errHandler.recover(this, re);
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
throw re;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
finally {
|
|
237
|
-
this.exitRule();
|
|
238
|
-
}
|
|
239
|
-
return _localctx;
|
|
240
|
-
}
|
|
241
|
-
static get _ATN() {
|
|
242
|
-
if (!ConciseTextParser.__ATN) {
|
|
243
|
-
ConciseTextParser.__ATN = new ATNDeserializer_1.ATNDeserializer().deserialize(Utils.toCharArray(ConciseTextParser._serializedATN));
|
|
244
|
-
}
|
|
245
|
-
return ConciseTextParser.__ATN;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
exports.ConciseTextParser = ConciseTextParser;
|
|
249
|
-
ConciseTextParser.SLASH = 1;
|
|
250
|
-
ConciseTextParser.ASTERISK = 2;
|
|
251
|
-
ConciseTextParser.COMMENT_START = 3;
|
|
252
|
-
ConciseTextParser.ML_COMMENT_BEGIN = 4;
|
|
253
|
-
ConciseTextParser.ML_COMMENT_END = 5;
|
|
254
|
-
ConciseTextParser.MULTILINE_COMMENT = 6;
|
|
255
|
-
ConciseTextParser.COMMENT = 7;
|
|
256
|
-
ConciseTextParser.NUMBER = 8;
|
|
257
|
-
ConciseTextParser.STRING = 9;
|
|
258
|
-
ConciseTextParser.WORD = 10;
|
|
259
|
-
ConciseTextParser.LABEL_START = 11;
|
|
260
|
-
ConciseTextParser.WHITESPACE = 12;
|
|
261
|
-
ConciseTextParser.RULE_instructions = 0;
|
|
262
|
-
ConciseTextParser.RULE_pushNumber = 1;
|
|
263
|
-
ConciseTextParser.RULE_pushString = 2;
|
|
264
|
-
ConciseTextParser.RULE_invokeFunction = 3;
|
|
265
|
-
// tslint:disable:no-trailing-whitespace
|
|
266
|
-
ConciseTextParser.ruleNames = [
|
|
267
|
-
"instructions", "pushNumber", "pushString", "invokeFunction",
|
|
268
|
-
];
|
|
269
|
-
ConciseTextParser._LITERAL_NAMES = [
|
|
270
|
-
undefined, "'/'", "'*'", undefined, undefined, undefined, undefined, undefined,
|
|
271
|
-
undefined, undefined, undefined, "'#'",
|
|
272
|
-
];
|
|
273
|
-
ConciseTextParser._SYMBOLIC_NAMES = [
|
|
274
|
-
undefined, "SLASH", "ASTERISK", "COMMENT_START", "ML_COMMENT_BEGIN", "ML_COMMENT_END",
|
|
275
|
-
"MULTILINE_COMMENT", "COMMENT", "NUMBER", "STRING", "WORD", "LABEL_START",
|
|
276
|
-
"WHITESPACE",
|
|
277
|
-
];
|
|
278
|
-
ConciseTextParser.VOCABULARY = new VocabularyImpl_1.VocabularyImpl(ConciseTextParser._LITERAL_NAMES, ConciseTextParser._SYMBOLIC_NAMES, []);
|
|
279
|
-
ConciseTextParser._serializedATN = "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03\x0E(\x04\x02" +
|
|
280
|
-
"\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x03\x02\x03\x02\x03\x02" +
|
|
281
|
-
"\x03\x02\x07\x02\x0F\n\x02\f\x02\x0E\x02\x12\v\x02\x03\x02\x03\x02\x03" +
|
|
282
|
-
"\x03\x03\x03\x03\x03\x03\x03\x05\x03\x1A\n\x03\x03\x04\x03\x04\x03\x04" +
|
|
283
|
-
"\x03\x04\x05\x04 \n\x04\x03\x05\x03\x05\x03\x05\x03\x05\x05\x05&\n\x05" +
|
|
284
|
-
"\x03\x05\x02\x02\x02\x06\x02\x02\x04\x02\x06\x02\b\x02\x02\x02\x02*\x02" +
|
|
285
|
-
"\x10\x03\x02\x02\x02\x04\x15\x03\x02\x02\x02\x06\x1B\x03\x02\x02\x02\b" +
|
|
286
|
-
"!\x03\x02\x02\x02\n\x0F\x05\x04\x03\x02\v\x0F\x05\x06\x04\x02\f\x0F\x05" +
|
|
287
|
-
"\b\x05\x02\r\x0F\x07\x0E\x02\x02\x0E\n\x03\x02\x02\x02\x0E\v\x03\x02\x02" +
|
|
288
|
-
"\x02\x0E\f\x03\x02\x02\x02\x0E\r\x03\x02\x02\x02\x0F\x12\x03\x02\x02\x02" +
|
|
289
|
-
"\x10\x0E\x03\x02\x02\x02\x10\x11\x03\x02\x02\x02\x11\x13\x03\x02\x02\x02" +
|
|
290
|
-
"\x12\x10\x03\x02\x02\x02\x13\x14\x07\x02\x02\x03\x14\x03\x03\x02\x02\x02" +
|
|
291
|
-
"\x15\x19\x07\n\x02\x02\x16\x17\x07\x0E\x02\x02\x17\x18\x07\r\x02\x02\x18" +
|
|
292
|
-
"\x1A\x07\f\x02\x02\x19\x16\x03\x02\x02\x02\x19\x1A\x03\x02\x02\x02\x1A" +
|
|
293
|
-
"\x05\x03\x02\x02\x02\x1B\x1F\x07\v\x02\x02\x1C\x1D\x07\x0E\x02\x02\x1D" +
|
|
294
|
-
"\x1E\x07\r\x02\x02\x1E \x07\f\x02\x02\x1F\x1C\x03\x02\x02\x02\x1F \x03" +
|
|
295
|
-
"\x02\x02\x02 \x07\x03\x02\x02\x02!%\x07\f\x02\x02\"#\x07\x0E\x02\x02#" +
|
|
296
|
-
"$\x07\r\x02\x02$&\x07\f\x02\x02%\"\x03\x02\x02\x02%&\x03\x02\x02\x02&" +
|
|
297
|
-
"\t\x03\x02\x02\x02\x07\x0E\x10\x19\x1F%";
|
|
298
|
-
class InstructionsContext extends ParserRuleContext_1.ParserRuleContext {
|
|
299
|
-
EOF() { return this.getToken(ConciseTextParser.EOF, 0); }
|
|
300
|
-
pushNumber(i) {
|
|
301
|
-
if (i === undefined) {
|
|
302
|
-
return this.getRuleContexts(PushNumberContext);
|
|
303
|
-
}
|
|
304
|
-
else {
|
|
305
|
-
return this.getRuleContext(i, PushNumberContext);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
pushString(i) {
|
|
309
|
-
if (i === undefined) {
|
|
310
|
-
return this.getRuleContexts(PushStringContext);
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
return this.getRuleContext(i, PushStringContext);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
invokeFunction(i) {
|
|
317
|
-
if (i === undefined) {
|
|
318
|
-
return this.getRuleContexts(InvokeFunctionContext);
|
|
319
|
-
}
|
|
320
|
-
else {
|
|
321
|
-
return this.getRuleContext(i, InvokeFunctionContext);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
WHITESPACE(i) {
|
|
325
|
-
if (i === undefined) {
|
|
326
|
-
return this.getTokens(ConciseTextParser.WHITESPACE);
|
|
327
|
-
}
|
|
328
|
-
else {
|
|
329
|
-
return this.getToken(ConciseTextParser.WHITESPACE, i);
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
constructor(parent, invokingState) {
|
|
333
|
-
super(parent, invokingState);
|
|
334
|
-
}
|
|
335
|
-
// @Override
|
|
336
|
-
get ruleIndex() { return ConciseTextParser.RULE_instructions; }
|
|
337
|
-
// @Override
|
|
338
|
-
enterRule(listener) {
|
|
339
|
-
if (listener.enterInstructions) {
|
|
340
|
-
listener.enterInstructions(this);
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
// @Override
|
|
344
|
-
exitRule(listener) {
|
|
345
|
-
if (listener.exitInstructions) {
|
|
346
|
-
listener.exitInstructions(this);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
// @Override
|
|
350
|
-
accept(visitor) {
|
|
351
|
-
if (visitor.visitInstructions) {
|
|
352
|
-
return visitor.visitInstructions(this);
|
|
353
|
-
}
|
|
354
|
-
else {
|
|
355
|
-
return visitor.visitChildren(this);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
exports.InstructionsContext = InstructionsContext;
|
|
360
|
-
class PushNumberContext extends ParserRuleContext_1.ParserRuleContext {
|
|
361
|
-
constructor(parent, invokingState) {
|
|
362
|
-
super(parent, invokingState);
|
|
363
|
-
}
|
|
364
|
-
NUMBER() { return this.getToken(ConciseTextParser.NUMBER, 0); }
|
|
365
|
-
WHITESPACE() { return this.tryGetToken(ConciseTextParser.WHITESPACE, 0); }
|
|
366
|
-
LABEL_START() { return this.tryGetToken(ConciseTextParser.LABEL_START, 0); }
|
|
367
|
-
WORD() { return this.tryGetToken(ConciseTextParser.WORD, 0); }
|
|
368
|
-
// @Override
|
|
369
|
-
get ruleIndex() { return ConciseTextParser.RULE_pushNumber; }
|
|
370
|
-
// @Override
|
|
371
|
-
enterRule(listener) {
|
|
372
|
-
if (listener.enterPushNumber) {
|
|
373
|
-
listener.enterPushNumber(this);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
// @Override
|
|
377
|
-
exitRule(listener) {
|
|
378
|
-
if (listener.exitPushNumber) {
|
|
379
|
-
listener.exitPushNumber(this);
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
// @Override
|
|
383
|
-
accept(visitor) {
|
|
384
|
-
if (visitor.visitPushNumber) {
|
|
385
|
-
return visitor.visitPushNumber(this);
|
|
386
|
-
}
|
|
387
|
-
else {
|
|
388
|
-
return visitor.visitChildren(this);
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
exports.PushNumberContext = PushNumberContext;
|
|
393
|
-
class PushStringContext extends ParserRuleContext_1.ParserRuleContext {
|
|
394
|
-
constructor(parent, invokingState) {
|
|
395
|
-
super(parent, invokingState);
|
|
396
|
-
}
|
|
397
|
-
STRING() { return this.getToken(ConciseTextParser.STRING, 0); }
|
|
398
|
-
WHITESPACE() { return this.tryGetToken(ConciseTextParser.WHITESPACE, 0); }
|
|
399
|
-
LABEL_START() { return this.tryGetToken(ConciseTextParser.LABEL_START, 0); }
|
|
400
|
-
WORD() { return this.tryGetToken(ConciseTextParser.WORD, 0); }
|
|
401
|
-
// @Override
|
|
402
|
-
get ruleIndex() { return ConciseTextParser.RULE_pushString; }
|
|
403
|
-
// @Override
|
|
404
|
-
enterRule(listener) {
|
|
405
|
-
if (listener.enterPushString) {
|
|
406
|
-
listener.enterPushString(this);
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
// @Override
|
|
410
|
-
exitRule(listener) {
|
|
411
|
-
if (listener.exitPushString) {
|
|
412
|
-
listener.exitPushString(this);
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
// @Override
|
|
416
|
-
accept(visitor) {
|
|
417
|
-
if (visitor.visitPushString) {
|
|
418
|
-
return visitor.visitPushString(this);
|
|
419
|
-
}
|
|
420
|
-
else {
|
|
421
|
-
return visitor.visitChildren(this);
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
exports.PushStringContext = PushStringContext;
|
|
426
|
-
class InvokeFunctionContext extends ParserRuleContext_1.ParserRuleContext {
|
|
427
|
-
constructor(parent, invokingState) {
|
|
428
|
-
super(parent, invokingState);
|
|
429
|
-
}
|
|
430
|
-
WORD(i) {
|
|
431
|
-
if (i === undefined) {
|
|
432
|
-
return this.getTokens(ConciseTextParser.WORD);
|
|
433
|
-
}
|
|
434
|
-
else {
|
|
435
|
-
return this.getToken(ConciseTextParser.WORD, i);
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
WHITESPACE() { return this.tryGetToken(ConciseTextParser.WHITESPACE, 0); }
|
|
439
|
-
LABEL_START() { return this.tryGetToken(ConciseTextParser.LABEL_START, 0); }
|
|
440
|
-
// @Override
|
|
441
|
-
get ruleIndex() { return ConciseTextParser.RULE_invokeFunction; }
|
|
442
|
-
// @Override
|
|
443
|
-
enterRule(listener) {
|
|
444
|
-
if (listener.enterInvokeFunction) {
|
|
445
|
-
listener.enterInvokeFunction(this);
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
// @Override
|
|
449
|
-
exitRule(listener) {
|
|
450
|
-
if (listener.exitInvokeFunction) {
|
|
451
|
-
listener.exitInvokeFunction(this);
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
// @Override
|
|
455
|
-
accept(visitor) {
|
|
456
|
-
if (visitor.visitInvokeFunction) {
|
|
457
|
-
return visitor.visitInvokeFunction(this);
|
|
458
|
-
}
|
|
459
|
-
else {
|
|
460
|
-
return visitor.visitChildren(this);
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
exports.InvokeFunctionContext = InvokeFunctionContext;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor";
|
|
2
|
-
import { InstructionsContext } from "./ConciseTextParser";
|
|
3
|
-
import { PushNumberContext } from "./ConciseTextParser";
|
|
4
|
-
import { PushStringContext } from "./ConciseTextParser";
|
|
5
|
-
import { InvokeFunctionContext } from "./ConciseTextParser";
|
|
6
|
-
/**
|
|
7
|
-
* This interface defines a complete generic visitor for a parse tree produced
|
|
8
|
-
* by `ConciseTextParser`.
|
|
9
|
-
*
|
|
10
|
-
* @param <Result> The return type of the visit operation. Use `void` for
|
|
11
|
-
* operations with no return type.
|
|
12
|
-
*/
|
|
13
|
-
export interface ConciseTextVisitor<Result> extends ParseTreeVisitor<Result> {
|
|
14
|
-
/**
|
|
15
|
-
* Visit a parse tree produced by `ConciseTextParser.instructions`.
|
|
16
|
-
* @param ctx the parse tree
|
|
17
|
-
* @return the visitor result
|
|
18
|
-
*/
|
|
19
|
-
visitInstructions?: (ctx: InstructionsContext) => Result;
|
|
20
|
-
/**
|
|
21
|
-
* Visit a parse tree produced by `ConciseTextParser.pushNumber`.
|
|
22
|
-
* @param ctx the parse tree
|
|
23
|
-
* @return the visitor result
|
|
24
|
-
*/
|
|
25
|
-
visitPushNumber?: (ctx: PushNumberContext) => Result;
|
|
26
|
-
/**
|
|
27
|
-
* Visit a parse tree produced by `ConciseTextParser.pushString`.
|
|
28
|
-
* @param ctx the parse tree
|
|
29
|
-
* @return the visitor result
|
|
30
|
-
*/
|
|
31
|
-
visitPushString?: (ctx: PushStringContext) => Result;
|
|
32
|
-
/**
|
|
33
|
-
* Visit a parse tree produced by `ConciseTextParser.invokeFunction`.
|
|
34
|
-
* @param ctx the parse tree
|
|
35
|
-
* @return the visitor result
|
|
36
|
-
*/
|
|
37
|
-
visitInvokeFunction?: (ctx: InvokeFunctionContext) => Result;
|
|
38
|
-
}
|
package/dist/cjs/index.d.ts
DELETED
package/dist/cjs/opcodes/and.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const getStackParams_js_1 = require("../getStackParams.js");
|
|
4
|
-
const and = (stack, context) => {
|
|
5
|
-
const [num1, num2] = getStackParams_js_1.getStackParams("and", ["number", "number"], stack);
|
|
6
|
-
stack.push(num1 !== 0 && num2 !== 0 ? 1 : 0);
|
|
7
|
-
};
|
|
8
|
-
exports.default = and;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const getStackParams_js_1 = require("../getStackParams.js");
|
|
4
|
-
const concat = (stack) => {
|
|
5
|
-
const [val1, val2] = getStackParams_js_1.getStackParams("concat", ["string | number", "string | number"], stack);
|
|
6
|
-
stack.push(`${val1}${val2}`);
|
|
7
|
-
};
|
|
8
|
-
exports.default = concat;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const getStackParams_js_1 = require("../getStackParams.js");
|
|
4
|
-
const delContext = (stack, context) => {
|
|
5
|
-
const [str] = getStackParams_js_1.getStackParams("delContext", ["string"], stack);
|
|
6
|
-
delete context[str];
|
|
7
|
-
};
|
|
8
|
-
exports.default = delContext;
|
package/dist/cjs/opcodes/eq.d.ts
DELETED
package/dist/cjs/opcodes/eq.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const getStackParams_js_1 = require("../getStackParams.js");
|
|
4
|
-
const eq = (stack, context) => {
|
|
5
|
-
const [val1, val2] = getStackParams_js_1.getStackParams("eq", ["string | number", "string | number"], stack);
|
|
6
|
-
const retval = val1 === val2 ? 1 : 0;
|
|
7
|
-
stack.push(retval);
|
|
8
|
-
};
|
|
9
|
-
exports.default = eq;
|
package/dist/cjs/opcodes/gt.d.ts
DELETED
package/dist/cjs/opcodes/jz.d.ts
DELETED
package/dist/cjs/opcodes/lt.d.ts
DELETED
package/dist/cjs/opcodes/or.d.ts
DELETED
package/dist/cjs/opcodes/or.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const getStackParams_js_1 = require("../getStackParams.js");
|
|
4
|
-
const or = (stack, context) => {
|
|
5
|
-
const [num1, num2] = getStackParams_js_1.getStackParams("or", ["number", "number"], stack);
|
|
6
|
-
stack.push(num1 !== 0 || num2 !== 0 ? 1 : 0);
|
|
7
|
-
};
|
|
8
|
-
exports.default = or;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const getStackParams_js_1 = require("../getStackParams.js");
|
|
4
|
-
const rconcat = (stack) => {
|
|
5
|
-
const [val1, val2] = getStackParams_js_1.getStackParams("rconcat", ["string | number", "string | number"], stack);
|
|
6
|
-
stack.push(`${val2}${val1}`);
|
|
7
|
-
};
|
|
8
|
-
exports.default = rconcat;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const getStackParams_js_1 = require("../getStackParams.js");
|
|
4
|
-
const setContext = (stack, context) => {
|
|
5
|
-
const [str1, arg2] = getStackParams_js_1.getStackParams("setContext", ["string", "string | number"], stack);
|
|
6
|
-
context[str1] = arg2;
|
|
7
|
-
};
|
|
8
|
-
exports.default = setContext;
|
package/dist/cjs/package.json
DELETED
package/dist/mjs/cli.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import program from "commander";
|
|
3
|
-
import { VM } from "./vm.js";
|
|
4
|
-
import { Tokenizer } from "./util/tokenizer.js";
|
|
5
|
-
program
|
|
6
|
-
.version('1.0.8')
|
|
7
|
-
.requiredOption('--input, -i <path>', "Path to Tzo VMState .json or Tzo ConciseText .txt/.tzoct file")
|
|
8
|
-
.parse(process.argv);
|
|
9
|
-
let input = [];
|
|
10
|
-
let vmState = {
|
|
11
|
-
context: {},
|
|
12
|
-
exit: false,
|
|
13
|
-
pause: false,
|
|
14
|
-
programCounter: 0,
|
|
15
|
-
labelMap: {},
|
|
16
|
-
programList: [],
|
|
17
|
-
stack: []
|
|
18
|
-
};
|
|
19
|
-
if (program.I && program.I.endsWith(".json")) {
|
|
20
|
-
vmState = JSON.parse(fs.readFileSync(program.I).toString());
|
|
21
|
-
}
|
|
22
|
-
if (program.I && (program.I.endsWith(".txt") || program.I.endsWith(".tzoct"))) {
|
|
23
|
-
const input_file = fs.readFileSync(program.I).toString();
|
|
24
|
-
const tokenizer = new Tokenizer();
|
|
25
|
-
vmState.programList = tokenizer.parse(input_file);
|
|
26
|
-
}
|
|
27
|
-
const vm = new VM({});
|
|
28
|
-
vm.loadVMState(vmState);
|
|
29
|
-
vm.run();
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ATN } from "antlr4ts/atn/ATN";
|
|
2
|
-
import { CharStream } from "antlr4ts/CharStream";
|
|
3
|
-
import { Lexer } from "antlr4ts/Lexer";
|
|
4
|
-
import { Vocabulary } from "antlr4ts/Vocabulary";
|
|
5
|
-
export declare class ConciseTextLexer extends Lexer {
|
|
6
|
-
static readonly SLASH = 1;
|
|
7
|
-
static readonly ASTERISK = 2;
|
|
8
|
-
static readonly COMMENT_START = 3;
|
|
9
|
-
static readonly ML_COMMENT_BEGIN = 4;
|
|
10
|
-
static readonly ML_COMMENT_END = 5;
|
|
11
|
-
static readonly MULTILINE_COMMENT = 6;
|
|
12
|
-
static readonly COMMENT = 7;
|
|
13
|
-
static readonly NUMBER = 8;
|
|
14
|
-
static readonly STRING = 9;
|
|
15
|
-
static readonly WORD = 10;
|
|
16
|
-
static readonly LABEL_START = 11;
|
|
17
|
-
static readonly WHITESPACE = 12;
|
|
18
|
-
static readonly channelNames: string[];
|
|
19
|
-
static readonly modeNames: string[];
|
|
20
|
-
static readonly ruleNames: string[];
|
|
21
|
-
private static readonly _LITERAL_NAMES;
|
|
22
|
-
private static readonly _SYMBOLIC_NAMES;
|
|
23
|
-
static readonly VOCABULARY: Vocabulary;
|
|
24
|
-
get vocabulary(): Vocabulary;
|
|
25
|
-
constructor(input: CharStream);
|
|
26
|
-
get grammarFileName(): string;
|
|
27
|
-
get ruleNames(): string[];
|
|
28
|
-
get serializedATN(): string;
|
|
29
|
-
get channelNames(): string[];
|
|
30
|
-
get modeNames(): string[];
|
|
31
|
-
static readonly _serializedATN: string;
|
|
32
|
-
static __ATN: ATN;
|
|
33
|
-
static get _ATN(): ATN;
|
|
34
|
-
}
|