summaryrefslogtreecommitdiff
path: root/static/v10/man1/lex.1
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 21:07:28 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 21:07:28 -0400
commit711594636704defae873be1a355a292505585afd (patch)
tree59ee13f863830d8beba6cfd02bbe813dd486c26f /static/v10/man1/lex.1
parent3258a063c1f189d7b019e40e525b46bef9b9a7b1 (diff)
docs: Added UNIX V10 Manuals
Diffstat (limited to 'static/v10/man1/lex.1')
-rw-r--r--static/v10/man1/lex.171
1 files changed, 71 insertions, 0 deletions
diff --git a/static/v10/man1/lex.1 b/static/v10/man1/lex.1
new file mode 100644
index 00000000..95dd3007
--- /dev/null
+++ b/static/v10/man1/lex.1
@@ -0,0 +1,71 @@
+.TH LEX 1
+.CT 1 prog_other
+.SH NAME
+lex \(mi generator of lexical analysis programs
+.SH SYNOPSIS
+.B lex
+[
+.B -tvfn
+]
+[
+.I file ...
+]
+.SH DESCRIPTION
+.I Lex
+generates programs to be used in simple lexical analysis of text.
+The input
+.I files
+(standard input default)
+contain regular expressions
+to be searched for, and actions written in C to be executed when
+expressions are found.
+.PP
+A C source program,
+.F lex.yy.c
+is generated, to be compiled thus:
+.IP
+.B cc lex.yy.c -ll
+.LP
+This program, when run, copies unrecognized portions of
+the input to the output,
+and executes the associated
+C action for each regular expression that is recognized.
+.PP
+The options have the following meanings.
+.TP
+.B -t
+Place the result on the standard output instead of in file
+.FR lex.yy.c .
+.TP
+.B -v
+Print a one-line summary of statistics of the generated analyzer.
+.TP
+.B -n
+Opposite of
+.BR -v ;
+.B -n
+is default.
+.TP
+.B -f
+`Faster' compilation: don't bother to pack
+the resulting tables; limited to small programs.
+.SH EXAMPLES
+This program converts upper case to lower,
+removes blanks at the end of lines,
+and replaces multiple blanks by single blanks.
+.PP
+.EX
+%%
+[A-Z] putchar(yytext[0]+\'a\'-\'A\');
+[ ]+$
+[ ]+ putchar(\' \');
+.EE
+.SH FILES
+.F lex.yy.c
+.SH "SEE ALSO"
+.IR yacc (1),
+.IR sed (1)
+.br
+M. E. Lesk and E. Schmidt,
+`LEX\(emLexical Analyzer Generator',
+this manual, Volume 2