Beispiel #1
0
 def acceptMethodExpr(self, tree):
     recv = self.stringfy(tree.recv)
     name = str(tree.name)
     fd = get_corpus(f'{recv}.{name}')
     if len(fd) > 0:
         p, p2 = self.params(tree.params, fd)
         self.pushFuncApp(name, p, fd, p2)
     else:
         fd = get_corpus(f'.{name}')
         if len(fd) > 0:
             p, p2 = self.params(tree.params, fd)
             p = [recv] + p
             self.pushFuncApp(name, p, fd, p2)
         else:
             self.push(str(tree))
Beispiel #2
0
 def acceptName(self, tree):
     name = str(tree)
     fd = get_corpus(name)
     if 'name' in fd:
         self.push(fd['name'])
     else:
         self.push(str(tree))
Beispiel #3
0
 def acceptSelfAssignment(self, tree):
     name = str(tree.name)
     p = [self.stringfy(tree.left), self.stringfy(tree.right)]
     self.pushFuncApp(name, p, get_corpus(name))
Beispiel #4
0
 def acceptUnary(self, tree):
     name = str(tree.name)
     p = [self.stringfy(tree.expr)]
     self.pushFuncApp(name, p, get_corpus(name))
Beispiel #5
0
 def acceptApplyExpr(self, tree):
     name = str(tree.name)
     fd = get_corpus(name)
     p, p2 = self.params(tree.params, fd)
     self.pushFuncApp(name, p, fd, p2)