Pseudocode: Translate instruction classes to Kotlin

This commit is contained in:
Alexey Sedunov
2014-06-03 14:26:10 +04:00
parent 145358654b
commit eabe2fcc8a
63 changed files with 1385 additions and 1741 deletions
@@ -109,7 +109,7 @@ public abstract class AbstractControlFlowTest extends AbstractPseudocodeTest {
//check edges directions
Collection<Instruction> instructions = pseudocode.getAllInstructions();
for (Instruction instruction : instructions) {
if (!((InstructionImpl)instruction).isDead()) {
if (!((InstructionImpl)instruction).getDead()) {
for (Instruction nextInstruction : instruction.getNextInstructions()) {
assertTrue("instruction '" + instruction + "' has '" + nextInstruction + "' among next instructions list, but not vice versa",
nextInstruction.getPreviousInstructions().contains(instruction));
@@ -45,7 +45,7 @@ public abstract class AbstractPseudoValueTest : AbstractPseudocodeTest() {
fun elementText(element: JetElement): String = element.getText()!!.replaceAll("\\s+", " ")
fun valueDescription(element: JetElement, value: PseudoValue): String {
return if (value.element != element) "COPY" else "NEW${value.createdAt.getInputValues().makeString(", ", "(", ")")}"
return if (value.element != element) "COPY" else "NEW${value.createdAt.inputValues.makeString(", ", "(", ")")}"
}
val elementToValues = getElementToValueMap(pseudocode)
@@ -135,7 +135,7 @@ public abstract class AbstractPseudocodeTest extends KotlinTestWithEnvironment {
@NotNull Set<Instruction> remainedAfterPostProcessInstructions
) {
boolean isRemovedThroughPostProcess = !remainedAfterPostProcessInstructions.contains(instruction);
assert isRemovedThroughPostProcess == ((InstructionImpl)instruction).isDead();
assert isRemovedThroughPostProcess == ((InstructionImpl)instruction).getDead();
return isRemovedThroughPostProcess ? "-" : " ";
}