[ale] [OT] Writing a parser

Pete Hardie pete.hardie at sciatl.com
Thu Mar 18 08:41:42 EST 2004


Kevin Krumwiede wrote:
> I am working on a program to capture data from a MUD (actually, TW2002).
>  I've looked at the source for a couple parsers, including one made
> specifically for that game, but because they are generated code I'm
> having a lot of difficulty understanding how they work.  
> 
> The gist of what I do understand is this (and somebody please tell me if
> I'm wrong): parsers generally take a string of text and return a numeric
> code signifying what pattern (if any) the text matches.  A program can
> then use that code to decide how to process the text.  I assume that
> sophisticated parsers take into account the preceding context of the
> text when evaluating its pattern.
> 
> I am completely lost when it comes to the input languages of parser
> generators.  Anyone know of a good tutorial?

Not a tutorial, but the stands CompSci text book on compilers is good.  It's the 
"Dragon Book" by Aho, Ullman, and <mumble>, available at college bookstores, and 
probably online.

Also check out ANTLR, it is a parser builder, and has lots of examples.


-- 
Pete Hardie                   |   Goalie, DVSG Dart Team
     posting from, but not     |
     speaking for:             |
Scientific Atlanta, Digital Video Services Group



     - - - - - - -  Appended by Scientific-Atlanta, Inc.  - - - - - - -  
This e-mail and any attachments may contain information which is confidential, proprietary, privileged or otherwise protected by law. The information is solely intended for the named addressee (or a person responsible for delivering it to the addressee). If you are not the intended recipient of this message, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer.



More information about the Ale mailing list