Loading ...
Sorry, an error occurred while loading the content.

219pretty printing

Expand Messages
  • sasecp@wnt.sas.com
    Mar 1, 1999
    • 0 Attachment
      I have an ANTLR java parser that I'm using successfully, and I'd like to add some pretty-printing capabilities to it. At the moment, the lexer throws away comments and whitespace, but I'd like to keep the comments and maybe some of the whitespace depending on user configuration. I'm wondering if there's a good hook that would allow me to not throw away the whitespace in the lexer, but deal with it in the parser somehow. I certainly don't want to modify every rule with information about where whitespace can occur. I will probably be adding actions to every rule to generate the text, I just don't want pollute the entire grammar.

      Is there a good way to do this?

      I'm using Antlr 2.5.0 with VC++ 5.0.

    • Show all 4 messages in this topic