XML based programming language

Laurent Pointal laurent.pointal at limsi.fr
Mon Mar 19 08:52:56 EDT 2007


stefaan a écrit :
>> Elementtree isn't lex. You are comparing apples and oranges here. Lex
>> tokenizes, yacc creates trees. Both of is covered in XML itself - it's
>> defined the tokenization and parsing, built into elementtree. So,
>> elemnttree is lex _and_ yacc for XML. And if your language is written in
>> XML, that's all there is to it.
> 
> I see your point. But yacc does more: I specify a grammar, and yacc
> will
> reject input files that do not conform to the grammar.
> Elementtree OTOH will happily accept any valid XML file, all checking
> has to
> implememented manually by me.
> 
> Best regards,
> Stefaan.
> 

For an XML represented programming language, isn't the DTD (or other XML
  definition format) your grammar?

IE. Just use an XML validator tool and you dont need to write checking.
DTDs may be not enough, see other definitions tools.




More information about the Python-list mailing list