[antlr-interest] Thoughts on tree construction

Oliver Zeigermann oliver at zeigermann.de
Fri May 7 14:43:47 PDT 2004


Mark Lentczner wrote:
> 1st: The DOM has a tremendous amount of cruft that is very XML 
> specific.  None of this would be applicable to parsing.

I thought the DOM document merely is a tree where each node also may 
have attributes. What is XML specific here? Have I missed anything?

> 2nd: By encoding information from a parse in both attributes and 
> elements, the complexity of the structure of the AST is increased.  
> Similarly, the structure of tree parsers would also have to be 
> increased.  There would need to be a more complex syntax for matching 
> since attributes and elements would need to be matched.

Not necessarily. AFAIK no XML schema allows attributes to be more than 
mere annotations. I.e. you can not use them to steer the direction of 
the parse. This means you can not use attributes to either allow or 
forbid subsequent elements. This in turn means there is not need to 
specify attributes in tree grammars. Thus I agree that attributes are 
merely instance variables of ASTs, no need to formalize anything here.

Oliver


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

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



More information about the antlr-interest mailing list