I'm trying to write a python interpreter with Flex & Bison.
There is the python grammar available here: http://docs.python.org/dev/py3k/reference/grammar.html.
I take as an example the following specification in EBNF notation from the python grammar:
Code: Select all
file_input: (NEWLINE | stmt)* ENDMARKER
In a bison file I wrote:
Code: Select all
file_input:
NEWLINE
| stmt
| ENDMARKER
;
Do you know how to translate EBNF notation to Flex & Bison?
Thanks in advance!