Programming challenges: parsers!

Member
Posts: 749
Joined: 2003.01
Post: #1
I was writing a parser for my data files and I found it useful to put in a variable in the data, so while the parser would see something like "y=x+4", so knowing what x was, would find y.

Ok, that's pretty simple still it's something I've never done this kind of stuff before

It seems writing a robust parser is really something that can distinguish a good programmer from a bad one (or help you improve)

For instance a challenging but hopefully not too much is writing an numerical expression solver, with the 4 basic operations and an unlimited number of numbers and parenthesis.

I'll give it a shot when i find the time. I guess the next step would be write a bare bones scripting language, that must be pretty hard (but fun!)

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #2
An expression solver with simple variable substitution isn't too hard to write, parts of the SICP lectures describe the basics generically enough for it to be applicable to any programming language. Highly recommended, especially if you're coming from a C/C++ background.
Quote this message in a reply
Member
Posts: 749
Joined: 2003.01
Post: #3
Cool, thanks for the link.

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Moderator
Posts: 916
Joined: 2002.10
Post: #4
are we allowed to use perl? >_>
Quote this message in a reply
Post Reply