diff options
author | chak <unknown> | 2001-12-12 06:48:20 +0000 |
---|---|---|
committer | chak <unknown> | 2001-12-12 06:48:20 +0000 |
commit | c91cb5aed3054f0bba98d9d35dd07f7c1ad0ffff (patch) | |
tree | 1f7bb74752389ff7581150bf0124e9bf6a70e792 | |
parent | d39ac95d83935c361561f6782238419f3725a651 (diff) | |
download | haskell-c91cb5aed3054f0bba98d9d35dd07f7c1ad0ffff.tar.gz |
[project @ 2001-12-12 06:48:20 by chak]
Added some more details about parsing.
-rw-r--r-- | ghc/docs/comm/the-beast/syntax.html | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/ghc/docs/comm/the-beast/syntax.html b/ghc/docs/comm/the-beast/syntax.html index d54b4eed34..d337315ded 100644 --- a/ghc/docs/comm/the-beast/syntax.html +++ b/ghc/docs/comm/the-beast/syntax.html @@ -59,6 +59,22 @@ data ParseResult a = POk PState a for GHCi. All three require a parser state (of type <code>PState</code>) and are invoked from <a href="http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/ghc/compiler/main/HscMain.lhs"><code>HscMain</code></a>. + <p> + Parsing of Haskell is a rather involved process. The most challenging + features are probably the treatment of layout and expressions that + contain infix operators. The latter may be user-defined and so are not + easily captured in a static syntax specification. Infix operators may + also appear in the right hand sides of value definitions, and so, GHC's + parser treats those in the same way as expressions. In other words, as + general expressions are a syntactic superset of expressions - ok, they + <em>nearly</em> are - the parser simply attempts to parse a general + expression in such positions. Afterwards, the generated parse tree is + inspected to ensure that the accepted phrase indeed forms a legal + pattern. This and similar checks are performed by the routines from <a + href="http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/ghc/compiler/parser/ParseUtil.lhs"><code>ParseUtil</code></a>. In + some cases, these routines do, in addition to checking for + wellformedness, also transform the parse tree, such that it fits into the + syntactic context in which it has been parsed. <h2>The Haskell Interface Parser</h2> <p> @@ -73,7 +89,7 @@ data ParseResult a = POk PState a <p><small> <!-- hhmts start --> -Last modified: Sun Nov 18 21:22:38 EST 2001 +Last modified: Wed Dec 12 17:45:36 EST 2001 <!-- hhmts end --> </small> </body> |