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

Line counting off in C++ generated code

Expand Messages
  • Mike Barnett
    I don t know if this problem has been reported before, but if piece of semantic action builds a manually-constructed tree and the tree specification extends
    Message 1 of 2 , Apr 4, 2001
    • 0 Attachment
      I don't know if this problem has been reported before, but if piece of
      semantic action builds a manually-constructed tree and the tree
      specification extends over more than one line, then the #line directives
      in the C++ generated code are off.

      For instance the Antlr code:

      nonterm
      {
      ## = #([TOK,"TOK"],
      ... Other stuff ...
      );
      f();
      }

      Creates a C++ file with the following:

      #line nnn "file.g"
      xxx_AST = ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory.make...
      f();

      which is incorrect.

      Thanks,

      Mike
    • Ric Klaren
      ... Uhmmm ya.. It s one of the few cases some things aren t handled 100% ok. (Is also an oddity with the parameterlists for rules). I ll add it to the list.
      Message 2 of 2 , Apr 5, 2001
      • 0 Attachment
        On Wed, Apr 04, 2001 at 12:38:02PM -0700, Mike Barnett wrote:
        > I don't know if this problem has been reported before, but if piece of
        > semantic action builds a manually-constructed tree and the tree
        > specification extends over more than one line, then the #line directives
        > in the C++ generated code are off.

        Uhmmm ya.. It's one of the few cases some things aren't handled 100% ok.
        (Is also an oddity with the parameterlists for rules). I'll add it to the
        list.

        Thanks for reminding me :)

        Ric
        --
        -----+++++*****************************************************+++++++++-------
        ---- Ric Klaren ----- klaren@... ----- +31 53 4893722 ----
        -----+++++*****************************************************+++++++++-------
        Why don't we just invite them to dinner and massacre them all when they're
        drunk? You heard the man. There's seven hundred thousand of them.
        Ah? ... So it'd have to be something simple with pasta, then.
        --- From: Interesting Times by Terry Pratchet
        -----+++++*****************************************************+++++++++-------
      Your message has been successfully submitted and would be delivered to recipients shortly.