add main back to QueryParser.py so we can create the parsetab.py file where we want it
authorDavid Blacka <david@blacka.com>
Mon, 14 Jul 2008 03:00:51 +0000 (23:00 -0400)
committerDavid Blacka <david@blacka.com>
Mon, 14 Jul 2008 03:00:51 +0000 (23:00 -0400)
rwhoisd/QueryParser.py
rwhoisd/parsetab.py [new file with mode: 0644]

index 7b9ed84..8133c30 100644 (file)
@@ -234,3 +234,10 @@ def parse(p, query):
         return p.parse(query)
     except (lex.LexError, yacc.YaccError), e:
         raise Rwhois.RwhoisError, (350, "Invalid Query Syntax: " + e.message)
+
+
+# NOTE: if you change the grammar, run this module from the 'rwhoisd'
+# directory to create the parsetab.py module there, rather than
+# wherever you run pyrwhoisd from.
+if __name__ == "__main__":
+    get_parser()
diff --git a/rwhoisd/parsetab.py b/rwhoisd/parsetab.py
new file mode 100644 (file)
index 0000000..2cdc4be
--- /dev/null
@@ -0,0 +1,41 @@
+
+# parsetab.py
+# This file is automatically generated. Do not edit.
+
+_lr_method = 'LALR'
+
+_lr_signature = '\xd1\x90\xe7\xda}\xb1\xca\xdb\xdfA\x9bp\xfe&\xa3\r'
+
+_lr_action_items = {'QUOTEDVALUE':([0,8,9,10,11,12,],[1,1,1,1,1,1,]),'AND':([1,2,3,4,5,6,13,14,15,16,17,18,19,],[-13,-10,-11,-12,-5,11,11,-8,-6,-9,-7,-3,-4,]),'ATTR':([0,8,9,10,11,12,],[2,2,14,16,2,2,]),'VALUE':([0,8,9,10,11,12,],[4,4,4,4,4,4,]),'CLASS':([0,],[8,]),'NEQ':([2,],[10,]),'EQ':([2,],[9,]),'OR':([1,2,3,4,5,6,13,14,15,16,17,18,19,],[-13,-10,-11,-12,-5,12,12,-8,-6,-9,-7,-3,-4,]),'$end':([1,2,3,4,5,6,7,13,14,15,16,17,18,19,],[-13,-10,-11,-12,-5,-2,0,-1,-8,-6,-9,-7,-3,-4,]),}
+
+_lr_action = { }
+for _k, _v in _lr_action_items.items():
+   for _x,_y in zip(_v[0],_v[1]):
+      if not _lr_action.has_key(_x):  _lr_action[_x] = { }
+      _lr_action[_x][_k] = _y
+del _lr_action_items
+
+_lr_goto_items = {'query':([0,8,],[6,13,]),'total':([0,],[7,]),'value':([0,8,9,10,11,12,],[3,3,15,17,3,3,]),'querystr':([0,8,11,12,],[5,5,18,19,]),}
+
+_lr_goto = { }
+for _k, _v in _lr_goto_items.items():
+   for _x,_y in zip(_v[0],_v[1]):
+       if not _lr_goto.has_key(_x): _lr_goto[_x] = { }
+       _lr_goto[_x][_k] = _y
+del _lr_goto_items
+_lr_productions = [
+  ("S'",1,None,None,None),
+  ('total',2,'p_total_class_query','QueryParser.py',102),
+  ('total',1,'p_total_query','QueryParser.py',108),
+  ('query',3,'p_query_oper_querystr','QueryParser.py',114),
+  ('query',3,'p_query_oper_querystr','QueryParser.py',115),
+  ('query',1,'p_query_querystr','QueryParser.py',125),
+  ('querystr',3,'p_querystr_attr_value','QueryParser.py',132),
+  ('querystr',3,'p_querystr_attr_value','QueryParser.py',133),
+  ('querystr',3,'p_querystr_attr_attr','QueryParser.py',138),
+  ('querystr',3,'p_querystr_attr_attr','QueryParser.py',139),
+  ('querystr',1,'p_querystr_value','QueryParser.py',144),
+  ('querystr',1,'p_querystr_value','QueryParser.py',145),
+  ('value',1,'p_value','QueryParser.py',150),
+  ('value',1,'p_quotedvalue','QueryParser.py',157),
+]