From ee76ee7c4c0a0f1a53d013a6f0dd124f6a8a20f0 Mon Sep 17 00:00:00 2001 From: David Beazley Date: Thu, 27 Oct 2022 13:50:46 -0500 Subject: Bit more cleanup --- README.md | 3 ++- example/BASIC/basic.py | 3 --- example/BASIC/basiclog.py | 2 -- example/ansic/clex.py | 3 --- example/ansic/cparse.py | 1 - example/calc/calc.py | 3 --- example/calcdebug/calc.py | 3 --- example/calceof/calc.py | 3 --- example/classcalc/calc.py | 3 --- example/closurecalc/calc.py | 3 --- example/yply/ylex.py | 3 --- example/yply/yply.py | 1 - 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 -- cgit v1.2.1