[antlr-interest] What exactly does 'follow set' mean?

Monty Zukowski monty at codetransform.com
Sun Apr 17 21:18:14 PDT 2005


On Apr 17, 2005, at 2:11 PM, shmuel siegel wrote:

> Prashant Deva wrote:
>> What exactly do you mean by a 'follow set'?
>> In the doc it says that, when antlr parsers encounter an error they
>> look up tokens until they find one in the 'follow set' of the rule.
>> So what exaclty does the parser look for when it encounters an error?
>> PRASHANT
> While we are on the subject of "follow set", is there a tool that will 
> translate a follow set to the characters that it represents? One of 
> the strong points of Antlr is that it is possible to understand the 
> code it generates. This would be enhanced if the follow and match sets 
> were easily translated into human terms.
>
>

Well, if you set the option codeGenBitsetThreshold very high, like 
999999, then you will see all the token names instead of the bitset 
objects.

Monty



More information about the antlr-interest mailing list