Leex is an erlang version of Lex, a Lexical Analyzer Generator written by Robert Virding. Robert (and several others in #erlang on freenode) were incredibly helpful and considerate in helping me understand these tools.

Leex is a tokenizer. It breaks the pieces of your file or text into tokens. You can then use a tool like yecc to take these tokens and generate useful parsers.

First, you’ll need the source. Leex source is available here. Go down to the last post in the forum, download the attached file.

  1. Create a directory for your erlang packages. I chose ~/erlang.

  2. Drop the leex directory in your new erlang package directory.

  3. Edit your ~/.erlang file (it probably doesn’t exist yet) to include this line, making sure to use the path to your erlang package directory instead of mine:


You should be able to use the leex libraries now.