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

220Re: pretty printing

Expand Messages
  • Terence Parr
    Mar 1, 1999
    • 0 Attachment
      sasecp@... hath spoken:
      >From: sasecp@...
      >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.

      2.6.0 will have token streams that are perfect for this...not sure if Pete
      Wells will be able to get the C++ output updated soon and I'm still working
      on doc.

    • Show all 4 messages in this topic