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()