X-Git-Url: http://plrg.eecs.uci.edu/git/?p=cdsspec-compiler.git;a=blobdiff_plain;f=src%2Fedu%2Fuci%2Feecs%2FcodeGenerator%2FCodeGeneratorUtils.java;h=08b9f7a448ed5ff25a62bd103efe2e7afe870a59;hp=2914d49b6d7e1b41ac40beeae61acd11f96896f2;hb=579524b6cd8994427d50cf604ee130493f59b4d3;hpb=83eae09be64a115aad7e6822d03cc87e603a60ea diff --git a/src/edu/uci/eecs/codeGenerator/CodeGeneratorUtils.java b/src/edu/uci/eecs/codeGenerator/CodeGeneratorUtils.java index 2914d49..08b9f7a 100644 --- a/src/edu/uci/eecs/codeGenerator/CodeGeneratorUtils.java +++ b/src/edu/uci/eecs/codeGenerator/CodeGeneratorUtils.java @@ -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("}");