summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2016-09-15 06:01:28 +0000
committerptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2016-09-15 06:01:28 +0000
commit7495b8f797419780718394a8597d493e9e839f06 (patch)
tree78a3e8d9847510dc60036ef9410d461098f41f5e
parentfd6099fbc56bf108ab20409750a8887a9e703a11 (diff)
downloadpyparsing-7495b8f797419780718394a8597d493e9e839f06.tar.gz
git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@441 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
-rw-r--r--src/examples/simpleSQL.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/examples/simpleSQL.py b/src/examples/simpleSQL.py
index 7bbd4cd..09c028e 100644
--- a/src/examples/simpleSQL.py
+++ b/src/examples/simpleSQL.py
@@ -7,7 +7,7 @@
#
from pyparsing import Literal, CaselessLiteral, Word, delimitedList, Optional, \
Combine, Group, alphas, nums, alphanums, ParseException, Forward, oneOf, quotedString, \
- ZeroOrMore, restOfLine, Keyword, upcaseTokens
+ ZeroOrMore, restOfLine, Keyword, upcaseTokens, pyparsing_common
# define SQL tokens
selectStmt = Forward()
@@ -26,14 +26,9 @@ and_ = Keyword("and", caseless=True)
or_ = Keyword("or", caseless=True)
in_ = Keyword("in", caseless=True)
-E = CaselessLiteral("E")
binop = oneOf("= != < > >= <= eq ne lt le gt ge", caseless=True)
-arithSign = Word("+-",exact=1)
-realNum = Combine( Optional(arithSign) + ( Word( nums ) + "." + Optional( Word(nums) ) |
- ( "." + Word(nums) ) ) +
- Optional( E + Optional(arithSign) + Word(nums) ) )
-intNum = Combine( Optional(arithSign) + Word( nums ) +
- Optional( E + Optional("+") + Word(nums) ) )
+realNum = pyparsing_common.real()
+intNum = pyparsing_common.signed_integer()
columnRval = realNum | intNum | quotedString | columnName # need to add support for alg expressions
whereCondition = Group(