forked from jhunkeler/exyapps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
95 lines (61 loc) · 2.52 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
This is exyapps, a LL(1) parser generator.
It is derived from yapps ( http://theory.stanford.edu/~amitp/yapps/
) by Amit J. Patel <amitp .at. cs.stanford.edu>. He is no longer
maintaining yapps, and there seem to be several forks out there,
all with varying version numbers. Matthias Urlichs <smurf .at.
debian.org> made some patches for Debian; this copy was derived
from the Debian distribution, by Mark Sienkiewicz <sienkiew .at.
stsci.edu> at the Space Telescope Science Institute.
Some of the modifications that changed yapps to exyapps introduced the
possibility of a fundmamental incompatibility with existing yapps2-based
parsers. This, coupled with the non-linear version numbers of the
various forks, prompted me to rename yapps to exyapps.
New Features of exyapps relative to yapps
--
- The generated parser no longer needs to have exyapps installed at
run time. The entire runtime is incorporated into the parser.
- You can pass a data object to the parser for it to use as
parser-global data. I know the OO way is to subclass the parser
object and hope you don't accidentally override anything important,
but I find easier to use in a particular application I have in mind.
Installing / using exyapps
--
python setup.py install
cd /your/project
exyapps my_grammar.exy
it will create a file named my_grammar.py
Modifying exyapps
--
The exyapps parser is written in exyapps. If you want to modify
yapps_grammar.g, use this procedure:
- install the current version of exyapps
- rm exyapps/grammar.py
- make
This will re-generate grammar.py, which will be your new parser. You can
install it somewhere else to try it.
VIM
--
To recognize .exy files and treat them as python, put this in .vimrc
autocmd BufRead,BufNewFile *.exy set filetype=python
This is not exactly an ideal configuration, but it is good enough.
What is here?
--
Makefile
yapps_grammar.g
yapps_grammar.g is the source code for exyapps/grammar.py
doc
latex source for the documentation - this is the original
document by Amit Patel; it has not been updated to reflect
the exyapps modifications.
examples
exyapps
the exyapps package that gets installed - this is only need
to compile the parser; you do not need to install exyapps
to run a generated parser.
scripts
"exyapps" command that compiles a parser into python code.
setup.py
regular setup.py using distutils
test
not actual tests, but apparently some interesting input to
run through the parser for testing