-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoverview.txt
17 lines (10 loc) · 1001 Bytes
/
overview.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
high level overview
The modules in this directory are used to make a parser from a language specification. The parser can then translate token streams into syntax trees, which can be evaluated.
primitives.py: mostly plain old data classes used by many other modules.
prettyprint.py: renders nice ASCII tables generated by the table classes.
table.py: LR table class. Generates action and goto tables for the LR parser.
SLRtable.py: same as table.py, but less prone to conflicts that make parsing impossible.
parseRules.py: converts a string representing a language spec, into a collection of primitives that represent the language spec.
LRParser.py: does the actual parsing. Taking the tables produced earlier, it can convert language strings into syntax trees.
util.py: convenience function for making it easier to construct parsers.
SimpleBinExpression: code specific to a sample language, including code that evaluates the syntax tree and produces human-readable results. Go here for a demo.