Exemple #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))
Exemple #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))
Exemple #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))
Exemple #4
0
 def acceptUnary(self, tree):
     name = str(tree.name)
     p = [self.stringfy(tree.expr)]
     self.pushFuncApp(name, p, get_corpus(name))
Exemple #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)