|
1 |
| -/* Grammar Tool for LL(1) Grammars |
| 1 | +/* *************************************************************************** |
| 2 | + * Grammar Tool for LL(1) Grammars |
2 | 3 | *
|
3 | 4 | * Copyright (C) 2015 Benjamin Kowarsch
|
4 | 5 | *
|
|
12 | 13 | *
|
13 | 14 | * grammar.gll
|
14 | 15 | *
|
15 |
| - * EBNF grammar of GLL input files. |
| 16 | + * EBNF of GLL grammar files. |
16 | 17 | *
|
17 | 18 | * License
|
18 | 19 | *
|
|
26 | 27 | *
|
27 | 28 | * You should have received a copy of the GNU Lesser General Public License
|
28 | 29 | * along with GLL. If not, visit <http://www.gnu.org/licenses/>.
|
| 30 | + * *************************************************************************** |
29 | 31 | */
|
30 | 32 |
|
31 | 33 | grammar gll;
|
@@ -129,7 +131,14 @@ literal :=
|
129 | 131 | /* Non-Terminal Definition */
|
130 | 132 |
|
131 | 133 | nonTerminalDef :=
|
132 |
| - NonTerminalIdent ':=' expression |
| 134 | + NonTerminalIdent ':=' expressionList |
| 135 | + ; |
| 136 | + |
| 137 | + |
| 138 | +/* Expression List */ |
| 139 | + |
| 140 | +expressionList := |
| 141 | + expression ( ',' expression )* |
133 | 142 | ;
|
134 | 143 |
|
135 | 144 |
|
@@ -171,12 +180,15 @@ terminalDef :=
|
171 | 180 | /* Terminal Value */
|
172 | 181 |
|
173 | 182 | terminalValue :=
|
174 |
| - terminalExpression | predefinedLiteral |
| 183 | + terminalExprList | predefinedLiteral |
175 | 184 | ;
|
176 | 185 |
|
177 |
| -predefinedLiteral := |
178 |
| - '<TAB>' | '<EOL>' | '<EOF>' |
179 |
| - ; |
| 186 | + |
| 187 | +/* Terminal Expression List */ |
| 188 | + |
| 189 | +terminalExprList := |
| 190 | + terminalExpression ( ',' terminalExpression )* |
| 191 | + ; |
180 | 192 |
|
181 | 193 |
|
182 | 194 | /* Terminal Expression */
|
@@ -207,6 +219,13 @@ terminalFactor :=
|
207 | 219 | ;
|
208 | 220 |
|
209 | 221 |
|
| 222 | +/* Predefined Literal */ |
| 223 | + |
| 224 | +predefinedLiteral := |
| 225 | + '<TAB>' | '<EOL>' | '<EOF>' |
| 226 | + ; |
| 227 | + |
| 228 | + |
210 | 229 | /* Terminal Fragment Definition */
|
211 | 230 |
|
212 | 231 | fragmentDef :=
|
|
0 commit comments