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

ASHOK REDDY asoka250 at gmail.com
Mon Jul 21 19:11:44 PDT 2008


Hi,

I am stuck with the following error during conversion of dot grammar from
antlr 2.7.7 to antlr 3.0.1. I request the list to help me out.

On Fri, Jul 11, 2008 at 4:29 AM, ASHOK REDDY <asoka250 at gmail.com> wrote:

> Hi Gavin,
>
> I used the conversion utility and generated the attached tree grammar. I am
> not sure about the # and |! symbols too. What does the # symbol mean when it
> is included in actions. The actions are encoded in Java language.
>
>
> On Fri, Jul 11, 2008 at 3:00 AM, Gavin Lambert <antlr at mirality.co.nz>
> wrote:
>
>> 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.
>>
>>
>
>
> --
> Ashok R Varikuti
> Graduate Research Assistant
> CIS Dept, Kansas State University
> 785-304-2401.
> ashokv at ksu.edu
>



-- 
Regards,
Ashok R Varikuti
Graduate Research Assistant
CIS Dept, Kansas State University
785-304-2401.
ashokv at ksu.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080721/28aec2c2/attachment.html 


More information about the antlr-interest mailing list