12 Jun 16:36
Name Conflict With Multiple Parsers In Same Program
Bob Smith <bsmith <at> sudleyplace.com>
2007-06-12 14:36:48 GMT
2007-06-12 14:36:48 GMT
I'm trying to use two parsers in the same program to parse different
grammars. The %name-prefix declaration works fine for as far as it goes.
However, I'm also using
#define YYDEBUG 1
%pure-parser
%lex-param {LPPLLOCALVARS lpplLocalVars}
%parse-param {LPPLLOCALVARS lpplLocalVars}
as well as function prototypes which complicates the picture.
Each source file (including the .c files generated from the .y files)
has its own separate file with an extension of .pro which consists of
the compiler's output from generating the source file's prototypes.
For example, one of the generated .pro files has an entry for
extern int __cdecl fh_yyparse(void );
while the other has
extern int __cdecl pl_yyparse(void );
corresponding to %name-prefix="fh_yy" and %name-prefix="pl_yy"
respectively in the two source files. All of the prototype files are
#included in one header file and that file is #included in every
source file (with appropriate #ifdefs around it for when the
prototypes are being generated).
Thus, there is a file called "compro.h" which has a line for each
(Continue reading)
> That would explain the problem: Bison doesn't support that,
> and is designed only for separate compilation.
On the other hand, if there are only four names which haven't been
namespacified, would it be difficult to admit it?
Hans Aberg
RSS Feed