The general form of a lex source file is:
definitions % rules % user routines
The definitions section contains any combination of:
where nnn is a decimal integer representing an array size and x selects the parameter.
Changes to internal array sizes could be represented as follows:
Table 2-3 Internal Array Sizesp |
Positions |
n |
States |
e |
Tree nodes |
a |
Transitions |
k |
Packed character classes |
o |
Output array size |
Lines in the rules section have the form:
expression action
where the action can be continued on succeeding lines by using braces to mark it.
The lex operator characters are:
" \ [] ^ - ? . * | () $ / {} <> +
Important lex variables, functions, and macros are:
Table 2-4 lex Variables, Functions, and Macrosyytext[] |
array of char |
yyleng |
int |
yylex() |
function |
yywrap() |
function |
yymore() |
function |
yyless(n) |
function |
REJECT |
macro |
ECHO |
macro |
input() |
macro |
unput(c) |
macro |
output(c) |
macro |