[antlr-interest] v3: failed predicate?

Mark Mandel mark.mandel at gmail.com
Tue Jan 30 23:24:15 PST 2007


All,

I'm running the latest version of ANTLR v3

I get this error when I run the following input against my grammar:
'from onetomany.Basic join onetomany.Child'

rule ALIAS failed predicate: { currentMode == ALIAS_MODE }?

and I don't know what it means.

I believe these are the relevant portions of my grammar:

I've attached the full grammar in case this doesn't explain enough.

I'm totally stumped.. so any help would be appreciated.

fromStatement
	:
	FROM^ classClause (joinClause classClause ON joinCondition)*
	;
	
classClause
	:
	CLASS_IDENTIFIER^ (AS ALIAS)?
	;

joinClause
	:
	((LEFT | RIGHT)? OUTER)? JOIN^
	;
	
joinCondition
	:
	(
	PROPERTY_IDENTIFIER (BOOLEAN_LOGIC PROPERTY_IDENTIFIER)*
	|
	conditionStatement
	)
	;

FROM	:
	{ currentMode == STRING_MODE }?=>
	'from'
	{ setMode(CLASS_IDENTIFIER_MODE); }
	;
AS	: //special case, not worrying about past mode
	{ currentMode == STRING_MODE }?=>
	'as'
	{ currentMode = ALIAS_MODE; }
		;		
ALIAS	:
	{ currentMode == ALIAS_MODE }?=>
	LETTER(LETTER|DIGIT|'_')*
	{ currentMode = STRING_MODE; }
	;
JOIN	:
	{ currentMode == STRING_MODE }?=>
	'join'
	;
ON	:
	{ currentMode == STRING_MODE }?=>
	'join'
	{ setMode(PROPERTY_IDENTIFIER_MODE); }
	;
CLASS_IDENTIFIER
	:
	{ currentMode == CLASS_IDENTIFIER_MODE }?=>
	IDENTIFIER
	{ setMode(STRING_MODE);  }
	;		
PROPERTY_IDENTIFIER
	:
	{ currentMode == PROPERTY_IDENTIFIER_MODE }?=>
	IDENTIFIER
	{ setMode(STRING_MODE);  }
	;
fragment IDENTIFIER
	:
	LETTER(LETTER|DIGIT|'.'|'_')+
	;
TIA

Mark


-- 
E: mark.mandel at gmail.com
W: www.compoundtheory.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Tql.g
Type: application/octet-stream
Size: 5985 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20070131/818f1c97/attachment-0001.obj 


More information about the antlr-interest mailing list