[antlr-interest] query in tree grammar - regd.

Gavin Lambert antlr at mirality.co.nz
Fri Jul 11 01:00:21 PDT 2008


At 18:49 11/07/2008, ASHOK REDDY wrote:
>     |! { boolean record = false; } ^(LBR n=node_id record = 
> l:a_list_node )
>         {
>             if(record) {
>                 #node_edge_subgraph_stmt = #([RBR,"]"], n, l);
>              }
>             else{
>                     #node_edge_subgraph_stmt = #([LBR], n, l);
>              }
[...]
>Antlrworks doesn't recognize l in record = l:a_list_node. How to 
>convert this assignment statement to the latest syntax. Thank 
>you. The whole tree grammar is attached for reference.

Have you tried using the semi-automatic v2 -> v3 conversion 
utility?

To answer your specific question, ANTLR v3 uses '=' instead of ':' 
for labels now, so swap that over and it should fix that.  But 
there are other problems there too -- the |! syntax isn't 
recognised AFAIK (what does that even do?), and the #s seem wrong 
as well.



More information about the antlr-interest mailing list