diff --git a/codego/grammars/aussagenlogik.g4 b/codego/grammars/aussagenlogik.g4 index 6f5cb2e..a58edf6 100644 --- a/codego/grammars/aussagenlogik.g4 +++ b/codego/grammars/aussagenlogik.g4 @@ -1,7 +1,9 @@ grammar aussagenlogik; // Standardtokens: -NUMBER: [0-9]+; +NUMBER: [0-9]; +ZERO: ~[a-zA-Z0-9][0]; // negatives Look-Behind nötig, um konfliktierendes Lexing zu vermeiden +ONE: ~[a-zA-Z0-9][1]; // "" WHITESPACE: [ \r\n\t]+ -> skip; LBRACE: '('; RBRACE: ')'; @@ -24,9 +26,9 @@ open: and2 | and | or2 | or | implies | iff; // Schemata für atomische Ausdrücke atomic: taut | contradiction | atom | generic; -taut: ('1'|'true'); -contradiction: ('0'|'false'); -atom: 'A0' | 'A1' | 'A' NUMBER; // muss A0, A1 wegen falsum/verum extra auflisten +taut: (ONE|'true'); +contradiction: (ZERO|'false'); +atom: 'A' NUMBER+; // als 'generische' Formeln schreibe bspw. {F}, {G}, usw. generic: LCURLYBRACE TEXT+ RCURLYBRACE | LCURLYBRACE TEXT* ( generic TEXT* )+ RCURLYBRACE; // FIXME: liest Zahlen schlecht ein