summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Beazley <dave@dabeaz.com>2022-10-27 13:50:46 -0500
committerDavid Beazley <dave@dabeaz.com>2022-10-27 13:50:46 -0500
commitee76ee7c4c0a0f1a53d013a6f0dd124f6a8a20f0 (patch)
treea228f02b0474c3be230f4044742528f3f21eb768
parentaf80858e888c5f36979da88fcb1080de7b848967 (diff)
downloadply-ee76ee7c4c0a0f1a53d013a6f0dd124f6a8a20f0.tar.gz
Bit more cleanup
-rw-r--r--README.md3
-rw-r--r--example/BASIC/basic.py3
-rw-r--r--example/BASIC/basiclog.py2
-rw-r--r--example/ansic/clex.py3
-rw-r--r--example/ansic/cparse.py1
-rw-r--r--example/calc/calc.py3
-rw-r--r--example/calcdebug/calc.py3
-rw-r--r--example/calceof/calc.py3
-rwxr-xr-xexample/classcalc/calc.py3
-rw-r--r--example/closurecalc/calc.py3
-rw-r--r--example/yply/ylex.py3
-rwxr-xr-xexample/yply/yply.py1
12 files changed, 2 insertions, 29 deletions
diff --git a/README.md b/README.md
index 9e4e3f9..1c10842 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,8 @@ Although PLY is open-source, it is not distributed or installed by
package manager. There are only two files: `lex.py` and `yacc.py`,
both of which are contained in a `ply` package directory. To use PLY,
copy the `ply` directory into your project and import `lex` and `yacc`
-from the associated `ply` subpackage.
+from the associated `ply` subpackage. Alternatively, you can install
+these files into your working python using `make install`.
```python
from .ply import lex
diff --git a/example/BASIC/basic.py b/example/BASIC/basic.py
index 8a8a500..a8a0ac9 100644
--- a/example/BASIC/basic.py
+++ b/example/BASIC/basic.py
@@ -1,9 +1,6 @@
# An implementation of Dartmouth BASIC (1964)
#
-import sys
-sys.path.insert(0, "../..")
-
import basiclex
import basparse
import basinterp
diff --git a/example/BASIC/basiclog.py b/example/BASIC/basiclog.py
index 9258e29..2463bc4 100644
--- a/example/BASIC/basiclog.py
+++ b/example/BASIC/basiclog.py
@@ -2,8 +2,6 @@
#
import sys
-sys.path.insert(0, "../..")
-
if sys.version_info[0] >= 3:
raw_input = input
diff --git a/example/ansic/clex.py b/example/ansic/clex.py
index 4bde1d7..5d99416 100644
--- a/example/ansic/clex.py
+++ b/example/ansic/clex.py
@@ -4,9 +4,6 @@
# A lexer for ANSI C.
# ----------------------------------------------------------------------
-import sys
-sys.path.insert(0, "../..")
-
import ply.lex as lex
# Reserved words
diff --git a/example/ansic/cparse.py b/example/ansic/cparse.py
index 5fe9bce..21c3478 100644
--- a/example/ansic/cparse.py
+++ b/example/ansic/cparse.py
@@ -4,7 +4,6 @@
# Simple parser for ANSI C. Based on the grammar in K&R, 2nd Ed.
# -----------------------------------------------------------------------------
-import sys
import clex
import ply.yacc as yacc
diff --git a/example/calc/calc.py b/example/calc/calc.py
index 406d83c..3eae2b2 100644
--- a/example/calc/calc.py
+++ b/example/calc/calc.py
@@ -5,9 +5,6 @@
# "Lex and Yacc", p. 63.
# -----------------------------------------------------------------------------
-import sys
-sys.path.insert(0, "../..")
-
tokens = (
'NAME', 'NUMBER',
)
diff --git a/example/calcdebug/calc.py b/example/calcdebug/calc.py
index 386000e..35de8ab 100644
--- a/example/calcdebug/calc.py
+++ b/example/calcdebug/calc.py
@@ -5,9 +5,6 @@
# with output routed to a logging object.
# -----------------------------------------------------------------------------
-import sys
-sys.path.insert(0, "../..")
-
tokens = (
'NAME', 'NUMBER',
)
diff --git a/example/calceof/calc.py b/example/calceof/calc.py
index 7bb7e0f..1ec8298 100644
--- a/example/calceof/calc.py
+++ b/example/calceof/calc.py
@@ -5,9 +5,6 @@
# demonstrates the use of the t_eof() rule.
# -----------------------------------------------------------------------------
-import sys
-sys.path.insert(0, "../..")
-
tokens = (
'NAME', 'NUMBER',
)
diff --git a/example/classcalc/calc.py b/example/classcalc/calc.py
index 6f35195..93bfeaa 100755
--- a/example/classcalc/calc.py
+++ b/example/classcalc/calc.py
@@ -9,9 +9,6 @@
# Class-based example contributed to PLY by David McNab
# -----------------------------------------------------------------------------
-import sys
-sys.path.insert(0, "../..")
-
import ply.lex as lex
import ply.yacc as yacc
import os
diff --git a/example/closurecalc/calc.py b/example/closurecalc/calc.py
index 59c9d6f..4fc0cd7 100644
--- a/example/closurecalc/calc.py
+++ b/example/closurecalc/calc.py
@@ -6,9 +6,6 @@
# lexing rules, parsing rules, and internal state are held inside the function.
# -----------------------------------------------------------------------------
-import sys
-sys.path.insert(0, "../..")
-
# Make a calculator function
diff --git a/example/yply/ylex.py b/example/yply/ylex.py
index 16410e2..6fb3692 100644
--- a/example/yply/ylex.py
+++ b/example/yply/ylex.py
@@ -3,9 +3,6 @@
# Author: David Beazley (dave@dabeaz.com)
# Date : October 2, 2006
-import sys
-sys.path.append("../..")
-
from ply import *
tokens = (
diff --git a/example/yply/yply.py b/example/yply/yply.py
index e24616c..b730fbb 100755
--- a/example/yply/yply.py
+++ b/example/yply/yply.py
@@ -21,7 +21,6 @@
#
import sys
-sys.path.insert(0, "../..")
import ylex
import yparse