stage3/fill_candidate_datatypes.cc
changeset 422 c957f712ef4d
parent 421 840cb1e1e177
child 424 43d73e28eca8
equal deleted inserted replaced
421:840cb1e1e177 422:c957f712ef4d
  1768 
  1768 
  1769 /********************************/
  1769 /********************************/
  1770 /* B 3.2.3 Selection Statements */
  1770 /* B 3.2.3 Selection Statements */
  1771 /********************************/
  1771 /********************************/
  1772 void *fill_candidate_datatypes_c::visit(if_statement_c *symbol) {
  1772 void *fill_candidate_datatypes_c::visit(if_statement_c *symbol) {
  1773 	/* MANU:
       
  1774 	 * IF statement accept only BOOL type. We intersect with BOOL type to validate current if condition
       
  1775 	 * Example:
       
  1776 	 * IF 1 THEN 		---> 	 ok
       
  1777 	 * IF 5 THEN 		---> not ok
       
  1778 	 * IF 1 OR 1 THEN	--->     ok
       
  1779 	 * IF 1 OR 5 THEN   ---> not ok
       
  1780 	 * IF SHL() THEN	---> 	 ok if shl return BOOL
       
  1781 	 * IF INT_TO_REAL() ---> not ok
       
  1782 	 */
       
  1783 	symbol->expression->accept(*this);
  1773 	symbol->expression->accept(*this);
  1784 	if (NULL != symbol->statement_list)
  1774 	if (NULL != symbol->statement_list)
  1785 		symbol->statement_list->accept(*this);
  1775 		symbol->statement_list->accept(*this);
  1786 	if (NULL != symbol->elseif_statement_list)
  1776 	if (NULL != symbol->elseif_statement_list)
  1787 		symbol->elseif_statement_list->accept(*this);
  1777 		symbol->elseif_statement_list->accept(*this);