help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bison 2.0 - lex-param not working in C++


From: Hal
Subject: Bison 2.0 - lex-param not working in C++
Date: Sat, 10 Dec 2005 02:22:04 -0800

Hi

I hope this is the right list to ask. I have a problem where I really can't
work out what I could be doing wrong -- so I am beginning to wonder whether
it's a bison bug.

In a C++ parser using %skeleton "lalr1.cc" in bison 2.0, I want to specify
an extra argument to the lexer function yylex(). However, anything that I
put in %lex-param is entirely ignored. For example, if I add

%lex-param { int test_int }

Then bison runs, but nothing at all changes in the output. I can verify that
searching for "test_int" with grep in the directory turns up only the
mention in the bison .y file. In fact, adding %lex-param { a*b *c* d*e }
produces .tab.c and .tab.h files that compile just the same. The yylex()
function that is called always has only one or two arguments (depending on
whether %locations is specified).

%parse-param works as expected.

Can you shed any light on this?

Thanks!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]