Ann: Plex 0.1 - A Lexical Analysis Module

Greg Ewing greg at cosc.canterbury.ac.nz
Mon Feb 7 19:56:40 EST 2000


Having spent a couple of years wondering "when is someone
going to write a decent lexing module for Python", I finally
decided to do it myself.

You can take a sneak preview of what I've come up with so
far at:

http://www.cosc.canterbury.ac.nz/~greg/python/Plex

Briefly, you construct a scanner from a bunch of regexps,
rather like flex, set it loose on a character stream,
and it returns you tokens.

Main selling point: All the regexps are compiled into a single
DFA, which allows input to be processed in time linear in the
number of characters to be scanned, regardless of the number
or complexity of the regexps.

Let me know if you like it,


-- 
Greg Ewing, Computer Science Dept,
+--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+



More information about the Python-list mailing list