148 lines
3.5 KiB
HTML
148 lines
3.5 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of OCAMLLEX</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>OCAMLLEX</H1>
|
|
Section: User Commands (1)<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<P>
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
ocamllex - The OCaml lexer generator
|
|
<P>
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>ocamllex</B>
|
|
|
|
[
|
|
<B>-o</B><I> output-file</I>
|
|
|
|
]
|
|
[
|
|
<B>-ml</B>
|
|
|
|
]
|
|
<I>filename.mll</I>
|
|
|
|
<P>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
The
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamllex">ocamllex</A></B>(1)
|
|
|
|
command generates OCaml lexers from a set of regular
|
|
expressions with associated semantic actions, in the style of
|
|
<B><A HREF="/cgi-bin/man/man2html?1+lex">lex</A></B>(1).
|
|
|
|
<P>
|
|
Running
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamllex">ocamllex</A></B>(1)
|
|
|
|
on the input file
|
|
<I>lexer</I>.mll
|
|
|
|
produces OCaml code for a lexical analyzer in file
|
|
<I>lexer</I>.ml.
|
|
|
|
<P>
|
|
This file defines one lexing function per entry point in the lexer
|
|
definition. These functions have the same names as the entry
|
|
points. Lexing functions take as argument a lexer buffer, and return
|
|
the semantic attribute of the corresponding entry point.
|
|
<P>
|
|
Lexer buffers are an abstract data type implemented in the standard
|
|
library module Lexing. The functions Lexing.from_channel,
|
|
Lexing.from_string and Lexing.from_function create
|
|
lexer buffers that read from an input channel, a character string, or
|
|
any reading function, respectively.
|
|
<P>
|
|
When used in conjunction with a parser generated by
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamlyacc">ocamlyacc</A></B>(1),
|
|
|
|
the semantic actions compute a value belonging to the type token defined
|
|
by the generated parsing module.
|
|
<P>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<P>
|
|
The
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamllex">ocamllex</A></B>(1)
|
|
|
|
command recognizes the following options:
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-ml</B>
|
|
|
|
<DD>
|
|
Output code that does not use OCaml's built-in automata
|
|
interpreter. Instead, the automaton is encoded by OCaml functions.
|
|
This option is mainly useful for debugging
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamllex">ocamllex</A></B>(1),
|
|
|
|
using it for production lexers is not recommended.
|
|
<DT id="2"><B>-o</B><I> output-file</I>
|
|
|
|
<DD>
|
|
Specify the name of the output file produced by
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamllex">ocamllex</A></B>(1).
|
|
|
|
The default is the input file name, with its extension replaced by .ml.
|
|
<DT id="3"><B>-q</B>
|
|
|
|
<DD>
|
|
Quiet mode.
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamllex">ocamllex</A></B>(1)
|
|
|
|
normally outputs informational messages
|
|
to standard output. They are suppressed if option
|
|
<B>-q</B>
|
|
|
|
is used.
|
|
<DT id="4"><B>-v</B> or<B> -version</B>
|
|
|
|
<DD>
|
|
Print version string and exit.
|
|
<DT id="5"><B>-vnum</B>
|
|
|
|
<DD>
|
|
Print short version number and exit.
|
|
<DT id="6"><B>-help</B> or<B> --help</B>
|
|
|
|
<DD>
|
|
Display a short usage summary and exit.
|
|
<P>
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ocamlyacc">ocamlyacc</A></B>(1).
|
|
|
|
<BR>
|
|
|
|
<I>The OCaml user's manual</I>,
|
|
|
|
chapter "Lexer and parser generators".
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="7"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="8"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="9"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="10"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="11"><A HREF="#lbAF">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:20 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|