-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBora.g4
More file actions
44 lines (33 loc) · 900 Bytes
/
Bora.g4
File metadata and controls
44 lines (33 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
grammar Bora;
prog
: expr?;
expr
: expr AND expr # andOperator
| expr NAND expr # nandOperator
| expr OR expr # orOperator
| expr NOR expr # norOperator
| expr XOR expr # xorOperator
| expr IMPLIES expr # impliesOperator
| expr XNOR expr # xnorOperator
| term # termExpr;
term
: factor # factorExpr
| term term # implicitAndOperator;
factor
: NOT factor # notOperator
| VARIABLE # variable
| TRUE # literalTrue
| FALSE # literalFalse
| '(' expr ')' # groupFactor;
VARIABLE: [a-zA-Z];
AND: 'and'|'AND'|'*';
OR: 'or'|'OR'|'+';
NOT: 'not'|'NOT'|'~';
NOR: 'nor'|'NOR';
NAND: 'nand'|'NAND';
XOR: 'xor'|'XOR';
XNOR: 'xnor'|'XNOR'|'<->'|'<=>';
IMPLIES: 'implies'|'IMPLIES'|'->'|'=>';
TRUE: '1';
FALSE: '0';
WS: [ \t\r\n]+ -> skip;