def visitStatement(self, ctx: DecafParser.StatementContext):
        line_num = ctx.start.line
        expression = ctx.expr(0)

        # 11 Expr of an if must have type bool
        if ctx.IF() != None:
            expr_type = self.visit(expression)
            expr_b_type = self.visit(expression.expr(0))

            print(expr_b_type)
            #if (expr_a_type != None and expr_a_type != 'boolean') or (expr_b_type != None and expr_b_type != 'boolean'):
            #print('Error on line ' + str(line_num) + ', expression in if must be of type boolean')

        elif ctx.location() != None:

            loc_type = self.visit(ctx.location())
            expr_type = self.visit(ctx.expr(0))
            operator = ctx.assign_op().getText()
            identifier = self.st.probe(ctx.location().getText())

            #2
            if identifier == None:
                print('Error on line ' + str(line_num) + ', identifier \'' +
                      ctx.location().getText() + '\' has not been declared')

            #16 - TODO change error message
            elif loc_type != None:
                if (loc_type != 'int'
                        or expr_type != 'int') and (operator == '-='
                                                    or operator == '+='):
                    print(
                        'Error on line ' + str(line_num) +
                        ' variables must be of type int when in an incrementing/decrementing assignment'
                    )

                #15
                elif loc_type != expr_type:
                    print('Error on line ' + str(line_num) +
                          ' type mismatched in expression')

        #17
        elif ctx.FOR() != None:

            expr_type_a = self.visit(ctx.expr(0))
            expr_type_b = self.visit(ctx.expr(1))

            if expr_type_a != 'int' or expr_type_b != 'int':

                print('Error on line ' + str(line_num) +
                      ' for statement expressions must be of type int')

        else:

            self.visitChildren(ctx)
 def visitStatement(self, ctx: DecafParser.StatementContext):
     #1. recognise statement type (minimal example below)
     #2. write code generation procedure for each special case
     if ctx.assign_op():
         pass