Recognizing terminals in a CFG production previously not defined as tokens.
- by kmels
I'm making a generator of LL(1) parsers, my input is a CoCo/R language specification. I've already got a Scanner generator for that input. Suppose I've got the following specification:
COMPILER 1.
CHARACTERS
digit="0123456789".
TOKENS
number = digit{digit}.
decnumber = digit{digit}"."digit{digit}.
PRODUCTIONS
Expression =…