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
def visitVardecl(self, ctx: MCParser.VardeclContext): return [ varlist(self.visit(ctx.pritype())) for varlist in self.visit(ctx.idlist()) ]