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

How to get back the coordinates from an AST?

Expand Messages
  • fcouche
    We use for the moment the last version of ANTLR (2.7.4). We have our particular grammar and all works fine. We have to analyse the AST produced by the parser
    Message 1 of 2 , Sep 1 3:11 AM
    • 0 Attachment
      We use for the moment the last version of ANTLR (2.7.4).
      We have our particular grammar and all works fine.

      We have to analyse the AST produced by the parser to do an additional
      validation. When a
      problem is detected during this validation, we would like to
      hightlight the error in our
      editor. For that, we need to know the coordinates (line,column) using
      the AST we are
      analysing but the methods getLine() and getColumn() always return 0
      (we checked it in the
      ANTLR sources in the BaseAST class)!

      So how to get back the coordinates from an AST?
    • Ric Klaren
      ... For an example implementation: http://antlraux.sourceforge.net/ There should also be FAQ entries on this on jguru (but it s down at the moment). Cheers,
      Message 2 of 2 , Sep 1 4:37 AM
      • 0 Attachment
        On Wed, Sep 01, 2004 at 10:11:48AM -0000, fcouche wrote:
        > So how to get back the coordinates from an AST?

        For an example implementation:

        http://antlraux.sourceforge.net/

        There should also be FAQ entries on this on jguru (but it's down at the
        moment).

        Cheers,

        Ric
        --
        -----+++++*****************************************************+++++++++-------
        ---- Ric Klaren ----- j.klaren@... ----- +31 53 4893755 ----
        -----+++++*****************************************************+++++++++-------
        Words fly like arrows
        as if we knew what was right and wrong. --- Chuang Tsu
      Your message has been successfully submitted and would be delivered to recipients shortly.