Changeset 560

Show
Ignore:
Timestamp:
07/11/08 11:25:27 (5 months ago)
Author:
athomas
Message:

Parse attributes on XML grammar root node.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cly/trunk/cly/builder.py

    r559 r560  
    10021002                              for k, v in self.node_aliases.items()]) 
    10031003 
    1004         if dom.firstChild.localName != 'grammar': 
     1004        grammar = dom.firstChild 
     1005        if grammar.localName != 'grammar': 
    10051006            raise XMLParseError('Invalid root element "%s", expected "grammar"' 
    1006                                 % dom.firstChild.localName) 
    1007  
    1008         self.parse_xml(self, dom.firstChild.firstChild) 
     1007                                % grammar.localName) 
     1008 
     1009        attributes = self.parse_attributes(self.__class__, grammar) 
     1010        self(**attributes) 
     1011        self.parse_xml(self, grammar.firstChild) 
    10091012 
    10101013    def parse_xml(self, parent, xnode):