[antlr-interest] Problem finding Template

Dr. Hartmut Kocher hwk.cortex-brainware at t-online.de
Thu Jan 25 15:22:00 PST 2007


Hi,

 

using ANTLR 3.0B5, I get an exception when I parse my grammar: error(10):
internal error: Test.g : java.lang.IllegalArgumentException: Can't find
template tokenRefRuleRootTrack.st

 

Has anybody encountered this?

 

Here’s a simple grammar to show the effect:

 

Thanks.

 

grammar Test;

 

options {

     language=CSharp;

     output=AST;

     ASTLabelType=CommonTree;

}

 

tokens { KK; }

 

logic     :    logicalExpression EOF;

 

logicalExpression    :    expr ('and'^^ expr)*;

 

expr :    term ('or'^^ term)*;

 

term :    (ID^^|lp=INT -> ^(KK[$lp] INT)| '('! logicalExpression^^ ')'!);

 

zahl :lp=INT -> ^(KK[$lp] INT);

 

fragment DIGIT  :    '0'..'9';

 

fragment LETTER :    ('a'..'z'|'A'..'Z');

 

INT :    DIGIT+;

 

ID   :    LETTER (LETTER|'_'|DIGIT)+;

 

 

WS  :  (' '|'\r'|'\t'|'\f'|'\n')+ { $channel=HIDDEN; };

 

SL_COMMENT :

        '//'

        ( options { greedy=false; } : . )*

        ( '\r' | '\r\n' | '\n' )

        { $channel=HIDDEN; }

    ;

 

// multiple-line comments

ML_COMMENT :

        '/*'

        ( options {greedy=false;} : . )*

        '*/'

        { $channel=HIDDEN; }

        ;

 

 

 

Dr. Hartmut Kocher

Cortex Brainware Consulting & Training GmbH

Kirchplatz 5
D-82049 Pullach

Tel: +49 (89) 744  850 0
Fax: +49 (89) 744  850 11

 <http://www.cortex-brainware.de/> http://www.cortex-brainware.de

E-Mail: hwk at cortex-brainware.de

Handelsregister:
Registergericht: Amtsgericht München
HRB-Nr. 120614

Vertretungsberechtigte Geschäftsführer:
Dipl.-Inform. Dorothea Burger, Dr.-Ing. Hartmut Kocher, Dr.-Ing. Martin
Lang, Dr. rer. nat. Rolf Peter Wehrum 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070126/81843e62/attachment.html 


More information about the antlr-interest mailing list