diff options
author | obrien <obrien@FreeBSD.org> | 1999-10-27 17:51:37 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 1999-10-27 17:51:37 +0000 |
commit | 3a2839fec91869c508c910499095e99a8f6dac46 (patch) | |
tree | e45e4006625eb522b52507d20820cbe1a130a9dc /games | |
parent | 2c86d1cce1222f4c34a02bfe36cd6d558c6c8cef (diff) | |
download | FreeBSD-src-3a2839fec91869c508c910499095e99a8f6dac46.zip FreeBSD-src-3a2839fec91869c508c910499095e99a8f6dac46.tar.gz |
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>
Diffstat (limited to 'games')
0 files changed, 0 insertions, 0 deletions