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

line #'s into tree

Expand Messages
  • ksplem
    Hi, A ANTLR newbie here. I ve been working with the tool for 2 weeks now and I m very impressed at how well it works and how easy it is to use. Kudos to the
    Message 1 of 3 , Apr 2, 2004
    • 0 Attachment
      Hi,

      A ANTLR newbie here. I've been working with the tool for 2 weeks now
      and I'm very impressed at how well it works and how easy it is to
      use. Kudos to the development team! I already have the basics of my
      compiler working already .NET executables that actually run ;>). I'm
      targetting .net using .Emit calls with the implementation in C#.

      What I'm looking for is a hint on the best way to get a token's or
      parser sentence's line number into the tree (e.g. anAST.getLine()
      perhaps?). From my limited understanding, it seems that I might have
      to override one or more classes perhaps ASTFactory and ASTNode
      (sp?).

      Any help for a rookie?

      Thanks in advance,
      Kenny
    • micheal_jor
      ... What does your compiler do?. What language is it for? ... You may want to search the archives before posting (even if Yahoo Groups search feature *sucks*
      Message 2 of 3 , Apr 2, 2004
      • 0 Attachment
        --- In antlr-interest@yahoogroups.com, "ksplem" <ken@i...> wrote:
        > Hi,
        >
        > A ANTLR newbie here. I've been working with the tool for 2 weeks now
        > and I'm very impressed at how well it works and how easy it is to
        > use. Kudos to the development team! I already have the basics of my
        > compiler working already .NET executables that actually run ;>). I'm
        > targetting .net using .Emit calls with the implementation in C#.

        What does your compiler do?. What language is it for?

        > What I'm looking for is a hint on the best way to get a token's or
        > parser sentence's line number into the tree (e.g. anAST.getLine()
        > perhaps?). From my limited understanding, it seems that I might have
        > to override one or more classes perhaps ASTFactory and ASTNode
        > (sp?).

        You may want to search the archives before posting (even if Yahoo
        Groups' search feature *sucks* big time). Anyway, here's a post you
        may have found that is relevant to your query:
        http://groups.yahoo.com/group/antlr-interest/message/7078

        Before you do anything though, have a look at the 2.7.3 release notes
        for C# in:
        http://www.antlr.org/blog/CHANGES-2.7.3.txt

        This bit from the release notes is relevant. It basically means that
        you do not need to override makeToken()/nextToken() anymore in your lexer:
        "c) CharScanner.cs: makeToken(int) now calls setFilename(string)
        on newly created tokens"

        Cheers,

        Micheal
        ANTLR/C#
      • Kenny Lindberg
        Micheal, Thanks for the hints, I ll take a look at the links and at 2.7.3 which I just downloaded. ... It s not really general purpose . My customer builds
        Message 3 of 3 , Apr 2, 2004
        • 0 Attachment
          Micheal,

          Thanks for the hints, I'll take a look at the links and at 2.7.3
          which I just downloaded.

          > What does your compiler do?. What language is it for?

          It's not really 'general purpose'. My customer builds electronic
          test equipment and they are going to emulate/execute some older
          PASCAL-like test languages on their hardware which already hosts or
          runs under .NET. So far so good with ANTLR.

          Kenny

          --- In antlr-interest@yahoogroups.com, "micheal_jor"
          <open.zone@v...> wrote:
          > --- In antlr-interest@yahoogroups.com, "ksplem" <ken@i...> wrote:
          > > Hi,
          > >
          > > A ANTLR newbie here. I've been working with the tool for 2 weeks
          now
          > > and I'm very impressed at how well it works and how easy it is
          to
          > > use. Kudos to the development team! I already have the basics of
          my
          > > compiler working already .NET executables that actually run ;>).
          I'm
          > > targetting .net using .Emit calls with the implementation in C#.
          >
          > What does your compiler do?. What language is it for?
          >
          > > What I'm looking for is a hint on the best way to get a token's
          or
          > > parser sentence's line number into the tree (e.g. anAST.getLine
          ()
          > > perhaps?). From my limited understanding, it seems that I might
          have
          > > to override one or more classes perhaps ASTFactory and ASTNode
          > > (sp?).
          >
          > You may want to search the archives before posting (even if Yahoo
          > Groups' search feature *sucks* big time). Anyway, here's a post you
          > may have found that is relevant to your query:
          > http://groups.yahoo.com/group/antlr-interest/message/7078
          >
          > Before you do anything though, have a look at the 2.7.3 release
          notes
          > for C# in:
          > http://www.antlr.org/blog/CHANGES-2.7.3.txt
          >
          > This bit from the release notes is relevant. It basically means
          that
          > you do not need to override makeToken()/nextToken() anymore in
          your lexer:
          > "c) CharScanner.cs: makeToken(int) now calls setFilename
          (string)
          > on newly created tokens"
          >
          > Cheers,
          >
          > Micheal
          > ANTLR/C#
        Your message has been successfully submitted and would be delivered to recipients shortly.