XML overuse? (was Re: Python to XML to Python conversion)

Christopher Browne cbbrowne at acm.org
Sat Jul 13 21:46:05 EDT 2002


pinard at iro.umontreal.ca (François Pinard) wrote:
> [Christopher Browne]
>> Yacc and Lex provide nice formal ways to describe grammars, can work with
>> the "Langues-du-jour," and it would be very instructive to see that they
>> _are_ usable for building parsers for small languages.
>
> Python users are blessed with many lexers/parsers systems.  Even if
> I glanced around, I surely do not know them all.  My favorite so far is
> SPARK, which is not only very elegant, but also quite simple to use and
> powerful at what it can recognise.  I also learned to like PLY.

Fair enough...

I'm pointing at Lex/Yacc since they provide _declarative_ ways of
describing grammars, which is commonly not what scripting language
schemes use.  (I'm afraid I'm not familiar with SPARK/PLY; perhaps
they are different?)

In addition, Lex/Yacc are commonly what are used to _build_ the
scripting language grammar, so they probably are hiding around
somewhere anyways :-).

Furthermore, what I'm trying to have as an underlying "theme" in the
"music" is that it might very well be easier to build a Lex/Yacc
grammar using C and link it in than to fight your way through
designing the XML-based system.  There may be more "elegant" options
than Lex/Yacc; the underlying theme is that that doesn't prevent the
"design-the-grammar-from-scratch" approach from being more manageable
than XML.
-- 
(reverse (concatenate 'string "gro.gultn@" "enworbbc"))
http://cbbrowne.com/info/spreadsheets.html
Why  are  there  flotation   devices  under  plane  seats  instead  of
parachutes?



More information about the Python-list mailing list