1

I had a look at the python run time module but I am unsure about creating the python parser and lexer files. I have written the .g files.

user944308
  • 27
  • 4

1 Answers1

3

Here are the steps:

  1. Write the grammar.
  2. Run ANTLR to generate the lexer/parser classes.
  3. Compile and run against Python source files to see how you do.

To accomplish anything useful, you'll have to get the code into an AST and then walk the tree. Did you do that? What did you get?

Here's a list of available grammars. It includes Python 3. How did you grammar compare?

duffymo
  • 305,152
  • 44
  • 369
  • 561