aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README27
-rw-r--r--exyapps/runtime.py5
2 files changed, 25 insertions, 7 deletions
diff --git a/README b/README
index 75d00c8..68b3302 100644
--- a/README
+++ b/README
@@ -1,10 +1,10 @@
This is exyapps, a LL(1) parser generator.
-It is derived from yapps ( http://theory.stanford.edu/~amitp/yapps/
-) by Amit J. Patel <amitp@cs.stanford.edu>. He is no longer
-maintaining it, and there seem to be several forks out there, all
-with varying version numbers. This copy was derived from some
-patches included with Debian by Matthias Urlichs <smurf@debian.org>
+It is derived from yapps ( http://theory.stanford.edu/~amitp/yapps/ )
+by Amit J. Patel <amitp@cs.stanford.edu>. He is no longer maintaining
+it, and there seem to be several forks out there, all with varying
+version numbers. This copy was derived from some patches included
+with Debian by Matthias Urlichs <smurf@debian.org>
Since I want to make some of my own specific changes, I'm actually changing
the name so this package can have a distinctive identity.
@@ -22,6 +22,13 @@ Installing / using exyapps
For now, the package is compatible with yapps; Someday, I want to
make parsers run without the exyapps package installed.
+VIM
+--
+
+Put this in .vimrc
+
+autocmd BufRead,BufNewFile *.exy set filetype=python
+
What is here?
--
@@ -48,3 +55,13 @@ test
not actual tests, but apparently some interesting input to
run through the parser for testing
+
+New Features
+--
+
+- 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/smash anything
+important, but this is easier to use in a particular application
+I have in mind.
+
diff --git a/exyapps/runtime.py b/exyapps/runtime.py
index 5d9d1d6..b0642fb 100644
--- a/exyapps/runtime.py
+++ b/exyapps/runtime.py
@@ -65,7 +65,7 @@ class Token(object):
in_name=0
class Scanner(object):
- """Yapps scanner.
+ """Yapps scanner. (lexical analyzer)
The Yapps scanner can work in context sensitive or context
insensitive modes. The token(i) method is used to retrieve the
@@ -357,8 +357,9 @@ class Parser(object):
"""
- def __init__(self, scanner):
+ def __init__(self, scanner, data=None):
self._scanner = scanner
+ self.data = data
def _stack(self, input="",file=None,filename=None):
"""Temporarily read from someplace else"""