1
- ====================================
2
- PyParsing -- A Python Parsing Module
3
- ====================================
4
-
5
- Introduction
6
- ============
1
+ PyParsing -- A Python Parsing Module
2
+ ====================================
3
+
4
+ Introduction
5
+ ============
7
6
8
7
The pyparsing module is an alternative approach to creating and executing
9
8
simple grammars, vs. the traditional lex/yacc approach, or the use of
10
9
regular expressions. The pyparsing module provides a library of classes
11
10
that client code uses to construct the grammar directly in Python code.
12
11
13
12
Here is a program to parse "Hello, World!" (or any greeting of the form
14
- "< salutation>, < addressee> !"):
13
+ "salutation, addressee!"):
15
14
16
15
from pyparsing import Word, alphas
17
16
greet = Word( alphas ) + "," + Word( alphas ) + "!"
@@ -39,18 +38,18 @@ vexing when writing text parsers:
39
38
The .zip file includes examples of a simple SQL parser, simple CORBA IDL
40
39
parser, a config file parser, a chemical formula parser, and a four-
41
40
function algebraic notation parser. It also includes a simple how-to
42
- document, and a UML class diagram of the library's classes.
43
-
44
-
45
-
46
- Installation
47
- ============
48
-
49
- Do the usual:
50
-
41
+ document, and a UML class diagram of the library's classes.
42
+
43
+
44
+
45
+ Installation
46
+ ============
47
+
48
+ Do the usual:
49
+
51
50
python setup.py install
52
51
53
- (pyparsing requires Python 2.6 or later.)
52
+ (pyparsing requires Python 2.6 or later.)
54
53
55
54
Or corresponding commands using pip, easy_install, or wheel:
56
55
@@ -59,22 +58,22 @@ Or corresponding commands using pip, easy_install, or wheel:
59
58
easy_install pyparsing
60
59
61
60
wheel install pyparsing
62
-
63
-
64
- Documentation
65
- =============
66
-
67
- See:
68
-
69
- HowToUsePyparsing.html
70
-
71
-
72
- License
73
- =======
74
-
75
- MIT License. See header of pyparsing.py
76
-
77
- History
78
- =======
79
-
61
+
62
+
63
+ Documentation
64
+ =============
65
+
66
+ See:
67
+
68
+ HowToUsePyparsing.html
69
+
70
+
71
+ License
72
+ =======
73
+
74
+ MIT License. See header of pyparsing.py
75
+
76
+ History
77
+ =======
78
+
80
79
See CHANGES file.
0 commit comments