Subversion Repositories programming

Rev

Rev 162 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
161 ira 1
#!/usr/bin/env python
2
# Copyright: Ira W. Snyder
3
# Start Date: 2005-11-18
4
# End Date:
5
# License: Public Domain
6
#
7
# Changelog Follows:
8
#
9
# 2005-11-18
10
# * Just getting the basics in place, since we haven't been given
11
#   the whole description of the project yet.
12
#
13
 
14
# Check for <Python-2.3 compatibility (boolean values)
15
try:
16
  True, False
17
except NameError:
18
  (True, False) = (1, 0)
19
 
20
class RecursiveDescentParser():
21
    def __init__(self):
22
        pass
23
 
24
    def __clear(self):
25
        self.str = ""   # the string of input to test
26
        self.strpos = 0 # the current position in str
27
 
28
    def __input_test_str(self):
29
        pass
30
 
31
    def main_menu(self):
32
 
33
        done = False
34
 
35
        while not done:
36
            print 'Menu:'
37
            print '========================================'
38
            print '1. Test a string'
39
            print '2. Quit'
40
            print
41
            s = raw_input('Choice >>> ')
42
            print
43
 
44
            if s == '1':
45
                self.__input_test_str()
46
                self.__test_str()
47
            elif s == '2':
48
                done = True
49
            else:
50
                print 'Bad Selection'
51
                print
52
 
53
 
54
if __name__ == '__main__':
55
    print 'Not complete yet, don\'t bother'
56