version 1.20, 2005/02/08 09:12:16 |
version 1.21, 2007/05/30 05:52:33 |
|
|
.Op Fl S Ar skeleton |
.Op Fl S Ar skeleton |
.Op Ar filename ... |
.Op Ar filename ... |
.Sm on |
.Sm on |
.Sh OVERVIEW |
.Sh DESCRIPTION |
This manual describes |
.Nm |
.Nm , |
is a tool for generating |
a tool for generating programs that perform pattern-matching on text. |
.Em scanners : |
|
programs which recognize lexical patterns in text. |
|
.Nm |
|
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 |
|
.Em rules . |
|
.Nm |
|
generates as output a C source file, |
|
.Pa lex.yy.c , |
|
which defines a routine |
|
.Fn yylex . |
|
This file is compiled and linked with the |
|
.Fl lfl |
|
library to produce an executable. |
|
When the executable is run, it analyzes its input for occurrences |
|
of the regular expressions. |
|
Whenever it finds one, it executes the corresponding C code. |
|
.Pp |
The manual includes both tutorial and reference sections: |
The manual includes both tutorial and reference sections: |
.Bl -ohang |
.Bl -ohang |
.It Sy Description |
|
A brief overview of the tool. |
|
.It Sy Some Simple Examples |
.It Sy Some Simple Examples |
.It Sy Format of the Input File |
.It Sy Format of the Input File |
.It Sy Patterns |
.It Sy Patterns |
|
|
Known problems with |
Known problems with |
.Nm . |
.Nm . |
.El |
.El |
.Sh DESCRIPTION |
|
.Nm |
|
is a tool for generating |
|
.Em scanners : |
|
programs which recognize lexical patterns in text. |
|
.Nm |
|
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 |
|
.Em rules . |
|
.Nm |
|
generates as output a C source file, |
|
.Pa lex.yy.c , |
|
which defines a routine |
|
.Fn yylex . |
|
This file is compiled and linked with the |
|
.Fl lfl |
|
library to produce an executable. |
|
When the executable is run, it analyzes its input for occurrences |
|
of the regular expressions. |
|
Whenever it finds one, it executes the corresponding C code. |
|
.Sh SOME SIMPLE EXAMPLES |
.Sh SOME SIMPLE EXAMPLES |
First some simple examples to get the flavor of how one uses |
First some simple examples to get the flavor of how one uses |
.Nm . |
.Nm . |