[antlr-interest] Internal error "OrderedHashSet"

Mark Bednarczyk voytechs at yahoo.com
Sun Feb 25 06:24:05 PST 2007


Getting this error on a rule. 

[antlr:antlr3] ANTLR Parser Generator  Version 3.0 beta revision 3386
(January 11, 2007) 1989-2007
[antlr:antlr3] error(10):  internal error:
org.antlr.misc.OrderedHashSet.size(OrderedHashSet.java:92): OrderedHashSet:
elements and set size differs; 4!=3
[antlr:antlr3] error(10):  internal error:
org.antlr.misc.OrderedHashSet.size(OrderedHashSet.java:92): OrderedHashSet:
elements and set size differs; 7!=4
... CONTINUES FOR EVER ....

The error is continuesly displayed and never stops. Is this a known issue?
 
The culprit is the "modifiers" subrule:

tableDeclaration
	: modifiers TABLE id tableBody -> ^(TABLE_DEF id tableBody)
	;

modifiers
	:	modifier*	-> ^(MODIFIERS modifier*)
	;
	
modifier
    :   'public'
    |   'protected'
    |   'private'
    |   'static'
    |   'final'
    |   'synchronized'
    |   'transient'
    |   'volatile'
    |   'field'
    ;

The error occures when I add the "modifiers" to teableDeclaration
production. It goes away when I don't include it. The modifiers subrule is
used in other parts of the grammar with success.  Could I be hitting some
kind of size related limit, there are nearly 100 rules in my entire grammar
file?

Cheers,
mark...




More information about the antlr-interest mailing list