BUAParser
index
/Users/dcavar/Documents/Teaching/DGfS Herbstschule 2005/Code/BUAParser.py

BUAParser.py
(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 an implementation of a simple agenda-based buttom-up parser with
backtracking.
 
You can change the behavior of the parser by setting the value in the code
line:
 
strategy = FIFO
 
to the LIFO or FIFO. This simulates breadth first or depth first, respectively.

 
Modules
       
grammar
sys

 
Functions
       
parse(input, grammar, rootsymbol)
Simple non-recursive bottom up parser.

 
Data
        FIFO = 0
LIFO = -1
strategy = -1