Example #1
0
 def visitVardecl(self, ctx: MCParser.VardeclContext):
     lst = []
     for x in ctx.var():
         if (x.INTLIT()):
             lst.append(
                 VarDecl((x.ID().getText()),
                         ArrayType(x.INTLIT().getText(),
                                   self.visit(ctx.pritype()))))
         else:
             lst.append(
                 VarDecl((x.ID().getText()), self.visit(ctx.pritype())))
     return lst
Example #2
0
 def visitVardecl(self, ctx: MCParser.VardeclContext):
     return [
         varlist(self.visit(ctx.pritype()))
         for varlist in self.visit(ctx.idlist())
     ]