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=abcb45cab7c0eba50f402b5e475cbbd773e16e5c;hp=d02fa4fc23ba7e796274818c1e9dfb81dabc4186;hb=114e1583393a6a214e41bf85adcf25344fc270cc;hpb=8cd44ecf2b3ae26173db7bbdc403585a94c11d6d diff --git a/src/edu/uci/eecs/codeGenerator/CodeGeneratorUtils.java b/src/edu/uci/eecs/codeGenerator/CodeGeneratorUtils.java index d02fa4f..abcb45c 100644 --- a/src/edu/uci/eecs/codeGenerator/CodeGeneratorUtils.java +++ b/src/edu/uci/eecs/codeGenerator/CodeGeneratorUtils.java @@ -776,10 +776,15 @@ public class CodeGeneratorUtils { + SpecNaming.CopyState.toUpperCase() + ", " + "(void*) _" + SpecNaming.CopyState.toLowerCase() + "),", 2)); // new NamedFunction(_Print_str, PRINT_STATE, (void*) _print), - code.addLine(TabbedLine("new " + SpecNaming.NamedFunction + "(" + line = "new " + SpecNaming.NamedFunction + "(" + SpecNaming.AppendStr(SpecNaming.PrintState) + ", " - + SpecNaming.PrintStateType + ", " + "(void*) _" - + SpecNaming.PrintState.toLowerCase() + "),", 2)); + + SpecNaming.PrintStateType + ", " + "(void*)"; + if (globalConstruct.printState.isEmpty()) { + line = line + SpecNaming.NullFunc + "),"; + } else { + line = line + "_" + SpecNaming.PrintState.toLowerCase() + "),"; + } + code.addLine(TabbedLine(line, 2)); // commuteRules, CommuteRuleSize); code.addLine(TabbedLine(SpecNaming.CommutativityRuleInst + ", " + SpecNaming.CommutativityRuleSizeInst + ");", 2)); @@ -862,7 +867,7 @@ public class CodeGeneratorUtils { + SpecNaming.PrintValue) + ", " + SpecNaming.PrintValueType + ", (void*) "; if (construct.print.isEmpty()) { - line = line + SpecNaming.NullFunc + "),"; + line = line + SpecNaming.NullFunc + ")"; } else { line = line + "_" + name + "_" + SpecNaming.PrintValue + ")";