Loading src/main/java/ca/mcscert/jtet/expression/BinaryOperation.java +4 −4 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ public enum BinaryOperation { BooleanAnd, BooleanOr; Collection<VariableTypeMarker> getInputTypeForOutput(VariableTypeMarker outputType) { Collection<TypeMarker> getInputTypeForOutput(TypeMarker outputType) { // Boolean inputs only work with a boolean input! if (this == BooleanAnd || this == BooleanOr || this == Implies || this == GreaterThen || this == GreaterThenEqual || this == LessThen || this == LessThenEqual || this == Equals || this == NotEquals) { Loading @@ -50,12 +50,12 @@ public enum BinaryOperation { case GreaterThenEqual: case LessThen: case LessThenEqual: return Arrays.asList(new VariableTypeMarker[]{RealType.Type, FixedPointType.TypeMarker}); return Arrays.asList(new TypeMarker[]{RealType.Type, FixedPointType.TypeMarker}); case Equals: case NotEquals: return Arrays.asList(new VariableTypeMarker[]{RealType.Type, FixedPointType.TypeMarker, EnumerationType.TypeMarker}); return Arrays.asList(new TypeMarker[]{RealType.Type, FixedPointType.TypeMarker, EnumerationType.TypeMarker}); } return Arrays.asList(new VariableTypeMarker[]{outputType}); return Arrays.asList(new TypeMarker[]{outputType}); } public Type getOutputForInput(Type inputType) { Loading src/main/java/ca/mcscert/jtet/expression/EnumerationType.java +1 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ final public class EnumerationType extends Type { private final Set<String> m_values = new LinkedHashSet<String>(); private final String m_name; public static class Marker implements VariableTypeMarker { public static class Marker implements TypeMarker { @Override public boolean isMarkerFor(Type m_type) { return m_type instanceof EnumerationType; Loading src/main/java/ca/mcscert/jtet/expression/Expression.java +1 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ public interface Expression { * @param requestedType The class of type requested. * @return The concrete type that will be used, or null if none can be found. */ Type actualOutputTypeForRequestedOutput(VariableTypeMarker requestedType); Type actualOutputTypeForRequestedOutput(TypeMarker requestedType); /** * Returns a string representing this expression generated from the given generator. Loading src/main/java/ca/mcscert/jtet/expression/ExpressionBinaryOperation.java +4 −4 Original line number Diff line number Diff line Loading @@ -26,9 +26,9 @@ public final class ExpressionBinaryOperation implements Expression, ExpressionWi m_rhs = expr; } private Type getInputTypeForOutput(VariableTypeMarker requestedType) { Collection<VariableTypeMarker> allowedInputTypes = m_op.getInputTypeForOutput(requestedType); for(VariableTypeMarker allowedType : allowedInputTypes) { private Type getInputTypeForOutput(TypeMarker requestedType) { Collection<TypeMarker> allowedInputTypes = m_op.getInputTypeForOutput(requestedType); for(TypeMarker allowedType : allowedInputTypes) { Type inputType = m_lhs.actualOutputTypeForRequestedOutput(allowedType); if(inputType != null && m_rhs.actualOutputTypeForRequestedOutput(inputType) != null) { Loading @@ -44,7 +44,7 @@ public final class ExpressionBinaryOperation implements Expression, ExpressionWi } @Override public Type actualOutputTypeForRequestedOutput(VariableTypeMarker requestedType) { public Type actualOutputTypeForRequestedOutput(TypeMarker requestedType) { Type inputType = getInputTypeForOutput(requestedType); if (inputType != null) { return m_op.getOutputForInput(inputType); Loading src/main/java/ca/mcscert/jtet/expression/ExpressionUnaryOperation.java +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ public final class ExpressionUnaryOperation implements Expression, ExpressionWit } @Override public Type actualOutputTypeForRequestedOutput(VariableTypeMarker requestedType) { public Type actualOutputTypeForRequestedOutput(TypeMarker requestedType) { return m_expr.actualOutputTypeForRequestedOutput(requestedType); } Loading Loading
src/main/java/ca/mcscert/jtet/expression/BinaryOperation.java +4 −4 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ public enum BinaryOperation { BooleanAnd, BooleanOr; Collection<VariableTypeMarker> getInputTypeForOutput(VariableTypeMarker outputType) { Collection<TypeMarker> getInputTypeForOutput(TypeMarker outputType) { // Boolean inputs only work with a boolean input! if (this == BooleanAnd || this == BooleanOr || this == Implies || this == GreaterThen || this == GreaterThenEqual || this == LessThen || this == LessThenEqual || this == Equals || this == NotEquals) { Loading @@ -50,12 +50,12 @@ public enum BinaryOperation { case GreaterThenEqual: case LessThen: case LessThenEqual: return Arrays.asList(new VariableTypeMarker[]{RealType.Type, FixedPointType.TypeMarker}); return Arrays.asList(new TypeMarker[]{RealType.Type, FixedPointType.TypeMarker}); case Equals: case NotEquals: return Arrays.asList(new VariableTypeMarker[]{RealType.Type, FixedPointType.TypeMarker, EnumerationType.TypeMarker}); return Arrays.asList(new TypeMarker[]{RealType.Type, FixedPointType.TypeMarker, EnumerationType.TypeMarker}); } return Arrays.asList(new VariableTypeMarker[]{outputType}); return Arrays.asList(new TypeMarker[]{outputType}); } public Type getOutputForInput(Type inputType) { Loading
src/main/java/ca/mcscert/jtet/expression/EnumerationType.java +1 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ final public class EnumerationType extends Type { private final Set<String> m_values = new LinkedHashSet<String>(); private final String m_name; public static class Marker implements VariableTypeMarker { public static class Marker implements TypeMarker { @Override public boolean isMarkerFor(Type m_type) { return m_type instanceof EnumerationType; Loading
src/main/java/ca/mcscert/jtet/expression/Expression.java +1 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ public interface Expression { * @param requestedType The class of type requested. * @return The concrete type that will be used, or null if none can be found. */ Type actualOutputTypeForRequestedOutput(VariableTypeMarker requestedType); Type actualOutputTypeForRequestedOutput(TypeMarker requestedType); /** * Returns a string representing this expression generated from the given generator. Loading
src/main/java/ca/mcscert/jtet/expression/ExpressionBinaryOperation.java +4 −4 Original line number Diff line number Diff line Loading @@ -26,9 +26,9 @@ public final class ExpressionBinaryOperation implements Expression, ExpressionWi m_rhs = expr; } private Type getInputTypeForOutput(VariableTypeMarker requestedType) { Collection<VariableTypeMarker> allowedInputTypes = m_op.getInputTypeForOutput(requestedType); for(VariableTypeMarker allowedType : allowedInputTypes) { private Type getInputTypeForOutput(TypeMarker requestedType) { Collection<TypeMarker> allowedInputTypes = m_op.getInputTypeForOutput(requestedType); for(TypeMarker allowedType : allowedInputTypes) { Type inputType = m_lhs.actualOutputTypeForRequestedOutput(allowedType); if(inputType != null && m_rhs.actualOutputTypeForRequestedOutput(inputType) != null) { Loading @@ -44,7 +44,7 @@ public final class ExpressionBinaryOperation implements Expression, ExpressionWi } @Override public Type actualOutputTypeForRequestedOutput(VariableTypeMarker requestedType) { public Type actualOutputTypeForRequestedOutput(TypeMarker requestedType) { Type inputType = getInputTypeForOutput(requestedType); if (inputType != null) { return m_op.getOutputForInput(inputType); Loading
src/main/java/ca/mcscert/jtet/expression/ExpressionUnaryOperation.java +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ public final class ExpressionUnaryOperation implements Expression, ExpressionWit } @Override public Type actualOutputTypeForRequestedOutput(VariableTypeMarker requestedType) { public Type actualOutputTypeForRequestedOutput(TypeMarker requestedType) { return m_expr.actualOutputTypeForRequestedOutput(requestedType); } Loading