src/parser.py
def p_for_in_expression(p):
	'statement : FOR ID IN expression TO expression COLON'
	if p[4] < p[6]:
		output_code.append("for(int " + str(p[2]) + " = " + str(p[4]) + "; " + str(p[2]) + " < " + str(p[6]+1) + "; " + str(p[2]) + "++ ){")
	else:
		output_code.append("for(int " + str(p[2]) + " = " + str(p[4]) + "; " + str(p[2]) + " > " + str(p[6]-1) + "; " + str(p[2]) + "-- ){")
statement : FOR ID IN expression TO expression COLON
statement : FOR ID IN expression TO expression COLON
statement : FOR ID IN expression TO expression COLON
def p_for_in_expression(p):
	if p[4] < p[6]:
		output_code.append("for(int " + str(p[2]) + " = " + str(p[4]) + "; " + str(p[2]) + " < " + str(p[6]+1) + "; " + str(p[2]) + "++ ){")
	else:
		output_code.append("for(int " + str(p[2]) + " = " + str(p[4]) + "; " + str(p[2]) + " > " + str(p[6]-1) + "; " + str(p[2]) + "-- ){")
def p_for_in_expression ( p ) : if p [ 4 ] < p [ 6 ] : output_code . append ( "for(int " + str ( p [ 2 ] ) + " = " + str ( p [ 4 ] ) + "; " + str ( p [ 2 ] ) + " < " + str ( p [ 6 ] + 1 ) + "; " + str ( p [ 2 ] ) + "++ ){" ) else : output_code . append ( "for(int " + str ( p [ 2 ] ) + " = " + str ( p [ 4 ] ) + "; " + str ( p [ 2 ] ) + " > " + str ( p [ 6 ] - 1 ) + "; " + str ( p [ 2 ] ) + "-- ){" )
statement : FOR ID IN expression TO expression COLON
statement : FOR ID IN expression TO expression COLON
'statement : FOR ID IN expression TO expression COLON'
p