def p_exit(p):
    """ statement : EXIT WHILE
                  | EXIT DO
                  | EXIT FOR
    """
    q = p[2]
    p[0] = make_sentence('EXIT_%s' % q)

    for i in gl.LOOPS:
        if q == i[0]:
            return

    syntax_error(p.lineno(1), 'Syntax Error: EXIT %s out of loop' % q)