We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d5baa9 commit 45c9be5Copy full SHA for 45c9be5
g4/Ds.g4
@@ -0,0 +1,39 @@
1
+grammar Ds;
2
+
3
+rule_pool
4
+ : rule* EOF
5
+ ;
6
7
+rule
8
+ : term
9
+ | (term (',' term)*)? '->' term
10
11
12
+term
13
+ : SYMBOL
14
+ | term '(' (term (',' term)*)? ')'
15
+ | '(' term ')'
16
+ | <assoc=right> ('~' | '!' | '-' | '+' | '&' | '*') term
17
+ | term ('*' | '/' | '%') term
18
+ | term ('+' | '-') term
19
+ | term ('<<' | '>>') term
20
+ | term ('<' | '>' | '<=' | '>=') term
21
+ | term ('==' | '!=') term
22
+ | term '&' term
23
+ | term '^' term
24
+ | term '|' term
25
+ | term '&&' term
26
+ | term '||' term
27
28
29
+WHITESPACE
30
+ : [ \t\r\n]+ -> skip
31
32
33
+COMMENT
34
+ : '//' ~[\r\n]* -> skip
35
36
37
+SYMBOL
38
+ : ~[ \t\r\n,()]+
39
0 commit comments