[antlr-interest] Error in "rewriteTokenRef" template

Dr. Hartmut Kocher hwk.cortex-brainware at t-online.de
Tue Feb 13 13:28:33 PST 2007


The following grammar triggers a 

„error(10):  internal error: Simple.g : java.util.NoSuchElementException: no
such attribute: args in template context [rewriteTokenRef]

“

rewriteTokenRef does not have an args parameter. But I couldn’t figure out,
how to fix it.

 

 

The rewrite rule -> ^(vars ID INT["1"])  triggers the error.

 

Any ideas?

 

Hartmut

 

 

grammar Simple;

 

options {

     language=Java;

     output=AST;

     ASTLabelType=CommonTree;

     }

 

 

t :

vars (

     'in' 'table' ID 

          ( '>' INT -> ^(vars ID INT)

          |               -> ^(vars ID INT["1"])  // The INT[“1”] triggers
the error

          )

);

 

vars : 'abc' | 'abd';

 

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

 

 

INT :    DIGIT+;

 

 

ID   :    ('abc' DIGIT) => 'abc' {$type = ABC;} | ('a'..'z'|'A'..'Z')
('a'..'z'|'A'..'Z'|'_'|'0'..'9')+ ;

 

 

WS  :  (' '|'\r'|'\t'|'\f'|'\n')+ { $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/20070213/7513daea/attachment.html 


More information about the antlr-interest mailing list