freebsd-skq/usr.bin/yacc
obrien 3a2839fec9 Allow a user specified parameter to 'yyparse()', in a manner similar to
that used by bison.  The names are consistent with the bison implementation
but this one also allows the type of the parameter to be specified.

For a desired prototype of:

	int yyparse __P((struct yyresult *));

and compile like this:

	yacc -dv grammar.y
	cc -c -DYYPARSE_PARAM_TYPE="struct yyresult *" \
	      -DYYPARSE_PARAM="parm" y.tab.c

and use like this:

	${
	#include "usrtypes.h"
	#include "usrproto.h"
	}$

	%token NUMBER

	%%

	goal : NUMBER
		{
		parm->value = yylval;
		} ;

If YYPARSE_PARAM_TYPE isn't specified then "void *" is the default type.
If YYPARSE_PARAM is not specified then the generated code behaves exactly
as traditional byacc.

PR:		13562
Submitted by:	W Gerald Hicks <wghicks@bellsouth.net>
1999-10-27 17:51:37 +00:00
..
test Regenerate to match changes made in the embedded yacc parser. 1999-07-23 23:13:44 +00:00
ACKNOWLEDGEMENTS
closure.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
defs.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
error.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
lalr.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
lr0.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
main.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Makefile $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
mkpar.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
NEW_FEATURES
NOTES
output.c Emit YYERRCODE into y.tab.h to help `lex' report scanning errors back to 1999-10-27 17:46:41 +00:00
reader.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
README
skeleton.c Allow a user specified parameter to 'yyparse()', in a manner similar to 1999-10-27 17:51:37 +00:00
symtab.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
verbose.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
warshall.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
yacc.1 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
yyfix.1 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
yyfix.sh Check that user supplied the required argument; and if not, show usage(). 1999-07-29 09:47:33 +00:00

    Berkeley Yacc is an LALR(1) parser generator.  Berkeley Yacc has been made
as compatible as possible with AT&T Yacc.  Berkeley Yacc can accept any input
specification that conforms to the AT&T Yacc documentation.  Specifications
that take advantage of undocumented features of AT&T Yacc will probably be
rejected.

    Berkeley Yacc is distributed with no warranty whatever.  The code is certain
to contain errors.  Neither the author nor any contributor takes responsibility
for any consequences of its use.

    Berkeley Yacc is in the public domain.  The data structures and algorithms
used in Berkeley Yacc are all either taken from documents available to the
general public or are inventions of the author.  Anyone may freely distribute
source or binary forms of Berkeley Yacc whether unchanged or modified.
Distributers may charge whatever fees they can obtain for Berkeley Yacc.
Programs generated by Berkeley Yacc may be distributed freely.

    Please report bugs to

			robert.corbett@eng.Sun.COM

Include a small example if possible.  Please include the banner string from
skeleton.c with the bug report.  Do not expect rapid responses.