MCPcopy Create free account
hub / github.com/FlyingFeather/DEA-SQL / Rule

Class Rule

evaluation/ts_old/spider-master/baselines/nl2code/astnode.py:285–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283
284
285class Rule(ASTNode):
286 def __init__(self, *args, **kwargs):
287 super(Rule, self).__init__(*args, **kwargs)
288
289 assert self.value is None and self.label is None, 'Rule LHS cannot have values or labels'
290
291 @property
292 def parent(self):
293 return self.as_type_node
294
295 def __repr__(self):
296 parent = typename(self.type)
297
298 if self.label is not None:
299 parent += '{%s}' % self.label
300
301 if self.value is not None:
302 parent += '{val=%s}' % self.value
303
304 return '%s -> %s' % (parent, ', '.join([repr(c) for c in self.children]))
305
306
307if __name__ == '__main__':

Callers 2

to_ruleMethod · 0.85
get_productionsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected