@tuprolog/2p-full 0.31.5-dev0f → 0.31.5-dev0n
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/2p-bdd.js +234 -229
- package/2p-bdd.js.map +1 -1
- package/2p-core.js +5576 -6196
- package/2p-core.js.map +1 -1
- package/2p-datalog.js +9 -2
- package/2p-datalog.js.map +1 -1
- package/2p-dsl-core.js +9 -2
- package/2p-dsl-core.js.map +1 -1
- package/2p-dsl-solve.js +9 -2
- package/2p-dsl-solve.js.map +1 -1
- package/2p-dsl-theory.js +9 -2
- package/2p-dsl-theory.js.map +1 -1
- package/2p-dsl-unify.js +9 -2
- package/2p-dsl-unify.js.map +1 -1
- package/2p-full.js +26 -3
- package/2p-full.js.map +1 -1
- package/2p-io-lib.js +903 -926
- package/2p-io-lib.js.map +1 -1
- package/2p-oop-lib.js +1298 -1327
- package/2p-oop-lib.js.map +1 -1
- package/2p-parser-core.js +352 -356
- package/2p-parser-core.js.map +1 -1
- package/2p-parser-js.js +14 -3
- package/2p-parser-js.js.map +1 -1
- package/2p-parser-theory.js +66 -41
- package/2p-parser-theory.js.map +1 -1
- package/2p-repl.js +175 -173
- package/2p-repl.js.map +1 -1
- package/2p-serialize-core.js +9 -2
- package/2p-serialize-core.js.map +1 -1
- package/2p-serialize-theory.js +9 -2
- package/2p-serialize-theory.js.map +1 -1
- package/2p-solve-classic.js +1405 -1677
- package/2p-solve-classic.js.map +1 -1
- package/2p-solve-concurrent.js +9 -2
- package/2p-solve-concurrent.js.map +1 -1
- package/2p-solve-plp.js +19 -5
- package/2p-solve-plp.js.map +1 -1
- package/2p-solve-problog.js +1845 -1880
- package/2p-solve-problog.js.map +1 -1
- package/2p-solve-streams.js +1239 -1331
- package/2p-solve-streams.js.map +1 -1
- package/2p-solve.js +5342 -5796
- package/2p-solve.js.map +1 -1
- package/2p-theory.js +1734 -1730
- package/2p-theory.js.map +1 -1
- package/2p-unify.js +364 -365
- package/2p-unify.js.map +1 -1
- package/2p-utils.js +548 -510
- package/2p-utils.js.map +1 -1
- package/88b0986a7186d029-atomicfu-js-ir.js +9 -2
- package/88b0986a7186d029-atomicfu-js-ir.js.map +1 -1
- package/clikt-clikt-js-ir.js +2078 -2260
- package/clikt-clikt-js-ir.js.map +1 -1
- package/kotlin-kotlin-stdlib-js-ir.js +2566 -2676
- package/kotlin-kotlin-stdlib-js-ir.js.map +1 -1
- package/kotlin-kotlinx-atomicfu-runtime-js-ir.js +9 -2
- package/kotlin-kotlinx-atomicfu-runtime-js-ir.js.map +1 -1
- package/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js +9 -2
- package/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js.map +1 -1
- package/kt-math.js +3666 -3302
- package/kt-math.js.map +1 -1
- package/package.json +56 -2
- package/2p-full.d.ts +0 -270
package/2p-parser-core.js
CHANGED
|
@@ -1,4 +1,36 @@
|
|
|
1
|
-
(function (
|
|
1
|
+
(function (root, factory) {
|
|
2
|
+
if (typeof define === 'function' && define.amd)
|
|
3
|
+
define(['exports', '@tuprolog/parser-utils', 'antlr4', 'antlr4/src/antlr4/error', 'antlr4/src/antlr4/atn', './kotlin-kotlin-stdlib-js-ir.js', './2p-core.js', './2p-parser-js.js', './kt-math.js'], factory);
|
|
4
|
+
else if (typeof exports === 'object')
|
|
5
|
+
factory(module.exports, require('@tuprolog/parser-utils'), require('antlr4'), require('antlr4/src/antlr4/error'), require('antlr4/src/antlr4/atn'), require('./kotlin-kotlin-stdlib-js-ir.js'), require('./2p-core.js'), require('./2p-parser-js.js'), require('./kt-math.js'));
|
|
6
|
+
else {
|
|
7
|
+
if (typeof this['@tuprolog/parser-utils'] === 'undefined') {
|
|
8
|
+
throw new Error("Error loading module '2p-parser-core'. Its dependency '@tuprolog/parser-utils' was not found. Please, check whether '@tuprolog/parser-utils' is loaded prior to '2p-parser-core'.");
|
|
9
|
+
}
|
|
10
|
+
if (typeof antlr4 === 'undefined') {
|
|
11
|
+
throw new Error("Error loading module '2p-parser-core'. Its dependency 'antlr4' was not found. Please, check whether 'antlr4' is loaded prior to '2p-parser-core'.");
|
|
12
|
+
}
|
|
13
|
+
if (typeof this['antlr4/src/antlr4/error'] === 'undefined') {
|
|
14
|
+
throw new Error("Error loading module '2p-parser-core'. Its dependency 'antlr4/src/antlr4/error' was not found. Please, check whether 'antlr4/src/antlr4/error' is loaded prior to '2p-parser-core'.");
|
|
15
|
+
}
|
|
16
|
+
if (typeof this['antlr4/src/antlr4/atn'] === 'undefined') {
|
|
17
|
+
throw new Error("Error loading module '2p-parser-core'. Its dependency 'antlr4/src/antlr4/atn' was not found. Please, check whether 'antlr4/src/antlr4/atn' is loaded prior to '2p-parser-core'.");
|
|
18
|
+
}
|
|
19
|
+
if (typeof this['kotlin-kotlin-stdlib-js-ir'] === 'undefined') {
|
|
20
|
+
throw new Error("Error loading module '2p-parser-core'. Its dependency 'kotlin-kotlin-stdlib-js-ir' was not found. Please, check whether 'kotlin-kotlin-stdlib-js-ir' is loaded prior to '2p-parser-core'.");
|
|
21
|
+
}
|
|
22
|
+
if (typeof this['2p-core'] === 'undefined') {
|
|
23
|
+
throw new Error("Error loading module '2p-parser-core'. Its dependency '2p-core' was not found. Please, check whether '2p-core' is loaded prior to '2p-parser-core'.");
|
|
24
|
+
}
|
|
25
|
+
if (typeof this['2p-parser-js'] === 'undefined') {
|
|
26
|
+
throw new Error("Error loading module '2p-parser-core'. Its dependency '2p-parser-js' was not found. Please, check whether '2p-parser-js' is loaded prior to '2p-parser-core'.");
|
|
27
|
+
}
|
|
28
|
+
if (typeof this['kt-math'] === 'undefined') {
|
|
29
|
+
throw new Error("Error loading module '2p-parser-core'. Its dependency 'kt-math' was not found. Please, check whether 'kt-math' is loaded prior to '2p-parser-core'.");
|
|
30
|
+
}
|
|
31
|
+
root['2p-parser-core'] = factory(typeof this['2p-parser-core'] === 'undefined' ? {} : this['2p-parser-core'], this['@tuprolog/parser-utils'], antlr4, this['antlr4/src/antlr4/error'], this['antlr4/src/antlr4/atn'], this['kotlin-kotlin-stdlib-js-ir'], this['2p-core'], this['2p-parser-js'], this['kt-math']);
|
|
32
|
+
}
|
|
33
|
+
}(this, function (_, $module$_tuprolog_parser_utils_xy31vy, $module$antlr4, $module$antlr4_src_antlr4_error_s9pni7, $module$antlr4_src_antlr4_atn_66gh9q, kotlin_kotlin, kotlin_it_unibo_tuprolog_core, kotlin_it_unibo_tuprolog_parser_js, kotlin_io_github_gciatto_kt_math) {
|
|
2
34
|
'use strict';
|
|
3
35
|
//region block: imports
|
|
4
36
|
var PrologParserListener = $module$_tuprolog_parser_utils_xy31vy.PrologParserListener;
|
|
@@ -12,23 +44,25 @@
|
|
|
12
44
|
var CommonTokenStream = $module$antlr4.CommonTokenStream;
|
|
13
45
|
var BailErrorStrategy = $module$antlr4_src_antlr4_error_s9pni7.BailErrorStrategy;
|
|
14
46
|
var PrologParserVisitor = $module$_tuprolog_parser_utils_xy31vy.PrologParserVisitor;
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
47
|
+
var VOID = kotlin_kotlin.$_$.gc;
|
|
48
|
+
var captureStack = kotlin_kotlin.$_$.o5;
|
|
49
|
+
var protoOf = kotlin_kotlin.$_$.s6;
|
|
50
|
+
var classMeta = kotlin_kotlin.$_$.t5;
|
|
51
|
+
var setMetadataFor = kotlin_kotlin.$_$.t6;
|
|
18
52
|
var TuPrologException = kotlin_it_unibo_tuprolog_core.$_$.l1;
|
|
19
53
|
var TuPrologException_init_$Init$ = kotlin_it_unibo_tuprolog_core.$_$.m;
|
|
20
|
-
var ensureNotNull = kotlin_kotlin.$_$.
|
|
21
|
-
var replace
|
|
22
|
-
var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.
|
|
23
|
-
var Char = kotlin_kotlin.$_$.
|
|
24
|
-
var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.
|
|
25
|
-
var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.
|
|
54
|
+
var ensureNotNull = kotlin_kotlin.$_$.wb;
|
|
55
|
+
var replace = kotlin_kotlin.$_$.fa;
|
|
56
|
+
var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.h1;
|
|
57
|
+
var Char = kotlin_kotlin.$_$.fb;
|
|
58
|
+
var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.q;
|
|
59
|
+
var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.c1;
|
|
26
60
|
var OperatorSet_init_$Create$ = kotlin_it_unibo_tuprolog_core.$_$.n;
|
|
27
|
-
var objectMeta = kotlin_kotlin.$_$.
|
|
61
|
+
var objectMeta = kotlin_kotlin.$_$.r6;
|
|
28
62
|
var Struct = kotlin_it_unibo_tuprolog_core.$_$.z1;
|
|
29
|
-
var isInterface = kotlin_kotlin.$_$.
|
|
63
|
+
var isInterface = kotlin_kotlin.$_$.g6;
|
|
30
64
|
var getKClass = kotlin_kotlin.$_$.c;
|
|
31
|
-
var Unit_getInstance = kotlin_kotlin.$_$.
|
|
65
|
+
var Unit_getInstance = kotlin_kotlin.$_$.v1;
|
|
32
66
|
var Constant = kotlin_it_unibo_tuprolog_core.$_$.q1;
|
|
33
67
|
var Var = kotlin_it_unibo_tuprolog_core.$_$.b3;
|
|
34
68
|
var Atom = kotlin_it_unibo_tuprolog_core.$_$.o1;
|
|
@@ -39,51 +73,51 @@
|
|
|
39
73
|
var Rule = kotlin_it_unibo_tuprolog_core.$_$.y1;
|
|
40
74
|
var Fact = kotlin_it_unibo_tuprolog_core.$_$.s1;
|
|
41
75
|
var Directive = kotlin_it_unibo_tuprolog_core.$_$.r1;
|
|
42
|
-
var interfaceMeta = kotlin_kotlin.$_$.
|
|
76
|
+
var interfaceMeta = kotlin_kotlin.$_$.c6;
|
|
43
77
|
var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_core.$_$.v;
|
|
44
|
-
var THROW_CCE = kotlin_kotlin.$_$.
|
|
45
|
-
var contains = kotlin_kotlin.$_$.
|
|
78
|
+
var THROW_CCE = kotlin_kotlin.$_$.tb;
|
|
79
|
+
var contains = kotlin_kotlin.$_$.p2;
|
|
46
80
|
var Companion_getInstance_2 = kotlin_it_unibo_tuprolog_core.$_$.r;
|
|
47
|
-
var map = kotlin_kotlin.$_$.
|
|
81
|
+
var map = kotlin_kotlin.$_$.o8;
|
|
48
82
|
var Operator = kotlin_it_unibo_tuprolog_core.$_$.n1;
|
|
49
83
|
var List = kotlin_it_unibo_tuprolog_core.$_$.v1;
|
|
50
|
-
var toString = kotlin_kotlin.$_$.
|
|
51
|
-
var coerceAtLeast = kotlin_kotlin.$_$.
|
|
84
|
+
var toString = kotlin_kotlin.$_$.x6;
|
|
85
|
+
var coerceAtLeast = kotlin_kotlin.$_$.i7;
|
|
52
86
|
var isRecognitionException = kotlin_it_unibo_tuprolog_parser_js.$_$.b;
|
|
53
87
|
var isParseCancellationException = kotlin_it_unibo_tuprolog_parser_js.$_$.a;
|
|
54
|
-
var generateSequence = kotlin_kotlin.$_$.
|
|
55
|
-
var takeWhile = kotlin_kotlin.$_$.
|
|
56
|
-
var to = kotlin_kotlin.$_$.
|
|
57
|
-
var Companion_getInstance_3 =
|
|
58
|
-
var charSequenceGet = kotlin_kotlin.$_$.
|
|
59
|
-
var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.
|
|
60
|
-
var
|
|
61
|
-
var plus = kotlin_kotlin.$_$.
|
|
62
|
-
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.
|
|
63
|
-
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.
|
|
64
|
-
var listOf = kotlin_kotlin.$_$.
|
|
65
|
-
var asList = kotlin_kotlin.$_$.
|
|
66
|
-
var plus_0 = kotlin_kotlin.$_$.
|
|
67
|
-
var collectionSizeOrDefault = kotlin_kotlin.$_$.
|
|
68
|
-
var toList = kotlin_kotlin.$_$.
|
|
69
|
-
var flatMap = kotlin_kotlin.$_$.
|
|
70
|
-
var asSequence = kotlin_kotlin.$_$.
|
|
71
|
-
var toList_0 = kotlin_kotlin.$_$.
|
|
72
|
-
var sequenceOf = kotlin_kotlin.$_$.
|
|
73
|
-
var asSequence_0 = kotlin_kotlin.$_$.
|
|
74
|
-
var plus_1 = kotlin_kotlin.$_$.
|
|
75
|
-
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.
|
|
88
|
+
var generateSequence = kotlin_kotlin.$_$.h8;
|
|
89
|
+
var takeWhile = kotlin_kotlin.$_$.x8;
|
|
90
|
+
var to = kotlin_kotlin.$_$.fc;
|
|
91
|
+
var Companion_getInstance_3 = kotlin_io_github_gciatto_kt_math.$_$.e;
|
|
92
|
+
var charSequenceGet = kotlin_kotlin.$_$.r5;
|
|
93
|
+
var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.k1;
|
|
94
|
+
var contains_0 = kotlin_kotlin.$_$.k9;
|
|
95
|
+
var plus = kotlin_kotlin.$_$.ac;
|
|
96
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.e;
|
|
97
|
+
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.v;
|
|
98
|
+
var listOf = kotlin_kotlin.$_$.o3;
|
|
99
|
+
var asList = kotlin_kotlin.$_$.g2;
|
|
100
|
+
var plus_0 = kotlin_kotlin.$_$.h4;
|
|
101
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.n2;
|
|
102
|
+
var toList = kotlin_kotlin.$_$.v4;
|
|
103
|
+
var flatMap = kotlin_kotlin.$_$.f8;
|
|
104
|
+
var asSequence = kotlin_kotlin.$_$.k2;
|
|
105
|
+
var toList_0 = kotlin_kotlin.$_$.b9;
|
|
106
|
+
var sequenceOf = kotlin_kotlin.$_$.u8;
|
|
107
|
+
var asSequence_0 = kotlin_kotlin.$_$.l2;
|
|
108
|
+
var plus_1 = kotlin_kotlin.$_$.s8;
|
|
109
|
+
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.t;
|
|
76
110
|
var Term = kotlin_it_unibo_tuprolog_core.$_$.y2;
|
|
77
111
|
var Companion_getInstance_4 = kotlin_it_unibo_tuprolog_core.$_$.x;
|
|
78
112
|
var Companion_getInstance_5 = kotlin_it_unibo_tuprolog_core.$_$.a1;
|
|
79
|
-
var NumberFormatException = kotlin_kotlin.$_$.
|
|
113
|
+
var NumberFormatException = kotlin_kotlin.$_$.qb;
|
|
80
114
|
//endregion
|
|
81
115
|
//region block: pre-declaration
|
|
82
|
-
setMetadataFor(ParseException, 'ParseException', classMeta, TuPrologException
|
|
83
|
-
setMetadataFor(InvalidTermTypeException, 'InvalidTermTypeException', classMeta, ParseException
|
|
84
|
-
setMetadataFor(Companion, 'Companion', objectMeta
|
|
116
|
+
setMetadataFor(ParseException, 'ParseException', classMeta, TuPrologException);
|
|
117
|
+
setMetadataFor(InvalidTermTypeException, 'InvalidTermTypeException', classMeta, ParseException);
|
|
118
|
+
setMetadataFor(Companion, 'Companion', objectMeta);
|
|
85
119
|
function parseTerm(input) {
|
|
86
|
-
return this.parseTermWithOperators(input, this.
|
|
120
|
+
return this.parseTermWithOperators(input, this.x3g());
|
|
87
121
|
}
|
|
88
122
|
function parseStructWithOperators(input, operators) {
|
|
89
123
|
var tmp$ret$2;
|
|
@@ -98,8 +132,7 @@
|
|
|
98
132
|
var tmp0_elvis_lhs = isInterface(tmp0_let, Struct) ? tmp0_let : null;
|
|
99
133
|
var tmp;
|
|
100
134
|
if (tmp0_elvis_lhs == null) {
|
|
101
|
-
|
|
102
|
-
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
135
|
+
throw new InvalidTermTypeException(input, tmp0_let, getKClass(Struct));
|
|
103
136
|
} else {
|
|
104
137
|
tmp = tmp0_elvis_lhs;
|
|
105
138
|
}
|
|
@@ -109,7 +142,7 @@
|
|
|
109
142
|
return tmp$ret$2;
|
|
110
143
|
}
|
|
111
144
|
function parseStruct(input) {
|
|
112
|
-
return this.parseStructWithOperators(input, this.
|
|
145
|
+
return this.parseStructWithOperators(input, this.x3g());
|
|
113
146
|
}
|
|
114
147
|
function parseConstantWithOperators(input, operators) {
|
|
115
148
|
var tmp$ret$2;
|
|
@@ -124,8 +157,7 @@
|
|
|
124
157
|
var tmp0_elvis_lhs = isInterface(tmp0_let, Constant) ? tmp0_let : null;
|
|
125
158
|
var tmp;
|
|
126
159
|
if (tmp0_elvis_lhs == null) {
|
|
127
|
-
|
|
128
|
-
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
160
|
+
throw new InvalidTermTypeException(input, tmp0_let, getKClass(Constant));
|
|
129
161
|
} else {
|
|
130
162
|
tmp = tmp0_elvis_lhs;
|
|
131
163
|
}
|
|
@@ -135,7 +167,7 @@
|
|
|
135
167
|
return tmp$ret$2;
|
|
136
168
|
}
|
|
137
169
|
function parseConstant(input) {
|
|
138
|
-
return this.parseConstantWithOperators(input, this.
|
|
170
|
+
return this.parseConstantWithOperators(input, this.x3g());
|
|
139
171
|
}
|
|
140
172
|
function parseVarWithOperators(input, operators) {
|
|
141
173
|
var tmp$ret$2;
|
|
@@ -150,8 +182,7 @@
|
|
|
150
182
|
var tmp0_elvis_lhs = isInterface(tmp0_let, Var) ? tmp0_let : null;
|
|
151
183
|
var tmp;
|
|
152
184
|
if (tmp0_elvis_lhs == null) {
|
|
153
|
-
|
|
154
|
-
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
185
|
+
throw new InvalidTermTypeException(input, tmp0_let, getKClass(Var));
|
|
155
186
|
} else {
|
|
156
187
|
tmp = tmp0_elvis_lhs;
|
|
157
188
|
}
|
|
@@ -161,7 +192,7 @@
|
|
|
161
192
|
return tmp$ret$2;
|
|
162
193
|
}
|
|
163
194
|
function parseVar(input) {
|
|
164
|
-
return this.parseVarWithOperators(input, this.
|
|
195
|
+
return this.parseVarWithOperators(input, this.x3g());
|
|
165
196
|
}
|
|
166
197
|
function parseAtomWithOperators(input, operators) {
|
|
167
198
|
var tmp$ret$2;
|
|
@@ -176,8 +207,7 @@
|
|
|
176
207
|
var tmp0_elvis_lhs = isInterface(tmp0_let, Atom) ? tmp0_let : null;
|
|
177
208
|
var tmp;
|
|
178
209
|
if (tmp0_elvis_lhs == null) {
|
|
179
|
-
|
|
180
|
-
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
210
|
+
throw new InvalidTermTypeException(input, tmp0_let, getKClass(Atom));
|
|
181
211
|
} else {
|
|
182
212
|
tmp = tmp0_elvis_lhs;
|
|
183
213
|
}
|
|
@@ -187,7 +217,7 @@
|
|
|
187
217
|
return tmp$ret$2;
|
|
188
218
|
}
|
|
189
219
|
function parseAtom(input) {
|
|
190
|
-
return this.parseAtomWithOperators(input, this.
|
|
220
|
+
return this.parseAtomWithOperators(input, this.x3g());
|
|
191
221
|
}
|
|
192
222
|
function parseNumericWithOperators(input, operators) {
|
|
193
223
|
var tmp$ret$2;
|
|
@@ -202,8 +232,7 @@
|
|
|
202
232
|
var tmp0_elvis_lhs = isInterface(tmp0_let, Numeric) ? tmp0_let : null;
|
|
203
233
|
var tmp;
|
|
204
234
|
if (tmp0_elvis_lhs == null) {
|
|
205
|
-
|
|
206
|
-
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
235
|
+
throw new InvalidTermTypeException(input, tmp0_let, getKClass(Numeric));
|
|
207
236
|
} else {
|
|
208
237
|
tmp = tmp0_elvis_lhs;
|
|
209
238
|
}
|
|
@@ -213,7 +242,7 @@
|
|
|
213
242
|
return tmp$ret$2;
|
|
214
243
|
}
|
|
215
244
|
function parseNumeric(input) {
|
|
216
|
-
return this.parseNumericWithOperators(input, this.
|
|
245
|
+
return this.parseNumericWithOperators(input, this.x3g());
|
|
217
246
|
}
|
|
218
247
|
function parseIntegerWithOperators(input, operators) {
|
|
219
248
|
var tmp$ret$2;
|
|
@@ -228,8 +257,7 @@
|
|
|
228
257
|
var tmp0_elvis_lhs = isInterface(tmp0_let, Integer) ? tmp0_let : null;
|
|
229
258
|
var tmp;
|
|
230
259
|
if (tmp0_elvis_lhs == null) {
|
|
231
|
-
|
|
232
|
-
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
260
|
+
throw new InvalidTermTypeException(input, tmp0_let, getKClass(Integer));
|
|
233
261
|
} else {
|
|
234
262
|
tmp = tmp0_elvis_lhs;
|
|
235
263
|
}
|
|
@@ -239,7 +267,7 @@
|
|
|
239
267
|
return tmp$ret$2;
|
|
240
268
|
}
|
|
241
269
|
function parseInteger(input) {
|
|
242
|
-
return this.parseIntegerWithOperators(input, this.
|
|
270
|
+
return this.parseIntegerWithOperators(input, this.x3g());
|
|
243
271
|
}
|
|
244
272
|
function parseRealWithOperators(input, operators) {
|
|
245
273
|
var tmp$ret$2;
|
|
@@ -254,8 +282,7 @@
|
|
|
254
282
|
var tmp0_elvis_lhs = isInterface(tmp0_let, Real) ? tmp0_let : null;
|
|
255
283
|
var tmp;
|
|
256
284
|
if (tmp0_elvis_lhs == null) {
|
|
257
|
-
|
|
258
|
-
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
285
|
+
throw new InvalidTermTypeException(input, tmp0_let, getKClass(Real));
|
|
259
286
|
} else {
|
|
260
287
|
tmp = tmp0_elvis_lhs;
|
|
261
288
|
}
|
|
@@ -265,7 +292,7 @@
|
|
|
265
292
|
return tmp$ret$2;
|
|
266
293
|
}
|
|
267
294
|
function parseReal(input) {
|
|
268
|
-
return this.parseRealWithOperators(input, this.
|
|
295
|
+
return this.parseRealWithOperators(input, this.x3g());
|
|
269
296
|
}
|
|
270
297
|
function parseClauseWithOperators(input, operators) {
|
|
271
298
|
var tmp$ret$2;
|
|
@@ -280,8 +307,7 @@
|
|
|
280
307
|
var tmp0_elvis_lhs = isInterface(tmp0_let, Clause) ? tmp0_let : null;
|
|
281
308
|
var tmp;
|
|
282
309
|
if (tmp0_elvis_lhs == null) {
|
|
283
|
-
|
|
284
|
-
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
310
|
+
throw new InvalidTermTypeException(input, tmp0_let, getKClass(Clause));
|
|
285
311
|
} else {
|
|
286
312
|
tmp = tmp0_elvis_lhs;
|
|
287
313
|
}
|
|
@@ -291,7 +317,7 @@
|
|
|
291
317
|
return tmp$ret$2;
|
|
292
318
|
}
|
|
293
319
|
function parseClause(input) {
|
|
294
|
-
return this.parseClauseWithOperators(input, this.
|
|
320
|
+
return this.parseClauseWithOperators(input, this.x3g());
|
|
295
321
|
}
|
|
296
322
|
function parseRuleWithOperators(input, operators) {
|
|
297
323
|
var tmp$ret$2;
|
|
@@ -306,8 +332,7 @@
|
|
|
306
332
|
var tmp0_elvis_lhs = isInterface(tmp0_let, Rule) ? tmp0_let : null;
|
|
307
333
|
var tmp;
|
|
308
334
|
if (tmp0_elvis_lhs == null) {
|
|
309
|
-
|
|
310
|
-
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
335
|
+
throw new InvalidTermTypeException(input, tmp0_let, getKClass(Rule));
|
|
311
336
|
} else {
|
|
312
337
|
tmp = tmp0_elvis_lhs;
|
|
313
338
|
}
|
|
@@ -317,7 +342,7 @@
|
|
|
317
342
|
return tmp$ret$2;
|
|
318
343
|
}
|
|
319
344
|
function parseRule(input) {
|
|
320
|
-
return this.parseRuleWithOperators(input, this.
|
|
345
|
+
return this.parseRuleWithOperators(input, this.x3g());
|
|
321
346
|
}
|
|
322
347
|
function parseFactWithOperators(input, operators) {
|
|
323
348
|
var tmp$ret$2;
|
|
@@ -332,8 +357,7 @@
|
|
|
332
357
|
var tmp0_elvis_lhs = isInterface(tmp0_let, Fact) ? tmp0_let : null;
|
|
333
358
|
var tmp;
|
|
334
359
|
if (tmp0_elvis_lhs == null) {
|
|
335
|
-
|
|
336
|
-
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
360
|
+
throw new InvalidTermTypeException(input, tmp0_let, getKClass(Fact));
|
|
337
361
|
} else {
|
|
338
362
|
tmp = tmp0_elvis_lhs;
|
|
339
363
|
}
|
|
@@ -343,7 +367,7 @@
|
|
|
343
367
|
return tmp$ret$2;
|
|
344
368
|
}
|
|
345
369
|
function parseFact(input) {
|
|
346
|
-
return this.parseFactWithOperators(input, this.
|
|
370
|
+
return this.parseFactWithOperators(input, this.x3g());
|
|
347
371
|
}
|
|
348
372
|
function parseDirectiveWithOperators(input, operators) {
|
|
349
373
|
var tmp$ret$2;
|
|
@@ -358,8 +382,7 @@
|
|
|
358
382
|
var tmp0_elvis_lhs = isInterface(tmp0_let, Directive) ? tmp0_let : null;
|
|
359
383
|
var tmp;
|
|
360
384
|
if (tmp0_elvis_lhs == null) {
|
|
361
|
-
|
|
362
|
-
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
385
|
+
throw new InvalidTermTypeException(input, tmp0_let, getKClass(Directive));
|
|
363
386
|
} else {
|
|
364
387
|
tmp = tmp0_elvis_lhs;
|
|
365
388
|
}
|
|
@@ -369,123 +392,113 @@
|
|
|
369
392
|
return tmp$ret$2;
|
|
370
393
|
}
|
|
371
394
|
function parseDirective(input) {
|
|
372
|
-
return this.parseDirectiveWithOperators(input, this.
|
|
373
|
-
}
|
|
374
|
-
setMetadataFor(TermParser, 'TermParser', interfaceMeta
|
|
375
|
-
setMetadataFor(Companion_0, 'Companion', objectMeta
|
|
376
|
-
setMetadataFor(DynamicOpListener, 'DynamicOpListener', classMeta, PrologParserListener
|
|
377
|
-
setMetadataFor(PrologParserFactory$newErrorListener$1,
|
|
378
|
-
setMetadataFor(PrologParserFactory, 'PrologParserFactory', objectMeta
|
|
379
|
-
setMetadataFor(PrologVisitor, 'PrologVisitor', classMeta, PrologParserVisitor
|
|
380
|
-
setMetadataFor(TermParserImpl, 'TermParserImpl', classMeta,
|
|
395
|
+
return this.parseDirectiveWithOperators(input, this.x3g());
|
|
396
|
+
}
|
|
397
|
+
setMetadataFor(TermParser, 'TermParser', interfaceMeta);
|
|
398
|
+
setMetadataFor(Companion_0, 'Companion', objectMeta);
|
|
399
|
+
setMetadataFor(DynamicOpListener, 'DynamicOpListener', classMeta, PrologParserListener);
|
|
400
|
+
setMetadataFor(PrologParserFactory$newErrorListener$1, VOID, classMeta);
|
|
401
|
+
setMetadataFor(PrologParserFactory, 'PrologParserFactory', objectMeta);
|
|
402
|
+
setMetadataFor(PrologVisitor, 'PrologVisitor', classMeta, PrologParserVisitor);
|
|
403
|
+
setMetadataFor(TermParserImpl, 'TermParserImpl', classMeta, VOID, [TermParser]);
|
|
381
404
|
//endregion
|
|
382
|
-
function
|
|
383
|
-
|
|
405
|
+
function InvalidTermTypeException(input, term, type, offendingSymbol, line, column, message, throwable) {
|
|
406
|
+
var tmp;
|
|
407
|
+
if (offendingSymbol === VOID) {
|
|
384
408
|
var tmp0_elvis_lhs = (!(input == null) ? typeof input === 'string' : false) ? input : null;
|
|
385
|
-
|
|
409
|
+
tmp = tmp0_elvis_lhs == null ? term.toString() : tmp0_elvis_lhs;
|
|
410
|
+
} else {
|
|
411
|
+
tmp = offendingSymbol;
|
|
386
412
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
message = 'Expected ' + type.kd() + ', got: ' + offendingSymbol;
|
|
393
|
-
if (!(($mask0 & 128) === 0))
|
|
394
|
-
throwable = null;
|
|
395
|
-
InvalidTermTypeException.call($this, input, term, type, offendingSymbol, line, column, message, throwable);
|
|
396
|
-
return $this;
|
|
397
|
-
}
|
|
398
|
-
function InvalidTermTypeException_init_$Create$(input, term, type, offendingSymbol, line, column, message, throwable, $mask0, $marker) {
|
|
399
|
-
var tmp = InvalidTermTypeException_init_$Init$(input, term, type, offendingSymbol, line, column, message, throwable, $mask0, $marker, Object.create(InvalidTermTypeException.prototype));
|
|
400
|
-
captureStack(tmp, InvalidTermTypeException_init_$Create$);
|
|
401
|
-
return tmp;
|
|
402
|
-
}
|
|
403
|
-
function InvalidTermTypeException(input, term, type, offendingSymbol, line, column, message, throwable) {
|
|
413
|
+
offendingSymbol = tmp;
|
|
414
|
+
line = line === VOID ? 1 : line;
|
|
415
|
+
column = column === VOID ? 1 : column;
|
|
416
|
+
message = message === VOID ? 'Expected ' + type.md() + ', got: ' + offendingSymbol : message;
|
|
417
|
+
throwable = throwable === VOID ? null : throwable;
|
|
404
418
|
ParseException.call(this, input, offendingSymbol, line, column, message, throwable);
|
|
405
|
-
this.k3i_1 = term;
|
|
406
|
-
this.l3i_1 = type;
|
|
407
419
|
captureStack(this, InvalidTermTypeException);
|
|
420
|
+
this.g3g_1 = term;
|
|
421
|
+
this.h3g_1 = type;
|
|
408
422
|
}
|
|
409
423
|
function ParseException(input, offendingSymbol, line, column, message, throwable) {
|
|
410
424
|
TuPrologException_init_$Init$(message, throwable, this);
|
|
425
|
+
captureStack(this, ParseException);
|
|
411
426
|
this.input = input;
|
|
412
427
|
this.offendingSymbol = offendingSymbol;
|
|
413
428
|
this.line = line;
|
|
414
429
|
this.column = column;
|
|
415
430
|
this.clauseIndex = -1;
|
|
416
|
-
captureStack(this, ParseException);
|
|
417
431
|
}
|
|
418
|
-
ParseException.
|
|
432
|
+
protoOf(ParseException).i3g = function (_set____db54di) {
|
|
419
433
|
this.input = _set____db54di;
|
|
420
434
|
};
|
|
421
|
-
ParseException.
|
|
435
|
+
protoOf(ParseException).j3g = function () {
|
|
422
436
|
return this.input;
|
|
423
437
|
};
|
|
424
|
-
ParseException.
|
|
438
|
+
protoOf(ParseException).k3g = function (_set____db54di) {
|
|
425
439
|
this.offendingSymbol = _set____db54di;
|
|
426
440
|
};
|
|
427
|
-
ParseException.
|
|
441
|
+
protoOf(ParseException).l3g = function () {
|
|
428
442
|
return this.offendingSymbol;
|
|
429
443
|
};
|
|
430
|
-
ParseException.
|
|
444
|
+
protoOf(ParseException).m3g = function (_set____db54di) {
|
|
431
445
|
this.line = _set____db54di;
|
|
432
446
|
};
|
|
433
|
-
ParseException.
|
|
447
|
+
protoOf(ParseException).n3g = function () {
|
|
434
448
|
return this.line;
|
|
435
449
|
};
|
|
436
|
-
ParseException.
|
|
450
|
+
protoOf(ParseException).o3g = function (_set____db54di) {
|
|
437
451
|
this.column = _set____db54di;
|
|
438
452
|
};
|
|
439
|
-
ParseException.
|
|
453
|
+
protoOf(ParseException).p3g = function () {
|
|
440
454
|
return this.column;
|
|
441
455
|
};
|
|
442
|
-
ParseException.
|
|
456
|
+
protoOf(ParseException).q3g = function (_set____db54di) {
|
|
443
457
|
this.clauseIndex = _set____db54di;
|
|
444
458
|
};
|
|
445
|
-
ParseException.
|
|
459
|
+
protoOf(ParseException).r3g = function () {
|
|
446
460
|
return this.clauseIndex;
|
|
447
461
|
};
|
|
448
|
-
ParseException.
|
|
449
|
-
|
|
450
|
-
return "ParseException{message='" + replace$default(tmp, '\\n', '\\\\n', false, 4, null) + new Char(_Char___init__impl__6a9atx(39)) + ', line=' + this.line + ', column=' + this.column + ", offendingSymbol='" + this.offendingSymbol + new Char(_Char___init__impl__6a9atx(39)) + new Char(_Char___init__impl__6a9atx(125));
|
|
462
|
+
protoOf(ParseException).toString = function () {
|
|
463
|
+
return "ParseException{message='" + replace(ensureNotNull(this.message), '\\n', '\\\\n') + new Char(_Char___init__impl__6a9atx(39)) + ', line=' + this.line + ', column=' + this.column + ", offendingSymbol='" + this.offendingSymbol + new Char(_Char___init__impl__6a9atx(39)) + new Char(_Char___init__impl__6a9atx(125));
|
|
451
464
|
};
|
|
452
465
|
function Companion() {
|
|
453
466
|
Companion_instance = this;
|
|
454
467
|
}
|
|
455
|
-
Companion.
|
|
456
|
-
return this.
|
|
457
|
-
};
|
|
458
|
-
Companion.prototype.w3i = function (scope) {
|
|
459
|
-
return this.x3i(Companion_getInstance_0().EMPTY, scope);
|
|
468
|
+
protoOf(Companion).s3g = function (scope) {
|
|
469
|
+
return this.t3g(Companion_getInstance().EMPTY, scope);
|
|
460
470
|
};
|
|
461
|
-
Companion.
|
|
462
|
-
|
|
471
|
+
protoOf(Companion).withNoOperator = function (scope, $super) {
|
|
472
|
+
scope = scope === VOID ? Companion_getInstance_0().empty() : scope;
|
|
473
|
+
return $super === VOID ? this.s3g(scope) : $super.s3g.call(this, scope);
|
|
463
474
|
};
|
|
464
|
-
Companion.
|
|
465
|
-
return this.
|
|
475
|
+
protoOf(Companion).u3g = function (scope) {
|
|
476
|
+
return this.t3g(Companion_getInstance().STANDARD, scope);
|
|
466
477
|
};
|
|
467
|
-
Companion.
|
|
468
|
-
|
|
478
|
+
protoOf(Companion).withStandardOperators = function (scope, $super) {
|
|
479
|
+
scope = scope === VOID ? Companion_getInstance_0().empty() : scope;
|
|
480
|
+
return $super === VOID ? this.u3g(scope) : $super.u3g.call(this, scope);
|
|
469
481
|
};
|
|
470
|
-
Companion.
|
|
471
|
-
return this.
|
|
482
|
+
protoOf(Companion).v3g = function (scope) {
|
|
483
|
+
return this.t3g(Companion_getInstance().DEFAULT, scope);
|
|
472
484
|
};
|
|
473
|
-
Companion.
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
return this.z3i(scope);
|
|
485
|
+
protoOf(Companion).withDefaultOperators = function (scope, $super) {
|
|
486
|
+
scope = scope === VOID ? Companion_getInstance_0().empty() : scope;
|
|
487
|
+
return $super === VOID ? this.v3g(scope) : $super.v3g.call(this, scope);
|
|
477
488
|
};
|
|
478
|
-
Companion.
|
|
479
|
-
return this.x3i(operators, scope === void 1 ? Companion_getInstance().empty() : scope);
|
|
480
|
-
};
|
|
481
|
-
Companion.prototype.x3i = function (operators, scope) {
|
|
489
|
+
protoOf(Companion).t3g = function (operators, scope) {
|
|
482
490
|
return termParserWithOperators(operators, scope);
|
|
483
491
|
};
|
|
484
|
-
Companion.
|
|
485
|
-
|
|
492
|
+
protoOf(Companion).withOperatorSet = function (operators, scope, $super) {
|
|
493
|
+
scope = scope === VOID ? Companion_getInstance_0().empty() : scope;
|
|
494
|
+
return $super === VOID ? this.t3g(operators, scope) : $super.t3g.call(this, operators, scope);
|
|
495
|
+
};
|
|
496
|
+
protoOf(Companion).w3g = function (operators, scope) {
|
|
497
|
+
return this.t3g(OperatorSet_init_$Create$(operators.slice()), scope);
|
|
486
498
|
};
|
|
487
|
-
Companion.
|
|
488
|
-
|
|
499
|
+
protoOf(Companion).withOperators = function (operators, scope, $super) {
|
|
500
|
+
scope = scope === VOID ? Companion_getInstance_0().empty() : scope;
|
|
501
|
+
return $super === VOID ? this.w3g(operators, scope) : $super.w3g.call(this, operators, scope);
|
|
489
502
|
};
|
|
490
503
|
var Companion_instance;
|
|
491
504
|
function Companion_getInstance_6() {
|
|
@@ -495,7 +508,10 @@
|
|
|
495
508
|
}
|
|
496
509
|
function TermParser() {
|
|
497
510
|
}
|
|
498
|
-
function
|
|
511
|
+
function termToClause(_this__u8e3s4, source, line, column) {
|
|
512
|
+
source = source === VOID ? null : source;
|
|
513
|
+
line = line === VOID ? 0 : line;
|
|
514
|
+
column = column === VOID ? 0 : column;
|
|
499
515
|
var tmp0_subject = _this__u8e3s4;
|
|
500
516
|
var tmp;
|
|
501
517
|
if (isInterface(tmp0_subject, Clause)) {
|
|
@@ -504,21 +520,11 @@
|
|
|
504
520
|
if (isInterface(tmp0_subject, Struct)) {
|
|
505
521
|
tmp = Companion_getInstance_1().of(_this__u8e3s4);
|
|
506
522
|
} else {
|
|
507
|
-
|
|
508
|
-
throw InvalidTermTypeException_init_$Create$(source, _this__u8e3s4, tmp_0, null, line, column, null, null, 200, null);
|
|
523
|
+
throw new InvalidTermTypeException(source, _this__u8e3s4, getKClass(Clause), VOID, line, column);
|
|
509
524
|
}
|
|
510
525
|
}
|
|
511
526
|
return tmp;
|
|
512
527
|
}
|
|
513
|
-
function toClause$default(_this__u8e3s4, source, line, column, $mask0, $handler) {
|
|
514
|
-
if (!(($mask0 & 1) === 0))
|
|
515
|
-
source = null;
|
|
516
|
-
if (!(($mask0 & 2) === 0))
|
|
517
|
-
line = 0;
|
|
518
|
-
if (!(($mask0 & 4) === 0))
|
|
519
|
-
column = 0;
|
|
520
|
-
return toClause(_this__u8e3s4, source, line, column);
|
|
521
|
-
}
|
|
522
528
|
function parseStructWithOperators_0(_this__u8e3s4, input, operators) {
|
|
523
529
|
return get_defaultParser().parseStructWithOperators(input, operators);
|
|
524
530
|
}
|
|
@@ -526,8 +532,7 @@
|
|
|
526
532
|
return get_defaultParser().parseStruct(input);
|
|
527
533
|
}
|
|
528
534
|
function get_defaultParser() {
|
|
529
|
-
|
|
530
|
-
return tmp.a3j(null, 1, null);
|
|
535
|
+
return Companion_getInstance_6().withDefaultOperators();
|
|
531
536
|
}
|
|
532
537
|
function toAssociativity(_this__u8e3s4) {
|
|
533
538
|
return _this__u8e3s4.toString();
|
|
@@ -536,13 +541,13 @@
|
|
|
536
541
|
return Unit_getInstance();
|
|
537
542
|
}
|
|
538
543
|
function onOperatorDefined($this, operator) {
|
|
539
|
-
$this.
|
|
540
|
-
$this.
|
|
544
|
+
$this.y3g_1.addOperator(operator.q1h_1, toAssociativity(operator.r1h_1), operator.s1h_1);
|
|
545
|
+
$this.z3g_1($this.y3g_1, operator);
|
|
541
546
|
}
|
|
542
547
|
function Companion_0() {
|
|
543
548
|
Companion_instance_0 = this;
|
|
544
549
|
}
|
|
545
|
-
Companion_0.
|
|
550
|
+
protoOf(Companion_0).a3h = function (parser) {
|
|
546
551
|
return new DynamicOpListener(parser, DynamicOpListener$Companion$of$lambda);
|
|
547
552
|
};
|
|
548
553
|
var Companion_instance_0;
|
|
@@ -557,10 +562,10 @@
|
|
|
557
562
|
function DynamicOpListener(parser, operatorDefinedCallback) {
|
|
558
563
|
Companion_getInstance_7();
|
|
559
564
|
PrologParserListener.call(this);
|
|
560
|
-
this.
|
|
561
|
-
this.
|
|
565
|
+
this.y3g_1 = parser;
|
|
566
|
+
this.z3g_1 = operatorDefinedCallback;
|
|
562
567
|
}
|
|
563
|
-
DynamicOpListener.
|
|
568
|
+
protoOf(DynamicOpListener).b3h = function (ctx) {
|
|
564
569
|
var expr = ctx.expression();
|
|
565
570
|
if (ctx.exception != null) {
|
|
566
571
|
return Unit_getInstance();
|
|
@@ -580,21 +585,21 @@
|
|
|
580
585
|
tmp = false;
|
|
581
586
|
}
|
|
582
587
|
if (tmp) {
|
|
583
|
-
var tmp_1 = ctx.accept(
|
|
588
|
+
var tmp_1 = ctx.accept(new PrologVisitor());
|
|
584
589
|
var directive = isInterface(tmp_1, Directive) ? tmp_1 : THROW_CCE();
|
|
585
|
-
var op = directive.
|
|
590
|
+
var op = directive.tx();
|
|
586
591
|
var tmp_2;
|
|
587
592
|
var tmp_3;
|
|
588
593
|
var tmp_4;
|
|
589
594
|
var tmp_5;
|
|
590
595
|
var tmp_6;
|
|
591
596
|
if (isInterface(op, Struct)) {
|
|
592
|
-
tmp_6 = op.
|
|
597
|
+
tmp_6 = op.qv() === 3;
|
|
593
598
|
} else {
|
|
594
599
|
tmp_6 = false;
|
|
595
600
|
}
|
|
596
601
|
if (tmp_6) {
|
|
597
|
-
tmp_5 = op.
|
|
602
|
+
tmp_5 = op.wv() === 'op';
|
|
598
603
|
} else {
|
|
599
604
|
tmp_5 = false;
|
|
600
605
|
}
|
|
@@ -611,7 +616,7 @@
|
|
|
611
616
|
tmp_3 = false;
|
|
612
617
|
}
|
|
613
618
|
if (tmp_3) {
|
|
614
|
-
tmp_2 = op.
|
|
619
|
+
tmp_2 = op.rw();
|
|
615
620
|
} else {
|
|
616
621
|
tmp_2 = false;
|
|
617
622
|
}
|
|
@@ -621,7 +626,7 @@
|
|
|
621
626
|
var tmp$ret$0;
|
|
622
627
|
// Inline function 'kotlin.math.max' call
|
|
623
628
|
var tmp_9 = op.get(0);
|
|
624
|
-
var tmp0_max = (isInterface(tmp_9, Numeric) ? tmp_9 : THROW_CCE()).
|
|
629
|
+
var tmp0_max = (isInterface(tmp_9, Numeric) ? tmp_9 : THROW_CCE()).az().toInt();
|
|
625
630
|
tmp$ret$0 = Math.max(0, tmp0_max);
|
|
626
631
|
var tmp1_min = tmp$ret$0;
|
|
627
632
|
tmp$ret$1 = Math.min(1200, tmp1_min);
|
|
@@ -635,7 +640,7 @@
|
|
|
635
640
|
var tmp$ret$3;
|
|
636
641
|
$l$block: {
|
|
637
642
|
// Inline function 'kotlin.sequences.all' call
|
|
638
|
-
var tmp2_all = operator.
|
|
643
|
+
var tmp2_all = operator.au();
|
|
639
644
|
var tmp0_iterator = tmp2_all.j();
|
|
640
645
|
while (tmp0_iterator.m()) {
|
|
641
646
|
var element = tmp0_iterator.n();
|
|
@@ -650,7 +655,7 @@
|
|
|
650
655
|
tmp$ret$3 = true;
|
|
651
656
|
}
|
|
652
657
|
if (tmp$ret$3) {
|
|
653
|
-
var tmp_10 = operator.
|
|
658
|
+
var tmp_10 = operator.au();
|
|
654
659
|
var tmp2_iterator = map(tmp_10, DynamicOpListener$exitClause$lambda).j();
|
|
655
660
|
while (tmp2_iterator.m()) {
|
|
656
661
|
var it = tmp2_iterator.n();
|
|
@@ -662,8 +667,8 @@
|
|
|
662
667
|
}
|
|
663
668
|
}
|
|
664
669
|
};
|
|
665
|
-
DynamicOpListener.
|
|
666
|
-
return this.
|
|
670
|
+
protoOf(DynamicOpListener).exitClause = function (ctx) {
|
|
671
|
+
return this.b3h(ctx);
|
|
667
672
|
};
|
|
668
673
|
function parseException(token, message) {
|
|
669
674
|
return new ParseException(null, token.text, token.line, token.column, message, null);
|
|
@@ -683,7 +688,7 @@
|
|
|
683
688
|
function parseExpression($this, parserAndErrorStrategy, source) {
|
|
684
689
|
var mark = -1;
|
|
685
690
|
var index = -1;
|
|
686
|
-
var parser = parserAndErrorStrategy.
|
|
691
|
+
var parser = parserAndErrorStrategy.k4_1;
|
|
687
692
|
var tmp;
|
|
688
693
|
try {
|
|
689
694
|
mark = parser.getTokenStream().mark();
|
|
@@ -692,18 +697,19 @@
|
|
|
692
697
|
} catch ($p) {
|
|
693
698
|
var tmp_0;
|
|
694
699
|
{
|
|
700
|
+
var e = $p;
|
|
695
701
|
var tmp_1;
|
|
696
|
-
if (isParseCancellationException(
|
|
702
|
+
if (isParseCancellationException(e) ? parser._interp.predictionMode === PredictionMode.SLL : false) {
|
|
697
703
|
parser.getTokenStream().seek(index);
|
|
698
704
|
parser._interp.predictionMode = PredictionMode.LL;
|
|
699
|
-
parser._errHandler = parserAndErrorStrategy.
|
|
705
|
+
parser._errHandler = parserAndErrorStrategy.l4_1;
|
|
700
706
|
parser.addErrorListener(newErrorListener($this, source));
|
|
701
707
|
tmp_1 = parseExpression($this, parserAndErrorStrategy, source);
|
|
702
|
-
} else if (
|
|
703
|
-
var tmp_2 =
|
|
708
|
+
} else if (e.clause !== null ? isRecognitionException(e.cause) : false) {
|
|
709
|
+
var tmp_2 = e.cause;
|
|
704
710
|
throw tmp_2 instanceof RecognitionException ? tmp_2 : THROW_CCE();
|
|
705
711
|
} else {
|
|
706
|
-
throw
|
|
712
|
+
throw e instanceof Error ? e : THROW_CCE();
|
|
707
713
|
}
|
|
708
714
|
tmp_0 = tmp_1;
|
|
709
715
|
}
|
|
@@ -717,7 +723,7 @@
|
|
|
717
723
|
function parseClause_0($this, parserAndErrorStrategy, source) {
|
|
718
724
|
var mark = -1;
|
|
719
725
|
var index = -1;
|
|
720
|
-
var parser = parserAndErrorStrategy.
|
|
726
|
+
var parser = parserAndErrorStrategy.k4_1;
|
|
721
727
|
var tmp;
|
|
722
728
|
try {
|
|
723
729
|
mark = parser.getTokenStream().mark();
|
|
@@ -726,18 +732,19 @@
|
|
|
726
732
|
} catch ($p) {
|
|
727
733
|
var tmp_0;
|
|
728
734
|
{
|
|
735
|
+
var e = $p;
|
|
729
736
|
var tmp_1;
|
|
730
|
-
if (isParseCancellationException(
|
|
737
|
+
if (isParseCancellationException(e) ? parser._interp.predictionMode === PredictionMode.SLL : false) {
|
|
731
738
|
parser.getTokenStream().seek(index);
|
|
732
739
|
parser._interp.predictionMode = PredictionMode.LL;
|
|
733
|
-
parser._errHandler = parserAndErrorStrategy.
|
|
740
|
+
parser._errHandler = parserAndErrorStrategy.l4_1;
|
|
734
741
|
parser.addErrorListener(newErrorListener($this, source));
|
|
735
742
|
tmp_1 = parseClause_0($this, parserAndErrorStrategy, source);
|
|
736
|
-
} else if (
|
|
737
|
-
var tmp_2 =
|
|
743
|
+
} else if (e.clause !== null ? isRecognitionException(e.cause) : false) {
|
|
744
|
+
var tmp_2 = e.cause;
|
|
738
745
|
throw tmp_2 instanceof RecognitionException ? tmp_2 : THROW_CCE();
|
|
739
746
|
} else {
|
|
740
|
-
throw
|
|
747
|
+
throw e instanceof Error ? e : THROW_CCE();
|
|
741
748
|
}
|
|
742
749
|
tmp_0 = tmp_1;
|
|
743
750
|
}
|
|
@@ -755,13 +762,13 @@
|
|
|
755
762
|
return map(tmp_1, PrologParserFactory$parseClauses$lambda_2);
|
|
756
763
|
}
|
|
757
764
|
function PrologParserFactory$newErrorListener$1($whileParsing) {
|
|
758
|
-
this.
|
|
765
|
+
this.c3h_1 = $whileParsing;
|
|
759
766
|
}
|
|
760
|
-
PrologParserFactory$newErrorListener$1.
|
|
767
|
+
protoOf(PrologParserFactory$newErrorListener$1).syntaxError = function (recognizer, offendingSymbol, line, column, msg, e) {
|
|
761
768
|
if (recognizer instanceof PrologParser) {
|
|
762
769
|
recognizer.removeParseListeners();
|
|
763
770
|
}
|
|
764
|
-
throw new ParseException(this.
|
|
771
|
+
throw new ParseException(this.c3h_1, symbolToString(this, offendingSymbol), line, column + 1 | 0, msg, e);
|
|
765
772
|
};
|
|
766
773
|
function PrologParserFactory$parseClauses$lambda(it) {
|
|
767
774
|
return it + 1 | 0;
|
|
@@ -774,8 +781,9 @@
|
|
|
774
781
|
} catch ($p) {
|
|
775
782
|
var tmp_0;
|
|
776
783
|
if ($p instanceof ParseException) {
|
|
777
|
-
|
|
778
|
-
|
|
784
|
+
var e = $p;
|
|
785
|
+
e.clauseIndex = it;
|
|
786
|
+
throw e;
|
|
779
787
|
} else {
|
|
780
788
|
throw $p;
|
|
781
789
|
}
|
|
@@ -793,15 +801,15 @@
|
|
|
793
801
|
function PrologParserFactory() {
|
|
794
802
|
PrologParserFactory_instance = this;
|
|
795
803
|
}
|
|
796
|
-
PrologParserFactory.
|
|
797
|
-
var parser = this.
|
|
804
|
+
protoOf(PrologParserFactory).d3h = function (string, withOperators) {
|
|
805
|
+
var parser = this.e3h(string, withOperators);
|
|
798
806
|
return parseExpression(this, parser, string);
|
|
799
807
|
};
|
|
800
|
-
PrologParserFactory.
|
|
801
|
-
var parser = this.
|
|
808
|
+
protoOf(PrologParserFactory).f3h = function (source, withOperators) {
|
|
809
|
+
var parser = this.e3h(source, withOperators);
|
|
802
810
|
return parseClauses(this, parser, source);
|
|
803
811
|
};
|
|
804
|
-
PrologParserFactory.
|
|
812
|
+
protoOf(PrologParserFactory).e3h = function (source, operators) {
|
|
805
813
|
var stream = new InputStream(source);
|
|
806
814
|
var lexer = new PrologLexer(stream);
|
|
807
815
|
lexer.removeErrorListeners();
|
|
@@ -811,17 +819,17 @@
|
|
|
811
819
|
var originalErrorStrategy = parser._errHandler;
|
|
812
820
|
parser._errHandler = new BailErrorStrategy();
|
|
813
821
|
parser._interp.predictionMode = PredictionMode.SLL;
|
|
814
|
-
return to(this.
|
|
822
|
+
return to(this.g3h(parser, operators), originalErrorStrategy);
|
|
815
823
|
};
|
|
816
|
-
PrologParserFactory.
|
|
824
|
+
protoOf(PrologParserFactory).g3h = function (prologParser, operators) {
|
|
817
825
|
// Inline function 'kotlin.collections.forEach' call
|
|
818
826
|
var tmp0_iterator = operators.j();
|
|
819
827
|
while (tmp0_iterator.m()) {
|
|
820
828
|
var element = tmp0_iterator.n();
|
|
821
829
|
// Inline function 'it.unibo.tuprolog.core.parsing.PrologParserFactory.addOperators.<anonymous>' call
|
|
822
|
-
prologParser.addOperator(element.
|
|
830
|
+
prologParser.addOperator(element.q1h_1, toAssociativity(element.r1h_1), element.s1h_1);
|
|
823
831
|
}
|
|
824
|
-
prologParser.addParseListener(Companion_getInstance_7().
|
|
832
|
+
prologParser.addParseListener(Companion_getInstance_7().a3h(prologParser));
|
|
825
833
|
return prologParser;
|
|
826
834
|
};
|
|
827
835
|
var PrologParserFactory_instance;
|
|
@@ -830,15 +838,6 @@
|
|
|
830
838
|
new PrologParserFactory();
|
|
831
839
|
return PrologParserFactory_instance;
|
|
832
840
|
}
|
|
833
|
-
function PrologVisitor_init_$Init$(scope, $mask0, $marker, $this) {
|
|
834
|
-
if (!(($mask0 & 1) === 0))
|
|
835
|
-
scope = Companion_getInstance().empty();
|
|
836
|
-
PrologVisitor.call($this, scope);
|
|
837
|
-
return $this;
|
|
838
|
-
}
|
|
839
|
-
function PrologVisitor_init_$Create$(scope, $mask0, $marker) {
|
|
840
|
-
return PrologVisitor_init_$Init$(scope, $mask0, $marker, Object.create(PrologVisitor.prototype));
|
|
841
|
-
}
|
|
842
841
|
function parseInteger_0($this, ctx) {
|
|
843
842
|
var str = ctx.value.text;
|
|
844
843
|
var base;
|
|
@@ -895,13 +894,7 @@
|
|
|
895
894
|
var tmp_0;
|
|
896
895
|
var tmp0_safe_receiver = ctx.sign;
|
|
897
896
|
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.text;
|
|
898
|
-
var
|
|
899
|
-
if (tmp1_safe_receiver == null) {
|
|
900
|
-
tmp_1 = null;
|
|
901
|
-
} else {
|
|
902
|
-
tmp_1 = contains$default(tmp1_safe_receiver, '-', false, 2, null);
|
|
903
|
-
}
|
|
904
|
-
var tmp2_elvis_lhs = tmp_1;
|
|
897
|
+
var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : contains_0(tmp1_safe_receiver, '-');
|
|
905
898
|
if (tmp2_elvis_lhs == null ? false : tmp2_elvis_lhs) {
|
|
906
899
|
tmp_0 = tmp1_with.unaryMinus();
|
|
907
900
|
} else {
|
|
@@ -925,11 +918,11 @@
|
|
|
925
918
|
var tmp = ensureNotNull(tmp0_safe_receiver == null ? null : tmp0_safe_receiver.accept($this));
|
|
926
919
|
var tmp$ret$2;
|
|
927
920
|
// Inline function 'kotlin.collections.map' call
|
|
928
|
-
var
|
|
921
|
+
var tmp1_map = ctx.operators;
|
|
929
922
|
var tmp$ret$1;
|
|
930
923
|
// Inline function 'kotlin.collections.mapTo' call
|
|
931
|
-
var tmp0_mapTo = ArrayList_init_$Create$(
|
|
932
|
-
var indexedObject =
|
|
924
|
+
var tmp0_mapTo = ArrayList_init_$Create$(tmp1_map.length);
|
|
925
|
+
var indexedObject = tmp1_map;
|
|
933
926
|
var inductionVariable = 0;
|
|
934
927
|
var last = indexedObject.length;
|
|
935
928
|
while (inductionVariable < last) {
|
|
@@ -946,9 +939,9 @@
|
|
|
946
939
|
}
|
|
947
940
|
function postfix($this, term, ops) {
|
|
948
941
|
var operator = ops.j();
|
|
949
|
-
var result = $this.
|
|
942
|
+
var result = $this.h3h_1.structOf(operator.n(), [term]);
|
|
950
943
|
while (operator.m()) {
|
|
951
|
-
result = $this.
|
|
944
|
+
result = $this.h3h_1.structOf(operator.n(), [result]);
|
|
952
945
|
}
|
|
953
946
|
return result;
|
|
954
947
|
}
|
|
@@ -956,11 +949,11 @@
|
|
|
956
949
|
var tmp = ctx.right[0].accept($this);
|
|
957
950
|
var tmp$ret$2;
|
|
958
951
|
// Inline function 'kotlin.collections.map' call
|
|
959
|
-
var
|
|
952
|
+
var tmp1_map = ctx.operators;
|
|
960
953
|
var tmp$ret$1;
|
|
961
954
|
// Inline function 'kotlin.collections.mapTo' call
|
|
962
|
-
var tmp0_mapTo = ArrayList_init_$Create$(
|
|
963
|
-
var indexedObject =
|
|
955
|
+
var tmp0_mapTo = ArrayList_init_$Create$(tmp1_map.length);
|
|
956
|
+
var indexedObject = tmp1_map;
|
|
964
957
|
var inductionVariable = 0;
|
|
965
958
|
var last = indexedObject.length;
|
|
966
959
|
while (inductionVariable < last) {
|
|
@@ -979,9 +972,9 @@
|
|
|
979
972
|
var i = ops.p() - 1 | 0;
|
|
980
973
|
var tmp0 = i;
|
|
981
974
|
i = tmp0 - 1 | 0;
|
|
982
|
-
var result = $this.
|
|
975
|
+
var result = $this.h3h_1.structOf(ops.o(tmp0), [term]);
|
|
983
976
|
while (i >= 0) {
|
|
984
|
-
result = $this.
|
|
977
|
+
result = $this.h3h_1.structOf(ops.o(i), [result]);
|
|
985
978
|
var tmp1 = i;
|
|
986
979
|
i = tmp1 - 1 | 0;
|
|
987
980
|
}
|
|
@@ -1004,11 +997,11 @@
|
|
|
1004
997
|
function visitInfixNonAssociativeExpression($this, ctx) {
|
|
1005
998
|
var tmp$ret$2;
|
|
1006
999
|
// Inline function 'kotlin.collections.map' call
|
|
1007
|
-
var
|
|
1000
|
+
var tmp1_map = plus_0(listOf(ensureNotNull(ctx.left)), asList(ctx.right));
|
|
1008
1001
|
var tmp$ret$1;
|
|
1009
1002
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1010
|
-
var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(
|
|
1011
|
-
var tmp0_iterator =
|
|
1003
|
+
var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(tmp1_map, 10));
|
|
1004
|
+
var tmp0_iterator = tmp1_map.j();
|
|
1012
1005
|
while (tmp0_iterator.m()) {
|
|
1013
1006
|
var item = tmp0_iterator.n();
|
|
1014
1007
|
var tmp$ret$0;
|
|
@@ -1021,11 +1014,11 @@
|
|
|
1021
1014
|
var operands = tmp$ret$2;
|
|
1022
1015
|
var tmp$ret$5;
|
|
1023
1016
|
// Inline function 'kotlin.collections.map' call
|
|
1024
|
-
var
|
|
1017
|
+
var tmp3_map = ctx.operators;
|
|
1025
1018
|
var tmp$ret$4;
|
|
1026
1019
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1027
|
-
var
|
|
1028
|
-
var indexedObject =
|
|
1020
|
+
var tmp2_mapTo = ArrayList_init_$Create$(tmp3_map.length);
|
|
1021
|
+
var indexedObject = tmp3_map;
|
|
1029
1022
|
var inductionVariable = 0;
|
|
1030
1023
|
var last = indexedObject.length;
|
|
1031
1024
|
while (inductionVariable < last) {
|
|
@@ -1034,15 +1027,15 @@
|
|
|
1034
1027
|
var tmp$ret$3;
|
|
1035
1028
|
// Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.visitInfixNonAssociativeExpression.<anonymous>' call
|
|
1036
1029
|
tmp$ret$3 = item_0.symbol.text;
|
|
1037
|
-
|
|
1030
|
+
tmp2_mapTo.g(tmp$ret$3);
|
|
1038
1031
|
}
|
|
1039
|
-
tmp$ret$4 =
|
|
1032
|
+
tmp$ret$4 = tmp2_mapTo;
|
|
1040
1033
|
tmp$ret$5 = tmp$ret$4;
|
|
1041
1034
|
var operators = tmp$ret$5;
|
|
1042
1035
|
return infixNonAssociative($this, operands, operators);
|
|
1043
1036
|
}
|
|
1044
1037
|
function infixNonAssociative($this, terms, ops) {
|
|
1045
|
-
return $this.
|
|
1038
|
+
return $this.h3h_1.structOf(ops.o(0), [terms.o(0), terms.o(1)]);
|
|
1046
1039
|
}
|
|
1047
1040
|
function handleOuters($this, expression, outers) {
|
|
1048
1041
|
var result = expression;
|
|
@@ -1052,11 +1045,11 @@
|
|
|
1052
1045
|
var tmp = listOf(result);
|
|
1053
1046
|
var tmp$ret$2;
|
|
1054
1047
|
// Inline function 'kotlin.collections.map' call
|
|
1055
|
-
var
|
|
1048
|
+
var tmp1_map = o.right;
|
|
1056
1049
|
var tmp$ret$1;
|
|
1057
1050
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1058
|
-
var tmp0_mapTo = ArrayList_init_$Create$(
|
|
1059
|
-
var indexedObject =
|
|
1051
|
+
var tmp0_mapTo = ArrayList_init_$Create$(tmp1_map.length);
|
|
1052
|
+
var indexedObject = tmp1_map;
|
|
1060
1053
|
var inductionVariable = 0;
|
|
1061
1054
|
var last = indexedObject.length;
|
|
1062
1055
|
while (inductionVariable < last) {
|
|
@@ -1072,11 +1065,11 @@
|
|
|
1072
1065
|
var operands = plus_0(tmp, tmp$ret$2);
|
|
1073
1066
|
var tmp$ret$5;
|
|
1074
1067
|
// Inline function 'kotlin.collections.map' call
|
|
1075
|
-
var
|
|
1068
|
+
var tmp3_map = o.operators;
|
|
1076
1069
|
var tmp$ret$4;
|
|
1077
1070
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1078
|
-
var
|
|
1079
|
-
var indexedObject_0 =
|
|
1071
|
+
var tmp2_mapTo = ArrayList_init_$Create$(tmp3_map.length);
|
|
1072
|
+
var indexedObject_0 = tmp3_map;
|
|
1080
1073
|
var inductionVariable_0 = 0;
|
|
1081
1074
|
var last_0 = indexedObject_0.length;
|
|
1082
1075
|
while (inductionVariable_0 < last_0) {
|
|
@@ -1085,9 +1078,9 @@
|
|
|
1085
1078
|
var tmp$ret$3;
|
|
1086
1079
|
// Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.handleOuters.<anonymous>' call
|
|
1087
1080
|
tmp$ret$3 = item_0.symbol.text;
|
|
1088
|
-
|
|
1081
|
+
tmp2_mapTo.g(tmp$ret$3);
|
|
1089
1082
|
}
|
|
1090
|
-
tmp$ret$4 =
|
|
1083
|
+
tmp$ret$4 = tmp2_mapTo;
|
|
1091
1084
|
tmp$ret$5 = tmp$ret$4;
|
|
1092
1085
|
var operators = tmp$ret$5;
|
|
1093
1086
|
var tmp1_subject = o.associativity;
|
|
@@ -1114,12 +1107,12 @@
|
|
|
1114
1107
|
var j = ops.p() - 1 | 0;
|
|
1115
1108
|
var tmp0 = j;
|
|
1116
1109
|
j = tmp0 - 1 | 0;
|
|
1117
|
-
var result = $this.
|
|
1110
|
+
var result = $this.h3h_1.structOf(ops.o(tmp0), [terms.o(i - 1 | 0), terms.o(i)]);
|
|
1118
1111
|
i = i - 2 | 0;
|
|
1119
1112
|
while (i >= 0) {
|
|
1120
1113
|
var tmp1 = j;
|
|
1121
1114
|
j = tmp1 - 1 | 0;
|
|
1122
|
-
result = $this.
|
|
1115
|
+
result = $this.h3h_1.structOf(ops.o(tmp1), [terms.o(i), result]);
|
|
1123
1116
|
var tmp2 = i;
|
|
1124
1117
|
i = tmp2 - 1 | 0;
|
|
1125
1118
|
}
|
|
@@ -1136,11 +1129,11 @@
|
|
|
1136
1129
|
var tmp_0 = terms.o(tmp1);
|
|
1137
1130
|
var tmp2 = i;
|
|
1138
1131
|
i = tmp2 + 1 | 0;
|
|
1139
|
-
var result = $this.
|
|
1132
|
+
var result = $this.h3h_1.structOf(tmp, [tmp_0, terms.o(tmp2)]);
|
|
1140
1133
|
while (i < terms.p()) {
|
|
1141
1134
|
var tmp3 = j;
|
|
1142
1135
|
j = tmp3 + 1 | 0;
|
|
1143
|
-
result = $this.
|
|
1136
|
+
result = $this.h3h_1.structOf(ops.o(tmp3), [result, terms.o(i)]);
|
|
1144
1137
|
var tmp4 = i;
|
|
1145
1138
|
i = tmp4 + 1 | 0;
|
|
1146
1139
|
}
|
|
@@ -1149,11 +1142,11 @@
|
|
|
1149
1142
|
function listOfOperands($this, ctx) {
|
|
1150
1143
|
var tmp$ret$2;
|
|
1151
1144
|
// Inline function 'kotlin.collections.map' call
|
|
1152
|
-
var
|
|
1145
|
+
var tmp1_map = plus_0(listOf(ctx.left), toList(ctx.right));
|
|
1153
1146
|
var tmp$ret$1;
|
|
1154
1147
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1155
|
-
var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(
|
|
1156
|
-
var tmp0_iterator =
|
|
1148
|
+
var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(tmp1_map, 10));
|
|
1149
|
+
var tmp0_iterator = tmp1_map.j();
|
|
1157
1150
|
while (tmp0_iterator.m()) {
|
|
1158
1151
|
var item = tmp0_iterator.n();
|
|
1159
1152
|
var tmp$ret$0;
|
|
@@ -1168,11 +1161,11 @@
|
|
|
1168
1161
|
function listOfOperators($this, ctx) {
|
|
1169
1162
|
var tmp$ret$2;
|
|
1170
1163
|
// Inline function 'kotlin.collections.map' call
|
|
1171
|
-
var
|
|
1164
|
+
var tmp1_map = ctx.operators;
|
|
1172
1165
|
var tmp$ret$1;
|
|
1173
1166
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1174
|
-
var tmp0_mapTo = ArrayList_init_$Create$(
|
|
1175
|
-
var indexedObject =
|
|
1167
|
+
var tmp0_mapTo = ArrayList_init_$Create$(tmp1_map.length);
|
|
1168
|
+
var indexedObject = tmp1_map;
|
|
1176
1169
|
var inductionVariable = 0;
|
|
1177
1170
|
var last = indexedObject.length;
|
|
1178
1171
|
while (inductionVariable < last) {
|
|
@@ -1205,7 +1198,7 @@
|
|
|
1205
1198
|
}
|
|
1206
1199
|
function PrologVisitor$visitExpression$ref($boundThis) {
|
|
1207
1200
|
var l = function (p0) {
|
|
1208
|
-
return $boundThis.
|
|
1201
|
+
return $boundThis.i3h(p0);
|
|
1209
1202
|
};
|
|
1210
1203
|
l.callableName = 'visitExpression';
|
|
1211
1204
|
return l;
|
|
@@ -1216,31 +1209,32 @@
|
|
|
1216
1209
|
};
|
|
1217
1210
|
}
|
|
1218
1211
|
function PrologVisitor(scope) {
|
|
1212
|
+
scope = scope === VOID ? Companion_getInstance_0().empty() : scope;
|
|
1219
1213
|
PrologParserVisitor.call(this);
|
|
1220
|
-
this.
|
|
1214
|
+
this.h3h_1 = scope;
|
|
1221
1215
|
}
|
|
1222
|
-
PrologVisitor.
|
|
1223
|
-
return this.
|
|
1216
|
+
protoOf(PrologVisitor).j3h = function (ctx) {
|
|
1217
|
+
return this.k3h(ctx.term());
|
|
1224
1218
|
};
|
|
1225
|
-
PrologVisitor.
|
|
1226
|
-
return this.
|
|
1219
|
+
protoOf(PrologVisitor).visitSingletonTerm = function (ctx) {
|
|
1220
|
+
return this.j3h(ctx);
|
|
1227
1221
|
};
|
|
1228
|
-
PrologVisitor.
|
|
1229
|
-
return this.
|
|
1222
|
+
protoOf(PrologVisitor).l3h = function (ctx) {
|
|
1223
|
+
return this.i3h(ctx.expression());
|
|
1230
1224
|
};
|
|
1231
|
-
PrologVisitor.
|
|
1232
|
-
return this.
|
|
1225
|
+
protoOf(PrologVisitor).visitSingletonExpression = function (ctx) {
|
|
1226
|
+
return this.l3h(ctx);
|
|
1233
1227
|
};
|
|
1234
|
-
PrologVisitor.
|
|
1235
|
-
return
|
|
1228
|
+
protoOf(PrologVisitor).m3h = function (ctx) {
|
|
1229
|
+
return termToClause(ctx.expression().accept(this), null, ensureNotNull(ctx.start).line, ensureNotNull(ctx.start).column);
|
|
1236
1230
|
};
|
|
1237
|
-
PrologVisitor.
|
|
1238
|
-
return this.
|
|
1231
|
+
protoOf(PrologVisitor).visitClause = function (ctx) {
|
|
1232
|
+
return this.m3h(ctx);
|
|
1239
1233
|
};
|
|
1240
|
-
PrologVisitor.
|
|
1234
|
+
protoOf(PrologVisitor).i3h = function (ctx) {
|
|
1241
1235
|
var tmp;
|
|
1242
1236
|
if (ctx.isTerm) {
|
|
1243
|
-
tmp = this.
|
|
1237
|
+
tmp = this.k3h(ensureNotNull(ctx.left));
|
|
1244
1238
|
} else if (contains(Associativity.INFIX, ctx.associativity)) {
|
|
1245
1239
|
tmp = visitInfixExpression(this, ctx);
|
|
1246
1240
|
} else if (contains(Associativity.POSTFIX, ctx.associativity)) {
|
|
@@ -1252,37 +1246,37 @@
|
|
|
1252
1246
|
}
|
|
1253
1247
|
return handleOuters(this, tmp, flatten_0(this, asList(ctx.outers)));
|
|
1254
1248
|
};
|
|
1255
|
-
PrologVisitor.
|
|
1256
|
-
return this.
|
|
1249
|
+
protoOf(PrologVisitor).visitExpression = function (ctx) {
|
|
1250
|
+
return this.i3h(ctx);
|
|
1257
1251
|
};
|
|
1258
|
-
PrologVisitor.
|
|
1252
|
+
protoOf(PrologVisitor).k3h = function (ctx) {
|
|
1259
1253
|
var tmp;
|
|
1260
1254
|
if (ctx.isExpr) {
|
|
1261
|
-
tmp = this.
|
|
1255
|
+
tmp = this.i3h(ctx.expression());
|
|
1262
1256
|
} else {
|
|
1263
1257
|
var tmp_0 = ctx.children[0].accept(this);
|
|
1264
1258
|
tmp = (!(tmp_0 == null) ? isInterface(tmp_0, Term) : false) ? tmp_0 : THROW_CCE();
|
|
1265
1259
|
}
|
|
1266
1260
|
return tmp;
|
|
1267
1261
|
};
|
|
1268
|
-
PrologVisitor.
|
|
1269
|
-
return this.
|
|
1262
|
+
protoOf(PrologVisitor).visitTerm = function (ctx) {
|
|
1263
|
+
return this.k3h(ctx);
|
|
1270
1264
|
};
|
|
1271
|
-
PrologVisitor.
|
|
1265
|
+
protoOf(PrologVisitor).n3h = function (ctx) {
|
|
1272
1266
|
var value = parseInteger_0(this, ctx);
|
|
1273
1267
|
return Companion_getInstance_4().ofBigInteger(value);
|
|
1274
1268
|
};
|
|
1275
|
-
PrologVisitor.
|
|
1276
|
-
return this.
|
|
1269
|
+
protoOf(PrologVisitor).visitInteger = function (ctx) {
|
|
1270
|
+
return this.n3h(ctx);
|
|
1277
1271
|
};
|
|
1278
|
-
PrologVisitor.
|
|
1272
|
+
protoOf(PrologVisitor).o3h = function (ctx) {
|
|
1279
1273
|
var tmp = ctx.children[0].accept(this);
|
|
1280
1274
|
return (!(tmp == null) ? isInterface(tmp, Term) : false) ? tmp : THROW_CCE();
|
|
1281
1275
|
};
|
|
1282
|
-
PrologVisitor.
|
|
1283
|
-
return this.
|
|
1276
|
+
protoOf(PrologVisitor).visitNumber = function (ctx) {
|
|
1277
|
+
return this.o3h(ctx);
|
|
1284
1278
|
};
|
|
1285
|
-
PrologVisitor.
|
|
1279
|
+
protoOf(PrologVisitor).p3h = function (ctx) {
|
|
1286
1280
|
var raw = ctx.value.text;
|
|
1287
1281
|
if (!(ctx.sign == null)) {
|
|
1288
1282
|
var tmp0_safe_receiver = ctx.sign;
|
|
@@ -1294,6 +1288,7 @@
|
|
|
1294
1288
|
} catch ($p) {
|
|
1295
1289
|
var tmp_0;
|
|
1296
1290
|
if ($p instanceof NumberFormatException) {
|
|
1291
|
+
var notAFloating = $p;
|
|
1297
1292
|
throw parseException(ctx.value, 'Invalid real number format: ' + ctx.value.text);
|
|
1298
1293
|
} else {
|
|
1299
1294
|
throw $p;
|
|
@@ -1302,54 +1297,54 @@
|
|
|
1302
1297
|
}
|
|
1303
1298
|
return tmp;
|
|
1304
1299
|
};
|
|
1305
|
-
PrologVisitor.
|
|
1306
|
-
return this.
|
|
1300
|
+
protoOf(PrologVisitor).visitReal = function (ctx) {
|
|
1301
|
+
return this.p3h(ctx);
|
|
1307
1302
|
};
|
|
1308
|
-
PrologVisitor.
|
|
1303
|
+
protoOf(PrologVisitor).q3h = function (ctx) {
|
|
1309
1304
|
var tmp;
|
|
1310
1305
|
if (ctx.isAnonymous) {
|
|
1311
|
-
tmp = this.
|
|
1306
|
+
tmp = this.h3h_1.anonymous();
|
|
1312
1307
|
} else {
|
|
1313
|
-
tmp = this.
|
|
1308
|
+
tmp = this.h3h_1.varOf(ctx.value.text);
|
|
1314
1309
|
}
|
|
1315
1310
|
return tmp;
|
|
1316
1311
|
};
|
|
1317
|
-
PrologVisitor.
|
|
1318
|
-
return this.
|
|
1312
|
+
protoOf(PrologVisitor).visitVariable = function (ctx) {
|
|
1313
|
+
return this.q3h(ctx);
|
|
1319
1314
|
};
|
|
1320
|
-
PrologVisitor.
|
|
1315
|
+
protoOf(PrologVisitor).r3h = function (ctx) {
|
|
1321
1316
|
if (ctx.isList) {
|
|
1322
|
-
return this.
|
|
1317
|
+
return this.h3h_1.listOf([]);
|
|
1323
1318
|
} else if (ctx.isBlock) {
|
|
1324
|
-
return this.
|
|
1319
|
+
return this.h3h_1.setOf([]);
|
|
1325
1320
|
}
|
|
1326
1321
|
var tmp;
|
|
1327
1322
|
if (ctx.arity === 0) {
|
|
1328
|
-
tmp = this.
|
|
1323
|
+
tmp = this.h3h_1.atomOf(ctx.functor.text);
|
|
1329
1324
|
} else {
|
|
1330
1325
|
var tmp_0 = ctx.functor.text;
|
|
1331
1326
|
var tmp_1 = asSequence_0(ctx.args);
|
|
1332
|
-
tmp = this.
|
|
1327
|
+
tmp = this.h3h_1.structOfSequence(tmp_0, map(tmp_1, PrologVisitor$visitExpression$ref(this)));
|
|
1333
1328
|
}
|
|
1334
1329
|
return tmp;
|
|
1335
1330
|
};
|
|
1336
|
-
PrologVisitor.
|
|
1337
|
-
return this.
|
|
1331
|
+
protoOf(PrologVisitor).visitStructure = function (ctx) {
|
|
1332
|
+
return this.r3h(ctx);
|
|
1338
1333
|
};
|
|
1339
|
-
PrologVisitor.
|
|
1334
|
+
protoOf(PrologVisitor).s3h = function (ctx) {
|
|
1340
1335
|
var tmp$ret$1;
|
|
1341
1336
|
// Inline function 'kotlin.collections.map' call
|
|
1342
|
-
var
|
|
1337
|
+
var tmp1_map = ctx.items;
|
|
1343
1338
|
var tmp$ret$0;
|
|
1344
1339
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1345
|
-
var tmp0_mapTo = ArrayList_init_$Create$(
|
|
1346
|
-
var indexedObject =
|
|
1340
|
+
var tmp0_mapTo = ArrayList_init_$Create$(tmp1_map.length);
|
|
1341
|
+
var indexedObject = tmp1_map;
|
|
1347
1342
|
var inductionVariable = 0;
|
|
1348
1343
|
var last = indexedObject.length;
|
|
1349
1344
|
while (inductionVariable < last) {
|
|
1350
1345
|
var item = indexedObject[inductionVariable];
|
|
1351
1346
|
inductionVariable = inductionVariable + 1 | 0;
|
|
1352
|
-
tmp0_mapTo.g(this.
|
|
1347
|
+
tmp0_mapTo.g(this.i3h(item));
|
|
1353
1348
|
}
|
|
1354
1349
|
tmp$ret$0 = tmp0_mapTo;
|
|
1355
1350
|
tmp$ret$1 = tmp$ret$0;
|
|
@@ -1357,94 +1352,95 @@
|
|
|
1357
1352
|
var tmp;
|
|
1358
1353
|
if (ctx.hasTail) {
|
|
1359
1354
|
var tmp0_safe_receiver = ctx.tail;
|
|
1360
|
-
tmp = this.
|
|
1355
|
+
tmp = this.h3h_1.o10(terms, tmp0_safe_receiver == null ? null : tmp0_safe_receiver.accept(this));
|
|
1361
1356
|
} else {
|
|
1362
|
-
tmp = this.
|
|
1357
|
+
tmp = this.h3h_1.listOfIterable(terms);
|
|
1363
1358
|
}
|
|
1364
1359
|
return tmp;
|
|
1365
1360
|
};
|
|
1366
|
-
PrologVisitor.
|
|
1367
|
-
return this.
|
|
1361
|
+
protoOf(PrologVisitor).visitList = function (ctx) {
|
|
1362
|
+
return this.s3h(ctx);
|
|
1368
1363
|
};
|
|
1369
|
-
PrologVisitor.
|
|
1364
|
+
protoOf(PrologVisitor).t3h = function (ctx) {
|
|
1370
1365
|
var tmp;
|
|
1371
1366
|
if (ctx.length === 1) {
|
|
1372
|
-
tmp = this.
|
|
1367
|
+
tmp = this.h3h_1.setOf([ctx.items[0].accept(this)]);
|
|
1373
1368
|
} else {
|
|
1374
1369
|
var tmp$ret$1;
|
|
1375
1370
|
// Inline function 'kotlin.collections.map' call
|
|
1376
|
-
var
|
|
1371
|
+
var tmp1_map = ctx.items;
|
|
1377
1372
|
var tmp$ret$0;
|
|
1378
1373
|
// Inline function 'kotlin.collections.mapTo' call
|
|
1379
|
-
var tmp0_mapTo = ArrayList_init_$Create$(
|
|
1380
|
-
var indexedObject =
|
|
1374
|
+
var tmp0_mapTo = ArrayList_init_$Create$(tmp1_map.length);
|
|
1375
|
+
var indexedObject = tmp1_map;
|
|
1381
1376
|
var inductionVariable = 0;
|
|
1382
1377
|
var last = indexedObject.length;
|
|
1383
1378
|
while (inductionVariable < last) {
|
|
1384
1379
|
var item = indexedObject[inductionVariable];
|
|
1385
1380
|
inductionVariable = inductionVariable + 1 | 0;
|
|
1386
|
-
tmp0_mapTo.g(this.
|
|
1381
|
+
tmp0_mapTo.g(this.i3h(item));
|
|
1387
1382
|
}
|
|
1388
1383
|
tmp$ret$0 = tmp0_mapTo;
|
|
1389
1384
|
tmp$ret$1 = tmp$ret$0;
|
|
1390
|
-
tmp = this.
|
|
1385
|
+
tmp = this.h3h_1.setOfIterable(tmp$ret$1);
|
|
1391
1386
|
}
|
|
1392
1387
|
return tmp;
|
|
1393
1388
|
};
|
|
1394
|
-
PrologVisitor.
|
|
1395
|
-
return this.
|
|
1389
|
+
protoOf(PrologVisitor).visitBlock = function (ctx) {
|
|
1390
|
+
return this.t3h(ctx);
|
|
1396
1391
|
};
|
|
1397
1392
|
function termParserWithOperators(operators, scope) {
|
|
1393
|
+
scope = scope === VOID ? Companion_getInstance_0().empty() : scope;
|
|
1398
1394
|
return new TermParserImpl(scope, operators);
|
|
1399
1395
|
}
|
|
1400
1396
|
function TermParserImpl(scope, defaultOperatorSet) {
|
|
1401
|
-
this.
|
|
1402
|
-
this.
|
|
1397
|
+
this.u3h_1 = scope;
|
|
1398
|
+
this.v3h_1 = defaultOperatorSet;
|
|
1403
1399
|
}
|
|
1404
|
-
TermParserImpl.
|
|
1405
|
-
return this.
|
|
1400
|
+
protoOf(TermParserImpl).x3g = function () {
|
|
1401
|
+
return this.v3h_1;
|
|
1406
1402
|
};
|
|
1407
|
-
TermParserImpl.
|
|
1408
|
-
return PrologParserFactory_getInstance().
|
|
1403
|
+
protoOf(TermParserImpl).w3h = function (input, operators) {
|
|
1404
|
+
return PrologParserFactory_getInstance().d3h(input, operators).accept(new PrologVisitor(this.u3h_1));
|
|
1409
1405
|
};
|
|
1410
|
-
TermParserImpl.
|
|
1411
|
-
return this.
|
|
1406
|
+
protoOf(TermParserImpl).parseTermWithOperators = function (input, operators) {
|
|
1407
|
+
return this.w3h(input, operators);
|
|
1412
1408
|
};
|
|
1413
1409
|
//region block: post-declaration
|
|
1414
|
-
TermParserImpl.
|
|
1415
|
-
TermParserImpl.
|
|
1416
|
-
TermParserImpl.
|
|
1417
|
-
TermParserImpl.
|
|
1418
|
-
TermParserImpl.
|
|
1419
|
-
TermParserImpl.
|
|
1420
|
-
TermParserImpl.
|
|
1421
|
-
TermParserImpl.
|
|
1422
|
-
TermParserImpl.
|
|
1423
|
-
TermParserImpl.
|
|
1424
|
-
TermParserImpl.
|
|
1425
|
-
TermParserImpl.
|
|
1426
|
-
TermParserImpl.
|
|
1427
|
-
TermParserImpl.
|
|
1428
|
-
TermParserImpl.
|
|
1429
|
-
TermParserImpl.
|
|
1430
|
-
TermParserImpl.
|
|
1431
|
-
TermParserImpl.
|
|
1432
|
-
TermParserImpl.
|
|
1433
|
-
TermParserImpl.
|
|
1434
|
-
TermParserImpl.
|
|
1435
|
-
TermParserImpl.
|
|
1436
|
-
TermParserImpl.
|
|
1410
|
+
protoOf(TermParserImpl).parseTerm = parseTerm;
|
|
1411
|
+
protoOf(TermParserImpl).parseStructWithOperators = parseStructWithOperators;
|
|
1412
|
+
protoOf(TermParserImpl).parseStruct = parseStruct;
|
|
1413
|
+
protoOf(TermParserImpl).parseConstantWithOperators = parseConstantWithOperators;
|
|
1414
|
+
protoOf(TermParserImpl).parseConstant = parseConstant;
|
|
1415
|
+
protoOf(TermParserImpl).parseVarWithOperators = parseVarWithOperators;
|
|
1416
|
+
protoOf(TermParserImpl).parseVar = parseVar;
|
|
1417
|
+
protoOf(TermParserImpl).parseAtomWithOperators = parseAtomWithOperators;
|
|
1418
|
+
protoOf(TermParserImpl).parseAtom = parseAtom;
|
|
1419
|
+
protoOf(TermParserImpl).parseNumericWithOperators = parseNumericWithOperators;
|
|
1420
|
+
protoOf(TermParserImpl).parseNumeric = parseNumeric;
|
|
1421
|
+
protoOf(TermParserImpl).parseIntegerWithOperators = parseIntegerWithOperators;
|
|
1422
|
+
protoOf(TermParserImpl).parseInteger = parseInteger;
|
|
1423
|
+
protoOf(TermParserImpl).parseRealWithOperators = parseRealWithOperators;
|
|
1424
|
+
protoOf(TermParserImpl).parseReal = parseReal;
|
|
1425
|
+
protoOf(TermParserImpl).parseClauseWithOperators = parseClauseWithOperators;
|
|
1426
|
+
protoOf(TermParserImpl).parseClause = parseClause;
|
|
1427
|
+
protoOf(TermParserImpl).parseRuleWithOperators = parseRuleWithOperators;
|
|
1428
|
+
protoOf(TermParserImpl).parseRule = parseRule;
|
|
1429
|
+
protoOf(TermParserImpl).parseFactWithOperators = parseFactWithOperators;
|
|
1430
|
+
protoOf(TermParserImpl).parseFact = parseFact;
|
|
1431
|
+
protoOf(TermParserImpl).parseDirectiveWithOperators = parseDirectiveWithOperators;
|
|
1432
|
+
protoOf(TermParserImpl).parseDirective = parseDirective;
|
|
1437
1433
|
//endregion
|
|
1438
1434
|
//region block: exports
|
|
1439
1435
|
_.$_$ = _.$_$ || {};
|
|
1440
|
-
_.$_$.a =
|
|
1441
|
-
_.$_$.b =
|
|
1442
|
-
_.$_$.c =
|
|
1443
|
-
_.$_$.d =
|
|
1444
|
-
_.$_$.e =
|
|
1445
|
-
_.$_$.f =
|
|
1436
|
+
_.$_$.a = PrologParserFactory_getInstance;
|
|
1437
|
+
_.$_$.b = ParseException;
|
|
1438
|
+
_.$_$.c = PrologVisitor;
|
|
1439
|
+
_.$_$.d = parseStruct_0;
|
|
1440
|
+
_.$_$.e = parseStructWithOperators_0;
|
|
1441
|
+
_.$_$.f = termToClause;
|
|
1446
1442
|
//endregion
|
|
1447
1443
|
return _;
|
|
1448
|
-
}
|
|
1444
|
+
}));
|
|
1449
1445
|
|
|
1450
1446
|
//# sourceMappingURL=2p-parser-core.js.map
|