[Please do not mail me a copy of your followup]
Post by Carl Daniel [VC++ MVP]I'll second Tom's suggestion - look at "compiler toolkits" like YACC/LEX,
Bison/Flex, ANTLR. They can be intimidating at first, but building a simple
lexer with them is actually quite easy.
If you'd like a pure C++ solution, you might consider Boost::Spirit
(www.boost.org).
I've learned lex/yacc via the "Dragon Book" and over the past year or
so became familiar with Spirit. Within the last month or so I looked
at ANTLR.
Of all those approaches, if I needed to write a little lexer or parser
now I would choose Spirit. Its like having a domain specific language
for your grammar right in C++. It can also do things that lex/yacc
just can't accomplish and it generally outperforms those other code
generation techniques as well. ANTLR has too manye external
dependencies for my tastes and it feels like a Mac tool that was
ported to Windows.
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>
Legalize Adulthood! <http://legalizeadulthood.wordpress.com>