From 27563c2d4982426531b09ebf814404c6a43add0f Mon Sep 17 00:00:00 2001 From: Christian Femers Date: Thu, 11 Jul 2019 21:59:27 +0200 Subject: [PATCH] Classes will move and be reworked in the net.mograsim.machine plugin --- .../mograsim/plugin/asm/model/AsmElement.java | 6 --- .../plugin/asm/model/AsmInstruction.java | 39 --------------- .../mograsim/plugin/asm/model/AsmLabel.java | 49 ------------------- .../mograsim/plugin/asm/model/AsmOperand.java | 6 --- .../plugin/asm/model/AsmOperands.java | 43 ---------------- .../plugin/asm/model/AsmOperation.java | 41 ---------------- .../plugin/asm/model/NumericOperand.java | 6 --- 7 files changed, 190 deletions(-) delete mode 100644 net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmElement.java delete mode 100644 net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmInstruction.java delete mode 100644 net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmLabel.java delete mode 100644 net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmOperand.java delete mode 100644 net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmOperands.java delete mode 100644 net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmOperation.java delete mode 100644 net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/NumericOperand.java diff --git a/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmElement.java b/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmElement.java deleted file mode 100644 index 832984fe..00000000 --- a/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmElement.java +++ /dev/null @@ -1,6 +0,0 @@ -package net.mograsim.plugin.asm.model; - -public interface AsmElement -{ - // only marker at the moment -} diff --git a/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmInstruction.java b/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmInstruction.java deleted file mode 100644 index 1591e218..00000000 --- a/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmInstruction.java +++ /dev/null @@ -1,39 +0,0 @@ -package net.mograsim.plugin.asm.model; - -import java.util.Objects; - -public final class AsmInstruction implements AsmElement -{ - private final AsmOperation operation; - private final AsmOperands operands; - - public AsmInstruction(AsmOperation operation, AsmOperands operands) - { - this.operation = Objects.requireNonNull(operation); - this.operands = Objects.requireNonNull(operands); - } - - @Override - public int hashCode() - { - return Objects.hash(operands, operation); - } - - @Override - public boolean equals(Object obj) - { - if (this == obj) - return true; - if (!(obj instanceof AsmInstruction)) - return false; - AsmInstruction other = (AsmInstruction) obj; - return Objects.equals(operands, other.operands) && Objects.equals(operation, other.operation); - } - - @Override - public String toString() - { - return String.format("%s %s", operation, operands).trim(); - } - -} diff --git a/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmLabel.java b/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmLabel.java deleted file mode 100644 index eb25f53c..00000000 --- a/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmLabel.java +++ /dev/null @@ -1,49 +0,0 @@ -package net.mograsim.plugin.asm.model; - -import java.util.Objects; - -public final class AsmLabel implements AsmElement -{ - private final String name; - private AsmInstruction inst; - - public AsmLabel(String name) - { - this.name = Objects.requireNonNull(name); - } - - public String getName() - { - return name; - } - - public void setInst(AsmInstruction inst) - { - if (inst != null) - throw new IllegalStateException("Instrution already set for " + name); - this.inst = inst; - } - - @Override - public String toString() - { - return name + ":"; - } - - @Override - public int hashCode() - { - return Objects.hash(inst, name); - } - - @Override - public boolean equals(Object obj) - { - if (this == obj) - return true; - if (!(obj instanceof AsmLabel)) - return false; - AsmLabel other = (AsmLabel) obj; - return Objects.equals(inst, other.inst) && Objects.equals(name, other.name); - } -} diff --git a/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmOperand.java b/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmOperand.java deleted file mode 100644 index 5c3a2021..00000000 --- a/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmOperand.java +++ /dev/null @@ -1,6 +0,0 @@ -package net.mograsim.plugin.asm.model; - -public interface AsmOperand -{ - -} diff --git a/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmOperands.java b/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmOperands.java deleted file mode 100644 index 8e5b475f..00000000 --- a/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmOperands.java +++ /dev/null @@ -1,43 +0,0 @@ -package net.mograsim.plugin.asm.model; - -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - -public final class AsmOperands -{ - private final List operands; - - public AsmOperands(List operands) - { - this.operands = Objects.requireNonNull(operands); - } - - public List getOperands() - { - return operands; - } - - @Override - public int hashCode() - { - return operands.hashCode(); - } - - @Override - public boolean equals(Object obj) - { - if (this == obj) - return true; - if (!(obj instanceof AsmOperands)) - return false; - AsmOperands other = (AsmOperands) obj; - return operands.equals(other.operands); - } - - @Override - public String toString() - { - return operands.stream().map(AsmOperand::toString).collect(Collectors.joining(", ")); - } -} diff --git a/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmOperation.java b/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmOperation.java deleted file mode 100644 index 248fcb16..00000000 --- a/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/AsmOperation.java +++ /dev/null @@ -1,41 +0,0 @@ -package net.mograsim.plugin.asm.model; - -import java.util.Objects; - -public final class AsmOperation -{ - private final String mnemonic; - - public AsmOperation(String mnemonic) - { - this.mnemonic = Objects.requireNonNull(mnemonic.toLowerCase()); - } - - public String getMnemonic() - { - return mnemonic; - } - - @Override - public String toString() - { - return getMnemonic(); - } - - @Override - public int hashCode() - { - return mnemonic.hashCode(); - } - - @Override - public boolean equals(Object obj) - { - if (this == obj) - return true; - if (!(obj instanceof AsmOperation)) - return false; - AsmOperation other = (AsmOperation) obj; - return mnemonic.equals(other.mnemonic); - } -} diff --git a/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/NumericOperand.java b/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/NumericOperand.java deleted file mode 100644 index 8391067d..00000000 --- a/net.mograsim.plugin.core/src/net/mograsim/plugin/asm/model/NumericOperand.java +++ /dev/null @@ -1,6 +0,0 @@ -package net.mograsim.plugin.asm.model; - -public class NumericOperand -{ - -} -- 2.17.1