Hello list,

My tree grammar looks as follow's:-

edges[Object g,String subID] returns [int nodeID] @init { nodeID= 0; } :
    { int edgeID = 0;  }
    ( ^(D_EDGE_OP  ( start=edges[g,subID] | start=node_id[g,subID] ) 
end=node_id[g,subID]
      {
      }

node_id[Object g,String subID] returns [int nodeID] @init { nodeID=0;}
    :
    ( i=id
    | ^(COLON i=id (r=ID) ? ( compass ) ? )
    ) {}

Simply put, *Can I get text of a next matched token using a grammar 
action*. *Lookahead K=1 for example*.

Further description:-
For this sample edge  cluster_A --> B, in the edges function, 
start=node_id[g,subID] is the first match.
How do I do something like this, ( ^(D_EDGE_OP  ( start=edges[g,subID] | 
start=node_id[g,subID] (get value of matched id in node_id func here) 
end=node_id[g,subID]
That is, I want to get the id of the matched node(which is obvious 
node_id func) in the edges function.

-- 
Ashok R Varikuti
Graduate Research Assistant
CIS Dept, Kansas State University
785-304-2401
[EMAIL PROTECTED]



List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-interest@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to