[antlr-interest] Error: Can't find template tokenRefBang.st -- FOUND WHY

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Jan 22 07:05:31 PST 2008


On 22/1/08 3:32 PM, "Ruslan Zasukhin" <sunshine at public.kherson.ua> wrote:

> On 22/1/08 11:32 AM, "Thomas Brandon" <tbrandonau at gmail.com> wrote:
> 
>> You can't have both AST operators (^ and !) and rewrites in the same rule.
>> You are using ! in a rule with rewrites. Unfortunately currently the error
>> message doesn't give the location, this is a known issue. I don't think this
>> will be fixed in 3.1.
>> Tom.
> 
> Thank you Thomas, I will check this point.
> Yes I am porting old grammar from v2 to v3.

Well, it seems I have found ONE MORE reason when ANTLR give this error.

Rule which cause problem is:

row_expr
    :   (LPAREN! expr RPAREN!) => LPAREN! expr RPAREN!
    ;


If remove ! In the head of predicate then it works

row_expr
    :   (LPAREN expr RPAREN) => LPAREN! expr RPAREN!
    ;


Please note down this issue for ANTLR.


----------  
>> On Jan 22, 2008 8:06 PM, Ruslan Zasukhin <sunshine at public.kherson.ua> wrote:
>> Hi,
>> 
>> I run ANTLR from terminal with our SQL parser grammar.
>> And get strange error:
>> Anybody can point reason?

>> ---------
>> ruslans-power-mac-g5:~ rz$ java org.antlr.Tool
>> /PARADIGMA/Developer_2/sources_Third_Party/ANTLR3/VSQL_Parser.g
>> ANTLR Parser Generator  Version 3.0.1 (August 13, 2007)  1989-2007
>> 
>> error(10):  internal error:
>> /PARADIGMA/Developer_2/sources_Third_Party/ANTLR3/VSQL_Parser.g :
>> java.lang.IllegalArgumentException: Can't find template tokenRefBang.st

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the antlr-interest mailing list