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

14401RE: [antlr-interest] Re: Bug in ANTLR C# implementation

Expand Messages
  • Maassen, H.A.M.
    Dec 1, 2004
    • 0 Attachment
      The Java generated treeparser doesn't seem to have an initializeASTFactory method.

      Since I'm running initializeASTFactory on the treeparser's own getASTFactory, there isn't much synching being done (by me, anyway). And all it does is set the factory's maximum anyway!


      -----Original Message-----
      From: micheal_jor [mailto:open.zone@...]
      Sent: Wed 12/1/2004 11:11 AM
      To: antlr-interest@yahoogroups.com
      Cc:
      Subject: [antlr-interest] Re: Bug in ANTLR C# implementation





      --- In antlr-interest@yahoogroups.com, "Maassen, H.A.M."
      <H.A.M.Maassen@s...> wrote:
      > Well I've found out why I couldn't get any tree-rewriting actions to
      work - it seems to be a bug in the C# version of the (generated)
      treeparser.
      >
      > The treeparser's method initializeASTFactory is never called. After
      manually adding a call to initializeASTFactory(getASTFactory()) in the
      treeparser the problems have been fixed.

      Hi Harald,

      I was just about to copy your previously posted grammar to see if I
      could reproduce your issues with buildAST. Never mind, seems you've
      fixed it in any case.

      The behaviour you describe (i.e. tree parsers being created with a
      default ASTFactory) is by design. Users are supposed to use the static
      method named initializeASTFactory() - or similar, it's on the
      generated Parsers - to ensure their tree parser's ASTFactory is in
      sync with the Parser's.

      I may be wrong but, I thought this was uniform behaviour across all
      the codegens(?).

      Cheers,

      Micheal
      ANTLR/C#







      Yahoo! Groups Links
    • Show all 10 messages in this topic