I'm trying to write a compiler program for a specific grammar I defined.
There are a few ε in the grammar because of some iterative and recursive rules. I tried to define ε by creating an empty token:
tokens = (
'EMPTY'
)
t_EMPTY = r'\ '
That caused some parsing problems, therefore I ignored spaces earlier in the lexer code:
t_ignore = ' \t'
What are other ways to describe define ε?
Click here to see the project files