def visitMctype(self, ctx: MCParser.MctypeContext): if ctx.primetype(): return self.visit(ctx.primetype()) elif ctx.arraypointer(): return self.visit(ctx.arraypointer()) else: return VoidType()
def visitMctype(self, ctx: MCParser.MctypeContext): if ctx.VOID(): return VoidType() elif ctx.LS(): return ArrayPointerType(self.visit(ctx.primitive_type())) else: return self.visit(ctx.primitive_type())
def visitMctype(self, ctx: MCParser.MctypeContext): if ctx.INTTYPE(): return IntType elif ctx.FLOATLIT(): return FloatType elif ctx.STRINGLIT(): return StringType else: return BoolType
def visitMctype(self, ctx: MCParser.MctypeContext): if ctx.VOIDTYPE(): return VoidType() else: return self.visit(ctx.getChild(0))
def visitMctype(self,ctx:MCParser.MctypeContext): if ctx.INTTYPE(): return IntType() else: return FloatType()
def visitMctype(self, ctx:MCParser.MctypeContext): return 5 + self.visitMctype(ctx.mctype()) if ctx.getChildCount() != 1 else 1
def visitMctype(self, ctx: MCParser.MctypeContext): return 1 + self.visitMctype(ctx.mctype()) if ctx.mctype() else 0
def visitMctype(self, ctx: MCParser.MctypeContext): if ctx.getChildCount() == 6: return 0 # return number of leaf nodes from the third right hand side else: return 0 # return number of leaf nodes from the first or second right hand side
def visitMctype(self, ctx: MCParser.MctypeContext): # return IntType() or FloatType() if ctx.INTTYPE(): return IntType() if ctx.FLOATTYPE(): return FloatType()
def visitMctype(self,ctx:MCParser.MctypeContext): return IntType() if (ctx.INTTYPE()) else FloatType()