grammar | index /Users/dcavar/Documents/Teaching/DGfS Herbstschule 2005/Code/grammar.py |
Filename: grammar.py
Author: Damir Cavar
Date: 19. Sept. 2005
(C) 2005 by Damir Cavar
This code is free; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This is a simple implementation of a context free grammar parser that
reads in files of the format:
----------- begin file example -----------
# my small example grammar
S -> NP VP
NP -> N
NP -> Art N
NP -> Art Adj N
VP -> V
VP -> V NP
# lexical rules
Art -> the
Art -> a
Adj -> green
Adj -> big
N -> dog
N -> cat
N -> mouse
V -> chase
V -> ignore
------------ end file example ------------
Modules | ||||||
|
Classes | ||||||||||
|