From owner-cvs-all Wed Oct 27 10:51:41 1999 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id C450A14FA6; Wed, 27 Oct 1999 10:51:38 -0700 (PDT) (envelope-from obrien@FreeBSD.org) Received: (from obrien@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id KAA44299; Wed, 27 Oct 1999 10:51:38 -0700 (PDT) (envelope-from obrien@FreeBSD.org) Message-Id: <199910271751.KAA44299@freefall.freebsd.org> From: "David E. O'Brien" Date: Wed, 27 Oct 1999 10:51:37 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/usr.bin/yacc skeleton.c Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk 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 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