File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
java/com/dat3m/dartagnan/parsers/cat Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,8 @@ expression
5353 | (TOID LPAR e = expression RPAR | LBRAC e = expression RBRAC ) # exprIdentity
5454 | LPAR e = expression RPAR # expr
5555 | n = NAME # exprBasic
56- | call = NEW LPAR RPAR # exprNew
56+ | NEW_SET LPAR RPAR # exprNewSet
57+ | NEW_RELATION LPAR RPAR # exprNewRelation
5758 | call = NAME LPAR args = argumentList RPAR # exprCall
5859 ;
5960
@@ -103,9 +104,10 @@ LBRAC : '[';
103104RBRAC : ' ]' ;
104105COMMA : ' ,' ;
105106
106- DOMAIN : ' domain' ;
107- RANGE : ' range' ;
108- NEW : ' [n|N]ew' ;
107+ DOMAIN : ' domain' ;
108+ RANGE : ' range' ;
109+ NEW_SET : ' newSet' ;
110+ NEW_RELATION : ' newRelation' ;
109111
110112FLAG : ' flag' ;
111113UNDEFINED : ' undefined_unless' ;
Original file line number Diff line number Diff line change @@ -203,9 +203,13 @@ public Object visitExpr(ExprContext ctx) {
203203 }
204204
205205 @ Override
206- public Object visitExprNew (ExprNewContext ctx ) {
207- final boolean unary = ctx .call .getText ().equals ("New" );
208- return addDefinition (new Free (wmm .newRelation (unary ? Relation .Arity .UNARY : Relation .Arity .BINARY )));
206+ public Object visitExprNewSet (ExprNewSetContext ctx ) {
207+ return addDefinition (new Free (wmm .newRelation (Relation .Arity .UNARY )));
208+ }
209+
210+ @ Override
211+ public Object visitExprNewRelation (ExprNewRelationContext ctx ) {
212+ return addDefinition (new Free (wmm .newRelation (Relation .Arity .BINARY )));
209213 }
210214
211215 @ Override
You can’t perform that action at this time.
0 commit comments