summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-07-25 15:09:28 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-07-25 15:09:28 +0200
commit3b35064d28382b66bdbe481baca9d80cc059dc42 (patch)
treec625327c6ab3c7487a42f5438b2e06487bba6eb5 /instr-to-kodkod/parser/PropertyParser.g4
parent97439a89b5439ce120e5bc2814251ce9dc513ce0 (diff)
Fixes issues with "_". things seem to work now.
Diffstat (limited to 'instr-to-kodkod/parser/PropertyParser.g4')
-rw-r--r--instr-to-kodkod/parser/PropertyParser.g415
1 files changed, 9 insertions, 6 deletions
diff --git a/instr-to-kodkod/parser/PropertyParser.g4 b/instr-to-kodkod/parser/PropertyParser.g4
index 4542130..70e672f 100644
--- a/instr-to-kodkod/parser/PropertyParser.g4
+++ b/instr-to-kodkod/parser/PropertyParser.g4
@@ -189,11 +189,11 @@ sl_predicate
if (($id_list.has_joker))
{
- final List<IntConstant> columns;
+ final List<IntExpression> columns;
final int params_length;
ids = new ArrayList<Variable>();
- columns = new ArrayList<IntConstant>();
+ columns = new ArrayList<IntExpression>();
params_length = ($id_list.list).size();
@@ -209,7 +209,7 @@ sl_predicate
predicate =
predicate_as_relation.project
(
- (IntExpression[]) columns.toArray()
+ columns.toArray(new IntExpression[columns.size()])
);
}
else
@@ -526,14 +526,17 @@ bl_predicate [Variable current_node]
if (($id_list.has_joker))
{
- final List<IntConstant> columns;
+ final List<IntExpression> columns;
final int params_length;
ids = new ArrayList<Variable>();
- columns = new ArrayList<IntConstant>();
+ columns = new ArrayList<IntExpression>();
params_length = ($id_list.list).size();
+ /* We always keep the node id. */
+ columns.add(IntConstant.constant(0));
+
for (int i = 0; i < params_length; ++i)
{
if (($id_list.list).get(i) != (Variable) null)
@@ -546,7 +549,7 @@ bl_predicate [Variable current_node]
predicate =
predicate_as_relation.project
(
- (IntExpression[]) columns.toArray()
+ columns.toArray(new IntExpression[columns.size()])
);
}
else