help-bison
[Top][All Lists]
Advanced

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

Re: Help to execute "A Complete C++ example"


From: ooklac
Subject: Re: Help to execute "A Complete C++ example"
Date: Thu, 1 Jun 2006 17:17:46 -0500

Updating to flex 2.5.4 from 2.5.31 solved the problem for me.  Thanks!

On 5/30/06, Anouar LACHHEB <address@hidden> wrote:


Hi ooklac,

I compiled again the source files on a RedHat linux 32 bits machine using as
usual flex 2.5.4a, bison 2.1 & g++ 3.3 and it works fine. I'm sure that I
did not changed any source file. However, I attached a .tar.gz.

Below is a snapshot.

address@hidden/YieldTracker/C++/Calculator(62)
:source compile.csh
mkdir: cannot create directory `.deps': File exists

>>>> flex Done
>>>> bison Done
>>>> g++ Calculator.l.cpp Done
>>>> g++ Calculator.cpp Done
>>>> g++ Calculator_driver.cpp Done
>>>> g++ Calculator.y.cpp Done
>>>> Linking Done
address@hidden/YieldTracker/C++/Calculator(63) :ll
total 2116
   4 drwxr-x---    3 dft          4096 May 30 17:03 ./
   4 drwxr-x---    5 dft          4096 Apr 24 15:14 ../
 692 -rwxr-x---    1 dft        701962 May 30 17:03 Calculator*
   4 -rw-r-----    1 dft           369 Feb 28 15:38 Calculator.cpp
   4 -rw-r-----    1 dft           659 May  8 14:21 Calculator_driver.cpp
   4 -rw-r-----    1 dft           993 Feb 28 14:33 Calculator_driver.hpp
 320 -rw-r-----    1 dft        322604 May 30 17:03 Calculator_driver.o
   4 -rw-r-----    1 dft          1128 Mar  1 13:37 Calculator.l
  40 -rw-r-----    1 dft         38840 May 30 17:03 Calculator.l.cpp
 232 -rw-r-----    1 dft        230452 May 30 17:03 Calculator.l.o
 164 -rw-r-----    1 dft        162180 May 30 17:03 Calculator.o
   4 -rw-r-----    1 dft          1501 Feb 28 14:34 Calculator.y
  24 -rw-r-----    1 dft         23235 May 30 17:03 Calculator.y.cpp
  12 -rw-r-----    1 dft          9136 May 30 17:03 Calculator.y.hpp
 572 -rw-r-----    1 dft        577992 May 30 17:03 Calculator.y.o
   8 -rw-r-----    1 dft          6815 May 30 17:03 Calculator.y.output
   4 -rw-r-----    1 dft          1642 Apr 24 10:03 compile.csh
   4 drwxr-x---    2 dft          4096 Feb 28 15:14 .deps/
   4 -rw-r-----    1 dft            69 Feb 27 17:56 in.calc
   4 -rw-r-----    1 dft          3121 May 30 17:03 location.hh
   4 -rw-r-----    1 dft          3178 May 30 17:03 position.hh
   4 -rw-r-----    1 dft          2300 May 30 17:03 stack.hh
address@hidden/YieldTracker/C++/Calculator(64)
:Calculator in.calc
50
address@hidden/YieldTracker/C++/Calculator(65) :more
in.calc
two := 2
three := 3
five := three + two
ten := five * two
ten * five
address@hidden/YieldTracker/C++/Calculator(66)


Best regards,
AnL.

-----Original Message-----
From: address@hidden [
mailto:address@hidden On
Behalf Of address@hidden

Sent: Tuesday, May 30, 2006 4:52 PM
To: address@hidden
Subject: Fwd: Help to execute "A Complete C++ example"


---------- Forwarded message ----------
From: address@hidden <address@hidden>
Date: May 16, 2006 3:06 PM
Subject: Re: Help to execute "A Complete C++ example"
To: Anouar LACHHEB <address@hidden>


Hmmm...I get the following from running compile.csh
>>>> flex Done
>>>> bison Done
>>>> g++ Calculator.l.cpp Done
>>>> g++ Calculator.cpp Done
>>>> g++ Calculator_driver.cpp Done
>>>> g++ Calculator.y.cpp Done
Calculator.y.o(.text+0xb7c): In function
`yy::Calculator_parser::parse()':
/home/mblackmon/c++/Calculator/Calculator.y.cpp:289:
undefined reference to `Calculator_lex(YYSTYPE*, yy::location*,
Calculator_driver&)'
collect2: ld returned 1 exit status

With bison 2.1, flex 2.5.31, and g++ 4.0.2 on Redhat 4.0.2-8

On 4/24/06, Anouar LACHHEB <address@hidden> wrote:
> Hi Anuradha;
>
> You'll find attached the complete C++ calculator sample including a
> customized "compile.csh" file with no compile errors.
>
> You can take that compile.csh and build up your make file.
>
> Best regards,
> AnL.
>
> -----Original Message-----
> From: address@hidden
> [
mailto:address@hidden On
Behalf Of

> Anuradha Somayaji
> Sent: Wednesday, April 19, 2006 7:36 AM
> To: address@hidden
> Subject: Help to execute "A Complete C++ example"
>
>
> I am a newbie trying to use Bison 2.1 to help build a C++ ast tree
> structure. So before that, when i wanted to try Bison out, i checked
> the section 10.1 "A Complete C++ example" as given in the
>
http://www.gnu.org/software/bison/manual/html_mono/bison.html,
I get a

> lot of compilation errors (unknown cin, cout, undeclared yyin,
> yyrestart, cerr,
> etc) when doing
> >g++ -c lex.yy.cc
>
> For all other files, [calc++-driver.cc, calc++-parser.tab.cc
> (generated by bison 2.1) and  calc++.c]  the g++ -c option was
> successful. Can you please let me know the order in which i should
> compile these files and the exact commands i should use to compile and
> execute the c++ calculator? It will also be helpful if you could point
> to a web-page where a
> C++ ast object has been built using bison.
>
> Thanks and regards,
> Anuradha S
> _______________________________________________
> address@hidden
http://lists.gnu.org/mailman/listinfo/help-bison

>
>
> _______________________________________________
> address@hidden
http://lists.gnu.org/mailman/listinfo/help-bison
>
>
>


_______________________________________________
address@hidden
http://lists.gnu.org/mailman/listinfo/help-bison






reply via email to

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