minor fix
[cdsspec-compiler.git] / src / edu / uci / eecs / codeGenerator / CodeGeneratorUtils.java
index 2914d49..08b9f7a 100644 (file)
@@ -529,7 +529,11 @@ public class CodeGeneratorUtils {
                        code.addLine(TabbedLine("#define " + decl.name + " "
                                        + SpecNaming.StateInst + "->" + decl.name));
                }
-               code.addLine(TabbedLine(ShortComment("User-defined intial state code")));
+               if (!globalConstruct.autoGenInitial)
+                       code.addLine(TabbedLine(ShortComment("User-defined state intialization code")));
+               else
+                       // Auto-generated the initialization function
+                       code.addLine(TabbedLine(ShortComment("Auto-generated state intialization code")));
                // Align the code with one tab
                globalConstruct.initState.align(1);
                code.addLines(globalConstruct.initState);
@@ -580,7 +584,12 @@ public class CodeGeneratorUtils {
                        fieldsInit.align(1);
                        code.addLines(fieldsInit);
                        code.addLine("");
-                       code.addLine(TabbedLine(ShortComment("Execute the print-out")));
+                       if (!globalConstruct.autoGenPrint)
+                               code.addLine(TabbedLine(ShortComment("Execute user-defined state printing code")));
+                       else
+                               // Auto-generated the copy function
+                               code.addLine(TabbedLine(ShortComment("Execute auto-generated state printing code")));
+                       
                        // Align the code with one tab
                        globalConstruct.printState.align(1);
                        code.addLines(globalConstruct.printState);
@@ -726,7 +735,11 @@ public class CodeGeneratorUtils {
                                        code.addLines(fieldsInit);
 
                                        construct.print.align(1);
-                                       code.addLine(TabbedLine(ShortComment("Execute Print")));
+                                       if (!construct.autoGenPrint)
+                                               code.addLine(TabbedLine(ShortComment("Execute user-defined value printing code")));
+                                       else
+                                               // Auto-generated the value printing function
+                                               code.addLine(TabbedLine(ShortComment("Execute auto-generated value printing code")));
                                        code.addLines(construct.print);
 
                                        code.addLine("}");