Comparison of parsers in python?

andrew cooke andrew at acooke.org
Sun Sep 20 10:36:49 EDT 2009


> So for the track definition, using a lexer package would be better
> than using regex in python, right?

they are similar.  a lexer is really just a library that packages
regular expressions in a certain way.  so you could write your own
code and you would really be writing a simple lexer.  the advantage of
writing your own code is that it will be easier to modify and you will
get more experience with regular expressions.  the advantage of using
a library (a lexer) is that it has already been tested by other
people, it is already packaged and so your code will be better
structured, and it may have features (perhaps logging, or handling of
quoted strings, for example) that will save you some work in the
future.

andrew




More information about the Python-list mailing list