help-bison
[Top][All Lists]
Advanced

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

Re: bison-1.50: how to parse apostrophe?


From: Jan Nieuwenhuizen
Subject: Re: bison-1.50: how to parse apostrophe?
Date: Fri, 11 Oct 2002 17:57:11 +0200
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i386-debian-linux-gnu)

Akim Demaille <address@hidden> writes:

> Could you confirm that the following patch works?  Thanks!

Yes, Bison does now parse the grammar file.


However, now I found another problem: the resulting C++ code does not
compile.

A very quick partial report (I've got to go now).

In LilyPond's parser.yy we have:

   #define YYPARSE_PARAM my_lily_parser
   #define YYLEX_PARAM my_lily_parser

   extern My_lily_parser * current_parser;

   int
   yylex (YYSTYPE *s,  void * v)
   {
           My_lily_parser        *pars = (My_lily_parser*) v;
           My_lily_lexer * lex = pars->lexer_;

           lex->lexval = (void*) s;
           lex->prepare_for_next_token();
           return lex->yylex ();
   }

Which works with bison <= 1.35, but doesn't with 1.50a.  Has anything
changed wrt this?  If it doesn't ring a bell, I'll investigate some
further tomorrow or on Monday.

Thanks.
Greetings,
Jan.

bison -o out/parser.cc parser.yy
parser.yy: warning: 2 shift/reduce conflicts
mv -f parser.yy.tab.c out/parser.cc # bison < 1.30
mv: cannot stat `parser.yy.tab.c': No such file or directory
make: [out/parser.cc] Error 1 (ignored)
rm -f ./out/parser.dep; DEPENDENCIES_OUTPUT="./out/parser.dep ./out/parser.o" 
c++ -c   -DHAVE_CONFIG_H  -Iinclude -I./out -I../flower/include 
-I../flower/./out -I../flower/include -g   
-I/home/fred/usr/pkg/guile-1.7.0/include     -g   
-I/home/fred/usr/pkg/guile-1.7.0/include -Wall  -W -Wmissing-prototypes 
-Wconversion  -o out/parser.o out/parser.cc
out/parser.cc: In function `void yyreport_parse_error(int, int, yystype)':
out/parser.cc:1703: `my_lily_parser' undeclared (first use this function)
out/parser.cc:1703: (Each undeclared identifier is reported only once
out/parser.cc:1703: for each function it appears in.)
make: *** [out/parser.o] Error 1
rm out/parser.cc





-- 
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org





reply via email to

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