PLY is a straightforward lex/yacc implementation. Here is a list of its
* It is implemented entirely in Python.
* It uses LR-parsing which is reasonably efficient and well suited for larger
* PLY provides most of the standard lex/yacc features including support
for empty productions, precedence rules, error recovery, and support
for ambiguous grammars.
* PLY is straightforward to use and provides very extensive error checking.
* PLY doesn't try to do anything more or less than provide the basic lex/yacc
functionality. In other words, it's not a large parsing framework or a
component of some larger system.
PLY (Python Lex-Yacc) Version 2.3 (February 18, 2007)
David M. Beazley (firstname.lastname@example.org)
Copyright (C) 2001-2007 David M. Beazley
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later versio
Inspired by a September 14, 2006 Salon article "Why Johnny Can't Code" by
David Brin (http://www.salon.com/tech/feature/2006/09/14/basic/index.html),
I thought that a fully working BASIC interpreter might be an interesting,
if not questionable, PLY example. Uh, okay, so maybe it's just a bad idea,
but in any case, here it is.
In this example, you'll find a rough implementation of 1964 Dartmouth
calc - Simple calculator
classcalc - Simple calculate defined as a cla
This example is incomplete. Was going to specify an ANSI C parser.
This is part of it.
An example showing how to use Python optimized mode.
- First run 'python calc.py'
This example implements a program yply.py that converts a UNIX-yacc
specification file into
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999
Browse inside python-ply-2.3-2.el4.1.noarch.rpm