|Aug 4, 2007, 12:31 AM||#1|
Writting a C++ Parser
Well, that may sound too vague, but I am trying to improve my skills in writing parsers. So far for C++ I haven't tried to look at any other type of parser other than recursive descent.
All I would like is to have some resources to get started with writing recursive descent parsers. Examples, tutorials, etc.
PS. If the resources are for Cocoa, I still want them
|Aug 11, 2007, 08:44 PM||#3|
I don't know I forgot if C++ is context sensitive or not
I would only do a recurcive decent parser for a simple language. The
last two I wrote I simply used LEX/YACC. It is so much easier and
you can be done in an hour.
But RD is easy, just write some functions that return "true" on a match.
Google found this. Looks good
|Aug 12, 2007, 06:32 AM||#5|
Flex/Bison are alternatives to Lex/Yacc, that I've personally used.
Probably the best resource that you can have for writing a compiler is the Dragon book. There's quite a lot of theory to wade through before you get to the juicy bits. For example, you're going to need to have a good understanding of BNF.
If I recall correctly, there are a lot of ambiguities in the C++ grammar that make writing a compiler for it difficult. That contrasts with C, which has only one ambiguity, the 'dangling else'.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|writting a proper mpkg||BruisedGhost||Mac Programming||2||Sep 29, 2008 12:46 PM|
|powermac superdrive writting speed questions||flyin3d||Macintosh Computers||2||Sep 23, 2005 08:15 PM|
|Help writting a basic Java app||mgiddy911||Mac Programming||11||Oct 15, 2004 11:52 AM|
|Writting app with 17" PowerBook?||Wano||Mac Applications and Mac App Store||2||Mar 30, 2003 06:37 PM|
All times are GMT -5. The time now is 05:18 PM.