def visitFuncall(self, ctx: MCParser.FuncallContext):
     #funcall: ID LB (exp (CM exp)*)?  RB;
     if ctx.getChildCount() == 3:
         return CallExpr(Id(ctx.ID().getText()), [])
     else:
         return CallExpr(Id(ctx.ID().getText()),
                         [self.visit(x) for x in ctx.exp()])
Exemple #2
0
 def visitFuncall(self, ctx: MCParser.FuncallContext):
     # funcall: ID LB (exp (CM exp)*)? RB;
     lstExp = []
     lst = ctx.exp()
     for item in lst:
         lstExp += [self.visit(item)]
     return CallExpr(Id(ctx.ID().getText()), lstExp)
 def visitFuncall(self, ctx: MCParser.FuncallContext):
     return CallExpr(Id(ctx.ID().getText()),
                     [self.visit(i) for i in ctx.exp() if ctx.exp()])
Exemple #4
0
    def visitFuncall(self, ctx: MCParser.FuncallContext):
        return CallExpr(Id(ctx.IDENTIFIER().getText()),
                        [self.visit(x) for x in ctx.exp()])


#========================================================================================
Exemple #5
0
 def visitFuncall(self, ctx: MCParser.FuncallContext):
     return CallExpr(Id(ctx.ID().getText()),
                     [self.visit(ctx.exp())] if ctx.exp() else [])