Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Oct 1999 10:51:37 -0700 (PDT)
From:      "David E. O'Brien" <obrien@FreeBSD.org>
To:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/usr.bin/yacc skeleton.c
Message-ID:  <199910271751.KAA44299@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
obrien      1999/10/27 10:51:37 PDT

  Modified files:
    usr.bin/yacc         skeleton.c 
  Log:
  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>
  
  Revision  Changes    Path
  1.25      +12 -9     src/usr.bin/yacc/skeleton.c



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199910271751.KAA44299>