PSGPars (version 0.1)
/Users/dcavar/Documents/Teaching/DGfS Herbstschule 2005/Code/Charty/PSGPars.py
This is a storage and parser class for context free grammars
written in the format of reproduction or replacement rules.
(C) 2002, 2003 by Damir Cavar <email@example.com>
This code is written and distributed under the
GNU General Public License which means that its
source code is freely-distributed and available
to the general public.
See http://www.gnu.org/copyleft/gpl.html for details
on the license or the the file gpl.txt that should always be
distributed with this code.
A parser for context free Phrase Structure Grammars (PSG).
The grammars are restricted to:
a. only one non-terminal on the left side of a rule:
N -> x y z
b. Non-terminals and terminals on the right side
Rules are read in with the following constraints:
i. it is assumed that all elements on the left side of a rule
ii. all elements that are not in the set of non-terminals
(appear on the right side, but never on the left side) are
assumed to be terminals
This code can be opimized. However, its main purpose is to help
students understand how simple chart parsing works. If there are any bugs,
please let me know: Damir Cavar <firstname.lastname@example.org>
|__author__ = 'Damir Cavar'|
__version__ = '0.1'