Skip to content

Commit

Permalink
Updated CAT grammar to correctly parse LKMM.
Browse files Browse the repository at this point in the history
Commented out includes in LKMM because the included file contains unsupported features.
  • Loading branch information
ThomasHaas committed Sep 12, 2024
1 parent ef8a507 commit dec62f9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion cat/linux-kernel.cat
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* It can be replaced by include "cos.cat" for tests that do not use locks.
*)

include "lock.cat"
//include "lock.cat"

(* Compute matching pairs of nested Srcu-lock and Srcu-unlock *)
let carry-srcu-data = (data ; [~ Srcu-unlock] ; rf)*
Expand Down
2 changes: 1 addition & 1 deletion cat/lkmm/lkmm-v00.cat
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* It can be replaced by include "cos.cat" for tests that do not use locks.
*)

include "lock.cat"
//include "lock.cat"

(* Compute marked and plain memory accesses *)
let Marked = (~M) | IW | Once | Release | Acquire | (RMW & R) | (RMW & W) |
Expand Down
2 changes: 1 addition & 1 deletion cat/lkmm/lkmm-v01.cat
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* It can be replaced by include "cos.cat" for tests that do not use locks.
*)

include "lock.cat"
//include "lock.cat"

(* Compute marked and plain memory accesses *)
let Marked = (~M) | IW | Once | Release | Acquire | (RMW & R) | (RMW & W) |
Expand Down
2 changes: 1 addition & 1 deletion cat/lkmm/lkmm-v02.cat
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* It can be replaced by include "cos.cat" for tests that do not use locks.
*)

include "lock.cat"
//include "lock.cat"

(* Compute marked and plain memory accesses *)
let Marked = (~M) | IW | Once | Release | Acquire | (RMW & R) | (RMW & W) |
Expand Down
14 changes: 4 additions & 10 deletions dartagnan/src/main/antlr4/Cat.g4
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import com.dat3m.dartagnan.wmm.axiom.*;
}

mcm
: (NAME)? definition+ EOF
: (NAME| QUOTED_STRING)? (definition | include)+ EOF
;

definition
: include
| axiomDefinition
: axiomDefinition
| letDefinition
| letRecDefinition
;
Expand Down Expand Up @@ -91,10 +90,10 @@ NEW : 'new';

FLAG : 'flag';

NAME : [A-Za-z0-9\-_.]+;

QUOTED_STRING : '"' .*? '"';

NAME : [A-Za-z0-9\-_.]+;

LINE_COMMENT
: '//' ~[\n]*
-> skip
Expand All @@ -109,8 +108,3 @@ WS
: [ \t\r\n]+
-> skip
;

MODELNAME
: '"' .*? '"'
-> skip
;

0 comments on commit dec62f9

Please sign in to comment.