Re: Stuck in treewalkers
- -----Original Message-----
From: Lars Clausen <lrclause@...>
To: email@example.com <firstname.lastname@example.org>
Date: Wednesday, September 30, 1998 8:01 PM
Subject: [antlr-interest] Stuck in treewalkers
>From: Lars Clausen <lrclause@...>You need to specify the tokenVocabulary for your TreeParser too!
>I am having the hardest time getting a treewalker to accept my ast. The
>parser works beautifully, and prints out the AST as it should be, but that
>treewalker won't accept anything, not even a simple integer. It's driving
>me crazy, as I can't see any difference between what I do here and what the
>docs say. It seems like the keywords (SEQ, NUMBER, "infixl" etc) aren't
>recognized by the walker at all. Please, what am I doing wrong?
class miniJRWalker extends TreeParser;
When you get into multiple tree parsers and start using the tokdef option,
you will undoubtedly change your grammar which will change the token types
file. Then if you don't rebuild all of your tree parsers you will have
errors where the token type doesn't match what the parser had. All of a
sudden the INT from the parser is now the STRING in the tree walker, etc.
It may look like your parser is building wacky trees, but it's just that the
token types no longer match. Rebuild all your tree parsers and you'll be