@tuprolog/arg2p-core 0.7.3 → 0.8.2

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-parser-core.js CHANGED
@@ -45,73 +45,286 @@
45
45
  var BailErrorStrategy = $module$antlr4_src_antlr4_error_s9pni7.BailErrorStrategy;
46
46
  var PrologParserVisitor = $module$_tuprolog_parser_utils_xy31vy.PrologParserVisitor;
47
47
  var VOID = kotlin_kotlin.$_$.d;
48
- var captureStack = kotlin_kotlin.$_$.r4;
49
- var protoOf = kotlin_kotlin.$_$.s5;
50
- var classMeta = kotlin_kotlin.$_$.w4;
51
- var setMetadataFor = kotlin_kotlin.$_$.t5;
52
- var TuPrologException = kotlin_it_unibo_tuprolog_core.$_$.x;
53
- var TuPrologException_init_$Init$ = kotlin_it_unibo_tuprolog_core.$_$.b;
54
- var ensureNotNull = kotlin_kotlin.$_$.k9;
55
- var replace = kotlin_kotlin.$_$.k8;
48
+ var captureStack = kotlin_kotlin.$_$.z4;
49
+ var protoOf = kotlin_kotlin.$_$.a6;
50
+ var classMeta = kotlin_kotlin.$_$.e5;
51
+ var setMetadataFor = kotlin_kotlin.$_$.b6;
52
+ var TuPrologException = kotlin_it_unibo_tuprolog_core.$_$.b1;
53
+ var TuPrologException_init_$Init$ = kotlin_it_unibo_tuprolog_core.$_$.e;
54
+ var ensureNotNull = kotlin_kotlin.$_$.y9;
55
+ var replace = kotlin_kotlin.$_$.w8;
56
56
  var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.f1;
57
- var Char = kotlin_kotlin.$_$.w8;
57
+ var Char = kotlin_kotlin.$_$.j9;
58
58
  var toString = kotlin_kotlin.$_$.j1;
59
- var Struct = kotlin_it_unibo_tuprolog_core.$_$.l1;
60
- var isInterface = kotlin_kotlin.$_$.i5;
61
- var Numeric = kotlin_it_unibo_tuprolog_core.$_$.i1;
62
- var Atom = kotlin_it_unibo_tuprolog_core.$_$.a1;
63
- var Clause = kotlin_it_unibo_tuprolog_core.$_$.b1;
59
+ var Struct = kotlin_it_unibo_tuprolog_core.$_$.r1;
60
+ var isInterface = kotlin_kotlin.$_$.q5;
61
+ var Numeric = kotlin_it_unibo_tuprolog_core.$_$.n1;
62
+ var Atom = kotlin_it_unibo_tuprolog_core.$_$.e1;
63
+ var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.i;
64
+ var Companion_instance = kotlin_it_unibo_tuprolog_core.$_$.t;
65
+ var OperatorSet_init_$Create$ = kotlin_it_unibo_tuprolog_core.$_$.f;
66
+ var objectMeta = kotlin_kotlin.$_$.z5;
64
67
  var getKClass = kotlin_kotlin.$_$.c;
65
- var Companion_instance = kotlin_it_unibo_tuprolog_core.$_$.j;
66
- var Unit_instance = kotlin_kotlin.$_$.r1;
67
- var objectMeta = kotlin_kotlin.$_$.r5;
68
- var THROW_CCE = kotlin_kotlin.$_$.h9;
69
- var contains = kotlin_kotlin.$_$.i2;
70
- var Directive = kotlin_it_unibo_tuprolog_core.$_$.d1;
71
- var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.g;
72
- var map = kotlin_kotlin.$_$.j7;
73
- var Operator = kotlin_it_unibo_tuprolog_core.$_$.z;
74
- var List = kotlin_it_unibo_tuprolog_core.$_$.h1;
75
- var toString_0 = kotlin_kotlin.$_$.x5;
76
- var coerceAtLeast = kotlin_kotlin.$_$.i6;
68
+ var Constant = kotlin_it_unibo_tuprolog_core.$_$.g1;
69
+ var Var = kotlin_it_unibo_tuprolog_core.$_$.s2;
70
+ var Integer = kotlin_it_unibo_tuprolog_core.$_$.l1;
71
+ var Real = kotlin_it_unibo_tuprolog_core.$_$.o1;
72
+ var Clause = kotlin_it_unibo_tuprolog_core.$_$.f1;
73
+ var Rule = kotlin_it_unibo_tuprolog_core.$_$.p1;
74
+ var Fact = kotlin_it_unibo_tuprolog_core.$_$.j1;
75
+ var Directive = kotlin_it_unibo_tuprolog_core.$_$.i1;
76
+ var interfaceMeta = kotlin_kotlin.$_$.n5;
77
+ var Companion_instance_0 = kotlin_it_unibo_tuprolog_core.$_$.m;
78
+ var Unit_instance = kotlin_kotlin.$_$.s1;
79
+ var THROW_CCE = kotlin_kotlin.$_$.v9;
80
+ var contains = kotlin_kotlin.$_$.l2;
81
+ var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.j;
82
+ var map = kotlin_kotlin.$_$.s7;
83
+ var Operator = kotlin_it_unibo_tuprolog_core.$_$.d1;
84
+ var List = kotlin_it_unibo_tuprolog_core.$_$.m1;
85
+ var toString_0 = kotlin_kotlin.$_$.f6;
86
+ var coerceAtLeast = kotlin_kotlin.$_$.q6;
77
87
  var isRecognitionException = kotlin_it_unibo_tuprolog_parser_js.$_$.b;
78
88
  var isParseCancellationException = kotlin_it_unibo_tuprolog_parser_js.$_$.a;
79
- var generateSequence = kotlin_kotlin.$_$.d7;
80
- var takeWhile = kotlin_kotlin.$_$.r7;
81
- var to = kotlin_kotlin.$_$.s9;
82
- var Companion_getInstance_0 = kotlin_io_github_gciatto_kt_math.$_$.e;
83
- var charSequenceGet = kotlin_kotlin.$_$.u4;
89
+ var generateSequence = kotlin_kotlin.$_$.m7;
90
+ var takeWhile = kotlin_kotlin.$_$.c8;
91
+ var to = kotlin_kotlin.$_$.ha;
92
+ var Companion_getInstance_1 = kotlin_io_github_gciatto_kt_math.$_$.e;
93
+ var charSequenceGet = kotlin_kotlin.$_$.c5;
84
94
  var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.i1;
85
- var contains_0 = kotlin_kotlin.$_$.d8;
86
- var plus = kotlin_kotlin.$_$.o9;
95
+ var contains_0 = kotlin_kotlin.$_$.o8;
96
+ var plus = kotlin_kotlin.$_$.ca;
87
97
  var ArrayList_init_$Create$ = kotlin_kotlin.$_$.e;
88
98
  var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.v;
89
- var listOf = kotlin_kotlin.$_$.d3;
90
- var asList = kotlin_kotlin.$_$.a2;
91
- var plus_0 = kotlin_kotlin.$_$.v3;
92
- var collectionSizeOrDefault = kotlin_kotlin.$_$.g2;
93
- var toList = kotlin_kotlin.$_$.e4;
94
- var flatMap = kotlin_kotlin.$_$.b7;
95
- var asSequence = kotlin_kotlin.$_$.e2;
96
- var toList_0 = kotlin_kotlin.$_$.v7;
97
- var sequenceOf = kotlin_kotlin.$_$.o7;
98
- var asSequence_0 = kotlin_kotlin.$_$.f2;
99
- var plus_1 = kotlin_kotlin.$_$.n7;
100
- var Companion_instance_0 = kotlin_it_unibo_tuprolog_core.$_$.q;
99
+ var listOf = kotlin_kotlin.$_$.j3;
100
+ var asList = kotlin_kotlin.$_$.d2;
101
+ var plus_0 = kotlin_kotlin.$_$.c4;
102
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.j2;
103
+ var toList = kotlin_kotlin.$_$.l4;
104
+ var flatMap = kotlin_kotlin.$_$.k7;
105
+ var asSequence = kotlin_kotlin.$_$.h2;
106
+ var toList_0 = kotlin_kotlin.$_$.g8;
107
+ var sequenceOf = kotlin_kotlin.$_$.y7;
108
+ var asSequence_0 = kotlin_kotlin.$_$.i2;
109
+ var plus_1 = kotlin_kotlin.$_$.w7;
101
110
  var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.s;
102
- var Term = kotlin_it_unibo_tuprolog_core.$_$.j2;
103
- var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_core.$_$.l;
111
+ var Term = kotlin_it_unibo_tuprolog_core.$_$.q2;
104
112
  var Companion_getInstance_2 = kotlin_it_unibo_tuprolog_core.$_$.o;
105
- var NumberFormatException = kotlin_kotlin.$_$.e9;
113
+ var Companion_getInstance_3 = kotlin_it_unibo_tuprolog_core.$_$.r;
114
+ var NumberFormatException = kotlin_kotlin.$_$.s9;
106
115
  //endregion
107
116
  //region block: pre-declaration
108
117
  setMetadataFor(ParseException, 'ParseException', classMeta, TuPrologException);
109
118
  setMetadataFor(InvalidTermTypeException, 'InvalidTermTypeException', classMeta, ParseException);
110
119
  setMetadataFor(Companion, 'Companion', objectMeta);
120
+ function parseTerm(input) {
121
+ return this.parseTermWithOperators(input, this.b39());
122
+ }
123
+ function parseStructWithOperators(input, operators) {
124
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
125
+ // Inline function 'kotlin.let' call
126
+ // Inline function 'kotlin.contracts.contract' call
127
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
128
+ var it = this.parseTermWithOperators(input, operators);
129
+ var tmp0_elvis_lhs = isInterface(it, Struct) ? it : null;
130
+ var tmp;
131
+ if (tmp0_elvis_lhs == null) {
132
+ throw new InvalidTermTypeException(input, it, getKClass(Struct));
133
+ } else {
134
+ tmp = tmp0_elvis_lhs;
135
+ }
136
+ return tmp;
137
+ }
138
+ function parseStruct(input) {
139
+ return this.parseStructWithOperators(input, this.b39());
140
+ }
141
+ function parseConstantWithOperators(input, operators) {
142
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
143
+ // Inline function 'kotlin.let' call
144
+ // Inline function 'kotlin.contracts.contract' call
145
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
146
+ var it = this.parseTermWithOperators(input, operators);
147
+ var tmp0_elvis_lhs = isInterface(it, Constant) ? it : null;
148
+ var tmp;
149
+ if (tmp0_elvis_lhs == null) {
150
+ throw new InvalidTermTypeException(input, it, getKClass(Constant));
151
+ } else {
152
+ tmp = tmp0_elvis_lhs;
153
+ }
154
+ return tmp;
155
+ }
156
+ function parseConstant(input) {
157
+ return this.parseConstantWithOperators(input, this.b39());
158
+ }
159
+ function parseVarWithOperators(input, operators) {
160
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
161
+ // Inline function 'kotlin.let' call
162
+ // Inline function 'kotlin.contracts.contract' call
163
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
164
+ var it = this.parseTermWithOperators(input, operators);
165
+ var tmp0_elvis_lhs = isInterface(it, Var) ? it : null;
166
+ var tmp;
167
+ if (tmp0_elvis_lhs == null) {
168
+ throw new InvalidTermTypeException(input, it, getKClass(Var));
169
+ } else {
170
+ tmp = tmp0_elvis_lhs;
171
+ }
172
+ return tmp;
173
+ }
174
+ function parseVar(input) {
175
+ return this.parseVarWithOperators(input, this.b39());
176
+ }
177
+ function parseAtomWithOperators(input, operators) {
178
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
179
+ // Inline function 'kotlin.let' call
180
+ // Inline function 'kotlin.contracts.contract' call
181
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
182
+ var it = this.parseTermWithOperators(input, operators);
183
+ var tmp0_elvis_lhs = isInterface(it, Atom) ? it : null;
184
+ var tmp;
185
+ if (tmp0_elvis_lhs == null) {
186
+ throw new InvalidTermTypeException(input, it, getKClass(Atom));
187
+ } else {
188
+ tmp = tmp0_elvis_lhs;
189
+ }
190
+ return tmp;
191
+ }
192
+ function parseAtom(input) {
193
+ return this.parseAtomWithOperators(input, this.b39());
194
+ }
195
+ function parseNumericWithOperators(input, operators) {
196
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
197
+ // Inline function 'kotlin.let' call
198
+ // Inline function 'kotlin.contracts.contract' call
199
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
200
+ var it = this.parseTermWithOperators(input, operators);
201
+ var tmp0_elvis_lhs = isInterface(it, Numeric) ? it : null;
202
+ var tmp;
203
+ if (tmp0_elvis_lhs == null) {
204
+ throw new InvalidTermTypeException(input, it, getKClass(Numeric));
205
+ } else {
206
+ tmp = tmp0_elvis_lhs;
207
+ }
208
+ return tmp;
209
+ }
210
+ function parseNumeric(input) {
211
+ return this.parseNumericWithOperators(input, this.b39());
212
+ }
213
+ function parseIntegerWithOperators(input, operators) {
214
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
215
+ // Inline function 'kotlin.let' call
216
+ // Inline function 'kotlin.contracts.contract' call
217
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
218
+ var it = this.parseTermWithOperators(input, operators);
219
+ var tmp0_elvis_lhs = isInterface(it, Integer) ? it : null;
220
+ var tmp;
221
+ if (tmp0_elvis_lhs == null) {
222
+ throw new InvalidTermTypeException(input, it, getKClass(Integer));
223
+ } else {
224
+ tmp = tmp0_elvis_lhs;
225
+ }
226
+ return tmp;
227
+ }
228
+ function parseInteger(input) {
229
+ return this.parseIntegerWithOperators(input, this.b39());
230
+ }
231
+ function parseRealWithOperators(input, operators) {
232
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
233
+ // Inline function 'kotlin.let' call
234
+ // Inline function 'kotlin.contracts.contract' call
235
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
236
+ var it = this.parseTermWithOperators(input, operators);
237
+ var tmp0_elvis_lhs = isInterface(it, Real) ? it : null;
238
+ var tmp;
239
+ if (tmp0_elvis_lhs == null) {
240
+ throw new InvalidTermTypeException(input, it, getKClass(Real));
241
+ } else {
242
+ tmp = tmp0_elvis_lhs;
243
+ }
244
+ return tmp;
245
+ }
246
+ function parseReal(input) {
247
+ return this.parseRealWithOperators(input, this.b39());
248
+ }
249
+ function parseClauseWithOperators(input, operators) {
250
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
251
+ // Inline function 'kotlin.let' call
252
+ // Inline function 'kotlin.contracts.contract' call
253
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
254
+ var it = this.parseTermWithOperators(input, operators);
255
+ var tmp0_elvis_lhs = isInterface(it, Clause) ? it : null;
256
+ var tmp;
257
+ if (tmp0_elvis_lhs == null) {
258
+ throw new InvalidTermTypeException(input, it, getKClass(Clause));
259
+ } else {
260
+ tmp = tmp0_elvis_lhs;
261
+ }
262
+ return tmp;
263
+ }
264
+ function parseClause(input) {
265
+ return this.parseClauseWithOperators(input, this.b39());
266
+ }
267
+ function parseRuleWithOperators(input, operators) {
268
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
269
+ // Inline function 'kotlin.let' call
270
+ // Inline function 'kotlin.contracts.contract' call
271
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
272
+ var it = this.parseTermWithOperators(input, operators);
273
+ var tmp0_elvis_lhs = isInterface(it, Rule) ? it : null;
274
+ var tmp;
275
+ if (tmp0_elvis_lhs == null) {
276
+ throw new InvalidTermTypeException(input, it, getKClass(Rule));
277
+ } else {
278
+ tmp = tmp0_elvis_lhs;
279
+ }
280
+ return tmp;
281
+ }
282
+ function parseRule(input) {
283
+ return this.parseRuleWithOperators(input, this.b39());
284
+ }
285
+ function parseFactWithOperators(input, operators) {
286
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
287
+ // Inline function 'kotlin.let' call
288
+ // Inline function 'kotlin.contracts.contract' call
289
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
290
+ var it = this.parseTermWithOperators(input, operators);
291
+ var tmp0_elvis_lhs = isInterface(it, Fact) ? it : null;
292
+ var tmp;
293
+ if (tmp0_elvis_lhs == null) {
294
+ throw new InvalidTermTypeException(input, it, getKClass(Fact));
295
+ } else {
296
+ tmp = tmp0_elvis_lhs;
297
+ }
298
+ return tmp;
299
+ }
300
+ function parseFact(input) {
301
+ return this.parseFactWithOperators(input, this.b39());
302
+ }
303
+ function parseDirectiveWithOperators(input, operators) {
304
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
305
+ // Inline function 'kotlin.let' call
306
+ // Inline function 'kotlin.contracts.contract' call
307
+ // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
308
+ var it = this.parseTermWithOperators(input, operators);
309
+ var tmp0_elvis_lhs = isInterface(it, Directive) ? it : null;
310
+ var tmp;
311
+ if (tmp0_elvis_lhs == null) {
312
+ throw new InvalidTermTypeException(input, it, getKClass(Directive));
313
+ } else {
314
+ tmp = tmp0_elvis_lhs;
315
+ }
316
+ return tmp;
317
+ }
318
+ function parseDirective(input) {
319
+ return this.parseDirectiveWithOperators(input, this.b39());
320
+ }
321
+ setMetadataFor(TermParser, 'TermParser', interfaceMeta);
322
+ setMetadataFor(Companion_0, 'Companion', objectMeta);
111
323
  setMetadataFor(DynamicOpListener, 'DynamicOpListener', classMeta, PrologParserListener);
112
324
  setMetadataFor(PrologParserFactory$newErrorListener$1, VOID, classMeta);
113
325
  setMetadataFor(PrologParserFactory, 'PrologParserFactory', objectMeta);
114
326
  setMetadataFor(PrologVisitor, 'PrologVisitor', classMeta, PrologParserVisitor, VOID, PrologVisitor);
327
+ setMetadataFor(TermParserImpl, 'TermParserImpl', classMeta, VOID, [TermParser]);
115
328
  //endregion
116
329
  function InvalidTermTypeException(input, term, type, offendingSymbol, line, column, message, throwable) {
117
330
  var tmp;
@@ -124,12 +337,12 @@
124
337
  offendingSymbol = tmp;
125
338
  line = line === VOID ? 1 : line;
126
339
  column = column === VOID ? 1 : column;
127
- message = message === VOID ? 'Expected ' + type.n6() + ', got: ' + offendingSymbol : message;
340
+ message = message === VOID ? 'Expected ' + type.o6() + ', got: ' + offendingSymbol : message;
128
341
  throwable = throwable === VOID ? null : throwable;
129
342
  ParseException.call(this, input, offendingSymbol, line, column, message, throwable);
130
343
  captureStack(this, InvalidTermTypeException);
131
- this.f35_1 = term;
132
- this.g35_1 = type;
344
+ this.k38_1 = term;
345
+ this.l38_1 = type;
133
346
  }
134
347
  function ParseException(input, offendingSymbol, line, column, message, throwable) {
135
348
  TuPrologException_init_$Init$(message, throwable, this);
@@ -140,34 +353,34 @@
140
353
  this.column = column;
141
354
  this.clauseIndex = -1;
142
355
  }
143
- protoOf(ParseException).h35 = function (_set____db54di) {
356
+ protoOf(ParseException).m38 = function (_set____db54di) {
144
357
  this.input = _set____db54di;
145
358
  };
146
- protoOf(ParseException).i35 = function () {
359
+ protoOf(ParseException).n38 = function () {
147
360
  return this.input;
148
361
  };
149
- protoOf(ParseException).j35 = function (_set____db54di) {
362
+ protoOf(ParseException).o38 = function (_set____db54di) {
150
363
  this.offendingSymbol = _set____db54di;
151
364
  };
152
- protoOf(ParseException).k35 = function () {
365
+ protoOf(ParseException).p38 = function () {
153
366
  return this.offendingSymbol;
154
367
  };
155
- protoOf(ParseException).l35 = function (_set____db54di) {
368
+ protoOf(ParseException).q38 = function (_set____db54di) {
156
369
  this.line = _set____db54di;
157
370
  };
158
- protoOf(ParseException).m35 = function () {
371
+ protoOf(ParseException).r38 = function () {
159
372
  return this.line;
160
373
  };
161
- protoOf(ParseException).n35 = function (_set____db54di) {
374
+ protoOf(ParseException).s38 = function (_set____db54di) {
162
375
  this.column = _set____db54di;
163
376
  };
164
- protoOf(ParseException).o35 = function () {
377
+ protoOf(ParseException).t38 = function () {
165
378
  return this.column;
166
379
  };
167
- protoOf(ParseException).p35 = function (_set____db54di) {
380
+ protoOf(ParseException).u38 = function (_set____db54di) {
168
381
  this.clauseIndex = _set____db54di;
169
382
  };
170
- protoOf(ParseException).q35 = function () {
383
+ protoOf(ParseException).v38 = function () {
171
384
  return this.clauseIndex;
172
385
  };
173
386
  protoOf(ParseException).toString = function () {
@@ -180,17 +393,17 @@
180
393
  var tmp_2;
181
394
  var tmp_3;
182
395
  if (isInterface(_this__u8e3s4, Struct)) {
183
- tmp_3 = _this__u8e3s4.eu() === 3;
396
+ tmp_3 = _this__u8e3s4.tu() === 3;
184
397
  } else {
185
398
  tmp_3 = false;
186
399
  }
187
400
  if (tmp_3) {
188
- tmp_2 = _this__u8e3s4.ku() === 'op';
401
+ tmp_2 = _this__u8e3s4.zu() === 'op';
189
402
  } else {
190
403
  tmp_2 = false;
191
404
  }
192
405
  if (tmp_2) {
193
- tmp_1 = _this__u8e3s4.ov();
406
+ tmp_1 = _this__u8e3s4.dw();
194
407
  } else {
195
408
  tmp_1 = false;
196
409
  }
@@ -208,6 +421,49 @@
208
421
  }
209
422
  return tmp;
210
423
  }
424
+ function Companion() {
425
+ }
426
+ protoOf(Companion).w38 = function (scope) {
427
+ return this.x38(Companion_getInstance().EMPTY, scope);
428
+ };
429
+ protoOf(Companion).withNoOperator = function (scope, $super) {
430
+ scope = scope === VOID ? Companion_instance.empty() : scope;
431
+ return $super === VOID ? this.w38(scope) : $super.w38.call(this, scope);
432
+ };
433
+ protoOf(Companion).y38 = function (scope) {
434
+ return this.x38(Companion_getInstance().STANDARD, scope);
435
+ };
436
+ protoOf(Companion).withStandardOperators = function (scope, $super) {
437
+ scope = scope === VOID ? Companion_instance.empty() : scope;
438
+ return $super === VOID ? this.y38(scope) : $super.y38.call(this, scope);
439
+ };
440
+ protoOf(Companion).z38 = function (scope) {
441
+ return this.x38(Companion_getInstance().DEFAULT, scope);
442
+ };
443
+ protoOf(Companion).withDefaultOperators = function (scope, $super) {
444
+ scope = scope === VOID ? Companion_instance.empty() : scope;
445
+ return $super === VOID ? this.z38(scope) : $super.z38.call(this, scope);
446
+ };
447
+ protoOf(Companion).x38 = function (operators, scope) {
448
+ return termParserWithOperators(operators, scope);
449
+ };
450
+ protoOf(Companion).withOperatorSet = function (operators, scope, $super) {
451
+ scope = scope === VOID ? Companion_instance.empty() : scope;
452
+ return $super === VOID ? this.x38(operators, scope) : $super.x38.call(this, operators, scope);
453
+ };
454
+ protoOf(Companion).a39 = function (operators, scope) {
455
+ return this.x38(OperatorSet_init_$Create$(operators.slice()), scope);
456
+ };
457
+ protoOf(Companion).withOperators = function (operators, scope, $super) {
458
+ scope = scope === VOID ? Companion_instance.empty() : scope;
459
+ return $super === VOID ? this.a39(operators, scope) : $super.a39.call(this, operators, scope);
460
+ };
461
+ var Companion_instance_1;
462
+ function Companion_getInstance_4() {
463
+ return Companion_instance_1;
464
+ }
465
+ function TermParser() {
466
+ }
211
467
  function termToClause(_this__u8e3s4, source, line, column) {
212
468
  source = source === VOID ? null : source;
213
469
  line = line === VOID ? 0 : line;
@@ -217,13 +473,22 @@
217
473
  tmp = _this__u8e3s4;
218
474
  } else {
219
475
  if (isInterface(_this__u8e3s4, Struct)) {
220
- tmp = Companion_instance.of(_this__u8e3s4);
476
+ tmp = Companion_instance_0.of(_this__u8e3s4);
221
477
  } else {
222
478
  throw new InvalidTermTypeException(source, _this__u8e3s4, getKClass(Clause), VOID, line, column);
223
479
  }
224
480
  }
225
481
  return tmp;
226
482
  }
483
+ function parseStructWithOperators_0(_this__u8e3s4, input, operators) {
484
+ return get_defaultParser().parseStructWithOperators(input, operators);
485
+ }
486
+ function parseStruct_0(_this__u8e3s4, input) {
487
+ return get_defaultParser().parseStruct(input);
488
+ }
489
+ function get_defaultParser() {
490
+ return Companion_instance_1.withDefaultOperators();
491
+ }
227
492
  function toAssociativity(_this__u8e3s4) {
228
493
  return _this__u8e3s4.toString();
229
494
  }
@@ -231,27 +496,27 @@
231
496
  return Unit_instance;
232
497
  }
233
498
  function onOperatorDefined($this, operator) {
234
- $this.r35_1.addOperator(operator.g1g_1, toAssociativity(operator.h1g_1), operator.i1g_1);
235
- $this.s35_1($this.r35_1, operator);
499
+ $this.c39_1.addOperator(operator.a1h_1, toAssociativity(operator.b1h_1), operator.c1h_1);
500
+ $this.d39_1($this.c39_1, operator);
236
501
  }
237
- function Companion() {
502
+ function Companion_0() {
238
503
  }
239
- protoOf(Companion).t35 = function (parser) {
504
+ protoOf(Companion_0).e39 = function (parser) {
240
505
  return new DynamicOpListener(parser, DynamicOpListener$Companion$of$lambda);
241
506
  };
242
- var Companion_instance_1;
243
- function Companion_getInstance_3() {
244
- return Companion_instance_1;
507
+ var Companion_instance_2;
508
+ function Companion_getInstance_5() {
509
+ return Companion_instance_2;
245
510
  }
246
511
  function DynamicOpListener$exitClause$lambda(it) {
247
512
  return isInterface(it, Atom) ? it : THROW_CCE();
248
513
  }
249
514
  function DynamicOpListener(parser, operatorDefinedCallback) {
250
515
  PrologParserListener.call(this);
251
- this.r35_1 = parser;
252
- this.s35_1 = operatorDefinedCallback;
516
+ this.c39_1 = parser;
517
+ this.d39_1 = operatorDefinedCallback;
253
518
  }
254
- protoOf(DynamicOpListener).u35 = function (ctx) {
519
+ protoOf(DynamicOpListener).f39 = function (ctx) {
255
520
  var expr = ctx.expression();
256
521
  if (ctx.exception != null) {
257
522
  return Unit_instance;
@@ -273,26 +538,26 @@
273
538
  if (tmp) {
274
539
  var tmp_1 = ctx.accept(new PrologVisitor());
275
540
  var directive = isInterface(tmp_1, Directive) ? tmp_1 : THROW_CCE();
276
- var op = directive.rw();
541
+ var op = directive.gx();
277
542
  if (get_isOpDirective(op)) {
278
543
  // Inline function 'kotlin.math.min' call
279
544
  // Inline function 'kotlin.math.max' call
280
545
  var tmp_2 = (isInterface(op, Struct) ? op : THROW_CCE()).get(0);
281
- var b = (isInterface(tmp_2, Numeric) ? tmp_2 : THROW_CCE()).sy().toInt();
546
+ var b = (isInterface(tmp_2, Numeric) ? tmp_2 : THROW_CCE()).hz().toInt();
282
547
  var b_0 = Math.max(0, b);
283
548
  var priority = Math.min(1200, b_0);
284
- var specifier = Companion_getInstance().fromTerm(op.get(1));
549
+ var specifier = Companion_getInstance_0().fromTerm(op.get(1));
285
550
  var operator = op.get(2);
286
551
  if (isInterface(operator, Atom)) {
287
- onOperatorDefined(this, new Operator(operator.q2(), specifier, priority));
552
+ onOperatorDefined(this, new Operator(operator.r2(), specifier, priority));
288
553
  } else {
289
554
  if (isInterface(operator, List)) {
290
555
  var tmp$ret$3;
291
556
  $l$block: {
292
557
  // Inline function 'kotlin.sequences.all' call
293
- var tmp0_iterator = operator.at().o();
294
- while (tmp0_iterator.p()) {
295
- var element = tmp0_iterator.r();
558
+ var tmp0_iterator = operator.pt().r();
559
+ while (tmp0_iterator.s()) {
560
+ var element = tmp0_iterator.u();
296
561
  // Inline function 'it.unibo.tuprolog.core.parsing.DynamicOpListener.exitClause.<anonymous>' call
297
562
  if (!isInterface(element, Atom)) {
298
563
  tmp$ret$3 = false;
@@ -302,11 +567,11 @@
302
567
  tmp$ret$3 = true;
303
568
  }
304
569
  if (tmp$ret$3) {
305
- var tmp_3 = operator.at();
306
- var tmp2_iterator = map(tmp_3, DynamicOpListener$exitClause$lambda).o();
307
- while (tmp2_iterator.p()) {
308
- var it = tmp2_iterator.r();
309
- onOperatorDefined(this, new Operator(it.q2(), specifier, priority));
570
+ var tmp_3 = operator.pt();
571
+ var tmp2_iterator = map(tmp_3, DynamicOpListener$exitClause$lambda).r();
572
+ while (tmp2_iterator.s()) {
573
+ var it = tmp2_iterator.u();
574
+ onOperatorDefined(this, new Operator(it.r2(), specifier, priority));
310
575
  }
311
576
  }
312
577
  }
@@ -315,7 +580,7 @@
315
580
  }
316
581
  };
317
582
  protoOf(DynamicOpListener).exitClause = function (ctx) {
318
- return this.u35(ctx);
583
+ return this.f39(ctx);
319
584
  };
320
585
  function parseException(token, message) {
321
586
  return new ParseException(null, token.text, token.line, token.column, message, null);
@@ -332,10 +597,43 @@
332
597
  function newErrorListener($this, whileParsing) {
333
598
  return new PrologParserFactory$newErrorListener$1(whileParsing);
334
599
  }
335
- function parseClause($this, parserAndErrorStrategy, source) {
600
+ function parseExpression($this, parserAndErrorStrategy, source) {
601
+ var mark = -1;
602
+ var index = -1;
603
+ var parser = parserAndErrorStrategy.qd_1;
604
+ var tmp;
605
+ try {
606
+ mark = parser.getTokenStream().mark();
607
+ index = coerceAtLeast(parser.getTokenStream().index, 0);
608
+ tmp = parser.singletonExpression();
609
+ } catch ($p) {
610
+ var tmp_0;
611
+ var e = $p;
612
+ var tmp_1;
613
+ if (isParseCancellationException(e) ? parser._interp.predictionMode === PredictionMode.SLL : false) {
614
+ parser.getTokenStream().seek(index);
615
+ parser._interp.predictionMode = PredictionMode.LL;
616
+ parser._errHandler = parserAndErrorStrategy.rd_1;
617
+ parser.addErrorListener(newErrorListener($this, source));
618
+ tmp_1 = parseExpression($this, parserAndErrorStrategy, source);
619
+ } else if (e.clause !== null ? isRecognitionException(e.cause) : false) {
620
+ var tmp_2 = e.cause;
621
+ throw tmp_2 instanceof RecognitionException ? tmp_2 : THROW_CCE();
622
+ } else {
623
+ throw e instanceof Error ? e : THROW_CCE();
624
+ }
625
+ tmp_0 = tmp_1;
626
+ tmp = tmp_0;
627
+ }
628
+ finally {
629
+ parser.getTokenStream().release(mark);
630
+ }
631
+ return tmp;
632
+ }
633
+ function parseClause_0($this, parserAndErrorStrategy, source) {
336
634
  var mark = -1;
337
635
  var index = -1;
338
- var parser = parserAndErrorStrategy.md_1;
636
+ var parser = parserAndErrorStrategy.qd_1;
339
637
  var tmp;
340
638
  try {
341
639
  mark = parser.getTokenStream().mark();
@@ -348,9 +646,9 @@
348
646
  if (isParseCancellationException(e) ? parser._interp.predictionMode === PredictionMode.SLL : false) {
349
647
  parser.getTokenStream().seek(index);
350
648
  parser._interp.predictionMode = PredictionMode.LL;
351
- parser._errHandler = parserAndErrorStrategy.nd_1;
649
+ parser._errHandler = parserAndErrorStrategy.rd_1;
352
650
  parser.addErrorListener(newErrorListener($this, source));
353
- tmp_1 = parseClause($this, parserAndErrorStrategy, source);
651
+ tmp_1 = parseClause_0($this, parserAndErrorStrategy, source);
354
652
  } else if (e.clause !== null ? isRecognitionException(e.cause) : false) {
355
653
  var tmp_2 = e.cause;
356
654
  throw tmp_2 instanceof RecognitionException ? tmp_2 : THROW_CCE();
@@ -372,13 +670,13 @@
372
670
  return map(tmp_1, PrologParserFactory$parseClauses$lambda_2);
373
671
  }
374
672
  function PrologParserFactory$newErrorListener$1($whileParsing) {
375
- this.v35_1 = $whileParsing;
673
+ this.g39_1 = $whileParsing;
376
674
  }
377
675
  protoOf(PrologParserFactory$newErrorListener$1).syntaxError = function (recognizer, offendingSymbol, line, column, msg, e) {
378
676
  if (recognizer instanceof PrologParser) {
379
677
  recognizer.removeParseListeners();
380
678
  }
381
- throw new ParseException(this.v35_1, symbolToString(this, offendingSymbol), line, column + 1 | 0, msg, e);
679
+ throw new ParseException(this.g39_1, symbolToString(this, offendingSymbol), line, column + 1 | 0, msg, e);
382
680
  };
383
681
  function PrologParserFactory$parseClauses$lambda(it) {
384
682
  return it + 1 | 0;
@@ -387,7 +685,7 @@
387
685
  return function (it) {
388
686
  var tmp;
389
687
  try {
390
- tmp = parseClause(PrologParserFactory_instance, $parser, $source);
688
+ tmp = parseClause_0(PrologParserFactory_instance, $parser, $source);
391
689
  } catch ($p) {
392
690
  var tmp_0;
393
691
  if ($p instanceof ParseException) {
@@ -409,11 +707,15 @@
409
707
  }
410
708
  function PrologParserFactory() {
411
709
  }
412
- protoOf(PrologParserFactory).w35 = function (source, withOperators) {
413
- var parser = this.x35(source, withOperators);
710
+ protoOf(PrologParserFactory).h39 = function (string, withOperators) {
711
+ var parser = this.i39(string, withOperators);
712
+ return parseExpression(this, parser, string);
713
+ };
714
+ protoOf(PrologParserFactory).j39 = function (source, withOperators) {
715
+ var parser = this.i39(source, withOperators);
414
716
  return parseClauses(this, parser, source);
415
717
  };
416
- protoOf(PrologParserFactory).x35 = function (source, operators) {
718
+ protoOf(PrologParserFactory).i39 = function (source, operators) {
417
719
  var stream = new InputStream(source);
418
720
  var lexer = new PrologLexer(stream);
419
721
  lexer.removeErrorListeners();
@@ -423,24 +725,24 @@
423
725
  var originalErrorStrategy = parser._errHandler;
424
726
  parser._errHandler = new BailErrorStrategy();
425
727
  parser._interp.predictionMode = PredictionMode.SLL;
426
- return to(this.y35(parser, operators), originalErrorStrategy);
728
+ return to(this.k39(parser, operators), originalErrorStrategy);
427
729
  };
428
- protoOf(PrologParserFactory).y35 = function (prologParser, operators) {
730
+ protoOf(PrologParserFactory).k39 = function (prologParser, operators) {
429
731
  // Inline function 'kotlin.collections.forEach' call
430
- var tmp0_iterator = operators.o();
431
- while (tmp0_iterator.p()) {
432
- var element = tmp0_iterator.r();
732
+ var tmp0_iterator = operators.r();
733
+ while (tmp0_iterator.s()) {
734
+ var element = tmp0_iterator.u();
433
735
  // Inline function 'it.unibo.tuprolog.core.parsing.PrologParserFactory.addOperators.<anonymous>' call
434
- prologParser.addOperator(element.g1g_1, toAssociativity(element.h1g_1), element.i1g_1);
736
+ prologParser.addOperator(element.a1h_1, toAssociativity(element.b1h_1), element.c1h_1);
435
737
  }
436
- prologParser.addParseListener(Companion_instance_1.t35(prologParser));
738
+ prologParser.addParseListener(Companion_instance_2.e39(prologParser));
437
739
  return prologParser;
438
740
  };
439
741
  var PrologParserFactory_instance;
440
742
  function PrologParserFactory_getInstance() {
441
743
  return PrologParserFactory_instance;
442
744
  }
443
- function parseInteger($this, ctx) {
745
+ function parseInteger_0($this, ctx) {
444
746
  var str = ctx.value.text;
445
747
  var base;
446
748
  var clean;
@@ -467,7 +769,7 @@
467
769
  throw parseException(ctx.value, 'Invalid character literal: ' + ctx.value.text);
468
770
  }
469
771
  // Inline function 'kotlin.with' call
470
- var tmp = Companion_getInstance_0();
772
+ var tmp = Companion_getInstance_1();
471
773
  // Inline function 'kotlin.code' call
472
774
  var this_0 = charSequenceGet(clean, 0);
473
775
  var tmp$ret$8 = Char__toInt_impl_vasixd(this_0);
@@ -492,7 +794,7 @@
492
794
  var tmp0_safe_receiver_0 = ctx.sign;
493
795
  clean = plus(tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.text, clean);
494
796
  }
495
- return Companion_getInstance_0().parseWithRadix(clean, base);
797
+ return Companion_getInstance_1().parseWithRadix(clean, base);
496
798
  }
497
799
  function visitPostfixExpression($this, ctx) {
498
800
  var tmp0_safe_receiver = ctx.left;
@@ -508,15 +810,15 @@
508
810
  inductionVariable = inductionVariable + 1 | 0;
509
811
  // Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.visitPostfixExpression.<anonymous>' call
510
812
  var tmp$ret$0 = item.symbol.text;
511
- destination.l(tmp$ret$0);
813
+ destination.o(tmp$ret$0);
512
814
  }
513
815
  return postfix($this, tmp, destination);
514
816
  }
515
817
  function postfix($this, term, ops) {
516
- var operator = ops.o();
517
- var result = $this.z35_1.structOf(operator.r(), [term]);
518
- while (operator.p()) {
519
- result = $this.z35_1.structOf(operator.r(), [result]);
818
+ var operator = ops.r();
819
+ var result = $this.l39_1.structOf(operator.u(), [term]);
820
+ while (operator.s()) {
821
+ result = $this.l39_1.structOf(operator.u(), [result]);
520
822
  }
521
823
  return result;
522
824
  }
@@ -533,17 +835,17 @@
533
835
  inductionVariable = inductionVariable + 1 | 0;
534
836
  // Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.visitPrefixExpression.<anonymous>' call
535
837
  var tmp$ret$0 = item.symbol.text;
536
- destination.l(tmp$ret$0);
838
+ destination.o(tmp$ret$0);
537
839
  }
538
840
  return prefix($this, tmp, destination);
539
841
  }
540
842
  function prefix($this, term, ops) {
541
- var i = ops.u() - 1 | 0;
843
+ var i = ops.l() - 1 | 0;
542
844
  var tmp0 = i;
543
845
  i = tmp0 - 1 | 0;
544
- var result = $this.z35_1.structOf(ops.a1(tmp0), [term]);
846
+ var result = $this.l39_1.structOf(ops.d1(tmp0), [term]);
545
847
  while (i >= 0) {
546
- result = $this.z35_1.structOf(ops.a1(i), [result]);
848
+ result = $this.l39_1.structOf(ops.d1(i), [result]);
547
849
  i = i - 1 | 0;
548
850
  }
549
851
  return result;
@@ -568,12 +870,12 @@
568
870
  var this_0 = plus_0(listOf(ensureNotNull(ctx.left)), asList(ctx.right));
569
871
  // Inline function 'kotlin.collections.mapTo' call
570
872
  var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
571
- var tmp0_iterator = this_0.o();
572
- while (tmp0_iterator.p()) {
573
- var item = tmp0_iterator.r();
873
+ var tmp0_iterator = this_0.r();
874
+ while (tmp0_iterator.s()) {
875
+ var item = tmp0_iterator.u();
574
876
  // Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.visitInfixNonAssociativeExpression.<anonymous>' call
575
877
  var tmp$ret$0 = item.accept($this);
576
- destination.l(tmp$ret$0);
878
+ destination.o(tmp$ret$0);
577
879
  }
578
880
  var operands = destination;
579
881
  // Inline function 'kotlin.collections.map' call
@@ -587,19 +889,19 @@
587
889
  inductionVariable = inductionVariable + 1 | 0;
588
890
  // Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.visitInfixNonAssociativeExpression.<anonymous>' call
589
891
  var tmp$ret$3 = item_0.symbol.text;
590
- destination_0.l(tmp$ret$3);
892
+ destination_0.o(tmp$ret$3);
591
893
  }
592
894
  var operators = destination_0;
593
895
  return infixNonAssociative($this, operands, operators);
594
896
  }
595
897
  function infixNonAssociative($this, terms, ops) {
596
- return $this.z35_1.structOf(ops.a1(0), [terms.a1(0), terms.a1(1)]);
898
+ return $this.l39_1.structOf(ops.d1(0), [terms.d1(0), terms.d1(1)]);
597
899
  }
598
900
  function handleOuters($this, expression, outers) {
599
901
  var result = expression;
600
- var tmp0_iterator = outers.o();
601
- while (tmp0_iterator.p()) {
602
- var o = tmp0_iterator.r();
902
+ var tmp0_iterator = outers.r();
903
+ while (tmp0_iterator.s()) {
904
+ var o = tmp0_iterator.u();
603
905
  var tmp = listOf(result);
604
906
  // Inline function 'kotlin.collections.map' call
605
907
  var this_0 = o.right;
@@ -612,7 +914,7 @@
612
914
  inductionVariable = inductionVariable + 1 | 0;
613
915
  // Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.handleOuters.<anonymous>' call
614
916
  var tmp$ret$0 = item.accept($this);
615
- destination.l(tmp$ret$0);
917
+ destination.o(tmp$ret$0);
616
918
  }
617
919
  var operands = plus_0(tmp, destination);
618
920
  // Inline function 'kotlin.collections.map' call
@@ -626,7 +928,7 @@
626
928
  inductionVariable_0 = inductionVariable_0 + 1 | 0;
627
929
  // Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.handleOuters.<anonymous>' call
628
930
  var tmp$ret$3 = item_0.symbol.text;
629
- destination_0.l(tmp$ret$3);
931
+ destination_0.o(tmp$ret$3);
630
932
  }
631
933
  var operators = destination_0;
632
934
  var associativity = o.associativity;
@@ -650,16 +952,16 @@
650
952
  return result;
651
953
  }
652
954
  function infixRight($this, terms, ops) {
653
- var i = terms.u() - 1 | 0;
654
- var j = ops.u() - 1 | 0;
955
+ var i = terms.l() - 1 | 0;
956
+ var j = ops.l() - 1 | 0;
655
957
  var tmp0 = j;
656
958
  j = tmp0 - 1 | 0;
657
- var result = $this.z35_1.structOf(ops.a1(tmp0), [terms.a1(i - 1 | 0), terms.a1(i)]);
959
+ var result = $this.l39_1.structOf(ops.d1(tmp0), [terms.d1(i - 1 | 0), terms.d1(i)]);
658
960
  i = i - 2 | 0;
659
961
  while (i >= 0) {
660
962
  var tmp1 = j;
661
963
  j = tmp1 - 1 | 0;
662
- result = $this.z35_1.structOf(ops.a1(tmp1), [terms.a1(i), result]);
964
+ result = $this.l39_1.structOf(ops.d1(tmp1), [terms.d1(i), result]);
663
965
  i = i - 1 | 0;
664
966
  }
665
967
  return result;
@@ -669,17 +971,17 @@
669
971
  var j = 0;
670
972
  var tmp0 = j;
671
973
  j = tmp0 + 1 | 0;
672
- var tmp = ops.a1(tmp0);
974
+ var tmp = ops.d1(tmp0);
673
975
  var tmp1 = i;
674
976
  i = tmp1 + 1 | 0;
675
- var tmp_0 = terms.a1(tmp1);
977
+ var tmp_0 = terms.d1(tmp1);
676
978
  var tmp2 = i;
677
979
  i = tmp2 + 1 | 0;
678
- var result = $this.z35_1.structOf(tmp, [tmp_0, terms.a1(tmp2)]);
679
- while (i < terms.u()) {
980
+ var result = $this.l39_1.structOf(tmp, [tmp_0, terms.d1(tmp2)]);
981
+ while (i < terms.l()) {
680
982
  var tmp3 = j;
681
983
  j = tmp3 + 1 | 0;
682
- result = $this.z35_1.structOf(ops.a1(tmp3), [result, terms.a1(i)]);
984
+ result = $this.l39_1.structOf(ops.d1(tmp3), [result, terms.d1(i)]);
683
985
  i = i + 1 | 0;
684
986
  }
685
987
  return result;
@@ -689,12 +991,12 @@
689
991
  var this_0 = plus_0(listOf(ctx.left), toList(ctx.right));
690
992
  // Inline function 'kotlin.collections.mapTo' call
691
993
  var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
692
- var tmp0_iterator = this_0.o();
693
- while (tmp0_iterator.p()) {
694
- var item = tmp0_iterator.r();
994
+ var tmp0_iterator = this_0.r();
995
+ while (tmp0_iterator.s()) {
996
+ var item = tmp0_iterator.u();
695
997
  // Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.listOfOperands.<anonymous>' call
696
998
  var tmp$ret$0 = ensureNotNull(item).accept($this);
697
- destination.l(tmp$ret$0);
999
+ destination.o(tmp$ret$0);
698
1000
  }
699
1001
  return destination;
700
1002
  }
@@ -710,7 +1012,7 @@
710
1012
  inductionVariable = inductionVariable + 1 | 0;
711
1013
  // Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.listOfOperators.<anonymous>' call
712
1014
  var tmp$ret$0 = item.symbol.text;
713
- destination.l(tmp$ret$0);
1015
+ destination.o(tmp$ret$0);
714
1016
  }
715
1017
  return destination;
716
1018
  }
@@ -730,7 +1032,7 @@
730
1032
  }
731
1033
  function PrologVisitor$visitExpression$ref($boundThis) {
732
1034
  var l = function (p0) {
733
- return $boundThis.a36(p0);
1035
+ return $boundThis.m39(p0);
734
1036
  };
735
1037
  l.callableName = 'visitExpression';
736
1038
  return l;
@@ -741,32 +1043,32 @@
741
1043
  };
742
1044
  }
743
1045
  function PrologVisitor(scope) {
744
- scope = scope === VOID ? Companion_instance_0.empty() : scope;
1046
+ scope = scope === VOID ? Companion_instance.empty() : scope;
745
1047
  PrologParserVisitor.call(this);
746
- this.z35_1 = scope;
1048
+ this.l39_1 = scope;
747
1049
  }
748
- protoOf(PrologVisitor).b36 = function (ctx) {
749
- return this.c36(ctx.term());
1050
+ protoOf(PrologVisitor).n39 = function (ctx) {
1051
+ return this.o39(ctx.term());
750
1052
  };
751
1053
  protoOf(PrologVisitor).visitSingletonTerm = function (ctx) {
752
- return this.b36(ctx);
1054
+ return this.n39(ctx);
753
1055
  };
754
- protoOf(PrologVisitor).d36 = function (ctx) {
755
- return this.a36(ctx.expression());
1056
+ protoOf(PrologVisitor).p39 = function (ctx) {
1057
+ return this.m39(ctx.expression());
756
1058
  };
757
1059
  protoOf(PrologVisitor).visitSingletonExpression = function (ctx) {
758
- return this.d36(ctx);
1060
+ return this.p39(ctx);
759
1061
  };
760
- protoOf(PrologVisitor).e36 = function (ctx) {
1062
+ protoOf(PrologVisitor).q39 = function (ctx) {
761
1063
  return termToClause(ctx.expression().accept(this), null, ensureNotNull(ctx.start).line, ensureNotNull(ctx.start).column);
762
1064
  };
763
1065
  protoOf(PrologVisitor).visitClause = function (ctx) {
764
- return this.e36(ctx);
1066
+ return this.q39(ctx);
765
1067
  };
766
- protoOf(PrologVisitor).a36 = function (ctx) {
1068
+ protoOf(PrologVisitor).m39 = function (ctx) {
767
1069
  var tmp;
768
1070
  if (ctx.isTerm) {
769
- tmp = this.c36(ensureNotNull(ctx.left));
1071
+ tmp = this.o39(ensureNotNull(ctx.left));
770
1072
  } else if (contains(Associativity.INFIX, ctx.associativity)) {
771
1073
  tmp = visitInfixExpression(this, ctx);
772
1074
  } else if (contains(Associativity.POSTFIX, ctx.associativity)) {
@@ -779,12 +1081,12 @@
779
1081
  return handleOuters(this, tmp, flatten_0(this, asList(ctx.outers)));
780
1082
  };
781
1083
  protoOf(PrologVisitor).visitExpression = function (ctx) {
782
- return this.a36(ctx);
1084
+ return this.m39(ctx);
783
1085
  };
784
- protoOf(PrologVisitor).c36 = function (ctx) {
1086
+ protoOf(PrologVisitor).o39 = function (ctx) {
785
1087
  var tmp;
786
1088
  if (ctx.isExpr) {
787
- tmp = this.a36(ctx.expression());
1089
+ tmp = this.m39(ctx.expression());
788
1090
  } else {
789
1091
  var tmp_0 = ctx.children[0].accept(this);
790
1092
  tmp = (!(tmp_0 == null) ? isInterface(tmp_0, Term) : false) ? tmp_0 : THROW_CCE();
@@ -792,23 +1094,23 @@
792
1094
  return tmp;
793
1095
  };
794
1096
  protoOf(PrologVisitor).visitTerm = function (ctx) {
795
- return this.c36(ctx);
1097
+ return this.o39(ctx);
796
1098
  };
797
- protoOf(PrologVisitor).f36 = function (ctx) {
798
- var value = parseInteger(this, ctx);
799
- return Companion_getInstance_1().ofBigInteger(value);
1099
+ protoOf(PrologVisitor).r39 = function (ctx) {
1100
+ var value = parseInteger_0(this, ctx);
1101
+ return Companion_getInstance_2().ofBigInteger(value);
800
1102
  };
801
1103
  protoOf(PrologVisitor).visitInteger = function (ctx) {
802
- return this.f36(ctx);
1104
+ return this.r39(ctx);
803
1105
  };
804
- protoOf(PrologVisitor).g36 = function (ctx) {
1106
+ protoOf(PrologVisitor).s39 = function (ctx) {
805
1107
  var tmp = ctx.children[0].accept(this);
806
1108
  return (!(tmp == null) ? isInterface(tmp, Term) : false) ? tmp : THROW_CCE();
807
1109
  };
808
1110
  protoOf(PrologVisitor).visitNumber = function (ctx) {
809
- return this.g36(ctx);
1111
+ return this.s39(ctx);
810
1112
  };
811
- protoOf(PrologVisitor).h36 = function (ctx) {
1113
+ protoOf(PrologVisitor).t39 = function (ctx) {
812
1114
  var raw = ctx.value.text;
813
1115
  if (!(ctx.sign == null)) {
814
1116
  var tmp0_safe_receiver = ctx.sign;
@@ -816,7 +1118,7 @@
816
1118
  }
817
1119
  var tmp;
818
1120
  try {
819
- tmp = Companion_getInstance_2().parse(raw);
1121
+ tmp = Companion_getInstance_3().parse(raw);
820
1122
  } catch ($p) {
821
1123
  var tmp_0;
822
1124
  if ($p instanceof NumberFormatException) {
@@ -829,39 +1131,39 @@
829
1131
  return tmp;
830
1132
  };
831
1133
  protoOf(PrologVisitor).visitReal = function (ctx) {
832
- return this.h36(ctx);
1134
+ return this.t39(ctx);
833
1135
  };
834
- protoOf(PrologVisitor).i36 = function (ctx) {
1136
+ protoOf(PrologVisitor).u39 = function (ctx) {
835
1137
  var tmp;
836
1138
  if (ctx.isAnonymous) {
837
- tmp = this.z35_1.anonymous();
1139
+ tmp = this.l39_1.anonymous();
838
1140
  } else {
839
- tmp = this.z35_1.varOf(ctx.value.text);
1141
+ tmp = this.l39_1.varOf(ctx.value.text);
840
1142
  }
841
1143
  return tmp;
842
1144
  };
843
1145
  protoOf(PrologVisitor).visitVariable = function (ctx) {
844
- return this.i36(ctx);
1146
+ return this.u39(ctx);
845
1147
  };
846
- protoOf(PrologVisitor).j36 = function (ctx) {
1148
+ protoOf(PrologVisitor).v39 = function (ctx) {
847
1149
  var tmp;
848
1150
  if (ctx.isList) {
849
- tmp = this.z35_1.logicListOf([]);
1151
+ tmp = this.l39_1.logicListOf([]);
850
1152
  } else if (ctx.isBlock) {
851
- tmp = this.z35_1.blockOf([]);
1153
+ tmp = this.l39_1.blockOf([]);
852
1154
  } else if (ctx.arity === 0) {
853
- tmp = this.z35_1.atomOf(ctx.functor.text);
1155
+ tmp = this.l39_1.atomOf(ctx.functor.text);
854
1156
  } else {
855
1157
  var tmp_0 = ctx.functor.text;
856
1158
  var tmp_1 = asSequence_0(ctx.args);
857
- tmp = this.z35_1.structOfSequence(tmp_0, map(tmp_1, PrologVisitor$visitExpression$ref(this)));
1159
+ tmp = this.l39_1.structOfSequence(tmp_0, map(tmp_1, PrologVisitor$visitExpression$ref(this)));
858
1160
  }
859
1161
  return tmp;
860
1162
  };
861
1163
  protoOf(PrologVisitor).visitStructure = function (ctx) {
862
- return this.j36(ctx);
1164
+ return this.v39(ctx);
863
1165
  };
864
- protoOf(PrologVisitor).k36 = function (ctx) {
1166
+ protoOf(PrologVisitor).w39 = function (ctx) {
865
1167
  // Inline function 'kotlin.collections.map' call
866
1168
  var this_0 = ctx.items;
867
1169
  // Inline function 'kotlin.collections.mapTo' call
@@ -871,26 +1173,26 @@
871
1173
  while (inductionVariable < last) {
872
1174
  var item = this_0[inductionVariable];
873
1175
  inductionVariable = inductionVariable + 1 | 0;
874
- var tmp$ret$0 = this.a36(item);
875
- destination.l(tmp$ret$0);
1176
+ var tmp$ret$0 = this.m39(item);
1177
+ destination.o(tmp$ret$0);
876
1178
  }
877
1179
  var terms = destination;
878
1180
  var tmp;
879
1181
  if (ctx.hasTail) {
880
1182
  var tmp0_safe_receiver = ctx.tail;
881
- tmp = this.z35_1.b10(terms, tmp0_safe_receiver == null ? null : tmp0_safe_receiver.accept(this));
1183
+ tmp = this.l39_1.q10(terms, tmp0_safe_receiver == null ? null : tmp0_safe_receiver.accept(this));
882
1184
  } else {
883
- tmp = this.z35_1.logicListOfIterable(terms);
1185
+ tmp = this.l39_1.logicListOfIterable(terms);
884
1186
  }
885
1187
  return tmp;
886
1188
  };
887
1189
  protoOf(PrologVisitor).visitList = function (ctx) {
888
- return this.k36(ctx);
1190
+ return this.w39(ctx);
889
1191
  };
890
- protoOf(PrologVisitor).l36 = function (ctx) {
1192
+ protoOf(PrologVisitor).x39 = function (ctx) {
891
1193
  var tmp;
892
1194
  if (ctx.length === 1) {
893
- tmp = this.z35_1.blockOf([ctx.items[0].accept(this)]);
1195
+ tmp = this.l39_1.blockOf([ctx.items[0].accept(this)]);
894
1196
  } else {
895
1197
  // Inline function 'kotlin.collections.map' call
896
1198
  var this_0 = ctx.items;
@@ -901,25 +1203,70 @@
901
1203
  while (inductionVariable < last) {
902
1204
  var item = this_0[inductionVariable];
903
1205
  inductionVariable = inductionVariable + 1 | 0;
904
- var tmp$ret$0 = this.a36(item);
905
- destination.l(tmp$ret$0);
1206
+ var tmp$ret$0 = this.m39(item);
1207
+ destination.o(tmp$ret$0);
906
1208
  }
907
- tmp = this.z35_1.blockOfIterable(destination);
1209
+ tmp = this.l39_1.blockOfIterable(destination);
908
1210
  }
909
1211
  return tmp;
910
1212
  };
911
1213
  protoOf(PrologVisitor).visitBlock = function (ctx) {
912
- return this.l36(ctx);
1214
+ return this.x39(ctx);
1215
+ };
1216
+ function termParserWithOperators(operators, scope) {
1217
+ scope = scope === VOID ? Companion_instance.empty() : scope;
1218
+ return new TermParserImpl(scope, operators);
1219
+ }
1220
+ function TermParserImpl(scope, defaultOperatorSet) {
1221
+ this.y39_1 = scope;
1222
+ this.z39_1 = defaultOperatorSet;
1223
+ }
1224
+ protoOf(TermParserImpl).b39 = function () {
1225
+ return this.z39_1;
913
1226
  };
1227
+ protoOf(TermParserImpl).a3a = function (input, operators) {
1228
+ return PrologParserFactory_instance.h39(input, operators).accept(new PrologVisitor(this.y39_1));
1229
+ };
1230
+ protoOf(TermParserImpl).parseTermWithOperators = function (input, operators) {
1231
+ return this.a3a(input, operators);
1232
+ };
1233
+ //region block: post-declaration
1234
+ protoOf(TermParserImpl).parseTerm = parseTerm;
1235
+ protoOf(TermParserImpl).parseStructWithOperators = parseStructWithOperators;
1236
+ protoOf(TermParserImpl).parseStruct = parseStruct;
1237
+ protoOf(TermParserImpl).parseConstantWithOperators = parseConstantWithOperators;
1238
+ protoOf(TermParserImpl).parseConstant = parseConstant;
1239
+ protoOf(TermParserImpl).parseVarWithOperators = parseVarWithOperators;
1240
+ protoOf(TermParserImpl).parseVar = parseVar;
1241
+ protoOf(TermParserImpl).parseAtomWithOperators = parseAtomWithOperators;
1242
+ protoOf(TermParserImpl).parseAtom = parseAtom;
1243
+ protoOf(TermParserImpl).parseNumericWithOperators = parseNumericWithOperators;
1244
+ protoOf(TermParserImpl).parseNumeric = parseNumeric;
1245
+ protoOf(TermParserImpl).parseIntegerWithOperators = parseIntegerWithOperators;
1246
+ protoOf(TermParserImpl).parseInteger = parseInteger;
1247
+ protoOf(TermParserImpl).parseRealWithOperators = parseRealWithOperators;
1248
+ protoOf(TermParserImpl).parseReal = parseReal;
1249
+ protoOf(TermParserImpl).parseClauseWithOperators = parseClauseWithOperators;
1250
+ protoOf(TermParserImpl).parseClause = parseClause;
1251
+ protoOf(TermParserImpl).parseRuleWithOperators = parseRuleWithOperators;
1252
+ protoOf(TermParserImpl).parseRule = parseRule;
1253
+ protoOf(TermParserImpl).parseFactWithOperators = parseFactWithOperators;
1254
+ protoOf(TermParserImpl).parseFact = parseFact;
1255
+ protoOf(TermParserImpl).parseDirectiveWithOperators = parseDirectiveWithOperators;
1256
+ protoOf(TermParserImpl).parseDirective = parseDirective;
1257
+ //endregion
914
1258
  //region block: init
915
1259
  Companion_instance_1 = new Companion();
1260
+ Companion_instance_2 = new Companion_0();
916
1261
  PrologParserFactory_instance = new PrologParserFactory();
917
1262
  //endregion
918
1263
  //region block: exports
919
1264
  _.$_$ = _.$_$ || {};
920
1265
  _.$_$.a = PrologParserFactory_instance;
921
1266
  _.$_$.b = PrologVisitor;
922
- _.$_$.c = termToClause;
1267
+ _.$_$.c = parseStruct_0;
1268
+ _.$_$.d = parseStructWithOperators_0;
1269
+ _.$_$.e = termToClause;
923
1270
  //endregion
924
1271
  return _;
925
1272
  }));