def compile(self):
manipulation_set = pp.Optional(pp.Suppress(pp.Keyword("THEN")) +
pp.Suppress("|") + pp.SkipTo(pp.Suppress(";"), include=True))
manipulation_set.setParseAction(lambda x: self._add_manipulation_set(x[0]))
parser = (pp.Keyword("CONNECT") + self.connect_block.parser() +
pp.Keyword("RETRIEVE") + self.retrieve_block.parser() +
pp.Optional(pp.Keyword("JOIN") + self.join_block.parser()))
try:
parser.parseString(self.qgl_str)
except pp.ParseException, e:
raise QGLSyntaxError("Couldn't parse query: \n %s" % e)
self._create_connectors()
self._create_query_nodes()
if self.join_block:
self._create_joins()
if self.manipulation_set_str:
self.query_graph.manipulation_set.append_from_str(self.manipulation_set_str)
评论列表
文章目录