help-bison
[Top][All Lists]
Advanced

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

Does Reverse Polish Notation Calculator example work?


From: Mike cai
Subject: Does Reverse Polish Notation Calculator example work?
Date: Fri, 31 Mar 2006 17:41:26 -0800 (PST)

Hi,
   
  I am learning to use bison. I read bison 2.1 online manual posted on 
http://www.gnu.org/software/bison/manual/html_mono/bison.html. There is an 
example in section 2.1 "Reverse Polish Notation Calculator". I typed in all the 
syntax rule and actions. I ran bison rpcalc.y and compile the output 
rpcalc.tab.c successful. When I try to run the program, it does not give 
correct result. No matter what expression I input, it returns 2.121995791e-314. 
For example,
  1 2 +
  2.121995791e-314
   
  It seems that the value of yylval is not passed to variables $1 and $2 in the 
action. Does anybody try that example successfully?
   
  By the way, I am using bison 2.1.
   
  Regards,
   
  M

                
---------------------------------
How low will we go? Check out Yahoo! Messenger’s low  PC-to-Phone call rates.


reply via email to

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