Skip to main content
GameDev.net gamedev.net
🔒 Locked

PARSING

Started by arithma Nov 10, 2005 at 2:10 AM 7 replies 1k views
Original Post
arithma
arithma
Any body interested in reading a tutorial about how to do parsing. There will be dynamic parsing (parsing against dynamic grammar rules). Am going to code the project anyway so I can document it and make tutorialize it any way? NOTE: I haven't read any formal academic "anything" about the subject, so my vocabulary would not be the same as those used in the Dragon Book ( sadly I don't know where to get it, well there is that library but it's just far ) Any way I would like some feedback and suggestions
PaulCesar
PaulCesar
Im sorry , but what exactly are you talking about? LOL. By that i mean, what are you talking about parsing? A file format? A language? The pure fact that your question was so generic makes me question your capability of writing a tutorial for anything complex enough to warrent a tutorial, but im sure there are some on here he would gladly take any help they can get.
arithma
arithma
It started as language parsing but it is very applicable to file format parsing as well.
It would basically use an auxiliary data structure to describe the language to search for the first match.

An yes I am a newbie on this, I have only one working project that is related to parsing expressions. However I won't post the tutorial unless it is attached to something solid.
Emmanuel Deloget
Emmanuel Deloget
What is a dynamic grammar?

Parsing is a bit harder than just playing with strings, and I suggest you to read more formal documents about this subject before writing an article about it. Not only you'll have to understand what a grammar is, what a lexical scanner is, what a syntax scanner is, and so on, but you'll also have to make people understand these notions. If the readers want to have a better understanding then they'll read more academic documents - if you don't use the same vocabulary, it will be harder for them to see the links between your article and the one they are reading.

Writing a tutorial won't really help (in fact, most tutorial don't really help because most of them is more or less a "I did this and this and it was ok. Then I did that and it was ok too"). You have to explain why things work, not to tell use what will work or not - and to do that, you'll have to write a fully featured article.

AFAIK you can buy the dragon book from amazon if you can't find it in your area :)

Courage ! :)

Regards,
Basiror
Basiror
i suggest you search for parser generators

you can use them to describe a language or what ever with a grammer and the generator creates the lexer and parser classes

i once did this with antlr for java but there are some nice generators for c++ as well
http://www.8ung.at/basiror/theironcross.html
Steadtler
Steadtler
Dont get the dragon book, it is famous but truly horrible. Its one of the worst academic book I ever laid my eyes on in 6 years of college. If you want a good book on parsing, I suggest "Modern Compiler Design" by Grune,Bal & Jacobs.

Some formal language can always help in any tutorial, but I dont know if many people here want and need to hear about LALR(1) syntaxic grammars and all 163 categories of semantic grammar.

If you dont feel comfortable with the subject, maybe a post-mortem about your project would be more appropriate? Just a suggestion, good luck!
Extrarius
Extrarius
Quote:
Original post by Steadtler
Dont get the dragon book, it is famous but truly horrible. Its one of the worst academic book I ever laid my eyes on in 6 years of college. [...]
Maybe you're talking of the 'Green Dragon' book?
There are currently two books called the Dragon Book, and apparently a third on the way.

The Red Dragon Book ("Compilers: Principles, Techniques and Tools" ISBN 0201100886) is IMO an excellent resource on compiling, as you can see from my review here.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
nmi
nmi
Quote:
Original post by Extrarius
The Red Dragon Book ("Compilers: Principles, Techniques and Tools" ISBN 0201100886) is IMO an excellent resource on compiling, as you can see from my review here.


I agree. It's probably the best book about that subject available.
smiley_horse
smiley_horse
I also like that book, however it's very complex & somewhat aged by today. While contructing parser & grammars & hash tables is still valid aktuell today, there some subject that doesn't really need to belong into a book about compilers. Such as a chapter about hashing. I also found it a bit short on some practical issues and to be noted - it's not a book for someone who is new to programming.

But if you know how to implement theory by yourself then it's still coolest one to go for :D.

I also suggest the tiger book (why does that sounds phunny), by Mr. Appel:

http://www.amazon.com/gp/product/0521583888/qid=1133331653/sr=1-1/ref=sr_1_1/103-0049683-5561423?s=books&v=glance&n=283155

It is very practical book, and has more up-to-date optimization theory that you wan't find in the old dragon book.

However I really wonder why should you write a tutorial about parsing techniques if you only has done one project about the subject? :). I mean - there is literally thousands of tutorials around the net on that subject. It's probably one of most (ab)used topics when it comes to tutorials & libraries.

Take a look overhere to get some starting point: http://www.compilers.net/.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.