[antlr-interest] Re: Parsing beginners question
mzukowski at yci.com
mzukowski at yci.com
Thu Jan 29 07:49:49 PST 2004
Bitsets are a compact representation of a set of token numbers--exactly what
antlr needs to test for lookahead. Setting the codeGenBitsetTestThreshold
tells antlr to switch from simple "==" tests to using bitsets when the
number of tokens to be tested is at or above the threshold.
Monty
-----Original Message-----
From: jenlhunt2003 [mailto:steam at tapisinc.com]
Sent: Wednesday, January 28, 2004 11:19 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] Re: Parsing beginners question
I tried adding those options like so:
java -classpath %CLASSPATH% antlr.Tool -trace
-codeGenBitsetTestThreshold=999999 $(InputPath),
which I ran on the StdCParser.g file.
The only difference that I see is that I now have a bunch of Tracer
TraceInOut() calls in the .cpp file,
which I assume was due to the -trace flag. What should the effect of the
999999 flag be,
and where should I see it?
Also, if you have a moment, could you tell me what the Bitset thing is all
about?
In going through source the StdCParser.cpp file last night I noticed several
_tokenSet_* arrays containing
unsigned long quantities that I didn't understand. Are these related to the
Bitset's you are referring to?
Thanks for your help!
Henry
--- In antlr-interest at yahoogroups.com, mzukowski at y... wrote:
> You can use the option codeGenBitsetTestThreshold = 999999; in order to
turn
> off the bitset generation and be able to see the actual tokens it is
trying
> to match. Also, have you run it through antlr with the -trace option?
That
> could help with debugging too.
>
> Actually you do need that syntactic predicate ": ("typedef" |
declaration)=>
> declaration". The parser doesn't know if it is looking at a declaration
or
> definition until it sees the semicolon which can be very far (undefined,
> unbounded length) into the file.
>
> Monty
>
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list