/* ===================================================================== Source: for.rule ===================================================================== */ for_cmd : KW_FOR atline variable_usage_expression EQUAL fgl_expr_c KW_TO fgl_expr_c for_step { char errbuff[256]; int dtype; dtype=get_variable_dtype_from_variable_usage_expression(errbuff,$3); if (dtype==-1) { a4gl_yyerror(errbuff); YYERROR; } dtype=dtype&DTYPE_MASK; switch (dtype) { case DTYPE_INT: case DTYPE_SMINT: case DTYPE_SERIAL: case 90: break; default : set_yytext(get_variable_as_string_from_variable_usage_expression($3)); a4gl_yyerror("Variable is not an INTEGER or SMALLINT. It cannot be used as the FOR loop variable."); YYERROR; } inc_var_assigned($3); inc_var_usage($3); add_feature("FOR"); push_blockcommand("FOR"); lastlineno=yylineno; } commands_as_list END_FOR { pop_blockcommand("FOR"); $$=new_for_cmd($3, chk_expr($5), chk_expr($7) ,chk_expr($8), $10, $2); } ; for_step : { $$=get_for_default_step(); } | STEP fgl_expr_c {$$=$2;} ; /* ============================= for.rule =========================== */