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

How do I use setText in a lexer?

Expand Messages
  • Anna Winkler
    Hi, I m trying to use setText in a lexer, and I m getting compile errors. I get the same errors with the ANTLR cpp example lexRewrite: rewrite.g: In method
    Message 1 of 2 , Nov 29, 2000
    • 0 Attachment
      Hi,

      I'm trying to use setText in a lexer, and I'm getting compile errors.
      I get the same errors with the ANTLR cpp example lexRewrite:

      rewrite.g: In method `void Rewrite::mEXPR(bool)':
      rewrite.g:40: parse error before `}'
      rewrite.g: In method `void Rewrite::mLETTER(bool)':
      rewrite.g:34: parse error before `}'

      I'm using Ric's latest development version of ANTLR.

      Does anyone have any ideas?

      Thanks!
      Anna
    • Ric Klaren
      ... I made a typo in the code generated (forgot a ; ). I made a fix for using $setText in if-else constructs which in the old versions yields some weird
      Message 2 of 2 , Nov 30, 2000
      • 0 Attachment
        On Wed, Nov 29, 2000 at 06:42:07PM -0000, Anna Winkler wrote:
        > rewrite.g: In method `void Rewrite::mEXPR(bool)':
        > rewrite.g:40: parse error before `}'
        > rewrite.g: In method `void Rewrite::mLETTER(bool)':
        > rewrite.g:34: parse error before `}'
        >
        > I'm using Ric's latest development version of ANTLR.

        I made a typo in the code generated (forgot a ';'). I made a fix for using
        $setText in if-else constructs which in the old versions yields some
        'weird' results.

        In this version things like

        if( sometest == true )
        $setText(x);

        Do as they would be suspected. In the old versions (2.7.1 and before) you
        get weird results.

        Anyway a new devel version is up at the usual place.

        Cheers,

        Ric
        --
        -----+++++*****************************************************+++++++++-------
        ---- Ric Klaren ----- klaren@... ----- +31 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.