next up previous contents
Next: Bison - generating parsers Up: Flex & Bison Previous: Flex & Bison   Contents

Flex - generating scanners

The Flex is a tool for generating scanners: programs which recognize lexical patterns in text. The Flex reads the given input files, or its standard input if no file names are given, for a description of a scanner to generate. The description is in the form of pairs of regular expressions and C code, called rules. The Flex generates as output a C source file, lex.yy.c, which defines a routine yylex(). When the routine is run, it analyzes its input for occurrences of the regular expressions. Whenever it finds one, it executes the corresponding C code.

The input file for the Flex to generate a scanner for the Controller, the Generator and the Validator is given in Appendix E.

The Flex is described in Appendix D and in [15,12] in details.



Igor Wojnicki 2001-02-21