67 lines
2.7 KiB
HTML
67 lines
2.7 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
|
|
<TITLE>Lex and YACC primer/HOWTO: Introduction</TITLE>
|
|
<LINK HREF="Lex-YACC-HOWTO-2.html" REL=next>
|
|
|
|
<LINK HREF="Lex-YACC-HOWTO.html#toc1" REL=contents>
|
|
</HEAD>
|
|
<BODY>
|
|
<A HREF="Lex-YACC-HOWTO-2.html">Next</A>
|
|
Previous
|
|
<A HREF="Lex-YACC-HOWTO.html#toc1">Contents</A>
|
|
<HR>
|
|
<H2><A NAME="s1">1. Introduction</A></H2>
|
|
|
|
<P>Welcome, gentle reader.
|
|
<P>If you have been programming for any length of time in a Unix environment,
|
|
you will have encountered the mystical programs Lex & YACC, or as they
|
|
are known to GNU/Linux users worldwide, Flex & Bison, where Flex is a
|
|
Lex implementation by Vern Paxon and Bison the GNU version of YACC. We will
|
|
call these programs Lex and YACC throughout - the newer versions are
|
|
upwardly compatible, so you can use Flex and Bison when trying our examples.
|
|
<P>These programs are massively useful, but as with your C compiler, their
|
|
manpage does not explain the language they understand, nor how to use them.
|
|
YACC is really amazing when used in combination with Lex, however, the Bison
|
|
manpage does not describe how to integrate Lex generated code with your
|
|
Bison program.
|
|
<P>
|
|
<H2><A NAME="ss1.1">1.1 What this document is NOT</A>
|
|
</H2>
|
|
|
|
<P>There are several great books which deal with Lex & YACC. By all means
|
|
read these books if you need to know more. They provide far more information
|
|
than we ever will. See the 'Further Reading' section at the end. This
|
|
document is aimed at bootstrapping your use of Lex
|
|
& YACC, to allow you to create your first programs.
|
|
<P>The documentation that comes with Flex and BISON is also excellent, but no
|
|
tutorial. They do complement my HOWTO very well though. They too are
|
|
referenced at the end.
|
|
<P>I am by no means a YACC/Lex expert. When I started writing this document, I
|
|
had exactly two days of experience. All I want to accomplish is to make
|
|
those two days easier for you.
|
|
<P>In no way expect the HOWTO to show proper YACC and Lex style. Examples
|
|
have been kept very simple and there may be better ways to write them. If
|
|
you know how to, please let me know.
|
|
<H2><A NAME="ss1.2">1.2 Downloading stuff </A>
|
|
</H2>
|
|
|
|
<P>Please note that you can download all the examples shown, which are in
|
|
machine readable form. See the
|
|
<A HREF="http://ds9a.nl/lex-yacc">homepage</A> for details.
|
|
<P>
|
|
<H2><A NAME="ss1.3">1.3 License</A>
|
|
</H2>
|
|
|
|
<P>Copyright (c) 2001 by bert hubert. This material may be
|
|
distributed only subject to the terms and conditions set forth in the Open
|
|
Publication License, vX.Y or later (the latest version is presently
|
|
available at http://www.opencontent.org/openpub/).
|
|
<HR>
|
|
<A HREF="Lex-YACC-HOWTO-2.html">Next</A>
|
|
Previous
|
|
<A HREF="Lex-YACC-HOWTO.html#toc1">Contents</A>
|
|
</BODY>
|
|
</HTML>
|