@tuprolog/2p-full 0.30.5-dev01 → 0.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2p-bdd.js +609 -0
- package/2p-bdd.js.map +1 -0
- package/2p-core.js +12057 -0
- package/2p-core.js.map +1 -0
- package/2p-datalog.js +8 -0
- package/2p-datalog.js.map +1 -0
- package/2p-dsl-core.js +8 -0
- package/2p-dsl-core.js.map +1 -0
- package/2p-dsl-solve.js +8 -0
- package/2p-dsl-solve.js.map +1 -0
- package/2p-dsl-theory.js +8 -0
- package/2p-dsl-theory.js.map +1 -0
- package/2p-dsl-unify.js +8 -0
- package/2p-dsl-unify.js.map +1 -0
- package/2p-full.d.ts +270 -0
- package/2p-full.js +21 -0
- package/2p-full.js.map +1 -0
- package/2p-io-lib.js +3600 -0
- package/2p-io-lib.js.map +1 -0
- package/2p-oop-lib.js +3660 -0
- package/2p-oop-lib.js.map +1 -0
- package/2p-parser-core.js +1450 -0
- package/2p-parser-core.js.map +1 -0
- package/2p-parser-js.js +29 -0
- package/2p-parser-js.js.map +1 -0
- package/2p-parser-theory.js +114 -0
- package/2p-parser-theory.js.map +1 -0
- package/2p-repl.js +519 -0
- package/2p-repl.js.map +1 -0
- package/2p-serialize-core.js +8 -0
- package/2p-serialize-core.js.map +1 -0
- package/2p-serialize-theory.js +8 -0
- package/2p-serialize-theory.js.map +1 -0
- package/2p-solve-classic.js +3329 -0
- package/2p-solve-classic.js.map +1 -0
- package/2p-solve-concurrent.js +8 -0
- package/2p-solve-concurrent.js.map +1 -0
- package/2p-solve-plp.js +44 -0
- package/2p-solve-plp.js.map +1 -0
- package/2p-solve-problog.js +4547 -0
- package/2p-solve-problog.js.map +1 -0
- package/2p-solve-streams.js +3028 -0
- package/2p-solve-streams.js.map +1 -0
- package/2p-solve.js +16824 -0
- package/2p-solve.js.map +1 -0
- package/2p-theory.js +4902 -0
- package/2p-theory.js.map +1 -0
- package/2p-unify.js +957 -0
- package/2p-unify.js.map +1 -0
- package/2p-utils.js +1423 -0
- package/2p-utils.js.map +1 -0
- package/88b0986a7186d029-atomicfu-js-ir.js +8 -0
- package/88b0986a7186d029-atomicfu-js-ir.js.map +1 -0
- package/clikt-clikt-js-ir.js +7240 -0
- package/clikt-clikt-js-ir.js.map +1 -0
- package/kotlin-kotlin-stdlib-js-ir.js +11847 -0
- package/kotlin-kotlin-stdlib-js-ir.js.map +1 -0
- package/kotlin-kotlinx-atomicfu-runtime-js-ir.js +8 -0
- package/kotlin-kotlinx-atomicfu-runtime-js-ir.js.map +1 -0
- package/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js +8 -0
- package/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js.map +1 -0
- package/kt-math.js +11348 -0
- package/kt-math.js.map +1 -0
- package/package.json +4 -36
- package/CONTRIBUTORS +0 -10
- package/LICENSE +0 -202
- package/kotlin/2p-full/it/unibo/tuprolog/tuprolog.kjsm +0 -0
- package/kotlin/2p-full.js +0 -15
- package/kotlin/2p-full.js.map +0 -1
- package/kotlin/2p-full.meta.js +0 -1
|
@@ -0,0 +1,1450 @@
|
|
|
1
|
+
(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_kt_math) {
|
|
2
|
+
'use strict';
|
|
3
|
+
//region block: imports
|
|
4
|
+
var PrologParserListener = $module$_tuprolog_parser_utils_xy31vy.PrologParserListener;
|
|
5
|
+
var Associativity = $module$_tuprolog_parser_utils_xy31vy.Associativity;
|
|
6
|
+
var Token = $module$antlr4.Token;
|
|
7
|
+
var RecognitionException = $module$antlr4_src_antlr4_error_s9pni7.RecognitionException;
|
|
8
|
+
var PredictionMode = $module$antlr4_src_antlr4_atn_66gh9q.PredictionMode;
|
|
9
|
+
var PrologParser = $module$_tuprolog_parser_utils_xy31vy.PrologParser;
|
|
10
|
+
var InputStream = $module$antlr4.InputStream;
|
|
11
|
+
var PrologLexer = $module$_tuprolog_parser_utils_xy31vy.PrologLexer;
|
|
12
|
+
var CommonTokenStream = $module$antlr4.CommonTokenStream;
|
|
13
|
+
var BailErrorStrategy = $module$antlr4_src_antlr4_error_s9pni7.BailErrorStrategy;
|
|
14
|
+
var PrologParserVisitor = $module$_tuprolog_parser_utils_xy31vy.PrologParserVisitor;
|
|
15
|
+
var captureStack = kotlin_kotlin.$_$.h6;
|
|
16
|
+
var classMeta = kotlin_kotlin.$_$.m6;
|
|
17
|
+
var setMetadataFor = kotlin_kotlin.$_$.j7;
|
|
18
|
+
var TuPrologException = kotlin_it_unibo_tuprolog_core.$_$.l1;
|
|
19
|
+
var TuPrologException_init_$Init$ = kotlin_it_unibo_tuprolog_core.$_$.m;
|
|
20
|
+
var ensureNotNull = kotlin_kotlin.$_$.vb;
|
|
21
|
+
var replace$default = kotlin_kotlin.$_$.r;
|
|
22
|
+
var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.d2;
|
|
23
|
+
var Char = kotlin_kotlin.$_$.eb;
|
|
24
|
+
var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.c1;
|
|
25
|
+
var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.q;
|
|
26
|
+
var OperatorSet_init_$Create$ = kotlin_it_unibo_tuprolog_core.$_$.n;
|
|
27
|
+
var objectMeta = kotlin_kotlin.$_$.i7;
|
|
28
|
+
var Struct = kotlin_it_unibo_tuprolog_core.$_$.z1;
|
|
29
|
+
var isInterface = kotlin_kotlin.$_$.y6;
|
|
30
|
+
var getKClass = kotlin_kotlin.$_$.c;
|
|
31
|
+
var Unit_getInstance = kotlin_kotlin.$_$.r2;
|
|
32
|
+
var Constant = kotlin_it_unibo_tuprolog_core.$_$.q1;
|
|
33
|
+
var Var = kotlin_it_unibo_tuprolog_core.$_$.b3;
|
|
34
|
+
var Atom = kotlin_it_unibo_tuprolog_core.$_$.o1;
|
|
35
|
+
var Numeric = kotlin_it_unibo_tuprolog_core.$_$.w1;
|
|
36
|
+
var Integer = kotlin_it_unibo_tuprolog_core.$_$.u1;
|
|
37
|
+
var Real = kotlin_it_unibo_tuprolog_core.$_$.x1;
|
|
38
|
+
var Clause = kotlin_it_unibo_tuprolog_core.$_$.p1;
|
|
39
|
+
var Rule = kotlin_it_unibo_tuprolog_core.$_$.y1;
|
|
40
|
+
var Fact = kotlin_it_unibo_tuprolog_core.$_$.s1;
|
|
41
|
+
var Directive = kotlin_it_unibo_tuprolog_core.$_$.r1;
|
|
42
|
+
var interfaceMeta = kotlin_kotlin.$_$.u6;
|
|
43
|
+
var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_core.$_$.v;
|
|
44
|
+
var THROW_CCE = kotlin_kotlin.$_$.sb;
|
|
45
|
+
var contains = kotlin_kotlin.$_$.l3;
|
|
46
|
+
var Companion_getInstance_2 = kotlin_it_unibo_tuprolog_core.$_$.r;
|
|
47
|
+
var map = kotlin_kotlin.$_$.c9;
|
|
48
|
+
var Operator = kotlin_it_unibo_tuprolog_core.$_$.n1;
|
|
49
|
+
var List = kotlin_it_unibo_tuprolog_core.$_$.v1;
|
|
50
|
+
var toString = kotlin_kotlin.$_$.n7;
|
|
51
|
+
var coerceAtLeast = kotlin_kotlin.$_$.y7;
|
|
52
|
+
var isRecognitionException = kotlin_it_unibo_tuprolog_parser_js.$_$.b;
|
|
53
|
+
var isParseCancellationException = kotlin_it_unibo_tuprolog_parser_js.$_$.a;
|
|
54
|
+
var generateSequence = kotlin_kotlin.$_$.w8;
|
|
55
|
+
var takeWhile = kotlin_kotlin.$_$.l9;
|
|
56
|
+
var to = kotlin_kotlin.$_$.ec;
|
|
57
|
+
var Companion_getInstance_3 = kotlin_kt_math.$_$.f;
|
|
58
|
+
var charSequenceGet = kotlin_kotlin.$_$.k6;
|
|
59
|
+
var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.g2;
|
|
60
|
+
var contains$default = kotlin_kotlin.$_$.j;
|
|
61
|
+
var plus = kotlin_kotlin.$_$.zb;
|
|
62
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.b1;
|
|
63
|
+
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.r1;
|
|
64
|
+
var listOf = kotlin_kotlin.$_$.h4;
|
|
65
|
+
var asList = kotlin_kotlin.$_$.c3;
|
|
66
|
+
var plus_0 = kotlin_kotlin.$_$.a5;
|
|
67
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.j3;
|
|
68
|
+
var toList = kotlin_kotlin.$_$.o5;
|
|
69
|
+
var flatMap = kotlin_kotlin.$_$.u8;
|
|
70
|
+
var asSequence = kotlin_kotlin.$_$.g3;
|
|
71
|
+
var toList_0 = kotlin_kotlin.$_$.p9;
|
|
72
|
+
var sequenceOf = kotlin_kotlin.$_$.i9;
|
|
73
|
+
var asSequence_0 = kotlin_kotlin.$_$.h3;
|
|
74
|
+
var plus_1 = kotlin_kotlin.$_$.g9;
|
|
75
|
+
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.p1;
|
|
76
|
+
var Term = kotlin_it_unibo_tuprolog_core.$_$.y2;
|
|
77
|
+
var Companion_getInstance_4 = kotlin_it_unibo_tuprolog_core.$_$.x;
|
|
78
|
+
var Companion_getInstance_5 = kotlin_it_unibo_tuprolog_core.$_$.a1;
|
|
79
|
+
var NumberFormatException = kotlin_kotlin.$_$.pb;
|
|
80
|
+
//endregion
|
|
81
|
+
//region block: pre-declaration
|
|
82
|
+
setMetadataFor(ParseException, 'ParseException', classMeta, TuPrologException, undefined, undefined, undefined, []);
|
|
83
|
+
setMetadataFor(InvalidTermTypeException, 'InvalidTermTypeException', classMeta, ParseException, undefined, undefined, undefined, []);
|
|
84
|
+
setMetadataFor(Companion, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
|
|
85
|
+
function parseTerm(input) {
|
|
86
|
+
return this.parseTermWithOperators(input, this.c3j());
|
|
87
|
+
}
|
|
88
|
+
function parseStructWithOperators(input, operators) {
|
|
89
|
+
var tmp$ret$2;
|
|
90
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
91
|
+
var tmp1_parseAs = Companion_getInstance_6();
|
|
92
|
+
var tmp$ret$1;
|
|
93
|
+
// Inline function 'kotlin.let' call
|
|
94
|
+
var tmp0_let = this.parseTermWithOperators(input, operators);
|
|
95
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
96
|
+
var tmp$ret$0;
|
|
97
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
|
|
98
|
+
var tmp0_elvis_lhs = isInterface(tmp0_let, Struct) ? tmp0_let : null;
|
|
99
|
+
var tmp;
|
|
100
|
+
if (tmp0_elvis_lhs == null) {
|
|
101
|
+
var tmp_0 = getKClass(Struct);
|
|
102
|
+
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
103
|
+
} else {
|
|
104
|
+
tmp = tmp0_elvis_lhs;
|
|
105
|
+
}
|
|
106
|
+
tmp$ret$0 = tmp;
|
|
107
|
+
tmp$ret$1 = tmp$ret$0;
|
|
108
|
+
tmp$ret$2 = tmp$ret$1;
|
|
109
|
+
return tmp$ret$2;
|
|
110
|
+
}
|
|
111
|
+
function parseStruct(input) {
|
|
112
|
+
return this.parseStructWithOperators(input, this.c3j());
|
|
113
|
+
}
|
|
114
|
+
function parseConstantWithOperators(input, operators) {
|
|
115
|
+
var tmp$ret$2;
|
|
116
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
117
|
+
var tmp1_parseAs = Companion_getInstance_6();
|
|
118
|
+
var tmp$ret$1;
|
|
119
|
+
// Inline function 'kotlin.let' call
|
|
120
|
+
var tmp0_let = this.parseTermWithOperators(input, operators);
|
|
121
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
122
|
+
var tmp$ret$0;
|
|
123
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
|
|
124
|
+
var tmp0_elvis_lhs = isInterface(tmp0_let, Constant) ? tmp0_let : null;
|
|
125
|
+
var tmp;
|
|
126
|
+
if (tmp0_elvis_lhs == null) {
|
|
127
|
+
var tmp_0 = getKClass(Constant);
|
|
128
|
+
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
129
|
+
} else {
|
|
130
|
+
tmp = tmp0_elvis_lhs;
|
|
131
|
+
}
|
|
132
|
+
tmp$ret$0 = tmp;
|
|
133
|
+
tmp$ret$1 = tmp$ret$0;
|
|
134
|
+
tmp$ret$2 = tmp$ret$1;
|
|
135
|
+
return tmp$ret$2;
|
|
136
|
+
}
|
|
137
|
+
function parseConstant(input) {
|
|
138
|
+
return this.parseConstantWithOperators(input, this.c3j());
|
|
139
|
+
}
|
|
140
|
+
function parseVarWithOperators(input, operators) {
|
|
141
|
+
var tmp$ret$2;
|
|
142
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
143
|
+
var tmp1_parseAs = Companion_getInstance_6();
|
|
144
|
+
var tmp$ret$1;
|
|
145
|
+
// Inline function 'kotlin.let' call
|
|
146
|
+
var tmp0_let = this.parseTermWithOperators(input, operators);
|
|
147
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
148
|
+
var tmp$ret$0;
|
|
149
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
|
|
150
|
+
var tmp0_elvis_lhs = isInterface(tmp0_let, Var) ? tmp0_let : null;
|
|
151
|
+
var tmp;
|
|
152
|
+
if (tmp0_elvis_lhs == null) {
|
|
153
|
+
var tmp_0 = getKClass(Var);
|
|
154
|
+
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
155
|
+
} else {
|
|
156
|
+
tmp = tmp0_elvis_lhs;
|
|
157
|
+
}
|
|
158
|
+
tmp$ret$0 = tmp;
|
|
159
|
+
tmp$ret$1 = tmp$ret$0;
|
|
160
|
+
tmp$ret$2 = tmp$ret$1;
|
|
161
|
+
return tmp$ret$2;
|
|
162
|
+
}
|
|
163
|
+
function parseVar(input) {
|
|
164
|
+
return this.parseVarWithOperators(input, this.c3j());
|
|
165
|
+
}
|
|
166
|
+
function parseAtomWithOperators(input, operators) {
|
|
167
|
+
var tmp$ret$2;
|
|
168
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
169
|
+
var tmp1_parseAs = Companion_getInstance_6();
|
|
170
|
+
var tmp$ret$1;
|
|
171
|
+
// Inline function 'kotlin.let' call
|
|
172
|
+
var tmp0_let = this.parseTermWithOperators(input, operators);
|
|
173
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
174
|
+
var tmp$ret$0;
|
|
175
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
|
|
176
|
+
var tmp0_elvis_lhs = isInterface(tmp0_let, Atom) ? tmp0_let : null;
|
|
177
|
+
var tmp;
|
|
178
|
+
if (tmp0_elvis_lhs == null) {
|
|
179
|
+
var tmp_0 = getKClass(Atom);
|
|
180
|
+
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
181
|
+
} else {
|
|
182
|
+
tmp = tmp0_elvis_lhs;
|
|
183
|
+
}
|
|
184
|
+
tmp$ret$0 = tmp;
|
|
185
|
+
tmp$ret$1 = tmp$ret$0;
|
|
186
|
+
tmp$ret$2 = tmp$ret$1;
|
|
187
|
+
return tmp$ret$2;
|
|
188
|
+
}
|
|
189
|
+
function parseAtom(input) {
|
|
190
|
+
return this.parseAtomWithOperators(input, this.c3j());
|
|
191
|
+
}
|
|
192
|
+
function parseNumericWithOperators(input, operators) {
|
|
193
|
+
var tmp$ret$2;
|
|
194
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
195
|
+
var tmp1_parseAs = Companion_getInstance_6();
|
|
196
|
+
var tmp$ret$1;
|
|
197
|
+
// Inline function 'kotlin.let' call
|
|
198
|
+
var tmp0_let = this.parseTermWithOperators(input, operators);
|
|
199
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
200
|
+
var tmp$ret$0;
|
|
201
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
|
|
202
|
+
var tmp0_elvis_lhs = isInterface(tmp0_let, Numeric) ? tmp0_let : null;
|
|
203
|
+
var tmp;
|
|
204
|
+
if (tmp0_elvis_lhs == null) {
|
|
205
|
+
var tmp_0 = getKClass(Numeric);
|
|
206
|
+
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
207
|
+
} else {
|
|
208
|
+
tmp = tmp0_elvis_lhs;
|
|
209
|
+
}
|
|
210
|
+
tmp$ret$0 = tmp;
|
|
211
|
+
tmp$ret$1 = tmp$ret$0;
|
|
212
|
+
tmp$ret$2 = tmp$ret$1;
|
|
213
|
+
return tmp$ret$2;
|
|
214
|
+
}
|
|
215
|
+
function parseNumeric(input) {
|
|
216
|
+
return this.parseNumericWithOperators(input, this.c3j());
|
|
217
|
+
}
|
|
218
|
+
function parseIntegerWithOperators(input, operators) {
|
|
219
|
+
var tmp$ret$2;
|
|
220
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
221
|
+
var tmp1_parseAs = Companion_getInstance_6();
|
|
222
|
+
var tmp$ret$1;
|
|
223
|
+
// Inline function 'kotlin.let' call
|
|
224
|
+
var tmp0_let = this.parseTermWithOperators(input, operators);
|
|
225
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
226
|
+
var tmp$ret$0;
|
|
227
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
|
|
228
|
+
var tmp0_elvis_lhs = isInterface(tmp0_let, Integer) ? tmp0_let : null;
|
|
229
|
+
var tmp;
|
|
230
|
+
if (tmp0_elvis_lhs == null) {
|
|
231
|
+
var tmp_0 = getKClass(Integer);
|
|
232
|
+
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
233
|
+
} else {
|
|
234
|
+
tmp = tmp0_elvis_lhs;
|
|
235
|
+
}
|
|
236
|
+
tmp$ret$0 = tmp;
|
|
237
|
+
tmp$ret$1 = tmp$ret$0;
|
|
238
|
+
tmp$ret$2 = tmp$ret$1;
|
|
239
|
+
return tmp$ret$2;
|
|
240
|
+
}
|
|
241
|
+
function parseInteger(input) {
|
|
242
|
+
return this.parseIntegerWithOperators(input, this.c3j());
|
|
243
|
+
}
|
|
244
|
+
function parseRealWithOperators(input, operators) {
|
|
245
|
+
var tmp$ret$2;
|
|
246
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
247
|
+
var tmp1_parseAs = Companion_getInstance_6();
|
|
248
|
+
var tmp$ret$1;
|
|
249
|
+
// Inline function 'kotlin.let' call
|
|
250
|
+
var tmp0_let = this.parseTermWithOperators(input, operators);
|
|
251
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
252
|
+
var tmp$ret$0;
|
|
253
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
|
|
254
|
+
var tmp0_elvis_lhs = isInterface(tmp0_let, Real) ? tmp0_let : null;
|
|
255
|
+
var tmp;
|
|
256
|
+
if (tmp0_elvis_lhs == null) {
|
|
257
|
+
var tmp_0 = getKClass(Real);
|
|
258
|
+
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
259
|
+
} else {
|
|
260
|
+
tmp = tmp0_elvis_lhs;
|
|
261
|
+
}
|
|
262
|
+
tmp$ret$0 = tmp;
|
|
263
|
+
tmp$ret$1 = tmp$ret$0;
|
|
264
|
+
tmp$ret$2 = tmp$ret$1;
|
|
265
|
+
return tmp$ret$2;
|
|
266
|
+
}
|
|
267
|
+
function parseReal(input) {
|
|
268
|
+
return this.parseRealWithOperators(input, this.c3j());
|
|
269
|
+
}
|
|
270
|
+
function parseClauseWithOperators(input, operators) {
|
|
271
|
+
var tmp$ret$2;
|
|
272
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
273
|
+
var tmp1_parseAs = Companion_getInstance_6();
|
|
274
|
+
var tmp$ret$1;
|
|
275
|
+
// Inline function 'kotlin.let' call
|
|
276
|
+
var tmp0_let = this.parseTermWithOperators(input, operators);
|
|
277
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
278
|
+
var tmp$ret$0;
|
|
279
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
|
|
280
|
+
var tmp0_elvis_lhs = isInterface(tmp0_let, Clause) ? tmp0_let : null;
|
|
281
|
+
var tmp;
|
|
282
|
+
if (tmp0_elvis_lhs == null) {
|
|
283
|
+
var tmp_0 = getKClass(Clause);
|
|
284
|
+
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
285
|
+
} else {
|
|
286
|
+
tmp = tmp0_elvis_lhs;
|
|
287
|
+
}
|
|
288
|
+
tmp$ret$0 = tmp;
|
|
289
|
+
tmp$ret$1 = tmp$ret$0;
|
|
290
|
+
tmp$ret$2 = tmp$ret$1;
|
|
291
|
+
return tmp$ret$2;
|
|
292
|
+
}
|
|
293
|
+
function parseClause(input) {
|
|
294
|
+
return this.parseClauseWithOperators(input, this.c3j());
|
|
295
|
+
}
|
|
296
|
+
function parseRuleWithOperators(input, operators) {
|
|
297
|
+
var tmp$ret$2;
|
|
298
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
299
|
+
var tmp1_parseAs = Companion_getInstance_6();
|
|
300
|
+
var tmp$ret$1;
|
|
301
|
+
// Inline function 'kotlin.let' call
|
|
302
|
+
var tmp0_let = this.parseTermWithOperators(input, operators);
|
|
303
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
304
|
+
var tmp$ret$0;
|
|
305
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
|
|
306
|
+
var tmp0_elvis_lhs = isInterface(tmp0_let, Rule) ? tmp0_let : null;
|
|
307
|
+
var tmp;
|
|
308
|
+
if (tmp0_elvis_lhs == null) {
|
|
309
|
+
var tmp_0 = getKClass(Rule);
|
|
310
|
+
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
311
|
+
} else {
|
|
312
|
+
tmp = tmp0_elvis_lhs;
|
|
313
|
+
}
|
|
314
|
+
tmp$ret$0 = tmp;
|
|
315
|
+
tmp$ret$1 = tmp$ret$0;
|
|
316
|
+
tmp$ret$2 = tmp$ret$1;
|
|
317
|
+
return tmp$ret$2;
|
|
318
|
+
}
|
|
319
|
+
function parseRule(input) {
|
|
320
|
+
return this.parseRuleWithOperators(input, this.c3j());
|
|
321
|
+
}
|
|
322
|
+
function parseFactWithOperators(input, operators) {
|
|
323
|
+
var tmp$ret$2;
|
|
324
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
325
|
+
var tmp1_parseAs = Companion_getInstance_6();
|
|
326
|
+
var tmp$ret$1;
|
|
327
|
+
// Inline function 'kotlin.let' call
|
|
328
|
+
var tmp0_let = this.parseTermWithOperators(input, operators);
|
|
329
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
330
|
+
var tmp$ret$0;
|
|
331
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
|
|
332
|
+
var tmp0_elvis_lhs = isInterface(tmp0_let, Fact) ? tmp0_let : null;
|
|
333
|
+
var tmp;
|
|
334
|
+
if (tmp0_elvis_lhs == null) {
|
|
335
|
+
var tmp_0 = getKClass(Fact);
|
|
336
|
+
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
337
|
+
} else {
|
|
338
|
+
tmp = tmp0_elvis_lhs;
|
|
339
|
+
}
|
|
340
|
+
tmp$ret$0 = tmp;
|
|
341
|
+
tmp$ret$1 = tmp$ret$0;
|
|
342
|
+
tmp$ret$2 = tmp$ret$1;
|
|
343
|
+
return tmp$ret$2;
|
|
344
|
+
}
|
|
345
|
+
function parseFact(input) {
|
|
346
|
+
return this.parseFactWithOperators(input, this.c3j());
|
|
347
|
+
}
|
|
348
|
+
function parseDirectiveWithOperators(input, operators) {
|
|
349
|
+
var tmp$ret$2;
|
|
350
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
351
|
+
var tmp1_parseAs = Companion_getInstance_6();
|
|
352
|
+
var tmp$ret$1;
|
|
353
|
+
// Inline function 'kotlin.let' call
|
|
354
|
+
var tmp0_let = this.parseTermWithOperators(input, operators);
|
|
355
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
356
|
+
var tmp$ret$0;
|
|
357
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
|
|
358
|
+
var tmp0_elvis_lhs = isInterface(tmp0_let, Directive) ? tmp0_let : null;
|
|
359
|
+
var tmp;
|
|
360
|
+
if (tmp0_elvis_lhs == null) {
|
|
361
|
+
var tmp_0 = getKClass(Directive);
|
|
362
|
+
throw InvalidTermTypeException_init_$Create$(input, tmp0_let, tmp_0, null, 0, 0, null, null, 248, null);
|
|
363
|
+
} else {
|
|
364
|
+
tmp = tmp0_elvis_lhs;
|
|
365
|
+
}
|
|
366
|
+
tmp$ret$0 = tmp;
|
|
367
|
+
tmp$ret$1 = tmp$ret$0;
|
|
368
|
+
tmp$ret$2 = tmp$ret$1;
|
|
369
|
+
return tmp$ret$2;
|
|
370
|
+
}
|
|
371
|
+
function parseDirective(input) {
|
|
372
|
+
return this.parseDirectiveWithOperators(input, this.c3j());
|
|
373
|
+
}
|
|
374
|
+
setMetadataFor(TermParser, 'TermParser', interfaceMeta, undefined, undefined, undefined, undefined, []);
|
|
375
|
+
setMetadataFor(Companion_0, 'Companion', objectMeta, undefined, undefined, undefined, undefined, []);
|
|
376
|
+
setMetadataFor(DynamicOpListener, 'DynamicOpListener', classMeta, PrologParserListener, undefined, undefined, undefined, []);
|
|
377
|
+
setMetadataFor(PrologParserFactory$newErrorListener$1, undefined, classMeta, undefined, undefined, undefined, undefined, []);
|
|
378
|
+
setMetadataFor(PrologParserFactory, 'PrologParserFactory', objectMeta, undefined, undefined, undefined, undefined, []);
|
|
379
|
+
setMetadataFor(PrologVisitor, 'PrologVisitor', classMeta, PrologParserVisitor, undefined, undefined, undefined, []);
|
|
380
|
+
setMetadataFor(TermParserImpl, 'TermParserImpl', classMeta, undefined, [TermParser], undefined, undefined, []);
|
|
381
|
+
//endregion
|
|
382
|
+
function InvalidTermTypeException_init_$Init$(input, term, type, offendingSymbol, line, column, message, throwable, $mask0, $marker, $this) {
|
|
383
|
+
if (!(($mask0 & 8) === 0)) {
|
|
384
|
+
var tmp0_elvis_lhs = (!(input == null) ? typeof input === 'string' : false) ? input : null;
|
|
385
|
+
offendingSymbol = tmp0_elvis_lhs == null ? term.toString() : tmp0_elvis_lhs;
|
|
386
|
+
}
|
|
387
|
+
if (!(($mask0 & 16) === 0))
|
|
388
|
+
line = 1;
|
|
389
|
+
if (!(($mask0 & 32) === 0))
|
|
390
|
+
column = 1;
|
|
391
|
+
if (!(($mask0 & 64) === 0))
|
|
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) {
|
|
404
|
+
ParseException.call(this, input, offendingSymbol, line, column, message, throwable);
|
|
405
|
+
this.k3i_1 = term;
|
|
406
|
+
this.l3i_1 = type;
|
|
407
|
+
captureStack(this, InvalidTermTypeException);
|
|
408
|
+
}
|
|
409
|
+
function ParseException(input, offendingSymbol, line, column, message, throwable) {
|
|
410
|
+
TuPrologException_init_$Init$(message, throwable, this);
|
|
411
|
+
this.input = input;
|
|
412
|
+
this.offendingSymbol = offendingSymbol;
|
|
413
|
+
this.line = line;
|
|
414
|
+
this.column = column;
|
|
415
|
+
this.clauseIndex = -1;
|
|
416
|
+
captureStack(this, ParseException);
|
|
417
|
+
}
|
|
418
|
+
ParseException.prototype.m3i = function (_set____db54di) {
|
|
419
|
+
this.input = _set____db54di;
|
|
420
|
+
};
|
|
421
|
+
ParseException.prototype.n3i = function () {
|
|
422
|
+
return this.input;
|
|
423
|
+
};
|
|
424
|
+
ParseException.prototype.o3i = function (_set____db54di) {
|
|
425
|
+
this.offendingSymbol = _set____db54di;
|
|
426
|
+
};
|
|
427
|
+
ParseException.prototype.p3i = function () {
|
|
428
|
+
return this.offendingSymbol;
|
|
429
|
+
};
|
|
430
|
+
ParseException.prototype.q3i = function (_set____db54di) {
|
|
431
|
+
this.line = _set____db54di;
|
|
432
|
+
};
|
|
433
|
+
ParseException.prototype.r3i = function () {
|
|
434
|
+
return this.line;
|
|
435
|
+
};
|
|
436
|
+
ParseException.prototype.s3i = function (_set____db54di) {
|
|
437
|
+
this.column = _set____db54di;
|
|
438
|
+
};
|
|
439
|
+
ParseException.prototype.t3i = function () {
|
|
440
|
+
return this.column;
|
|
441
|
+
};
|
|
442
|
+
ParseException.prototype.u3i = function (_set____db54di) {
|
|
443
|
+
this.clauseIndex = _set____db54di;
|
|
444
|
+
};
|
|
445
|
+
ParseException.prototype.v3i = function () {
|
|
446
|
+
return this.clauseIndex;
|
|
447
|
+
};
|
|
448
|
+
ParseException.prototype.toString = function () {
|
|
449
|
+
var tmp = ensureNotNull(this.message);
|
|
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));
|
|
451
|
+
};
|
|
452
|
+
function Companion() {
|
|
453
|
+
Companion_instance = this;
|
|
454
|
+
}
|
|
455
|
+
Companion.prototype.withNoOperator = function (scope) {
|
|
456
|
+
return this.w3i(scope === void 1 ? Companion_getInstance().empty() : scope);
|
|
457
|
+
};
|
|
458
|
+
Companion.prototype.w3i = function (scope) {
|
|
459
|
+
return this.x3i(Companion_getInstance_0().EMPTY, scope);
|
|
460
|
+
};
|
|
461
|
+
Companion.prototype.withStandardOperators = function (scope) {
|
|
462
|
+
return this.y3i(scope === void 1 ? Companion_getInstance().empty() : scope);
|
|
463
|
+
};
|
|
464
|
+
Companion.prototype.y3i = function (scope) {
|
|
465
|
+
return this.x3i(Companion_getInstance_0().STANDARD, scope);
|
|
466
|
+
};
|
|
467
|
+
Companion.prototype.withDefaultOperators = function (scope) {
|
|
468
|
+
return this.z3i(scope === void 1 ? Companion_getInstance().empty() : scope);
|
|
469
|
+
};
|
|
470
|
+
Companion.prototype.z3i = function (scope) {
|
|
471
|
+
return this.x3i(Companion_getInstance_0().DEFAULT, scope);
|
|
472
|
+
};
|
|
473
|
+
Companion.prototype.a3j = function (scope, $mask0, $handler) {
|
|
474
|
+
if (!(($mask0 & 1) === 0))
|
|
475
|
+
scope = Companion_getInstance().empty();
|
|
476
|
+
return this.z3i(scope);
|
|
477
|
+
};
|
|
478
|
+
Companion.prototype.withOperatorSet = function (operators, scope) {
|
|
479
|
+
return this.x3i(operators, scope === void 1 ? Companion_getInstance().empty() : scope);
|
|
480
|
+
};
|
|
481
|
+
Companion.prototype.x3i = function (operators, scope) {
|
|
482
|
+
return termParserWithOperators(operators, scope);
|
|
483
|
+
};
|
|
484
|
+
Companion.prototype.withOperators = function (operators, scope) {
|
|
485
|
+
return this.b3j(operators, scope === void 1 ? Companion_getInstance().empty() : scope);
|
|
486
|
+
};
|
|
487
|
+
Companion.prototype.b3j = function (operators, scope) {
|
|
488
|
+
return this.x3i(OperatorSet_init_$Create$(operators.slice()), scope);
|
|
489
|
+
};
|
|
490
|
+
var Companion_instance;
|
|
491
|
+
function Companion_getInstance_6() {
|
|
492
|
+
if (Companion_instance == null)
|
|
493
|
+
new Companion();
|
|
494
|
+
return Companion_instance;
|
|
495
|
+
}
|
|
496
|
+
function TermParser() {
|
|
497
|
+
}
|
|
498
|
+
function toClause(_this__u8e3s4, source, line, column) {
|
|
499
|
+
var tmp0_subject = _this__u8e3s4;
|
|
500
|
+
var tmp;
|
|
501
|
+
if (isInterface(tmp0_subject, Clause)) {
|
|
502
|
+
tmp = _this__u8e3s4;
|
|
503
|
+
} else {
|
|
504
|
+
if (isInterface(tmp0_subject, Struct)) {
|
|
505
|
+
tmp = Companion_getInstance_1().of(_this__u8e3s4);
|
|
506
|
+
} else {
|
|
507
|
+
var tmp_0 = getKClass(Clause);
|
|
508
|
+
throw InvalidTermTypeException_init_$Create$(source, _this__u8e3s4, tmp_0, null, line, column, null, null, 200, null);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
return tmp;
|
|
512
|
+
}
|
|
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
|
+
function parseStructWithOperators_0(_this__u8e3s4, input, operators) {
|
|
523
|
+
return get_defaultParser().parseStructWithOperators(input, operators);
|
|
524
|
+
}
|
|
525
|
+
function parseStruct_0(_this__u8e3s4, input) {
|
|
526
|
+
return get_defaultParser().parseStruct(input);
|
|
527
|
+
}
|
|
528
|
+
function get_defaultParser() {
|
|
529
|
+
var tmp = Companion_getInstance_6();
|
|
530
|
+
return tmp.a3j(null, 1, null);
|
|
531
|
+
}
|
|
532
|
+
function toAssociativity(_this__u8e3s4) {
|
|
533
|
+
return _this__u8e3s4.toString();
|
|
534
|
+
}
|
|
535
|
+
function DynamicOpListener$Companion$of$lambda($this$$receiver, it) {
|
|
536
|
+
return Unit_getInstance();
|
|
537
|
+
}
|
|
538
|
+
function onOperatorDefined($this, operator) {
|
|
539
|
+
$this.d3j_1.addOperator(operator.n1i_1, toAssociativity(operator.o1i_1), operator.p1i_1);
|
|
540
|
+
$this.e3j_1($this.d3j_1, operator);
|
|
541
|
+
}
|
|
542
|
+
function Companion_0() {
|
|
543
|
+
Companion_instance_0 = this;
|
|
544
|
+
}
|
|
545
|
+
Companion_0.prototype.f3j = function (parser) {
|
|
546
|
+
return new DynamicOpListener(parser, DynamicOpListener$Companion$of$lambda);
|
|
547
|
+
};
|
|
548
|
+
var Companion_instance_0;
|
|
549
|
+
function Companion_getInstance_7() {
|
|
550
|
+
if (Companion_instance_0 == null)
|
|
551
|
+
new Companion_0();
|
|
552
|
+
return Companion_instance_0;
|
|
553
|
+
}
|
|
554
|
+
function DynamicOpListener$exitClause$lambda(it) {
|
|
555
|
+
return isInterface(it, Atom) ? it : THROW_CCE();
|
|
556
|
+
}
|
|
557
|
+
function DynamicOpListener(parser, operatorDefinedCallback) {
|
|
558
|
+
Companion_getInstance_7();
|
|
559
|
+
PrologParserListener.call(this);
|
|
560
|
+
this.d3j_1 = parser;
|
|
561
|
+
this.e3j_1 = operatorDefinedCallback;
|
|
562
|
+
}
|
|
563
|
+
DynamicOpListener.prototype.g3j = function (ctx) {
|
|
564
|
+
var expr = ctx.expression();
|
|
565
|
+
if (ctx.exception != null) {
|
|
566
|
+
return Unit_getInstance();
|
|
567
|
+
}
|
|
568
|
+
var tmp;
|
|
569
|
+
var tmp_0;
|
|
570
|
+
if (!(expr._op == null)) {
|
|
571
|
+
var tmp0_safe_receiver = expr._op;
|
|
572
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.symbol;
|
|
573
|
+
tmp_0 = ':-' === (tmp1_safe_receiver == null ? null : tmp1_safe_receiver.text);
|
|
574
|
+
} else {
|
|
575
|
+
tmp_0 = false;
|
|
576
|
+
}
|
|
577
|
+
if (tmp_0) {
|
|
578
|
+
tmp = contains(Associativity.PREFIX, expr.associativity);
|
|
579
|
+
} else {
|
|
580
|
+
tmp = false;
|
|
581
|
+
}
|
|
582
|
+
if (tmp) {
|
|
583
|
+
var tmp_1 = ctx.accept(PrologVisitor_init_$Create$(null, 1, null));
|
|
584
|
+
var directive = isInterface(tmp_1, Directive) ? tmp_1 : THROW_CCE();
|
|
585
|
+
var op = directive.my();
|
|
586
|
+
var tmp_2;
|
|
587
|
+
var tmp_3;
|
|
588
|
+
var tmp_4;
|
|
589
|
+
var tmp_5;
|
|
590
|
+
var tmp_6;
|
|
591
|
+
if (isInterface(op, Struct)) {
|
|
592
|
+
tmp_6 = op.zv() === 3;
|
|
593
|
+
} else {
|
|
594
|
+
tmp_6 = false;
|
|
595
|
+
}
|
|
596
|
+
if (tmp_6) {
|
|
597
|
+
tmp_5 = op.fw() === 'op';
|
|
598
|
+
} else {
|
|
599
|
+
tmp_5 = false;
|
|
600
|
+
}
|
|
601
|
+
if (tmp_5) {
|
|
602
|
+
var tmp_7 = op.get(0);
|
|
603
|
+
tmp_4 = isInterface(tmp_7, Numeric);
|
|
604
|
+
} else {
|
|
605
|
+
tmp_4 = false;
|
|
606
|
+
}
|
|
607
|
+
if (tmp_4) {
|
|
608
|
+
var tmp_8 = op.get(1);
|
|
609
|
+
tmp_3 = isInterface(tmp_8, Atom);
|
|
610
|
+
} else {
|
|
611
|
+
tmp_3 = false;
|
|
612
|
+
}
|
|
613
|
+
if (tmp_3) {
|
|
614
|
+
tmp_2 = op.jx();
|
|
615
|
+
} else {
|
|
616
|
+
tmp_2 = false;
|
|
617
|
+
}
|
|
618
|
+
if (tmp_2) {
|
|
619
|
+
var tmp$ret$1;
|
|
620
|
+
// Inline function 'kotlin.math.min' call
|
|
621
|
+
var tmp$ret$0;
|
|
622
|
+
// Inline function 'kotlin.math.max' call
|
|
623
|
+
var tmp_9 = op.get(0);
|
|
624
|
+
var tmp0_max = (isInterface(tmp_9, Numeric) ? tmp_9 : THROW_CCE()).p10().toInt();
|
|
625
|
+
tmp$ret$0 = Math.max(0, tmp0_max);
|
|
626
|
+
var tmp1_min = tmp$ret$0;
|
|
627
|
+
tmp$ret$1 = Math.min(1200, tmp1_min);
|
|
628
|
+
var priority = tmp$ret$1;
|
|
629
|
+
var specifier = Companion_getInstance_2().fromTerm(op.get(1));
|
|
630
|
+
var operator = op.get(2);
|
|
631
|
+
if (isInterface(operator, Atom)) {
|
|
632
|
+
onOperatorDefined(this, new Operator(operator.b1(), specifier, priority));
|
|
633
|
+
} else {
|
|
634
|
+
if (isInterface(operator, List)) {
|
|
635
|
+
var tmp$ret$3;
|
|
636
|
+
$l$block: {
|
|
637
|
+
// Inline function 'kotlin.sequences.all' call
|
|
638
|
+
var tmp2_all = operator.ju();
|
|
639
|
+
var tmp0_iterator = tmp2_all.j();
|
|
640
|
+
while (tmp0_iterator.m()) {
|
|
641
|
+
var element = tmp0_iterator.p();
|
|
642
|
+
var tmp$ret$2;
|
|
643
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.DynamicOpListener.exitClause.<anonymous>' call
|
|
644
|
+
tmp$ret$2 = isInterface(element, Atom);
|
|
645
|
+
if (!tmp$ret$2) {
|
|
646
|
+
tmp$ret$3 = false;
|
|
647
|
+
break $l$block;
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
tmp$ret$3 = true;
|
|
651
|
+
}
|
|
652
|
+
if (tmp$ret$3) {
|
|
653
|
+
var tmp_10 = operator.ju();
|
|
654
|
+
var tmp2_iterator = map(tmp_10, DynamicOpListener$exitClause$lambda).j();
|
|
655
|
+
while (tmp2_iterator.m()) {
|
|
656
|
+
var it = tmp2_iterator.p();
|
|
657
|
+
onOperatorDefined(this, new Operator(it.b1(), specifier, priority));
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
};
|
|
665
|
+
DynamicOpListener.prototype.exitClause = function (ctx) {
|
|
666
|
+
return this.g3j(ctx);
|
|
667
|
+
};
|
|
668
|
+
function parseException(token, message) {
|
|
669
|
+
return new ParseException(null, token.text, token.line, token.column, message, null);
|
|
670
|
+
}
|
|
671
|
+
function symbolToString($this, obj) {
|
|
672
|
+
var tmp;
|
|
673
|
+
if (obj instanceof Token) {
|
|
674
|
+
tmp = obj.text;
|
|
675
|
+
} else {
|
|
676
|
+
tmp = toString(obj);
|
|
677
|
+
}
|
|
678
|
+
return tmp;
|
|
679
|
+
}
|
|
680
|
+
function newErrorListener($this, whileParsing) {
|
|
681
|
+
return new PrologParserFactory$newErrorListener$1(whileParsing);
|
|
682
|
+
}
|
|
683
|
+
function parseExpression($this, parserAndErrorStrategy, source) {
|
|
684
|
+
var mark = -1;
|
|
685
|
+
var index = -1;
|
|
686
|
+
var parser = parserAndErrorStrategy.g4_1;
|
|
687
|
+
var tmp;
|
|
688
|
+
try {
|
|
689
|
+
mark = parser.getTokenStream().mark();
|
|
690
|
+
index = coerceAtLeast(parser.getTokenStream().index, 0);
|
|
691
|
+
tmp = parser.singletonExpression();
|
|
692
|
+
} catch ($p) {
|
|
693
|
+
var tmp_0;
|
|
694
|
+
{
|
|
695
|
+
var tmp_1;
|
|
696
|
+
if (isParseCancellationException($p) ? parser._interp.predictionMode === PredictionMode.SLL : false) {
|
|
697
|
+
parser.getTokenStream().seek(index);
|
|
698
|
+
parser._interp.predictionMode = PredictionMode.LL;
|
|
699
|
+
parser._errHandler = parserAndErrorStrategy.h4_1;
|
|
700
|
+
parser.addErrorListener(newErrorListener($this, source));
|
|
701
|
+
tmp_1 = parseExpression($this, parserAndErrorStrategy, source);
|
|
702
|
+
} else if ($p.clause !== null ? isRecognitionException($p.cause) : false) {
|
|
703
|
+
var tmp_2 = $p.cause;
|
|
704
|
+
throw tmp_2 instanceof RecognitionException ? tmp_2 : THROW_CCE();
|
|
705
|
+
} else {
|
|
706
|
+
throw $p instanceof Error ? $p : THROW_CCE();
|
|
707
|
+
}
|
|
708
|
+
tmp_0 = tmp_1;
|
|
709
|
+
}
|
|
710
|
+
tmp = tmp_0;
|
|
711
|
+
}
|
|
712
|
+
finally {
|
|
713
|
+
parser.getTokenStream().release(mark);
|
|
714
|
+
}
|
|
715
|
+
return tmp;
|
|
716
|
+
}
|
|
717
|
+
function parseClause_0($this, parserAndErrorStrategy, source) {
|
|
718
|
+
var mark = -1;
|
|
719
|
+
var index = -1;
|
|
720
|
+
var parser = parserAndErrorStrategy.g4_1;
|
|
721
|
+
var tmp;
|
|
722
|
+
try {
|
|
723
|
+
mark = parser.getTokenStream().mark();
|
|
724
|
+
index = coerceAtLeast(parser.getTokenStream().index, 0);
|
|
725
|
+
tmp = parser.optClause();
|
|
726
|
+
} catch ($p) {
|
|
727
|
+
var tmp_0;
|
|
728
|
+
{
|
|
729
|
+
var tmp_1;
|
|
730
|
+
if (isParseCancellationException($p) ? parser._interp.predictionMode === PredictionMode.SLL : false) {
|
|
731
|
+
parser.getTokenStream().seek(index);
|
|
732
|
+
parser._interp.predictionMode = PredictionMode.LL;
|
|
733
|
+
parser._errHandler = parserAndErrorStrategy.h4_1;
|
|
734
|
+
parser.addErrorListener(newErrorListener($this, source));
|
|
735
|
+
tmp_1 = parseClause_0($this, parserAndErrorStrategy, source);
|
|
736
|
+
} else if ($p.clause !== null ? isRecognitionException($p.cause) : false) {
|
|
737
|
+
var tmp_2 = $p.cause;
|
|
738
|
+
throw tmp_2 instanceof RecognitionException ? tmp_2 : THROW_CCE();
|
|
739
|
+
} else {
|
|
740
|
+
throw $p instanceof Error ? $p : THROW_CCE();
|
|
741
|
+
}
|
|
742
|
+
tmp_0 = tmp_1;
|
|
743
|
+
}
|
|
744
|
+
tmp = tmp_0;
|
|
745
|
+
}
|
|
746
|
+
finally {
|
|
747
|
+
parser.getTokenStream().release(mark);
|
|
748
|
+
}
|
|
749
|
+
return tmp;
|
|
750
|
+
}
|
|
751
|
+
function parseClauses($this, parser, source) {
|
|
752
|
+
var tmp = generateSequence(0, PrologParserFactory$parseClauses$lambda);
|
|
753
|
+
var tmp_0 = map(tmp, PrologParserFactory$parseClauses$lambda_0(parser, source));
|
|
754
|
+
var tmp_1 = takeWhile(tmp_0, PrologParserFactory$parseClauses$lambda_1);
|
|
755
|
+
return map(tmp_1, PrologParserFactory$parseClauses$lambda_2);
|
|
756
|
+
}
|
|
757
|
+
function PrologParserFactory$newErrorListener$1($whileParsing) {
|
|
758
|
+
this.h3j_1 = $whileParsing;
|
|
759
|
+
}
|
|
760
|
+
PrologParserFactory$newErrorListener$1.prototype.syntaxError = function (recognizer, offendingSymbol, line, column, msg, e) {
|
|
761
|
+
if (recognizer instanceof PrologParser) {
|
|
762
|
+
recognizer.removeParseListeners();
|
|
763
|
+
}
|
|
764
|
+
throw new ParseException(this.h3j_1, symbolToString(this, offendingSymbol), line, column + 1 | 0, msg, e);
|
|
765
|
+
};
|
|
766
|
+
function PrologParserFactory$parseClauses$lambda(it) {
|
|
767
|
+
return it + 1 | 0;
|
|
768
|
+
}
|
|
769
|
+
function PrologParserFactory$parseClauses$lambda_0($parser, $source) {
|
|
770
|
+
return function (it) {
|
|
771
|
+
var tmp;
|
|
772
|
+
try {
|
|
773
|
+
tmp = parseClause_0(PrologParserFactory_getInstance(), $parser, $source);
|
|
774
|
+
} catch ($p) {
|
|
775
|
+
var tmp_0;
|
|
776
|
+
if ($p instanceof ParseException) {
|
|
777
|
+
$p.clauseIndex = it;
|
|
778
|
+
throw $p;
|
|
779
|
+
} else {
|
|
780
|
+
throw $p;
|
|
781
|
+
}
|
|
782
|
+
tmp = tmp_0;
|
|
783
|
+
}
|
|
784
|
+
return tmp;
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
function PrologParserFactory$parseClauses$lambda_1(it) {
|
|
788
|
+
return !it.isOver;
|
|
789
|
+
}
|
|
790
|
+
function PrologParserFactory$parseClauses$lambda_2(it) {
|
|
791
|
+
return it.clause();
|
|
792
|
+
}
|
|
793
|
+
function PrologParserFactory() {
|
|
794
|
+
PrologParserFactory_instance = this;
|
|
795
|
+
}
|
|
796
|
+
PrologParserFactory.prototype.i3j = function (string, withOperators) {
|
|
797
|
+
var parser = this.j3j(string, withOperators);
|
|
798
|
+
return parseExpression(this, parser, string);
|
|
799
|
+
};
|
|
800
|
+
PrologParserFactory.prototype.k3j = function (source, withOperators) {
|
|
801
|
+
var parser = this.j3j(source, withOperators);
|
|
802
|
+
return parseClauses(this, parser, source);
|
|
803
|
+
};
|
|
804
|
+
PrologParserFactory.prototype.j3j = function (source, operators) {
|
|
805
|
+
var stream = new InputStream(source);
|
|
806
|
+
var lexer = new PrologLexer(stream);
|
|
807
|
+
lexer.removeErrorListeners();
|
|
808
|
+
var tokenStream = new CommonTokenStream(lexer);
|
|
809
|
+
var parser = new PrologParser(tokenStream);
|
|
810
|
+
parser.removeErrorListeners();
|
|
811
|
+
var originalErrorStrategy = parser._errHandler;
|
|
812
|
+
parser._errHandler = new BailErrorStrategy();
|
|
813
|
+
parser._interp.predictionMode = PredictionMode.SLL;
|
|
814
|
+
return to(this.l3j(parser, operators), originalErrorStrategy);
|
|
815
|
+
};
|
|
816
|
+
PrologParserFactory.prototype.l3j = function (prologParser, operators) {
|
|
817
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
818
|
+
var tmp0_iterator = operators.j();
|
|
819
|
+
while (tmp0_iterator.m()) {
|
|
820
|
+
var element = tmp0_iterator.p();
|
|
821
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.PrologParserFactory.addOperators.<anonymous>' call
|
|
822
|
+
prologParser.addOperator(element.n1i_1, toAssociativity(element.o1i_1), element.p1i_1);
|
|
823
|
+
}
|
|
824
|
+
prologParser.addParseListener(Companion_getInstance_7().f3j(prologParser));
|
|
825
|
+
return prologParser;
|
|
826
|
+
};
|
|
827
|
+
var PrologParserFactory_instance;
|
|
828
|
+
function PrologParserFactory_getInstance() {
|
|
829
|
+
if (PrologParserFactory_instance == null)
|
|
830
|
+
new PrologParserFactory();
|
|
831
|
+
return PrologParserFactory_instance;
|
|
832
|
+
}
|
|
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
|
+
function parseInteger_0($this, ctx) {
|
|
843
|
+
var str = ctx.value.text;
|
|
844
|
+
var base;
|
|
845
|
+
var clean;
|
|
846
|
+
if (ctx.isBin) {
|
|
847
|
+
base = 2;
|
|
848
|
+
var tmp$ret$1;
|
|
849
|
+
// Inline function 'kotlin.text.substring' call
|
|
850
|
+
var tmp$ret$0;
|
|
851
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
852
|
+
tmp$ret$0 = str;
|
|
853
|
+
tmp$ret$1 = tmp$ret$0.substring(2);
|
|
854
|
+
clean = tmp$ret$1;
|
|
855
|
+
} else if (ctx.isOct) {
|
|
856
|
+
base = 8;
|
|
857
|
+
var tmp$ret$3;
|
|
858
|
+
// Inline function 'kotlin.text.substring' call
|
|
859
|
+
var tmp$ret$2;
|
|
860
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
861
|
+
tmp$ret$2 = str;
|
|
862
|
+
tmp$ret$3 = tmp$ret$2.substring(2);
|
|
863
|
+
clean = tmp$ret$3;
|
|
864
|
+
} else if (ctx.isHex) {
|
|
865
|
+
base = 16;
|
|
866
|
+
var tmp$ret$5;
|
|
867
|
+
// Inline function 'kotlin.text.substring' call
|
|
868
|
+
var tmp$ret$4;
|
|
869
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
870
|
+
tmp$ret$4 = str;
|
|
871
|
+
tmp$ret$5 = tmp$ret$4.substring(2);
|
|
872
|
+
clean = tmp$ret$5;
|
|
873
|
+
} else if (ctx.isChar) {
|
|
874
|
+
var tmp$ret$7;
|
|
875
|
+
// Inline function 'kotlin.text.substring' call
|
|
876
|
+
var tmp$ret$6;
|
|
877
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
878
|
+
tmp$ret$6 = str;
|
|
879
|
+
tmp$ret$7 = tmp$ret$6.substring(2);
|
|
880
|
+
clean = tmp$ret$7;
|
|
881
|
+
if (!(clean.length === 1)) {
|
|
882
|
+
throw parseException(ctx.value, 'Invalid character literal: ' + ctx.value.text);
|
|
883
|
+
}
|
|
884
|
+
var tmp$ret$10;
|
|
885
|
+
// Inline function 'kotlin.with' call
|
|
886
|
+
var tmp = Companion_getInstance_3();
|
|
887
|
+
var tmp$ret$8;
|
|
888
|
+
// Inline function 'kotlin.code' call
|
|
889
|
+
var tmp0__get_code__88qj9g = charSequenceGet(clean, 0);
|
|
890
|
+
tmp$ret$8 = Char__toInt_impl_vasixd(tmp0__get_code__88qj9g);
|
|
891
|
+
var tmp1_with = tmp.of(tmp$ret$8);
|
|
892
|
+
// Inline function 'kotlin.contracts.contract' call
|
|
893
|
+
var tmp$ret$9;
|
|
894
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.parseInteger.<anonymous>' call
|
|
895
|
+
var tmp_0;
|
|
896
|
+
var tmp0_safe_receiver = ctx.sign;
|
|
897
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.text;
|
|
898
|
+
var tmp_1;
|
|
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;
|
|
905
|
+
if (tmp2_elvis_lhs == null ? false : tmp2_elvis_lhs) {
|
|
906
|
+
tmp_0 = tmp1_with.unaryMinus();
|
|
907
|
+
} else {
|
|
908
|
+
tmp_0 = tmp1_with;
|
|
909
|
+
}
|
|
910
|
+
tmp$ret$9 = tmp_0;
|
|
911
|
+
tmp$ret$10 = tmp$ret$9;
|
|
912
|
+
return tmp$ret$10;
|
|
913
|
+
} else {
|
|
914
|
+
base = 10;
|
|
915
|
+
clean = str;
|
|
916
|
+
}
|
|
917
|
+
if (!(ctx.sign == null)) {
|
|
918
|
+
var tmp0_safe_receiver_0 = ctx.sign;
|
|
919
|
+
clean = plus(tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.text, clean);
|
|
920
|
+
}
|
|
921
|
+
return Companion_getInstance_3().parseWithRadix(clean, base);
|
|
922
|
+
}
|
|
923
|
+
function visitPostfixExpression($this, ctx) {
|
|
924
|
+
var tmp0_safe_receiver = ctx.left;
|
|
925
|
+
var tmp = ensureNotNull(tmp0_safe_receiver == null ? null : tmp0_safe_receiver.accept($this));
|
|
926
|
+
var tmp$ret$2;
|
|
927
|
+
// Inline function 'kotlin.collections.map' call
|
|
928
|
+
var tmp0_map = ctx.operators;
|
|
929
|
+
var tmp$ret$1;
|
|
930
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
931
|
+
var tmp0_mapTo = ArrayList_init_$Create$(tmp0_map.length);
|
|
932
|
+
var indexedObject = tmp0_map;
|
|
933
|
+
var inductionVariable = 0;
|
|
934
|
+
var last = indexedObject.length;
|
|
935
|
+
while (inductionVariable < last) {
|
|
936
|
+
var item = indexedObject[inductionVariable];
|
|
937
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
938
|
+
var tmp$ret$0;
|
|
939
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.visitPostfixExpression.<anonymous>' call
|
|
940
|
+
tmp$ret$0 = item.symbol.text;
|
|
941
|
+
tmp0_mapTo.g(tmp$ret$0);
|
|
942
|
+
}
|
|
943
|
+
tmp$ret$1 = tmp0_mapTo;
|
|
944
|
+
tmp$ret$2 = tmp$ret$1;
|
|
945
|
+
return postfix($this, tmp, tmp$ret$2);
|
|
946
|
+
}
|
|
947
|
+
function postfix($this, term, ops) {
|
|
948
|
+
var operator = ops.j();
|
|
949
|
+
var result = $this.m3j_1.structOf(operator.p(), [term]);
|
|
950
|
+
while (operator.m()) {
|
|
951
|
+
result = $this.m3j_1.structOf(operator.p(), [result]);
|
|
952
|
+
}
|
|
953
|
+
return result;
|
|
954
|
+
}
|
|
955
|
+
function visitPrefixExpression($this, ctx) {
|
|
956
|
+
var tmp = ctx.right[0].accept($this);
|
|
957
|
+
var tmp$ret$2;
|
|
958
|
+
// Inline function 'kotlin.collections.map' call
|
|
959
|
+
var tmp0_map = ctx.operators;
|
|
960
|
+
var tmp$ret$1;
|
|
961
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
962
|
+
var tmp0_mapTo = ArrayList_init_$Create$(tmp0_map.length);
|
|
963
|
+
var indexedObject = tmp0_map;
|
|
964
|
+
var inductionVariable = 0;
|
|
965
|
+
var last = indexedObject.length;
|
|
966
|
+
while (inductionVariable < last) {
|
|
967
|
+
var item = indexedObject[inductionVariable];
|
|
968
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
969
|
+
var tmp$ret$0;
|
|
970
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.visitPrefixExpression.<anonymous>' call
|
|
971
|
+
tmp$ret$0 = item.symbol.text;
|
|
972
|
+
tmp0_mapTo.g(tmp$ret$0);
|
|
973
|
+
}
|
|
974
|
+
tmp$ret$1 = tmp0_mapTo;
|
|
975
|
+
tmp$ret$2 = tmp$ret$1;
|
|
976
|
+
return prefix($this, tmp, tmp$ret$2);
|
|
977
|
+
}
|
|
978
|
+
function prefix($this, term, ops) {
|
|
979
|
+
var i = ops.o() - 1 | 0;
|
|
980
|
+
var tmp0 = i;
|
|
981
|
+
i = tmp0 - 1 | 0;
|
|
982
|
+
var result = $this.m3j_1.structOf(ops.n(tmp0), [term]);
|
|
983
|
+
while (i >= 0) {
|
|
984
|
+
result = $this.m3j_1.structOf(ops.n(i), [result]);
|
|
985
|
+
var tmp1 = i;
|
|
986
|
+
i = tmp1 - 1 | 0;
|
|
987
|
+
}
|
|
988
|
+
return result;
|
|
989
|
+
}
|
|
990
|
+
function visitInfixExpression($this, ctx) {
|
|
991
|
+
var tmp0_subject = ctx.associativity;
|
|
992
|
+
var tmp;
|
|
993
|
+
if (tmp0_subject === Associativity.XFY) {
|
|
994
|
+
tmp = visitInfixRightAssociativeExpression($this, ctx);
|
|
995
|
+
} else if (tmp0_subject === Associativity.YFX) {
|
|
996
|
+
tmp = visitInfixLeftAssociativeExpression($this, ctx);
|
|
997
|
+
} else if (tmp0_subject === Associativity.XFX) {
|
|
998
|
+
tmp = visitInfixNonAssociativeExpression($this, ctx);
|
|
999
|
+
} else {
|
|
1000
|
+
throw IllegalStateException_init_$Create$();
|
|
1001
|
+
}
|
|
1002
|
+
return tmp;
|
|
1003
|
+
}
|
|
1004
|
+
function visitInfixNonAssociativeExpression($this, ctx) {
|
|
1005
|
+
var tmp$ret$2;
|
|
1006
|
+
// Inline function 'kotlin.collections.map' call
|
|
1007
|
+
var tmp0_map = plus_0(listOf(ensureNotNull(ctx.left)), asList(ctx.right));
|
|
1008
|
+
var tmp$ret$1;
|
|
1009
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1010
|
+
var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(tmp0_map, 10));
|
|
1011
|
+
var tmp0_iterator = tmp0_map.j();
|
|
1012
|
+
while (tmp0_iterator.m()) {
|
|
1013
|
+
var item = tmp0_iterator.p();
|
|
1014
|
+
var tmp$ret$0;
|
|
1015
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.visitInfixNonAssociativeExpression.<anonymous>' call
|
|
1016
|
+
tmp$ret$0 = item.accept($this);
|
|
1017
|
+
tmp0_mapTo.g(tmp$ret$0);
|
|
1018
|
+
}
|
|
1019
|
+
tmp$ret$1 = tmp0_mapTo;
|
|
1020
|
+
tmp$ret$2 = tmp$ret$1;
|
|
1021
|
+
var operands = tmp$ret$2;
|
|
1022
|
+
var tmp$ret$5;
|
|
1023
|
+
// Inline function 'kotlin.collections.map' call
|
|
1024
|
+
var tmp1_map = ctx.operators;
|
|
1025
|
+
var tmp$ret$4;
|
|
1026
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1027
|
+
var tmp0_mapTo_0 = ArrayList_init_$Create$(tmp1_map.length);
|
|
1028
|
+
var indexedObject = tmp1_map;
|
|
1029
|
+
var inductionVariable = 0;
|
|
1030
|
+
var last = indexedObject.length;
|
|
1031
|
+
while (inductionVariable < last) {
|
|
1032
|
+
var item_0 = indexedObject[inductionVariable];
|
|
1033
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
1034
|
+
var tmp$ret$3;
|
|
1035
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.visitInfixNonAssociativeExpression.<anonymous>' call
|
|
1036
|
+
tmp$ret$3 = item_0.symbol.text;
|
|
1037
|
+
tmp0_mapTo_0.g(tmp$ret$3);
|
|
1038
|
+
}
|
|
1039
|
+
tmp$ret$4 = tmp0_mapTo_0;
|
|
1040
|
+
tmp$ret$5 = tmp$ret$4;
|
|
1041
|
+
var operators = tmp$ret$5;
|
|
1042
|
+
return infixNonAssociative($this, operands, operators);
|
|
1043
|
+
}
|
|
1044
|
+
function infixNonAssociative($this, terms, ops) {
|
|
1045
|
+
return $this.m3j_1.structOf(ops.n(0), [terms.n(0), terms.n(1)]);
|
|
1046
|
+
}
|
|
1047
|
+
function handleOuters($this, expression, outers) {
|
|
1048
|
+
var result = expression;
|
|
1049
|
+
var tmp0_iterator = outers.j();
|
|
1050
|
+
while (tmp0_iterator.m()) {
|
|
1051
|
+
var o = tmp0_iterator.p();
|
|
1052
|
+
var tmp = listOf(result);
|
|
1053
|
+
var tmp$ret$2;
|
|
1054
|
+
// Inline function 'kotlin.collections.map' call
|
|
1055
|
+
var tmp0_map = o.right;
|
|
1056
|
+
var tmp$ret$1;
|
|
1057
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1058
|
+
var tmp0_mapTo = ArrayList_init_$Create$(tmp0_map.length);
|
|
1059
|
+
var indexedObject = tmp0_map;
|
|
1060
|
+
var inductionVariable = 0;
|
|
1061
|
+
var last = indexedObject.length;
|
|
1062
|
+
while (inductionVariable < last) {
|
|
1063
|
+
var item = indexedObject[inductionVariable];
|
|
1064
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
1065
|
+
var tmp$ret$0;
|
|
1066
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.handleOuters.<anonymous>' call
|
|
1067
|
+
tmp$ret$0 = item.accept($this);
|
|
1068
|
+
tmp0_mapTo.g(tmp$ret$0);
|
|
1069
|
+
}
|
|
1070
|
+
tmp$ret$1 = tmp0_mapTo;
|
|
1071
|
+
tmp$ret$2 = tmp$ret$1;
|
|
1072
|
+
var operands = plus_0(tmp, tmp$ret$2);
|
|
1073
|
+
var tmp$ret$5;
|
|
1074
|
+
// Inline function 'kotlin.collections.map' call
|
|
1075
|
+
var tmp1_map = o.operators;
|
|
1076
|
+
var tmp$ret$4;
|
|
1077
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1078
|
+
var tmp0_mapTo_0 = ArrayList_init_$Create$(tmp1_map.length);
|
|
1079
|
+
var indexedObject_0 = tmp1_map;
|
|
1080
|
+
var inductionVariable_0 = 0;
|
|
1081
|
+
var last_0 = indexedObject_0.length;
|
|
1082
|
+
while (inductionVariable_0 < last_0) {
|
|
1083
|
+
var item_0 = indexedObject_0[inductionVariable_0];
|
|
1084
|
+
inductionVariable_0 = inductionVariable_0 + 1 | 0;
|
|
1085
|
+
var tmp$ret$3;
|
|
1086
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.handleOuters.<anonymous>' call
|
|
1087
|
+
tmp$ret$3 = item_0.symbol.text;
|
|
1088
|
+
tmp0_mapTo_0.g(tmp$ret$3);
|
|
1089
|
+
}
|
|
1090
|
+
tmp$ret$4 = tmp0_mapTo_0;
|
|
1091
|
+
tmp$ret$5 = tmp$ret$4;
|
|
1092
|
+
var operators = tmp$ret$5;
|
|
1093
|
+
var tmp1_subject = o.associativity;
|
|
1094
|
+
var tmp_0;
|
|
1095
|
+
if (tmp1_subject === Associativity.XFY) {
|
|
1096
|
+
tmp_0 = infixRight($this, operands, operators);
|
|
1097
|
+
} else if (tmp1_subject === Associativity.XF ? true : tmp1_subject === Associativity.YF) {
|
|
1098
|
+
tmp_0 = postfix($this, result, operators);
|
|
1099
|
+
} else if (tmp1_subject === Associativity.XFX) {
|
|
1100
|
+
tmp_0 = infixNonAssociative($this, operands, operators);
|
|
1101
|
+
} else if (tmp1_subject === Associativity.YFX) {
|
|
1102
|
+
tmp_0 = infixLeft($this, operands, operators);
|
|
1103
|
+
} else if (tmp1_subject === Associativity.FX ? true : tmp1_subject === Associativity.FY) {
|
|
1104
|
+
tmp_0 = prefix($this, result, operators);
|
|
1105
|
+
} else {
|
|
1106
|
+
throw IllegalStateException_init_$Create$();
|
|
1107
|
+
}
|
|
1108
|
+
result = tmp_0;
|
|
1109
|
+
}
|
|
1110
|
+
return result;
|
|
1111
|
+
}
|
|
1112
|
+
function infixRight($this, terms, ops) {
|
|
1113
|
+
var i = terms.o() - 1 | 0;
|
|
1114
|
+
var j = ops.o() - 1 | 0;
|
|
1115
|
+
var tmp0 = j;
|
|
1116
|
+
j = tmp0 - 1 | 0;
|
|
1117
|
+
var result = $this.m3j_1.structOf(ops.n(tmp0), [terms.n(i - 1 | 0), terms.n(i)]);
|
|
1118
|
+
i = i - 2 | 0;
|
|
1119
|
+
while (i >= 0) {
|
|
1120
|
+
var tmp1 = j;
|
|
1121
|
+
j = tmp1 - 1 | 0;
|
|
1122
|
+
result = $this.m3j_1.structOf(ops.n(tmp1), [terms.n(i), result]);
|
|
1123
|
+
var tmp2 = i;
|
|
1124
|
+
i = tmp2 - 1 | 0;
|
|
1125
|
+
}
|
|
1126
|
+
return result;
|
|
1127
|
+
}
|
|
1128
|
+
function infixLeft($this, terms, ops) {
|
|
1129
|
+
var i = 0;
|
|
1130
|
+
var j = 0;
|
|
1131
|
+
var tmp0 = j;
|
|
1132
|
+
j = tmp0 + 1 | 0;
|
|
1133
|
+
var tmp = ops.n(tmp0);
|
|
1134
|
+
var tmp1 = i;
|
|
1135
|
+
i = tmp1 + 1 | 0;
|
|
1136
|
+
var tmp_0 = terms.n(tmp1);
|
|
1137
|
+
var tmp2 = i;
|
|
1138
|
+
i = tmp2 + 1 | 0;
|
|
1139
|
+
var result = $this.m3j_1.structOf(tmp, [tmp_0, terms.n(tmp2)]);
|
|
1140
|
+
while (i < terms.o()) {
|
|
1141
|
+
var tmp3 = j;
|
|
1142
|
+
j = tmp3 + 1 | 0;
|
|
1143
|
+
result = $this.m3j_1.structOf(ops.n(tmp3), [result, terms.n(i)]);
|
|
1144
|
+
var tmp4 = i;
|
|
1145
|
+
i = tmp4 + 1 | 0;
|
|
1146
|
+
}
|
|
1147
|
+
return result;
|
|
1148
|
+
}
|
|
1149
|
+
function listOfOperands($this, ctx) {
|
|
1150
|
+
var tmp$ret$2;
|
|
1151
|
+
// Inline function 'kotlin.collections.map' call
|
|
1152
|
+
var tmp0_map = plus_0(listOf(ctx.left), toList(ctx.right));
|
|
1153
|
+
var tmp$ret$1;
|
|
1154
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1155
|
+
var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(tmp0_map, 10));
|
|
1156
|
+
var tmp0_iterator = tmp0_map.j();
|
|
1157
|
+
while (tmp0_iterator.m()) {
|
|
1158
|
+
var item = tmp0_iterator.p();
|
|
1159
|
+
var tmp$ret$0;
|
|
1160
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.listOfOperands.<anonymous>' call
|
|
1161
|
+
tmp$ret$0 = ensureNotNull(item).accept($this);
|
|
1162
|
+
tmp0_mapTo.g(tmp$ret$0);
|
|
1163
|
+
}
|
|
1164
|
+
tmp$ret$1 = tmp0_mapTo;
|
|
1165
|
+
tmp$ret$2 = tmp$ret$1;
|
|
1166
|
+
return tmp$ret$2;
|
|
1167
|
+
}
|
|
1168
|
+
function listOfOperators($this, ctx) {
|
|
1169
|
+
var tmp$ret$2;
|
|
1170
|
+
// Inline function 'kotlin.collections.map' call
|
|
1171
|
+
var tmp0_map = ctx.operators;
|
|
1172
|
+
var tmp$ret$1;
|
|
1173
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1174
|
+
var tmp0_mapTo = ArrayList_init_$Create$(tmp0_map.length);
|
|
1175
|
+
var indexedObject = tmp0_map;
|
|
1176
|
+
var inductionVariable = 0;
|
|
1177
|
+
var last = indexedObject.length;
|
|
1178
|
+
while (inductionVariable < last) {
|
|
1179
|
+
var item = indexedObject[inductionVariable];
|
|
1180
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
1181
|
+
var tmp$ret$0;
|
|
1182
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.listOfOperators.<anonymous>' call
|
|
1183
|
+
tmp$ret$0 = item.symbol.text;
|
|
1184
|
+
tmp0_mapTo.g(tmp$ret$0);
|
|
1185
|
+
}
|
|
1186
|
+
tmp$ret$1 = tmp0_mapTo;
|
|
1187
|
+
tmp$ret$2 = tmp$ret$1;
|
|
1188
|
+
return tmp$ret$2;
|
|
1189
|
+
}
|
|
1190
|
+
function visitInfixRightAssociativeExpression($this, ctx) {
|
|
1191
|
+
return infixRight($this, listOfOperands($this, ctx), listOfOperators($this, ctx));
|
|
1192
|
+
}
|
|
1193
|
+
function visitInfixLeftAssociativeExpression($this, ctx) {
|
|
1194
|
+
return infixLeft($this, listOfOperands($this, ctx), listOfOperators($this, ctx));
|
|
1195
|
+
}
|
|
1196
|
+
function flatten($this, outers) {
|
|
1197
|
+
var tmp$ret$0;
|
|
1198
|
+
// Inline function 'kotlin.sequences.asSequence' call
|
|
1199
|
+
tmp$ret$0 = outers;
|
|
1200
|
+
var tmp = tmp$ret$0;
|
|
1201
|
+
return flatMap(tmp, PrologVisitor$flatten$lambda($this));
|
|
1202
|
+
}
|
|
1203
|
+
function flatten_0($this, outers) {
|
|
1204
|
+
return toList_0(flatten($this, asSequence(outers)));
|
|
1205
|
+
}
|
|
1206
|
+
function PrologVisitor$visitExpression$ref($boundThis) {
|
|
1207
|
+
var l = function (p0) {
|
|
1208
|
+
return $boundThis.n3j(p0);
|
|
1209
|
+
};
|
|
1210
|
+
l.callableName = 'visitExpression';
|
|
1211
|
+
return l;
|
|
1212
|
+
}
|
|
1213
|
+
function PrologVisitor$flatten$lambda(this$0) {
|
|
1214
|
+
return function (it) {
|
|
1215
|
+
return plus_1(sequenceOf([it]), flatten(this$0, asSequence_0(it.outers)));
|
|
1216
|
+
};
|
|
1217
|
+
}
|
|
1218
|
+
function PrologVisitor(scope) {
|
|
1219
|
+
PrologParserVisitor.call(this);
|
|
1220
|
+
this.m3j_1 = scope;
|
|
1221
|
+
}
|
|
1222
|
+
PrologVisitor.prototype.o3j = function (ctx) {
|
|
1223
|
+
return this.p3j(ctx.term());
|
|
1224
|
+
};
|
|
1225
|
+
PrologVisitor.prototype.visitSingletonTerm = function (ctx) {
|
|
1226
|
+
return this.o3j(ctx);
|
|
1227
|
+
};
|
|
1228
|
+
PrologVisitor.prototype.q3j = function (ctx) {
|
|
1229
|
+
return this.n3j(ctx.expression());
|
|
1230
|
+
};
|
|
1231
|
+
PrologVisitor.prototype.visitSingletonExpression = function (ctx) {
|
|
1232
|
+
return this.q3j(ctx);
|
|
1233
|
+
};
|
|
1234
|
+
PrologVisitor.prototype.r3j = function (ctx) {
|
|
1235
|
+
return toClause(ctx.expression().accept(this), null, ensureNotNull(ctx.start).line, ensureNotNull(ctx.start).column);
|
|
1236
|
+
};
|
|
1237
|
+
PrologVisitor.prototype.visitClause = function (ctx) {
|
|
1238
|
+
return this.r3j(ctx);
|
|
1239
|
+
};
|
|
1240
|
+
PrologVisitor.prototype.n3j = function (ctx) {
|
|
1241
|
+
var tmp;
|
|
1242
|
+
if (ctx.isTerm) {
|
|
1243
|
+
tmp = this.p3j(ensureNotNull(ctx.left));
|
|
1244
|
+
} else if (contains(Associativity.INFIX, ctx.associativity)) {
|
|
1245
|
+
tmp = visitInfixExpression(this, ctx);
|
|
1246
|
+
} else if (contains(Associativity.POSTFIX, ctx.associativity)) {
|
|
1247
|
+
tmp = visitPostfixExpression(this, ctx);
|
|
1248
|
+
} else if (contains(Associativity.PREFIX, ctx.associativity)) {
|
|
1249
|
+
tmp = visitPrefixExpression(this, ctx);
|
|
1250
|
+
} else {
|
|
1251
|
+
throw IllegalArgumentException_init_$Create$('Associativity unknown: ' + ctx.associativity + ' INFIX=' + Associativity.INFIX + ' PREFIX=' + Associativity.PREFIX + ' POSTFIX=' + Associativity.POSTFIX);
|
|
1252
|
+
}
|
|
1253
|
+
return handleOuters(this, tmp, flatten_0(this, asList(ctx.outers)));
|
|
1254
|
+
};
|
|
1255
|
+
PrologVisitor.prototype.visitExpression = function (ctx) {
|
|
1256
|
+
return this.n3j(ctx);
|
|
1257
|
+
};
|
|
1258
|
+
PrologVisitor.prototype.p3j = function (ctx) {
|
|
1259
|
+
var tmp;
|
|
1260
|
+
if (ctx.isExpr) {
|
|
1261
|
+
tmp = this.n3j(ctx.expression());
|
|
1262
|
+
} else {
|
|
1263
|
+
var tmp_0 = ctx.children[0].accept(this);
|
|
1264
|
+
tmp = (!(tmp_0 == null) ? isInterface(tmp_0, Term) : false) ? tmp_0 : THROW_CCE();
|
|
1265
|
+
}
|
|
1266
|
+
return tmp;
|
|
1267
|
+
};
|
|
1268
|
+
PrologVisitor.prototype.visitTerm = function (ctx) {
|
|
1269
|
+
return this.p3j(ctx);
|
|
1270
|
+
};
|
|
1271
|
+
PrologVisitor.prototype.s3j = function (ctx) {
|
|
1272
|
+
var value = parseInteger_0(this, ctx);
|
|
1273
|
+
return Companion_getInstance_4().ofBigInteger(value);
|
|
1274
|
+
};
|
|
1275
|
+
PrologVisitor.prototype.visitInteger = function (ctx) {
|
|
1276
|
+
return this.s3j(ctx);
|
|
1277
|
+
};
|
|
1278
|
+
PrologVisitor.prototype.t3j = function (ctx) {
|
|
1279
|
+
var tmp = ctx.children[0].accept(this);
|
|
1280
|
+
return (!(tmp == null) ? isInterface(tmp, Term) : false) ? tmp : THROW_CCE();
|
|
1281
|
+
};
|
|
1282
|
+
PrologVisitor.prototype.visitNumber = function (ctx) {
|
|
1283
|
+
return this.t3j(ctx);
|
|
1284
|
+
};
|
|
1285
|
+
PrologVisitor.prototype.u3j = function (ctx) {
|
|
1286
|
+
var raw = ctx.value.text;
|
|
1287
|
+
if (!(ctx.sign == null)) {
|
|
1288
|
+
var tmp0_safe_receiver = ctx.sign;
|
|
1289
|
+
raw = plus(tmp0_safe_receiver == null ? null : tmp0_safe_receiver.text, raw);
|
|
1290
|
+
}
|
|
1291
|
+
var tmp;
|
|
1292
|
+
try {
|
|
1293
|
+
tmp = Companion_getInstance_5().parse(raw);
|
|
1294
|
+
} catch ($p) {
|
|
1295
|
+
var tmp_0;
|
|
1296
|
+
if ($p instanceof NumberFormatException) {
|
|
1297
|
+
throw parseException(ctx.value, 'Invalid real number format: ' + ctx.value.text);
|
|
1298
|
+
} else {
|
|
1299
|
+
throw $p;
|
|
1300
|
+
}
|
|
1301
|
+
tmp = tmp_0;
|
|
1302
|
+
}
|
|
1303
|
+
return tmp;
|
|
1304
|
+
};
|
|
1305
|
+
PrologVisitor.prototype.visitReal = function (ctx) {
|
|
1306
|
+
return this.u3j(ctx);
|
|
1307
|
+
};
|
|
1308
|
+
PrologVisitor.prototype.v3j = function (ctx) {
|
|
1309
|
+
var tmp;
|
|
1310
|
+
if (ctx.isAnonymous) {
|
|
1311
|
+
tmp = this.m3j_1.anonymous();
|
|
1312
|
+
} else {
|
|
1313
|
+
tmp = this.m3j_1.varOf(ctx.value.text);
|
|
1314
|
+
}
|
|
1315
|
+
return tmp;
|
|
1316
|
+
};
|
|
1317
|
+
PrologVisitor.prototype.visitVariable = function (ctx) {
|
|
1318
|
+
return this.v3j(ctx);
|
|
1319
|
+
};
|
|
1320
|
+
PrologVisitor.prototype.w3j = function (ctx) {
|
|
1321
|
+
if (ctx.isList) {
|
|
1322
|
+
return this.m3j_1.listOf([]);
|
|
1323
|
+
} else if (ctx.isBlock) {
|
|
1324
|
+
return this.m3j_1.setOf([]);
|
|
1325
|
+
}
|
|
1326
|
+
var tmp;
|
|
1327
|
+
if (ctx.arity === 0) {
|
|
1328
|
+
tmp = this.m3j_1.atomOf(ctx.functor.text);
|
|
1329
|
+
} else {
|
|
1330
|
+
var tmp_0 = ctx.functor.text;
|
|
1331
|
+
var tmp_1 = asSequence_0(ctx.args);
|
|
1332
|
+
tmp = this.m3j_1.structOfSequence(tmp_0, map(tmp_1, PrologVisitor$visitExpression$ref(this)));
|
|
1333
|
+
}
|
|
1334
|
+
return tmp;
|
|
1335
|
+
};
|
|
1336
|
+
PrologVisitor.prototype.visitStructure = function (ctx) {
|
|
1337
|
+
return this.w3j(ctx);
|
|
1338
|
+
};
|
|
1339
|
+
PrologVisitor.prototype.x3j = function (ctx) {
|
|
1340
|
+
var tmp$ret$1;
|
|
1341
|
+
// Inline function 'kotlin.collections.map' call
|
|
1342
|
+
var tmp0_map = ctx.items;
|
|
1343
|
+
var tmp$ret$0;
|
|
1344
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1345
|
+
var tmp0_mapTo = ArrayList_init_$Create$(tmp0_map.length);
|
|
1346
|
+
var indexedObject = tmp0_map;
|
|
1347
|
+
var inductionVariable = 0;
|
|
1348
|
+
var last = indexedObject.length;
|
|
1349
|
+
while (inductionVariable < last) {
|
|
1350
|
+
var item = indexedObject[inductionVariable];
|
|
1351
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
1352
|
+
tmp0_mapTo.g(this.n3j(item));
|
|
1353
|
+
}
|
|
1354
|
+
tmp$ret$0 = tmp0_mapTo;
|
|
1355
|
+
tmp$ret$1 = tmp$ret$0;
|
|
1356
|
+
var terms = tmp$ret$1;
|
|
1357
|
+
var tmp;
|
|
1358
|
+
if (ctx.hasTail) {
|
|
1359
|
+
var tmp0_safe_receiver = ctx.tail;
|
|
1360
|
+
tmp = this.m3j_1.y11(terms, tmp0_safe_receiver == null ? null : tmp0_safe_receiver.accept(this));
|
|
1361
|
+
} else {
|
|
1362
|
+
tmp = this.m3j_1.listOfIterable(terms);
|
|
1363
|
+
}
|
|
1364
|
+
return tmp;
|
|
1365
|
+
};
|
|
1366
|
+
PrologVisitor.prototype.visitList = function (ctx) {
|
|
1367
|
+
return this.x3j(ctx);
|
|
1368
|
+
};
|
|
1369
|
+
PrologVisitor.prototype.y3j = function (ctx) {
|
|
1370
|
+
var tmp;
|
|
1371
|
+
if (ctx.length === 1) {
|
|
1372
|
+
tmp = this.m3j_1.setOf([ctx.items[0].accept(this)]);
|
|
1373
|
+
} else {
|
|
1374
|
+
var tmp$ret$1;
|
|
1375
|
+
// Inline function 'kotlin.collections.map' call
|
|
1376
|
+
var tmp0_map = ctx.items;
|
|
1377
|
+
var tmp$ret$0;
|
|
1378
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
1379
|
+
var tmp0_mapTo = ArrayList_init_$Create$(tmp0_map.length);
|
|
1380
|
+
var indexedObject = tmp0_map;
|
|
1381
|
+
var inductionVariable = 0;
|
|
1382
|
+
var last = indexedObject.length;
|
|
1383
|
+
while (inductionVariable < last) {
|
|
1384
|
+
var item = indexedObject[inductionVariable];
|
|
1385
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
1386
|
+
tmp0_mapTo.g(this.n3j(item));
|
|
1387
|
+
}
|
|
1388
|
+
tmp$ret$0 = tmp0_mapTo;
|
|
1389
|
+
tmp$ret$1 = tmp$ret$0;
|
|
1390
|
+
tmp = this.m3j_1.setOfIterable(tmp$ret$1);
|
|
1391
|
+
}
|
|
1392
|
+
return tmp;
|
|
1393
|
+
};
|
|
1394
|
+
PrologVisitor.prototype.visitBlock = function (ctx) {
|
|
1395
|
+
return this.y3j(ctx);
|
|
1396
|
+
};
|
|
1397
|
+
function termParserWithOperators(operators, scope) {
|
|
1398
|
+
return new TermParserImpl(scope, operators);
|
|
1399
|
+
}
|
|
1400
|
+
function TermParserImpl(scope, defaultOperatorSet) {
|
|
1401
|
+
this.z3j_1 = scope;
|
|
1402
|
+
this.a3k_1 = defaultOperatorSet;
|
|
1403
|
+
}
|
|
1404
|
+
TermParserImpl.prototype.c3j = function () {
|
|
1405
|
+
return this.a3k_1;
|
|
1406
|
+
};
|
|
1407
|
+
TermParserImpl.prototype.b3k = function (input, operators) {
|
|
1408
|
+
return PrologParserFactory_getInstance().i3j(input, operators).accept(new PrologVisitor(this.z3j_1));
|
|
1409
|
+
};
|
|
1410
|
+
TermParserImpl.prototype.parseTermWithOperators = function (input, operators) {
|
|
1411
|
+
return this.b3k(input, operators);
|
|
1412
|
+
};
|
|
1413
|
+
//region block: post-declaration
|
|
1414
|
+
TermParserImpl.prototype.parseTerm = parseTerm;
|
|
1415
|
+
TermParserImpl.prototype.parseStructWithOperators = parseStructWithOperators;
|
|
1416
|
+
TermParserImpl.prototype.parseStruct = parseStruct;
|
|
1417
|
+
TermParserImpl.prototype.parseConstantWithOperators = parseConstantWithOperators;
|
|
1418
|
+
TermParserImpl.prototype.parseConstant = parseConstant;
|
|
1419
|
+
TermParserImpl.prototype.parseVarWithOperators = parseVarWithOperators;
|
|
1420
|
+
TermParserImpl.prototype.parseVar = parseVar;
|
|
1421
|
+
TermParserImpl.prototype.parseAtomWithOperators = parseAtomWithOperators;
|
|
1422
|
+
TermParserImpl.prototype.parseAtom = parseAtom;
|
|
1423
|
+
TermParserImpl.prototype.parseNumericWithOperators = parseNumericWithOperators;
|
|
1424
|
+
TermParserImpl.prototype.parseNumeric = parseNumeric;
|
|
1425
|
+
TermParserImpl.prototype.parseIntegerWithOperators = parseIntegerWithOperators;
|
|
1426
|
+
TermParserImpl.prototype.parseInteger = parseInteger;
|
|
1427
|
+
TermParserImpl.prototype.parseRealWithOperators = parseRealWithOperators;
|
|
1428
|
+
TermParserImpl.prototype.parseReal = parseReal;
|
|
1429
|
+
TermParserImpl.prototype.parseClauseWithOperators = parseClauseWithOperators;
|
|
1430
|
+
TermParserImpl.prototype.parseClause = parseClause;
|
|
1431
|
+
TermParserImpl.prototype.parseRuleWithOperators = parseRuleWithOperators;
|
|
1432
|
+
TermParserImpl.prototype.parseRule = parseRule;
|
|
1433
|
+
TermParserImpl.prototype.parseFactWithOperators = parseFactWithOperators;
|
|
1434
|
+
TermParserImpl.prototype.parseFact = parseFact;
|
|
1435
|
+
TermParserImpl.prototype.parseDirectiveWithOperators = parseDirectiveWithOperators;
|
|
1436
|
+
TermParserImpl.prototype.parseDirective = parseDirective;
|
|
1437
|
+
//endregion
|
|
1438
|
+
//region block: exports
|
|
1439
|
+
_.$_$ = _.$_$ || {};
|
|
1440
|
+
_.$_$.a = toClause$default;
|
|
1441
|
+
_.$_$.b = PrologVisitor_init_$Create$;
|
|
1442
|
+
_.$_$.c = PrologParserFactory_getInstance;
|
|
1443
|
+
_.$_$.d = ParseException;
|
|
1444
|
+
_.$_$.e = parseStruct_0;
|
|
1445
|
+
_.$_$.f = parseStructWithOperators_0;
|
|
1446
|
+
//endregion
|
|
1447
|
+
return _;
|
|
1448
|
+
}(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')));
|
|
1449
|
+
|
|
1450
|
+
//# sourceMappingURL=2p-parser-core.js.map
|