@Test public void testEmitVoidPcodeOpCall(){ StringBuilder pCode = new StringBuilder(); PcodeTextEmitter.emitVoidPcodeOpCall(pCode, "PCODEOP"); assertTrue(pCode.toString().equals("PCODEOP();\n")); pCode = new StringBuilder(); PcodeTextEmitter.emitVoidPcodeOpCall(pCode,"PCODEOP", "ARG1"); assertTrue(pCode.toString().equals("PCODEOP(ARG1);\n")); pCode = new StringBuilder(); PcodeTextEmitter.emitVoidPcodeOpCall(pCode,"PCODEOP", "ARG1", "ARG2"); assertTrue(pCode.toString().equals("PCODEOP(ARG1,ARG2);\n")); }
public static void emitVoidPcodeOpCall(StringBuilder pCode, String pcodeop, String... args){ pCode.append(pcodeop); pCode.append("("); for (int i = 0, numArgs = args.length; i < numArgs; ++i){ pCode.append(args[i]); if (i < numArgs - 1){ pCode.append(","); } } pCode.append(");\n"); }
PcodeTextEmitter { public static void emitVoidPcodeOpCall(StringBuilder pCode, String pcodeop, String... args){ pCode.append(pcodeop); pCode.append("("); for (int i = 0, numArgs = args.length; i < numArgs; ++i){ pCode.append(args[i]); if (i < numArgs - 1){ pCode.append(","); } } pCode.append(");\n"); } }
PcodeTextEmitter { public static void emitVoidPcodeOpCall(StringBuilder pCode, String pcodeop, String... args){ pCode.append(pcodeop); pCode.append("("); for (int i = 0, numArgs = args.length; i < numArgs; ++i){ pCode.append(args[i]); if (i < numArgs - 1){ pCode.append(","); } } pCode.append(");\n"); } private  PcodeTextEmitter(); }
PcodeTextEmitter { public static void emitVoidPcodeOpCall(StringBuilder pCode, String pcodeop, String... args){ pCode.append(pcodeop); pCode.append("("); for (int i = 0, numArgs = args.length; i < numArgs; ++i){ pCode.append(args[i]); if (i < numArgs - 1){ pCode.append(","); } } pCode.append(");\n"); } private  PcodeTextEmitter(); static void emitPushCat1Value(StringBuilder pCode, String valueName); static void emitPushCat2Value(StringBuilder pCode, String valueName); static void emitPopCat2Value(StringBuilder pCode, String destName); static void emitPopCat1Value(StringBuilder pCode, String destName); static void emitAssignVarnodeFromPcodeOpCall(StringBuilder pCode, String varnodeName, int size, String pcodeop, String... args); static void emitVoidPcodeOpCall(StringBuilder pCode, String pcodeop, String... args); static void emitAssignConstantToRegister(StringBuilder pCode, String register, int constant); static void emitAssignRegisterFromPcodeOpCall(StringBuilder pCode, String register, String pcodeop, String... args); static void emitLabelDefinition(StringBuilder pCode, String caseName); static void emitWriteToMemory(StringBuilder pCode, String space, int size, String offset, String value); static void emitIndirectCall(StringBuilder pCode, String target); static void emitAddToStackPointer(StringBuilder pCode, int amount); static void emitSignExtension(StringBuilder pCode, String dest, int size, String src); static void emitZeroExtension(StringBuilder pCode, String dest, int size, String src); static void emitTruncate(StringBuilder pCode, String dest, int size, String src); }
PcodeTextEmitter { public static void emitVoidPcodeOpCall(StringBuilder pCode, String pcodeop, String... args){ pCode.append(pcodeop); pCode.append("("); for (int i = 0, numArgs = args.length; i < numArgs; ++i){ pCode.append(args[i]); if (i < numArgs - 1){ pCode.append(","); } } pCode.append(");\n"); } private  PcodeTextEmitter(); static void emitPushCat1Value(StringBuilder pCode, String valueName); static void emitPushCat2Value(StringBuilder pCode, String valueName); static void emitPopCat2Value(StringBuilder pCode, String destName); static void emitPopCat1Value(StringBuilder pCode, String destName); static void emitAssignVarnodeFromPcodeOpCall(StringBuilder pCode, String varnodeName, int size, String pcodeop, String... args); static void emitVoidPcodeOpCall(StringBuilder pCode, String pcodeop, String... args); static void emitAssignConstantToRegister(StringBuilder pCode, String register, int constant); static void emitAssignRegisterFromPcodeOpCall(StringBuilder pCode, String register, String pcodeop, String... args); static void emitLabelDefinition(StringBuilder pCode, String caseName); static void emitWriteToMemory(StringBuilder pCode, String space, int size, String offset, String value); static void emitIndirectCall(StringBuilder pCode, String target); static void emitAddToStackPointer(StringBuilder pCode, int amount); static void emitSignExtension(StringBuilder pCode, String dest, int size, String src); static void emitZeroExtension(StringBuilder pCode, String dest, int size, String src); static void emitTruncate(StringBuilder pCode, String dest, int size, String src);  }