New Parser Generator

Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
Reply

Join Date: Jun 2005
Posts: 2,047
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 139
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Super Senior Demiposter

Re: New Parser Generator

 
1
  #11
Dec 14th, 2008
It's not your compiler, it's you. Also, that file you linked doesn't use fgets.

Instead of using gets, you should use fgets.

But really you should use std::string functions.
Last edited by Rashakil Fol; Dec 14th, 2008 at 8:54 pm.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 7
Reputation: frencheneesz is an unknown quantity at this point 
Solved Threads: 0
frencheneesz frencheneesz is offline Offline
Newbie Poster

Re: New Parser Generator

 
0
  #12
Dec 14th, 2008
Paste an example where fgets is behaving buggily and I can take a look.
So I actually tested it on another computer - and gets does indeed crash it. This is one of those errors that make 0 sense. I just write them off as a bug in GCC.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 2,047
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 139
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Super Senior Demiposter

Re: New Parser Generator

 
3
  #13
Dec 14th, 2008
That's extremely dumb. Compiler errors are extremely rare, and you're not going to set one off just by using gets.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 7
Reputation: frencheneesz is an unknown quantity at this point 
Solved Threads: 0
frencheneesz frencheneesz is offline Offline
Newbie Poster

Re: New Parser Generator

 
0
  #14
Dec 15th, 2008
Come on. Please don't insult me. Look, I fixed the file up at the link I had given you - sorry I was careless about leaving gets out.

http://www.uweb.ucsb.edu/~frenchenee...Calculator.cpp

That does use gets, and it doesn't work properly. I shouldn't have said "crash" - that was misleading. The string is not recognized by my parser for some reason, and it fails. Commenting out fgets, and using my code makes it work. I don't believe there is any logical error. This is why I assumed something was wrong with the compiler.
Instead of using gets, you should use fgets.
Why? I would be very surprised if 'gets' didn't use 'fgets' under the covers.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 7
Reputation: frencheneesz is an unknown quantity at this point 
Solved Threads: 0
frencheneesz frencheneesz is offline Offline
Newbie Poster

Re: New Parser Generator

 
0
  #15
Dec 15th, 2008
Just to clarify, no offense, but I'm not actually looking for critique of my programming style. Much of this code was slapped together - I am not attempting to push it as the best example of C++ code.
Last edited by frencheneesz; Dec 15th, 2008 at 12:56 am.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 2,047
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 139
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Super Senior Demiposter

Re: New Parser Generator

 
2
  #16
Dec 15th, 2008
Originally Posted by Rashakil Fol View Post
I'll post an example of what I would consider to be a more comfortable C++ parser generator at this level of scope later tonight.
Er, tomorrow night.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC