| summaryrefslogtreecommitdiff | 
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-07-17 17:34:40 +0200 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-07-17 17:34:40 +0200 | 
| commit | 44c43a703e2d996ac80318a67c7ba3a828dca19b (patch) | |
| tree | 8571efbf3c676abbcce9bfd9d1b817ec98dac950 /instr-to-kodkod/parser/PropertyParser.g4 | |
| parent | c5caca06e411066828cec2a6008c126d64ffabb6 (diff) | |
Starting to work on a parser for the properties.
Diffstat (limited to 'instr-to-kodkod/parser/PropertyParser.g4')
| -rw-r--r-- | instr-to-kodkod/parser/PropertyParser.g4 | 30 | 
1 files changed, 30 insertions, 0 deletions
| diff --git a/instr-to-kodkod/parser/PropertyParser.g4 b/instr-to-kodkod/parser/PropertyParser.g4 new file mode 100644 index 0000000..740b308 --- /dev/null +++ b/instr-to-kodkod/parser/PropertyParser.g4 @@ -0,0 +1,30 @@ +parser grammar PropertyParser; +options { tokenVocab = PropertyLexer; } + +prog: tag_existing; + +tag_existing +   : TAG_EXISTING_KW L_PAREN (tag_item)+ R_PAREN formula R_PAREN +; + +tag_item +   : L_PAREN ID ID R_PAREN +; + +formula +   : and_operator +   | or_operator +   | not_operator +   | exists_operator +   | forall_operator +   | predicate +; + +and_operator: AND_OPERATOR_KW formula (formula)+ R_PAREN; +or_operator: OR_OPERATOR_KW formula (formula)+ R_PAREN; +not_operator: NOT_OPERATOR_KW formula R_PAREN; +exists_operator: EXISTS_OPERATOR_KW ID ID formula R_PAREN; +forall_operator: FORALL_OPERATOR_KW ID ID formula R_PAREN; + + +predicate: L_PAREN ID (ID)* R_PAREN; | 


