# HG changeset patch
# User etisserant
# Date 1184962035 -7200
# Node ID 3b6bf2b5f1dfab9702eab341468ad627b64acfb2
# Parent 3fb449ba9a725c6aff817e9e1cdc6cb7bdbb2d99
Fixed verious problems with SFC, Globals and located variables.
diff -r 3fb449ba9a72 -r 3b6bf2b5f1df stage4/generate_cc/generate_cc_sfc.cc
--- a/stage4/generate_cc/generate_cc_sfc.cc Thu Jul 19 14:07:04 2007 +0200
+++ b/stage4/generate_cc/generate_cc_sfc.cc Fri Jul 20 22:07:15 2007 +0200
@@ -49,6 +49,8 @@
public:
transition_element(transition_c *tr, char pr, char idx) {
+ prev = NULL;
+ next = NULL;
transition = tr;
priority = pr;
index = idx;
diff -r 3fb449ba9a72 -r 3b6bf2b5f1df stage4/generate_cc/generate_cc_vardecl.cc
--- a/stage4/generate_cc/generate_cc_vardecl.cc Thu Jul 19 14:07:04 2007 +0200
+++ b/stage4/generate_cc/generate_cc_vardecl.cc Fri Jul 20 22:07:15 2007 +0200
@@ -1347,7 +1347,8 @@
void *visit(configuration_declaration_c *symbol) {
TRACE("configuration_declaration_c");
- symbol->global_var_declarations->accept(*this); // will contain VAR_GLOBAL declarations!!
+ if(symbol->global_var_declarations)
+ symbol->global_var_declarations->accept(*this); // will contain VAR_GLOBAL declarations!!
symbol->resource_declarations->accept(*this); // will contain PROGRAM declarations!!
return NULL;
}
diff -r 3fb449ba9a72 -r 3b6bf2b5f1df stage4/generate_cc/search_var_instance_decl.cc
--- a/stage4/generate_cc/search_var_instance_decl.cc Thu Jul 19 14:07:04 2007 +0200
+++ b/stage4/generate_cc/search_var_instance_decl.cc Fri Jul 20 22:07:15 2007 +0200
@@ -321,7 +321,7 @@
//SYM_REF4(located_var_decl_c, variable_name, location, located_var_spec_init, unused)
void *visit(located_var_decl_c *symbol) {
if (symbol->variable_name != NULL && compare_identifiers(symbol->variable_name, search_name) == 0) {
- return current_type_decl;
+ return symbol->located_var_spec_init;
}
else
return NULL;
diff -r 3fb449ba9a72 -r 3b6bf2b5f1df tests/SFC_TEST.xml
--- a/tests/SFC_TEST.xml Thu Jul 19 14:07:04 2007 +0200
+++ b/tests/SFC_TEST.xml Fri Jul 20 22:07:15 2007 +0200
@@ -342,7 +342,7 @@
- QX1 OR GX2 OR QX3 = FALSE
+ NOT ( QX1 OR QX2 OR QX3 )
@@ -376,7 +376,7 @@
- QX1 OR GX2 OR QX3 = FALSE
+ NOT ( QX1 OR QX2 OR QX3 )
@@ -410,7 +410,7 @@
- QX1 OR GX2 OR QX3 = FALSE
+ NOT ( QX1 OR QX2 OR QX3 )
@@ -471,7 +471,7 @@
- QX1 AND GX2 AND QX3 = TRUE
+ QX1 AND QX2 AND QX3
@@ -498,7 +498,7 @@
-
+
@@ -509,7 +509,7 @@
- QX1 := QX2 XOR QX1; QX2 := NOT QX2
+ QX1 := QX2 XOR QX1; QX2 := NOT QX2;
@@ -638,7 +638,7 @@
-
+
@@ -649,11 +649,11 @@
- IX1 := TRUE
-
-
-
-
+ IX1 := TRUE;
+
+
+
+
@@ -664,11 +664,11 @@
- IX1 := FALSE
-
-
-
-
+ IX1 := FALSE;
+
+
+
+
@@ -679,7 +679,7 @@
- IX1 := TRUE
+ IX1 := TRUE;
@@ -694,7 +694,7 @@
- QX1 : = FALSE
+ QX1 := FALSE;
@@ -709,7 +709,7 @@
- QX2 : = FALSE
+ QX2 := FALSE;
@@ -724,11 +724,11 @@
- QX2 : = FALSE
-
-
-
-
+ QX2 := FALSE;
+
+
+
+
@@ -739,11 +739,11 @@
- QX1 := TRUE
-
-
-
-
+ QX1 := TRUE;
+
+
+
+
@@ -754,11 +754,11 @@
- QX2 := TRUE
-
-
-
-
+ QX2 := TRUE;
+
+
+
+
@@ -769,7 +769,7 @@
- QX3 := TRUE
+ QX3 := TRUE;