Closed FrankC01 closed 6 years ago
I think I solved by creating multiple productions to account for the variations. E.g.:
pg.production('declaration: INCLUDE SYMBOL')
pg.production('declaration: INCLUDE SYMBOL declaration')
pg.production('declaration: VAR SYMBOL expression')
pg.production('declaration: VAR SYMBOL expression declaration')
pg.production('declaration: FUNC SYMBOL LIST expression')
pg.production('declaration: FUNC SYMBOL LIST expression declaration')
Haven't written complex inputs yet but works for simple case. Is this the right direction or is there a more terse way to do?
With the following EBNF:
It's not clear how to declare the
pg.production(...)
Basically, how to indicate 0 or more occurrences of productions?Any help would be appreciated.