[antlr-interest] Urgent help tree building

mzukowski at yci.com mzukowski at yci.com
Tue Sep 23 08:44:53 PDT 2003


Use manual tree building, so I turned off tree building for the rule.
Having null as the root below just means that the resulting tree will be all
siblings with no children.  In this case the second sibling is a tree with
EXTENDS as the root and a as the child.

name_def!:
	a:IDENT "subclass" COLON SHARP c:IDENT
	{##=#(null,c,#(#[EXTENDS,"EXTENDS"],a));}

Monty

-----Original Message-----
From: Nico [mailto:nico123 at adinet.com.uy] 
Sent: Monday, September 22, 2003 4:10 PM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] Urgent help tree building

Hi:
 
I have a question in building a tree with buildAST = true;
I am building a custom tree, from a partial Smalltalk-80 grammar.
 
When I have this Lexer rule:
 
name_def: 
 a:IDENT "subclass"! COLON! SHARP! c:IDENT
 
I want to create this tree:
 
- c:IDENT
- EXTENDS
   - a:IDENT
 
c:IDENT and EXTENDS are in same level. - a:IDENT is EXTEND'S child
and "subclass"! COLON! SHARP! don't want to be in the tree.
 
The source is:
 
Object subclass: #AClasesPOS2
 
How do i do that?I apreciate the help!
 
regards
 
Nico
 

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list