stage3/print_datatypes_error.cc
changeset 454 099aa5d655de
parent 453 4733f662362a
child 455 933c0dccc82f
equal deleted inserted replaced
453:4733f662362a 454:099aa5d655de
   473 }
   473 }
   474 
   474 
   475 /* subscript_list ',' subscript */
   475 /* subscript_list ',' subscript */
   476 // SYM_LIST(subscript_list_c)
   476 // SYM_LIST(subscript_list_c)
   477 /* NOTE: we inherit from iterator visitor, so we do not need to implement this method... */
   477 /* NOTE: we inherit from iterator visitor, so we do not need to implement this method... */
   478 #if 0
   478 // void *print_datatypes_error_c::visit(subscript_list_c *symbol)
   479 void *print_datatypes_error_c::visit(subscript_list_c *symbol) {
       
   480 }
       
   481 #endif
       
   482 
   479 
   483 
   480 
   484 /*  record_variable '.' field_selector */
   481 /*  record_variable '.' field_selector */
   485 /*  WARNING: input and/or output variables of function blocks
   482 /*  WARNING: input and/or output variables of function blocks
   486  *           may be accessed as fields of a structured variable!
   483  *           may be accessed as fields of a structured variable!
   509 	/* We do not check for data type errors in variable declarations, Skip this for now... */
   506 	/* We do not check for data type errors in variable declarations, Skip this for now... */
   510 // 	symbol->var_declarations_list->accept(*this);
   507 // 	symbol->var_declarations_list->accept(*this);
   511 	if (debug) printf("Print error data types list in body of function %s\n", ((token_c *)(symbol->derived_function_name))->value);
   508 	if (debug) printf("Print error data types list in body of function %s\n", ((token_c *)(symbol->derived_function_name))->value);
   512 	il_parenthesis_level = 0;
   509 	il_parenthesis_level = 0;
   513 	il_error = false;
   510 	il_error = false;
   514 	prev_il_instruction = NULL;
       
   515 	symbol->function_body->accept(*this);
   511 	symbol->function_body->accept(*this);
   516 	prev_il_instruction = NULL;
       
   517 	delete search_varfb_instance_type;
   512 	delete search_varfb_instance_type;
   518 	search_varfb_instance_type = NULL;
   513 	search_varfb_instance_type = NULL;
   519 	return NULL;
   514 	return NULL;
   520 }
   515 }
   521 
   516 
   527 	/* We do not check for data type errors in variable declarations, Skip this for now... */
   522 	/* We do not check for data type errors in variable declarations, Skip this for now... */
   528 // 	symbol->var_declarations->accept(*this);
   523 // 	symbol->var_declarations->accept(*this);
   529 	if (debug) printf("Print error data types list in body of FB %s\n", ((token_c *)(symbol->fblock_name))->value);
   524 	if (debug) printf("Print error data types list in body of FB %s\n", ((token_c *)(symbol->fblock_name))->value);
   530 	il_parenthesis_level = 0;
   525 	il_parenthesis_level = 0;
   531 	il_error = false;
   526 	il_error = false;
   532 	prev_il_instruction = NULL;
       
   533 	symbol->fblock_body->accept(*this);
   527 	symbol->fblock_body->accept(*this);
   534 	prev_il_instruction = NULL;
       
   535 	delete search_varfb_instance_type;
   528 	delete search_varfb_instance_type;
   536 	search_varfb_instance_type = NULL;
   529 	search_varfb_instance_type = NULL;
   537 	return NULL;
   530 	return NULL;
   538 }
   531 }
   539 
   532 
   545 	/* We do not check for data type errors in variable declarations, Skip this for now... */
   538 	/* We do not check for data type errors in variable declarations, Skip this for now... */
   546 // 	symbol->var_declarations->accept(*this);
   539 // 	symbol->var_declarations->accept(*this);
   547 	if (debug) printf("Print error data types list in body of program %s\n", ((token_c *)(symbol->program_type_name))->value);
   540 	if (debug) printf("Print error data types list in body of program %s\n", ((token_c *)(symbol->program_type_name))->value);
   548 	il_parenthesis_level = 0;
   541 	il_parenthesis_level = 0;
   549 	il_error = false;
   542 	il_error = false;
   550 	prev_il_instruction = NULL;
       
   551 	symbol->function_block_body->accept(*this);
   543 	symbol->function_block_body->accept(*this);
   552 	prev_il_instruction = NULL;
       
   553 	delete search_varfb_instance_type;
   544 	delete search_varfb_instance_type;
   554 	search_varfb_instance_type = NULL;
   545 	search_varfb_instance_type = NULL;
   555 	return NULL;
   546 	return NULL;
   556 }
   547 }
   557 
   548 
   572 /* B.2 - Language IL (Instruction List) */
   563 /* B.2 - Language IL (Instruction List) */
   573 /****************************************/
   564 /****************************************/
   574 /***********************************/
   565 /***********************************/
   575 /* B 2.1 Instructions and Operands */
   566 /* B 2.1 Instructions and Operands */
   576 /***********************************/
   567 /***********************************/
       
   568 
   577 // void *visit(instruction_list_c *symbol);
   569 // void *visit(instruction_list_c *symbol);
       
   570 
       
   571 /* | label ':' [il_incomplete_instruction] eol_list */
       
   572 // SYM_REF2(il_instruction_c, label, il_instruction)
       
   573 void *print_datatypes_error_c::visit(il_instruction_c *symbol) {
       
   574 	if (NULL != symbol->il_instruction) {
       
   575 		prev_il_instruction = symbol->prev_il_instruction;
       
   576 		symbol->il_instruction->accept(*this);
       
   577 		prev_il_instruction = NULL;
       
   578 	}
       
   579 
       
   580 	return NULL;
       
   581 }
       
   582 
       
   583 
       
   584 
   578 void *print_datatypes_error_c::visit(il_simple_operation_c *symbol) {
   585 void *print_datatypes_error_c::visit(il_simple_operation_c *symbol) {
   579 	il_operand = symbol->il_operand;
   586 	il_operand = symbol->il_operand;
   580 	if (NULL != symbol->il_operand) {
   587 	if (NULL != symbol->il_operand) {
   581 		symbol->il_operand->accept(*this);
   588 		symbol->il_operand->accept(*this);
   582 	}
   589 	}
   633 	}
   640 	}
   634 
   641 
   635 	return NULL;
   642 	return NULL;
   636 }
   643 }
   637 
   644 
       
   645 
       
   646 /* | il_expr_operator '(' [il_operand] eol_list [simple_instr_list] ')' */
       
   647 // SYM_REF3(il_expression_c, il_expr_operator, il_operand, simple_instr_list);
   638 void *print_datatypes_error_c::visit(il_expression_c *symbol) {
   648 void *print_datatypes_error_c::visit(il_expression_c *symbol) {
   639   /* TODO */
   649   /* first give the parenthesised IL list a chance to print errors */
   640 	return NULL;
   650   symbol_c *save_prev_il_instruction = prev_il_instruction;
   641 }
   651   symbol->simple_instr_list->accept(*this);
       
   652   prev_il_instruction = save_prev_il_instruction;
       
   653 
       
   654   /* Now handle the operation (il_expr_operator) that will use the result coming from the parenthesised IL list (i.e. simple_instr_list) */
       
   655   il_operand = symbol->simple_instr_list; /* This is not a bug! The parenthesised expression will be used as the operator! */
       
   656   symbol->il_expr_operator->accept(*this);
       
   657 
       
   658 return NULL;
       
   659 }
       
   660 
   642 
   661 
   643 /*   il_call_operator prev_declared_fb_name
   662 /*   il_call_operator prev_declared_fb_name
   644  * | il_call_operator prev_declared_fb_name '(' ')'
   663  * | il_call_operator prev_declared_fb_name '(' ')'
   645  * | il_call_operator prev_declared_fb_name '(' eol_list ')'
   664  * | il_call_operator prev_declared_fb_name '(' eol_list ')'
   646  * | il_call_operator prev_declared_fb_name '(' il_operand_list ')'
   665  * | il_call_operator prev_declared_fb_name '(' il_operand_list ')'
   683 	return NULL;
   702 	return NULL;
   684 }
   703 }
   685 
   704 
   686 
   705 
   687 //     void *visit(il_operand_list_c *symbol);
   706 //     void *visit(il_operand_list_c *symbol);
   688 
   707 //     void *visit(simple_instr_list_c *symbol);
   689 
       
   690 /* | simple_instr_list il_simple_instruction */
       
   691 /* This object is referenced by il_expression_c objects */
       
   692 void *print_datatypes_error_c::visit(simple_instr_list_c *symbol) {
       
   693   /* TODO */
       
   694 	return NULL;
       
   695 }
       
   696 
   708 
   697 // SYM_REF1(il_simple_instruction_c, il_simple_instruction, symbol_c *prev_il_instruction;)
   709 // SYM_REF1(il_simple_instruction_c, il_simple_instruction, symbol_c *prev_il_instruction;)
   698 void *print_datatypes_error_c::visit(il_simple_instruction_c *symbol) {
   710 void *print_datatypes_error_c::visit(il_simple_instruction_c *symbol)	{
   699   /* TODO */
   711   prev_il_instruction = symbol->prev_il_instruction;
   700 	return NULL;
   712   symbol->il_simple_instruction->accept(*this);
   701 }
   713   prev_il_instruction = NULL;
   702 
   714   return NULL;
   703 //     void *visit(simple_instr_list_c *symbol);
   715 }
       
   716 
       
   717 
   704 //     void *visit(il_param_list_c *symbol);
   718 //     void *visit(il_param_list_c *symbol);
   705 //     void *visit(il_param_assignment_c *symbol);
   719 //     void *visit(il_param_assignment_c *symbol);
   706 //     void *visit(il_param_out_assignment_c *symbol);
   720 //     void *visit(il_param_out_assignment_c *symbol);
   707 
   721 
   708 /*******************/
   722 /*******************/
   709 /* B 2.2 Operators */
   723 /* B 2.2 Operators */
   710 /*******************/
   724 /*******************/
   711 void *print_datatypes_error_c::visit(LD_operator_c *symbol) {
   725 void *print_datatypes_error_c::visit(LD_operator_c *symbol) {
   712 	prev_il_instruction = symbol;
       
   713 	return NULL;
   726 	return NULL;
   714 }
   727 }
   715 
   728 
   716 void *print_datatypes_error_c::visit(LDN_operator_c *symbol) {
   729 void *print_datatypes_error_c::visit(LDN_operator_c *symbol) {
   717 	il_operand->accept(*this);
       
   718 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   730 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   719 		(il_operand->candidate_datatypes.size() > 0))
   731 		(il_operand->candidate_datatypes.size() > 0))
   720 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'LDN' operator.");
   732 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'LDN' operator.");
   721 	prev_il_instruction = symbol;
       
   722 	return NULL;
   733 	return NULL;
   723 }
   734 }
   724 
   735 
   725 void *print_datatypes_error_c::visit(ST_operator_c *symbol) {
   736 void *print_datatypes_error_c::visit(ST_operator_c *symbol) {
   726 	/* MANU:
   737 	/* MANU:
   727 	 * if prev_instruction is NULL we can print a message error or warning error like:
   738 	 * if prev_instruction is NULL we can print a message error or warning error like:
   728 	 * we can't use a ST like first instruction.
   739 	 * we can't use a ST like first instruction.
   729 	 * What do you think?
   740 	 * What do you think?
   730 	 */
   741 	 */
   731 	il_operand->accept(*this);
       
   732 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   742 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   733 		(il_operand->candidate_datatypes.size() > 0))
   743 		(il_operand->candidate_datatypes.size() > 0))
   734 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'ST' operator.");
   744 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'ST' operator.");
   735 	prev_il_instruction = symbol;
       
   736 	return NULL;
   745 	return NULL;
   737 }
   746 }
   738 
   747 
   739 void *print_datatypes_error_c::visit(STN_operator_c *symbol) {
   748 void *print_datatypes_error_c::visit(STN_operator_c *symbol) {
   740 	/* MANU:
   749 	/* MANU:
   741 	 * if prev_instruction is NULL we can print a message error or warning error like:
   750 	 * if prev_instruction is NULL we can print a message error or warning error like:
   742 	 * we can't use a ST like first instruction.
   751 	 * we can't use a ST like first instruction.
   743 	 * What do you think?
   752 	 * What do you think?
   744 	 */
   753 	 */
   745 	il_operand->accept(*this);
       
   746 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   754 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   747 		(il_operand->candidate_datatypes.size() > 0))
   755 		(il_operand->candidate_datatypes.size() > 0))
   748 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'STN' operator.");
   756 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'STN' operator.");
   749 	prev_il_instruction = symbol;
       
   750 	return NULL;
   757 	return NULL;
   751 }
   758 }
   752 
   759 
   753 void *print_datatypes_error_c::visit(NOT_operator_c *symbol) {
   760 void *print_datatypes_error_c::visit(NOT_operator_c *symbol) {
   754 	prev_il_instruction = symbol;
       
   755 	return NULL;
   761 	return NULL;
   756 }
   762 }
   757 
   763 
   758 void *print_datatypes_error_c::visit(S_operator_c *symbol) {
   764 void *print_datatypes_error_c::visit(S_operator_c *symbol) {
   759   /* TODO: what if this is a FB call ?? */
   765   /* TODO: what if this is a FB call ?? */
   760 	il_operand->accept(*this);
       
   761 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   766 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   762 		(il_operand->candidate_datatypes.size() > 0))
   767 		(il_operand->candidate_datatypes.size() > 0))
   763 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'S' operator.");
   768 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'S' operator.");
   764 	prev_il_instruction = symbol;
       
   765 	return NULL;
   769 	return NULL;
   766 }
   770 }
   767 
   771 
   768 void *print_datatypes_error_c::visit(R_operator_c *symbol) {
   772 void *print_datatypes_error_c::visit(R_operator_c *symbol) {
   769   /* TODO: what if this is a FB call ?? */
   773   /* TODO: what if this is a FB call ?? */
   770 	il_operand->accept(*this);
       
   771 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   774 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   772 		(il_operand->candidate_datatypes.size() > 0))
   775 		(il_operand->candidate_datatypes.size() > 0))
   773 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'R' operator.");
   776 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'R' operator.");
   774 	prev_il_instruction = symbol;
       
   775 	return NULL;
   777 	return NULL;
   776 }
   778 }
   777 
   779 
   778 void *print_datatypes_error_c::visit(S1_operator_c *symbol) {
   780 void *print_datatypes_error_c::visit(S1_operator_c *symbol) {
   779 	handle_implicit_il_fb_invocation(symbol, "S1", symbol->called_fb_declaration);  
   781 	handle_implicit_il_fb_invocation(symbol, "S1", symbol->called_fb_declaration);  
   814 	handle_implicit_il_fb_invocation(symbol, "PT", symbol->called_fb_declaration);  
   816 	handle_implicit_il_fb_invocation(symbol, "PT", symbol->called_fb_declaration);  
   815 	return NULL;
   817 	return NULL;
   816 }
   818 }
   817 
   819 
   818 void *print_datatypes_error_c::visit(AND_operator_c *symbol) {
   820 void *print_datatypes_error_c::visit(AND_operator_c *symbol) {
   819 	il_operand->accept(*this);
       
   820 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   821 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   821 		(il_operand->candidate_datatypes.size() > 0))
   822 		(il_operand->candidate_datatypes.size() > 0))
   822 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'AND' operator.");
   823 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'AND' operator.");
   823 	prev_il_instruction = symbol;
       
   824 	return NULL;
   824 	return NULL;
   825 }
   825 }
   826 
   826 
   827 void *print_datatypes_error_c::visit(OR_operator_c *symbol) {
   827 void *print_datatypes_error_c::visit(OR_operator_c *symbol) {
   828 	il_operand->accept(*this);
       
   829 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   828 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   830 		(il_operand->candidate_datatypes.size() > 0))
   829 		(il_operand->candidate_datatypes.size() > 0))
   831 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'OR' operator.");
   830 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'OR' operator.");
   832 	prev_il_instruction = symbol;
       
   833 	return NULL;
   831 	return NULL;
   834 }
   832 }
   835 
   833 
   836 void *print_datatypes_error_c::visit(XOR_operator_c *symbol) {
   834 void *print_datatypes_error_c::visit(XOR_operator_c *symbol) {
   837 	il_operand->accept(*this);
       
   838 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   835 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   839 		(il_operand->candidate_datatypes.size() > 0))
   836 		(il_operand->candidate_datatypes.size() > 0))
   840 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'XOR' operator.");
   837 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'XOR' operator.");
   841 	prev_il_instruction = symbol;
       
   842 	return NULL;
   838 	return NULL;
   843 }
   839 }
   844 
   840 
   845 void *print_datatypes_error_c::visit(ANDN_operator_c *symbol) {
   841 void *print_datatypes_error_c::visit(ANDN_operator_c *symbol) {
   846 	il_operand->accept(*this);
       
   847 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   842 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   848 		(il_operand->candidate_datatypes.size() > 0))
   843 		(il_operand->candidate_datatypes.size() > 0))
   849 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'ANDN' operator.");
   844 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'ANDN' operator.");
   850 	prev_il_instruction = symbol;
       
   851 	return NULL;
   845 	return NULL;
   852 }
   846 }
   853 
   847 
   854 void *print_datatypes_error_c::visit(ORN_operator_c *symbol) {
   848 void *print_datatypes_error_c::visit(ORN_operator_c *symbol) {
   855 	il_operand->accept(*this);
       
   856 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   849 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   857 		(il_operand->candidate_datatypes.size() > 0))
   850 		(il_operand->candidate_datatypes.size() > 0))
   858 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'ORN' operator.");
   851 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'ORN' operator.");
   859 	prev_il_instruction = symbol;
       
   860 	return NULL;
   852 	return NULL;
   861 }
   853 }
   862 
   854 
   863 void *print_datatypes_error_c::visit(XORN_operator_c *symbol) {
   855 void *print_datatypes_error_c::visit(XORN_operator_c *symbol) {
   864 	il_operand->accept(*this);
       
   865 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   856 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   866 		(il_operand->candidate_datatypes.size() > 0))
   857 		(il_operand->candidate_datatypes.size() > 0))
   867 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'ORN' operator.");
   858 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'ORN' operator.");
   868 	prev_il_instruction = symbol;
       
   869 	return NULL;
   859 	return NULL;
   870 }
   860 }
   871 
   861 
   872 void *print_datatypes_error_c::visit(ADD_operator_c *symbol) {
   862 void *print_datatypes_error_c::visit(ADD_operator_c *symbol) {
   873 	il_operand->accept(*this);
       
   874 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   863 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   875 		(il_operand->candidate_datatypes.size() > 0))
   864 		(il_operand->candidate_datatypes.size() > 0))
   876 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'ADD' operator.");
   865 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'ADD' operator.");
   877 	prev_il_instruction = symbol;
       
   878 	return NULL;
   866 	return NULL;
   879 }
   867 }
   880 
   868 
   881 void *print_datatypes_error_c::visit(SUB_operator_c *symbol) {
   869 void *print_datatypes_error_c::visit(SUB_operator_c *symbol) {
   882 	il_operand->accept(*this);
       
   883 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   870 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   884 		(il_operand->candidate_datatypes.size() > 0))
   871 		(il_operand->candidate_datatypes.size() > 0))
   885 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'SUB' operator.");
   872 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'SUB' operator.");
   886 	prev_il_instruction = symbol;
       
   887 	return NULL;
   873 	return NULL;
   888 }
   874 }
   889 
   875 
   890 void *print_datatypes_error_c::visit(MUL_operator_c *symbol) {
   876 void *print_datatypes_error_c::visit(MUL_operator_c *symbol) {
   891 	il_operand->accept(*this);
       
   892 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   877 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   893 		(il_operand->candidate_datatypes.size() > 0))
   878 		(il_operand->candidate_datatypes.size() > 0))
   894 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'MUL' operator.");
   879 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'MUL' operator.");
   895 	prev_il_instruction = symbol;
       
   896 	return NULL;
   880 	return NULL;
   897 }
   881 }
   898 
   882 
   899 void *print_datatypes_error_c::visit(DIV_operator_c *symbol) {
   883 void *print_datatypes_error_c::visit(DIV_operator_c *symbol) {
   900 	il_operand->accept(*this);
       
   901 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   884 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   902 		(il_operand->candidate_datatypes.size() > 0))
   885 		(il_operand->candidate_datatypes.size() > 0))
   903 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'DIV' operator.");
   886 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'DIV' operator.");
   904 	prev_il_instruction = symbol;
       
   905 	return NULL;
   887 	return NULL;
   906 }
   888 }
   907 
   889 
   908 void *print_datatypes_error_c::visit(MOD_operator_c *symbol) {
   890 void *print_datatypes_error_c::visit(MOD_operator_c *symbol) {
   909 	il_operand->accept(*this);
       
   910 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   891 	if ((symbol->candidate_datatypes.size() == 0) 		&&
   911 		(il_operand->candidate_datatypes.size() > 0))
   892 		(il_operand->candidate_datatypes.size() > 0))
   912 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'MOD' operator.");
   893 		STAGE3_ERROR(0, symbol, symbol, "Data type mismatch for 'MOD' operator.");
   913 	prev_il_instruction = symbol;
       
   914 	return NULL;
   894 	return NULL;
   915 }
   895 }
   916 
   896 
   917 void *print_datatypes_error_c::visit(GT_operator_c *symbol) {
   897 void *print_datatypes_error_c::visit(GT_operator_c *symbol) {
   918 	prev_il_instruction = symbol;
       
   919 	return NULL;
   898 	return NULL;
   920 }
   899 }
   921 
   900 
   922 void *print_datatypes_error_c::visit(GE_operator_c *symbol) {
   901 void *print_datatypes_error_c::visit(GE_operator_c *symbol) {
   923 	prev_il_instruction = symbol;
       
   924 	return NULL;
   902 	return NULL;
   925 }
   903 }
   926 
   904 
   927 void *print_datatypes_error_c::visit(EQ_operator_c *symbol) {
   905 void *print_datatypes_error_c::visit(EQ_operator_c *symbol) {
   928 	prev_il_instruction = symbol;
       
   929 	return NULL;
   906 	return NULL;
   930 }
   907 }
   931 
   908 
   932 void *print_datatypes_error_c::visit(LT_operator_c *symbol) {
   909 void *print_datatypes_error_c::visit(LT_operator_c *symbol) {
   933 	prev_il_instruction = symbol;
       
   934 	return NULL;
   910 	return NULL;
   935 }
   911 }
   936 
   912 
   937 void *print_datatypes_error_c::visit(LE_operator_c *symbol) {
   913 void *print_datatypes_error_c::visit(LE_operator_c *symbol) {
   938 	prev_il_instruction = symbol;
       
   939 	return NULL;
   914 	return NULL;
   940 }
   915 }
   941 
   916 
   942 void *print_datatypes_error_c::visit(NE_operator_c *symbol) {
   917 void *print_datatypes_error_c::visit(NE_operator_c *symbol) {
   943 	prev_il_instruction = symbol;
       
   944 	return NULL;
   918 	return NULL;
   945 }
   919 }
   946 
   920 
   947 void *print_datatypes_error_c::visit(CAL_operator_c *symbol) {
   921 void *print_datatypes_error_c::visit(CAL_operator_c *symbol) {
   948 	prev_il_instruction = symbol;
       
   949 	return NULL;
   922 	return NULL;
   950 }
   923 }
   951 
   924 
   952 void *print_datatypes_error_c::visit(CALC_operator_c *symbol) {
   925 void *print_datatypes_error_c::visit(CALC_operator_c *symbol) {
   953 	prev_il_instruction = symbol;
       
   954 	return NULL;
   926 	return NULL;
   955 }
   927 }
   956 
   928 
   957 void *print_datatypes_error_c::visit(CALCN_operator_c *symbol) {
   929 void *print_datatypes_error_c::visit(CALCN_operator_c *symbol) {
   958 	prev_il_instruction = symbol;
       
   959 	return NULL;
   930 	return NULL;
   960 }
   931 }
   961 
   932 
   962 void *print_datatypes_error_c::visit(RET_operator_c *symbol) {
   933 void *print_datatypes_error_c::visit(RET_operator_c *symbol) {
   963 	prev_il_instruction = symbol;
       
   964 	return NULL;
   934 	return NULL;
   965 }
   935 }
   966 
   936 
   967 void *print_datatypes_error_c::visit(RETC_operator_c *symbol) {
   937 void *print_datatypes_error_c::visit(RETC_operator_c *symbol) {
   968 	prev_il_instruction = symbol;
       
   969 	return NULL;
   938 	return NULL;
   970 }
   939 }
   971 
   940 
   972 void *print_datatypes_error_c::visit(RETCN_operator_c *symbol) {
   941 void *print_datatypes_error_c::visit(RETCN_operator_c *symbol) {
   973 	prev_il_instruction = symbol;
       
   974 	return NULL;
   942 	return NULL;
   975 }
   943 }
   976 
   944 
   977 void *print_datatypes_error_c::visit(JMP_operator_c *symbol) {
   945 void *print_datatypes_error_c::visit(JMP_operator_c *symbol) {
   978 	prev_il_instruction = symbol;
       
   979 	return NULL;
   946 	return NULL;
   980 }
   947 }
   981 
   948 
   982 void *print_datatypes_error_c::visit(JMPC_operator_c *symbol) {
   949 void *print_datatypes_error_c::visit(JMPC_operator_c *symbol) {
   983 	prev_il_instruction = symbol;
       
   984 	return NULL;
   950 	return NULL;
   985 }
   951 }
   986 
   952 
   987 void *print_datatypes_error_c::visit(JMPCN_operator_c *symbol) {
   953 void *print_datatypes_error_c::visit(JMPCN_operator_c *symbol) {
   988 	prev_il_instruction = symbol;
       
   989 	return NULL;
   954 	return NULL;
   990 }
   955 }
   991 
   956 
   992 /* Symbol class handled together with function call checks */
   957 /* Symbol class handled together with function call checks */
   993 // void *visit(il_assign_operator_c *symbol, variable_name);
   958 // void *visit(il_assign_operator_c *symbol, variable_name);