]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/parser/grammar/input/Grammar.grammar
Moved SCL parser generator to platform repository.
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / parser / grammar / input / Grammar.grammar
1 initial file ;
2
3 file
4     = declaration+                                    # File
5     ;
6
7 declaration
8     = NONTERMINAL EQUALS prod (BAR prod)* SEMICOLON   # Production
9     | INITIAL NONTERMINAL SEMICOLON                   # Initial
10     ;
11
12 prod
13     = regexps HASH TERMINAL (COMMA (SHIFT|REDUCE) TERMINAL)* # ProductionRhs
14     ;
15
16 regexps 
17     = (regexp (regexp | STAR | PLUS | OPTIONAL)*)?         # Concatenation 
18     ;
19
20 regexp
21     = (TERMINAL | NONTERMINAL | SHIFT | REDUCE | INITIAL)  # Terminal
22     | LPAREN regexps (BAR regexps)* RPAREN                 # Union
23     ;