bug-bison
[Top][All Lists]
Advanced

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

Re: a probalem with Bison


From: josephus
Subject: Re: a probalem with Bison
Date: Mon, 06 Jun 2005 14:03:57 -0500
User-agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.8) Gecko/20050511

I understand I will reconfigure the makefile and the sources. I have installed Bison and it manufactured the data files. I really did not want the various language files. and the multilingual info files. I doubt that I could or would use it. However it is correctly installed. the commands now create .c .h and .output files. before it did not work correctly at all. my fault. sigh.

I have a file block.c created with Berkley Yacc. I compiled and linked it. It parses, the grammar is not sane but it will walk through the grammar. If it was reliable, I could fix the grammar. I will add this file just for the reference. I do not know where the source for it is.
              josephus


Paul Eggert wrote:
josephus <address@hidden> writes:


bison -v -d nualgol.y does not generate nualgol.table and does not
generate nualgol.tab.h


Unfortunately you haven't sent us a file named nualgol.y, so it won't
be easy for us to reproduce the problem.


I found the m4 files in the bison source direct y, but there is no
m4sugar.m4 there is no sugar anything.


This sounds like Bison wasn't installed correctly in your machine.
For example, if you installed Bison 2.0a by running the commands
"configure; make; make install" then you should be running the command
"/usr/local/bin/bison" and you should observe something like the
following behavior when you are running the shell:

   $ type bison
   bison is /usr/local/bin/bison
   $ find /usr/local/share/bison -name '*m4sugar*' -print
   /usr/local/share/bison/m4sugar
   /usr/local/share/bison/m4sugar/m4sugar.m4

If you get different behavior, then your Bison wasn't installed
correctly, and that is what you need to be looking at.



make install ... would mangle
my file system. not only would it maxed out the portion, it would
overwrite datafiles.


Please install into some other area, then.  For example:

   $ configure --prefix=/my/location
   $ make
   $ make install

This will install into /my/location/bin/bison, etc., rather than
/usr/local/bin/bison.  You can then repair things later by removing
/my/location.


I start with  algol.y and algol.l
bison -v -d algol.y
rename algol.tab.h algol.h
flex algol.l
compile and link.


I cannot reproduce the problem with the code that you submitted.  Can
you please resubmit exactly what you have now, using a gzipped tar
file as before?  Apparently you've made some changes.  Here's my
attempt to reproduce it:

   bash-2.05a$ bison -v -d algol.y
   bash-2.05a$ mv algol.tab.h algol.h
   bash-2.05a$ flex algol.l
   bash-2.05a$ make
   gcc -g -c lex.yy.c
   algol.l: In function 'yylex':
   algol.l:47: error: 'LONG' undeclared (first use in this function)
   algol.l:47: error: (Each undeclared identifier is reported only once
   algol.l:47: error: for each function it appears in.)
   algol.l:80: error: 'MOD' undeclared (first use in this function)
   algol.l: In function 'init':
   algol.l:150: error: invalid lvalue in assignment
   algol.l:153: error: invalid lvalue in assignment
   algol.l: In function 'symbol':
   algol.l:171: error: invalid lvalue in assignment
   algol.l:175: error: invalid lvalue in assignment
   algol.l:185: error: invalid lvalue in assignment
   algol.l: In function 'main':
   algol.l:220: warning: incompatible implicit declaration of built-in function 
'strcpy'
   make: *** [lex.yy.o] Error 1








reply via email to

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