# HG changeset patch # User lbessard # Date 1190044030 -7200 # Node ID 273d6d5cec9d8752340d1f62d6a76a68e4d19dc4 # Parent db9cadaab2ea0b9dadae442f0a81437990d288b0 Bugs with direct variable in Pou body fixed diff -r db9cadaab2ea -r 273d6d5cec9d stage1_2/iec.flex --- a/stage1_2/iec.flex Thu Aug 30 16:40:20 2007 +0200 +++ b/stage1_2/iec.flex Mon Sep 17 17:47:10 2007 +0200 @@ -770,6 +770,7 @@ { {st_whitespace_no_pragma} /* Eat any whitespace */ {qualified_identifier}{st_whitespace}":=" unput_text(0); BEGIN(st_state); +{direct_variable}{st_whitespace}":=" unput_text(0); BEGIN(st_state); {qualified_identifier}"[" unput_text(0); BEGIN(st_state); RETURN unput_text(0); BEGIN(st_state); @@ -899,9 +900,11 @@ /* B 1.2.1 - Numeric Literals */ /******************************/ TRUE return TRUE; -BOOL#1 return TRUE; +BOOL#1 return TRUE; +BOOL#TRUE return TRUE; FALSE return FALSE; -BOOL#0 return FALSE; +BOOL#0 return FALSE; +BOOL#FALSE return FALSE; /************************/ diff -r db9cadaab2ea -r 273d6d5cec9d stage4/generate_cc/generate_location_list.cc --- a/stage4/generate_cc/generate_location_list.cc Thu Aug 30 16:40:20 2007 +0200 +++ b/stage4/generate_cc/generate_location_list.cc Mon Sep 17 17:47:10 2007 +0200 @@ -118,14 +118,16 @@ /********************************************/ void *visit(direct_variable_c *symbol) { - s4o.print("__LOCATED_VAR("); - current_var_type_symbol->accept(*generate_cc_base); - s4o.print(","); - /* Do not use print_token() as it will change everything into uppercase */ - s4o.printlocation((symbol->value)+1); - s4o.print(","); - s4o.printlocation_comasep((symbol->value)+1); - s4o.print(")\n"); + if (current_var_type_symbol) { + s4o.print("__LOCATED_VAR("); + current_var_type_symbol->accept(*generate_cc_base); + s4o.print(","); + /* Do not use print_token() as it will change everything into uppercase */ + s4o.printlocation((symbol->value)+1); + s4o.print(","); + s4o.printlocation_comasep((symbol->value)+1); + s4o.print(")\n"); + } return NULL; }