From 3b35064d28382b66bdbe481baca9d80cc059dc42 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Tue, 25 Jul 2017 15:09:28 +0200 Subject: Fixes issues with "_". things seem to work now. --- instr-to-kodkod/parser/PropertyParser.g4 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'instr-to-kodkod') 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 columns; + final List columns; final int params_length; ids = new ArrayList(); - columns = new ArrayList(); + columns = new ArrayList(); 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 columns; + final List columns; final int params_length; ids = new ArrayList(); - columns = new ArrayList(); + columns = new ArrayList(); 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 -- cgit v1.2.3-70-g09d2