flex: plex?

David M. Cooke cookedm+news at physics.mcmaster.ca
Tue Aug 17 18:01:42 EDT 2004


At some point, Peter Kleiweg <in.aqua.scribis at nl.invalid> wrote:

> Hi,
>
> I am looking for a Python equivalent of Flex. After some
> browsing, it seems that Plex is my best bet, but I would like to
> hear suggestions before I dive in.
>
> I have been using Flex a lot in combination with C programming.
> I never use Yacc (or Bison), though Flex and Yacc are supposed
> to be used together. But I found Yacc too cumbersome, and
> unnecessary. Yacc is about context-free grammars, nice if you
> like to describe an input language as a set of context-free
> rewrite rules. Flex is about finite-state automata, but can be
> extended to push-down automata (equivalent to context-free
> grammars) and beyond, as long as it stays deterministic. I found
> this to be very productive. I prefer automata over rewrite rules.

If you've been using Flex, you might want to check out FlexModule at
<http://www.cs.utexas.edu/users/mcguire/software/fbmodule/>
which allows you to use Flex to generate a lexer callable from python.

-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca



More information about the Python-list mailing list