String Parsing

Started by
12 comments, last by CoiN 22 years, 2 months ago
quote:Original post by OldGuy
I didn''t know there was a ''Son of Dragon''. I''ll have to pick it up; I thought the first one was excellent. I actually caught myself reading it for fun (what a nerd, right? )

Nah, not really. I did the same thing - read Son of... when I was 17 and really had no reason to.

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!
Advertisement
CoiN, I agree with Oluseyi and TerranFury that you should probably stick to straight C/C++. It could take a couple days to get the hang of regular expressions and LALR(1) parsing. However, recognize that lex and yacc are the "right way" to handle you parsing problem. Those tools are specifically designed for what you are doing (operator precedence, string tokenizing, recursion - aka context free grammar). Why spend hours writing that yourself when lex and yacc will generate a complete parser in a matter of minutes?

Oluseyi and TerranFury, yes, I know what an "expression tree" is. Like most programmers, I was required to write one in my data structures class in school. But I never think about writing one now. Just like I avoid writing my own hash tables and linked lists.


Edited by - poozer on February 2, 2002 1:22:47 AM
As with almost any computing problem:

1) Do it once yourself, so you understand and appreciate the area.
2) Then use the standard tools provided, as they are well-tested and well optimised.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost ]
Thanks everyone for the replys.... Muchos help, I''ve got it figured out in my head what I want to do now.

This topic is closed to new replies.

Advertisement