ALEX(1)

okay bestie, welcome to the Alex Lexical Analyser Generator manual πŸŽ€ (aka the alex command, and yes, it's iconic)

✨ NAME ✨

alex - the lexical analyser generator for Haskell πŸ’–

πŸ’… SYNOPSIS πŸ’…

alex [OPTION]... file [OPTION]...

πŸ¦‹ DESCRIPTION πŸ¦‹

So this page is a quick little intro to the alex command 🌸

This page was written for the Debian GNU/Linux distribution, ngl, because the original program doesn't come with a manual page of its own πŸ™ˆ. It has docs in other formats instead, including DVI, Info and HTML, which I'll mention below πŸ“š.

Alex is a lexical analyser generator system for Haskell 🌈 it's giving lex or flex vibes for C/C++.

Input files should be file.x, and alex spits out file.y 🧚

Caveat, bestie πŸ’€: if you're using hbc (Chalmers Haskell), the command arguments are set up a little differently. That's because the hbc run time system grabs some flags for itself (for setting things like the heap size, etc). You can get around it by adding a single dash (-) to your command line. So with an hbc generated version of Alex, the argument structure is:
alex - [OPTION]... file [OPTION]...

🌷 OPTIONS

Alex uses the usual GNU command line style, so long options start with two dashes (--) πŸ’ Here's a quick summary of the options. For the full deal, check out the other docs.

  • -d, --debug β€” tells Alex to make a lexer that prints debugging messages while it runs πŸ›
  • -g, --ghc β€” makes a lexer that's optimised for compiling with GHC πŸš€ It's significantly more efficient, both in terms of the size of the compiled lexer and its runtime πŸ”₯
  • -o FILE, --outfile=FILE β€” picks where the output goes πŸ“ By default, it's the name of the input file with the .x suffix swapped out for .hs
  • -i [FILE], --info[=FILE] β€” makes a human-readable version of the state machine (DFA) that Alex builds from your lexer, in FILE (default: file.info where the input file is file.x) πŸ”
    • heads up, the info file format is kinda basic right now and not super informative 😭
  • -v, --version β€” prints version info to standard output, then exits successfully βœ…

πŸ—‚οΈ FILES

Just one thing here: @DATADIR@ πŸ“

πŸ”— SEE ALSO

/usr/share/doc/alex, the Alex homepage (http://haskell.org/alex/) πŸ¦‹

Alex Version 3.5.4.0

Copyright (c) 1995-2003, Chris Dornan and Simon Marlow

πŸ‘‘ AUTHOR

This page was written by Ian Lynagh <igloo@debian.org>, based on the happy manpage, for the Debian GNU/Linux system. Anyone else is welcome to use it too 🫢


That's the tea, from Glasgow FP Suite, dated 2003-09-09, filed under ALEX(1)! Stay iconic, bestie πŸ’…βœ¨

πŸ“¦ where this page comes from