# HG changeset patch # User Mario de Sousa # Date 1306774455 -3600 # Node ID fe5cb87610fa37c5b96a5ae6e7f828d543910b21 # Parent 1b6d8e3df1b2685e7fb835672bcf0f800d92f468 When checking semantics of expressions, skip semantic checking of data type definitions (not yet supported). If we don't skip, all subsequent POUs would not be checked. diff -r 1b6d8e3df1b2 -r fe5cb87610fa stage3/visit_expression_type.cc --- a/stage3/visit_expression_type.cc Mon May 30 17:52:15 2011 +0100 +++ b/stage3/visit_expression_type.cc Mon May 30 17:54:15 2011 +0100 @@ -895,6 +895,14 @@ } +/********************************/ +/* B 1.3.3 - Derived data types */ +/********************************/ +void *visit_expression_type_c::visit(data_type_declaration_c *symbol) { + // TODO !!! + /* for the moment we must return NULL so semantic analysis of remaining code is not interrupted! */ + return NULL; +} /*********************/ @@ -1989,6 +1997,19 @@ symbol_c *left_type = base_type((symbol_c *)symbol->l_exp->accept(*this)); symbol_c *right_type = base_type((symbol_c *)symbol->r_exp->accept(*this)); + if (debug) { + printf("visit_expression_type_c::visit(assignment_statement_c) called. Checking --->"); + symbolic_variable_c *hi = dynamic_cast(symbol->l_exp); + if (hi != NULL) { + identifier_c *hi1 = dynamic_cast(hi->var_name); + if (hi1 != NULL) printf(hi1->value); + } + printf(" := "); + hex_integer_c *hi2 = dynamic_cast(symbol->r_exp); + if (hi2 != NULL) printf(hi2->value); + printf("\n"); + } // if (debug) + if (!is_valid_assignment(left_type, right_type)) { STAGE3_ERROR(symbol, symbol, "data type mismatch in assignment statement!\n"); } diff -r 1b6d8e3df1b2 -r fe5cb87610fa stage3/visit_expression_type.hh --- a/stage3/visit_expression_type.hh Mon May 30 17:52:15 2011 +0100 +++ b/stage3/visit_expression_type.hh Mon May 30 17:54:15 2011 +0100 @@ -214,6 +214,11 @@ /* a helper function... */ void *verify_null(symbol_c *symbol); + + /********************************/ + /* B 1.3.3 - Derived data types */ + /********************************/ + void *visit(data_type_declaration_c *symbol); /*********************/ /* B 1.4 - Variables */