yecc question
Joe Armstrong
joe@REDACTED
Thu Jul 8 09:30:06 CEST 2004
A long time ago I wrote a tutorial on the use of yecc an leex
It's at
http://www.erlang.org/contrib/parser_tutorial-1.0.tgz
Cheers
/Joe
On Wed, 7 Jul 2004, David N. Welton wrote:
> Hi, I've been trying to put some yecc code together, but I'm a bit
> confused. The documentation gives a simple example:
>
> Nonterminals list elements element.
> Terminals atom '(' ')'.
> Rootsymbol list.
> list -> '(' ')'.
> list -> '(' elements ')'.
> elements -> element.
> elements -> element elements.
> element -> atom.
> element -> list.
>
> ... which doesn't report any errors when processed with yecc:yecc("foo",
> "bar"). So far so good. But then the manual has this:
>
> """The output file contains Erlang source code for a parser module with
> module name equal to the Parserfile parameter. After
> compilation, the parser can be called as follows (the module name is
> assumed to be myparser):
>
> myparser:parse(myscanner:scan(Inport))"""
>
> erlang-doc-html/html/lib/parsetools-1.2/doc/html/yecc.html
>
> The 'bar' module created above doesn't have any scan function, though:
>
> -export([parse/1, parse_and_scan/1, format_error/1]).
>
> Is there a simple (i.e. not an erlang parser!) functioning example I can
> look at somewhere?
>
> Thankyou,
>
More information about the erlang-questions
mailing list