Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Currently ANTLR does not create templates for you automatically when you use output=template option. This is because, when I first implemented it, I had no idea what the right answer was here. I did not know how to deal with whitespace and so on. I think I have the answer now. First, let me remind you that output=AST builds a completely flat tree given no instructions to the contrary. Similarly, the template output should reproduce the input given no instructions.

Templates from parser grammars

Some cases seem obvious. What should the output template be for this rule?

...