Newbie programmer question: How do parsers work?(Python examples?)

Neil Cerutti horpner at yahoo.com
Fri Aug 25 16:21:41 EDT 2006


On 2006-08-25, bio_enthusiast <lancepickens at gmail.com> wrote:
> I was wondering exactly how you create a parser. I'm learning
> Python and I recently have come across this material. I'm
> interested in the method or art of writing a parser.
>
> If anyone has some python code to post for an abstract parser,
> or links to some informative tutorials, that would be great.

Start with the comp.compilers FAQ.

  http://compilers.iecc.com/faq.txt

For a treatment aimed at non-computer scientists, check out Jack
Crenshaw's Let's Build a Compiler series. The sample code is
Pascal, but translating it to Python is an OK way to learn Python
and get a taste of writing several different
recursive-descent-parsers.
  
  http://compilers.iecc.com/crenshaw/

You don't really need to know Pascal to be able to read the
simple, small, functions, as long as you have experience in other
similar languages.

-- 
Neil Cerutti
I'm tired of hearing about money, money, money, money, money. I
just want to play the game, drink Pepsi, wear Reebok.
--Shaquille O'Neal



More information about the Python-list mailing list