master > master: codego - Grammatik

This commit is contained in:
RD 2021-05-18 11:31:01 +02:00
parent c48f703744
commit 4be6896a0f
1 changed files with 6 additions and 4 deletions

View File

@ -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