yecc question

David N. Welton davidw@REDACTED
Wed Jul 7 15:08:36 CEST 2004


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,
-- 
David N. Welton
davidw@REDACTED



More information about the erlang-questions mailing list