Fixed verious problems with SFC, Globals and located variables.
authoretisserant
Fri, 20 Jul 2007 22:07:15 +0200 (2007-07-20)
changeset 45 3b6bf2b5f1df
parent 44 3fb449ba9a72
child 46 fc1b78ea6d84
Fixed verious problems with SFC, Globals and located variables.
stage4/generate_cc/generate_cc_sfc.cc
stage4/generate_cc/generate_cc_vardecl.cc
stage4/generate_cc/search_var_instance_decl.cc
tests/SFC_TEST.xml
--- 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;
--- 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;
 }
--- 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;
--- 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 @@
               </connectionPointOut>
               <condition>
                 <inline name="">
-                  <ST>QX1 OR GX2 OR QX3 = FALSE</ST>
+                  <ST>NOT ( QX1 OR QX2 OR QX3 )</ST>
                 </inline>
               </condition>
             </transition>
@@ -376,7 +376,7 @@
               </connectionPointOut>
               <condition>
                 <inline name="">
-                  <ST>QX1 OR GX2 OR QX3 = FALSE</ST>
+                  <ST>NOT ( QX1 OR QX2 OR QX3 )</ST>
                 </inline>
               </condition>
             </transition>
@@ -410,7 +410,7 @@
               </connectionPointOut>
               <condition>
                 <inline name="">
-                  <ST>QX1 OR GX2 OR QX3 = FALSE</ST>
+                  <ST>NOT ( QX1 OR QX2 OR QX3 )</ST>
                 </inline>
               </condition>
             </transition>
@@ -471,7 +471,7 @@
               </connectionPointOut>
               <condition>
                 <inline name="">
-                  <ST>QX1 AND GX2 AND QX3 = TRUE</ST>
+                  <ST>QX1 AND QX2 AND QX3</ST>
                 </inline>
               </condition>
             </transition>
@@ -498,7 +498,7 @@
                 <reference name="ONSTEP1"/>
               </action>
             </actionBlock>
-            <actionBlock localId="35" height="30" width="289">
+            <actionBlock localId="35" height="30" width="293">
               <position y="186" x="140"/>
               <connectionPointIn>
                 <relPosition y="15" x="0"/>
@@ -509,7 +509,7 @@
               </connectionPointIn>
               <action qualifier="P">
                 <inline>
-                  <ST>QX1 := QX2 XOR QX1; QX2 := NOT QX2</ST>
+                  <ST>QX1 := QX2 XOR QX1; QX2 := NOT QX2;</ST>
                 </inline>
               </action>
             </actionBlock>
@@ -638,7 +638,7 @@
                 </connection>
               </connectionPointIn>
             </jumpStep>
-            <actionBlock localId="54" height="30" width="107">
+            <actionBlock localId="54" height="30" width="111">
               <position y="291" x="135"/>
               <connectionPointIn>
                 <relPosition y="15" x="0"/>
@@ -649,11 +649,11 @@
               </connectionPointIn>
               <action qualifier="N">
                 <inline>
-                  <ST>IX1 := TRUE</ST>
-                </inline>
-              </action>
-            </actionBlock>
-            <actionBlock localId="55" height="30" width="113">
+                  <ST>IX1 := TRUE;</ST>
+                </inline>
+              </action>
+            </actionBlock>
+            <actionBlock localId="55" height="30" width="117">
               <position y="291" x="439"/>
               <connectionPointIn>
                 <relPosition y="15" x="0"/>
@@ -664,11 +664,11 @@
               </connectionPointIn>
               <action qualifier="N">
                 <inline>
-                  <ST>IX1 := FALSE</ST>
-                </inline>
-              </action>
-            </actionBlock>
-            <actionBlock localId="56" height="30" width="107">
+                  <ST>IX1 := FALSE;</ST>
+                </inline>
+              </action>
+            </actionBlock>
+            <actionBlock localId="56" height="30" width="111">
               <position y="291" x="714"/>
               <connectionPointIn>
                 <relPosition y="15" x="0"/>
@@ -679,7 +679,7 @@
               </connectionPointIn>
               <action qualifier="N">
                 <inline>
-                  <ST>IX1 := TRUE</ST>
+                  <ST>IX1 := TRUE;</ST>
                 </inline>
               </action>
             </actionBlock>
@@ -694,7 +694,7 @@
               </connectionPointIn>
               <action qualifier="N">
                 <inline>
-                  <ST>QX1 : = FALSE</ST>
+                  <ST>QX1 := FALSE;</ST>
                 </inline>
               </action>
             </actionBlock>
@@ -709,7 +709,7 @@
               </connectionPointIn>
               <action qualifier="N">
                 <inline>
-                  <ST>QX2 : = FALSE</ST>
+                  <ST>QX2 := FALSE;</ST>
                 </inline>
               </action>
             </actionBlock>
@@ -724,11 +724,11 @@
               </connectionPointIn>
               <action qualifier="N">
                 <inline>
-                  <ST>QX2 : = FALSE</ST>
-                </inline>
-              </action>
-            </actionBlock>
-            <actionBlock localId="60" height="30" width="114">
+                  <ST>QX2 := FALSE;</ST>
+                </inline>
+              </action>
+            </actionBlock>
+            <actionBlock localId="60" height="30" width="118">
               <position y="402" x="936"/>
               <connectionPointIn>
                 <relPosition y="15" x="0"/>
@@ -739,11 +739,11 @@
               </connectionPointIn>
               <action qualifier="N">
                 <inline>
-                  <ST>QX1 := TRUE</ST>
-                </inline>
-              </action>
-            </actionBlock>
-            <actionBlock localId="61" height="30" width="114">
+                  <ST>QX1 := TRUE;</ST>
+                </inline>
+              </action>
+            </actionBlock>
+            <actionBlock localId="61" height="30" width="118">
               <position y="402" x="1185"/>
               <connectionPointIn>
                 <relPosition y="15" x="0"/>
@@ -754,11 +754,11 @@
               </connectionPointIn>
               <action qualifier="N">
                 <inline>
-                  <ST>QX2 := TRUE</ST>
-                </inline>
-              </action>
-            </actionBlock>
-            <actionBlock localId="62" height="30" width="114">
+                  <ST>QX2 := TRUE;</ST>
+                </inline>
+              </action>
+            </actionBlock>
+            <actionBlock localId="62" height="30" width="118">
               <position y="406" x="1422"/>
               <connectionPointIn>
                 <relPosition y="15" x="0"/>
@@ -769,7 +769,7 @@
               </connectionPointIn>
               <action qualifier="N">
                 <inline>
-                  <ST>QX3 := TRUE</ST>
+                  <ST>QX3 := TRUE;</ST>
                 </inline>
               </action>
             </actionBlock>