Skip to content

Commit 10498ea

Browse files
authored
expression lists
1 parent 93b0e44 commit 10498ea

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

gll-grammar.gll

+26-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/* Grammar Tool for LL(1) Grammars
1+
/* ***************************************************************************
2+
* Grammar Tool for LL(1) Grammars
23
*
34
* Copyright (C) 2015 Benjamin Kowarsch
45
*
@@ -12,7 +13,7 @@
1213
*
1314
* grammar.gll
1415
*
15-
* EBNF grammar of GLL input files.
16+
* EBNF of GLL grammar files.
1617
*
1718
* License
1819
*
@@ -26,6 +27,7 @@
2627
*
2728
* You should have received a copy of the GNU Lesser General Public License
2829
* along with GLL. If not, visit <http://www.gnu.org/licenses/>.
30+
* ***************************************************************************
2931
*/
3032

3133
grammar gll;
@@ -129,7 +131,14 @@ literal :=
129131
/* Non-Terminal Definition */
130132

131133
nonTerminalDef :=
132-
NonTerminalIdent ':=' expression
134+
NonTerminalIdent ':=' expressionList
135+
;
136+
137+
138+
/* Expression List */
139+
140+
expressionList :=
141+
expression ( ',' expression )*
133142
;
134143

135144

@@ -171,12 +180,15 @@ terminalDef :=
171180
/* Terminal Value */
172181

173182
terminalValue :=
174-
terminalExpression | predefinedLiteral
183+
terminalExprList | predefinedLiteral
175184
;
176185

177-
predefinedLiteral :=
178-
'<TAB>' | '<EOL>' | '<EOF>'
179-
;
186+
187+
/* Terminal Expression List */
188+
189+
terminalExprList :=
190+
terminalExpression ( ',' terminalExpression )*
191+
;
180192

181193

182194
/* Terminal Expression */
@@ -207,6 +219,13 @@ terminalFactor :=
207219
;
208220

209221

222+
/* Predefined Literal */
223+
224+
predefinedLiteral :=
225+
'<TAB>' | '<EOL>' | '<EOF>'
226+
;
227+
228+
210229
/* Terminal Fragment Definition */
211230

212231
fragmentDef :=

0 commit comments

Comments
 (0)