/usr/share/doc/happy/html/happy-introduction.html is in happy 1.19.5-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 1. Introduction</title><link rel="stylesheet" type="text/css" href="fptools.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Happy User Guide"><link rel="up" href="index.html" title="Happy User Guide"><link rel="prev" href="index.html" title="Happy User Guide"><link rel="next" href="sec-reporting-bugs.html" title="1.2. Reporting Bugs"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. Introduction</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="sec-reporting-bugs.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="happy-introduction"></a>Chapter 1. Introduction</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="happy-introduction.html#sec-compatibility">1.1. Compatibility</a></span></dt><dt><span class="sect1"><a href="sec-reporting-bugs.html">1.2. Reporting Bugs</a></span></dt><dt><span class="sect1"><a href="sec-license.html">1.3. License</a></span></dt><dt><span class="sect1"><a href="sec-obtaining.html">1.4. Obtaining <span class="application">Happy</span></a></span></dt></dl></div><p> <span class="application">Happy</span> is a parser generator
system for Haskell, similar to the tool
<span class="application">yacc</span> for C. Like
<span class="application">yacc</span>, it takes a file containing an
annotated BNF specification of a grammar and produces a Haskell
module containing a parser for the grammar. </p><a class="indexterm" name="idp42465120"></a><p> <span class="application">Happy</span> is flexible: you can have several
<span class="application">Happy</span> parsers in the same program, and
each parser may have multiple entry points.
<span class="application">Happy</span> can work in conjunction with a
lexical analyser supplied by the user (either hand-written or
generated by another program), or it can parse a stream of
characters directly (but this isn't practical in most cases). In
a future version we hope to include a lexical analyser generator
with <span class="application">Happy</span> as a single package. </p><p> Parsers generated by <span class="application">Happy</span> are
fast; generally faster than an equivalent parser written using
parsing combinators or similar tools. Furthermore, any future
improvements made to <span class="application">Happy</span> will benefit
an existing grammar, without need for a rewrite. </p><p> <span class="application">Happy</span> is sufficiently powerful
to parse full Haskell
- <a class="ulink" href="http://www.haskell.org/ghc" target="_top">GHC</a> itself uses
a Happy parser.</p><a class="indexterm" name="idp42417472"></a><a class="indexterm" name="idp42418688"></a><p> <span class="application">Happy</span> can currently generate
four types of parser from a given grammar, the intention being
that we can experiment with different kinds of functional code to
see which is the best, and compiler writers can use the different
types of parser to tune their compilers. The types of parser
supported are: </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p><a name="item-default-backend"></a>`standard' Haskell 98 (should work with any compiler
that compiles Haskell 98).</p></li><li class="listitem"><a class="indexterm" name="idp46315840"></a><a class="indexterm" name="idp46316880"></a><p>standard Haskell using arrays (this is not the default
because we have found this generates slower parsers than <a class="xref" href="happy-introduction.html#item-default-backend">1</a>).</p></li><li class="listitem"><a class="indexterm" name="idp42361440"></a><a class="indexterm" name="idp42362192"></a><p>Haskell with GHC (Glasgow Haskell) extensions. This is a
slightly faster option than <a class="xref" href="happy-introduction.html#item-default-backend">1</a> for Glasgow Haskell
users.</p></li><li class="listitem"><p>GHC Haskell with string-encoded arrays. This is the
fastest/smallest option for GHC users. If you're using GHC,
the optimum flag settings are <code class="literal">-agc</code> (see
<a class="xref" href="sec-invoking.html" title="Chapter 5. Invoking Happy">Chapter 5, <i>Invoking <span class="application">Happy</span></i></a>).</p></li></ol></div><p>Happy can also generate parsers which will dump debugging
information at run time, showing state transitions and the input
tokens to the parser.</p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec-compatibility"></a>1.1. Compatibility</h2></div></div></div><p> <span class="application">Happy</span> is written in Glasgow Haskell. This
means that (for the time being), you need GHC to compile it.
Any version of GHC >= 6.2 should work.</p><p> Remember: parsers produced using
<span class="application">Happy</span> should compile without
difficulty under any Haskell 98 compiler or interpreter<a href="#ftn.idp42370912" class="footnote" name="idp42370912"><sup class="footnote">[1]</sup></a></p></div><div class="footnotes"><br><hr style="width:100; text-align:left;margin-left: 0"><div id="ftn.idp42370912" class="footnote"><p><a href="#idp42370912" class="para"><sup class="para">[1] </sup></a>With one
exception: if you have a production with a polymorphic type signature,
then a compiler that supports local universal quantification is
required. See <a class="xref" href="sec-type-signatures.html" title="2.4. Type Signatures">Section 2.4, “Type Signatures”</a>.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="sec-reporting-bugs.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Happy User Guide </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 1.2. Reporting Bugs</td></tr></table></div></body></html>
|