Skip to content
Snippets Groups Projects
Commit 22034d36725a authored by Paul McGuire's avatar Paul McGuire
Browse files

No commit message

No commit message
parent 19277c96b4c7
Branches
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
from pyparsing import Literal, CaselessLiteral, Word, delimitedList, Optional, \ from pyparsing import Literal, CaselessLiteral, Word, delimitedList, Optional, \
Combine, Group, alphas, nums, alphanums, ParseException, Forward, oneOf, quotedString, \ Combine, Group, alphas, nums, alphanums, ParseException, Forward, oneOf, quotedString, \
ZeroOrMore, restOfLine, Keyword, upcaseTokens ZeroOrMore, restOfLine, Keyword, upcaseTokens, pyparsing_common
# define SQL tokens # define SQL tokens
selectStmt = Forward() selectStmt = Forward()
...@@ -26,5 +26,4 @@ ...@@ -26,5 +26,4 @@
or_ = Keyword("or", caseless=True) or_ = Keyword("or", caseless=True)
in_ = Keyword("in", caseless=True) in_ = Keyword("in", caseless=True)
E = CaselessLiteral("E")
binop = oneOf("= != < > >= <= eq ne lt le gt ge", caseless=True) binop = oneOf("= != < > >= <= eq ne lt le gt ge", caseless=True)
...@@ -30,10 +29,6 @@ ...@@ -30,10 +29,6 @@
binop = oneOf("= != < > >= <= eq ne lt le gt ge", caseless=True) binop = oneOf("= != < > >= <= eq ne lt le gt ge", caseless=True)
arithSign = Word("+-",exact=1) realNum = pyparsing_common.real()
realNum = Combine( Optional(arithSign) + ( Word( nums ) + "." + Optional( Word(nums) ) | intNum = pyparsing_common.signed_integer()
( "." + Word(nums) ) ) +
Optional( E + Optional(arithSign) + Word(nums) ) )
intNum = Combine( Optional(arithSign) + Word( nums ) +
Optional( E + Optional("+") + Word(nums) ) )
columnRval = realNum | intNum | quotedString | columnName # need to add support for alg expressions columnRval = realNum | intNum | quotedString | columnName # need to add support for alg expressions
whereCondition = Group( whereCondition = Group(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment