Hi Jim, thanks for you quick reply !
do you mean i should break them into pieces ?
cause the tree structure only can have two children in maximum
if so ,so how about this one? break them too ?
javaSource
: (packageDeclaration)? (importDeclaration)* (typeDeclaration)*
->^(V packageDeclaration? importDeclaration* typeDeclaration*)
;
here means the java source file can contain package and import and type ,three
kinds of element
but i wrote that tree like that , is it right ?
any article about this ? i read the book of antlr many times on the tree
grammer ,but still didnt get all of it
thanks again!
BILL
在2009-10-05,"Jim Idle" <[email protected]> 写道: -----原始邮件-----
发件人:"Jim Idle" <[email protected]>
发送时间:2009年10月5日 星期一
收件人:"[email protected]" <[email protected]>
主题:Re: [antlr-interest] help on rewritting the tree
a: b -> ^(V b) ;
b : part (DOT^ part )* ;
part: ID( ABC )? ;
Jim
From:[email protected][mailto:[email protected]]on
Behalf Ofantlr_bill
Sent:Sunday, October 04, 2009 8:56 AM
To:[email protected]
Subject:[antlr-interest] help on rewritting the tree
can someone please help on this ?
i have an rule like this :
a:
: ID( ABC )? (DOT ID (ABC)? )*
;
how to rewrite it into a tree grammer ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address