From 2d33fc7517922206eb1a922d3a417da5ff38d2be Mon Sep 17 00:00:00 2001 From: Lucas Wojciechowski Date: Sun, 6 Jul 2014 14:03:27 -0400 Subject: [PATCH 1/5] Refactored codebase to share primitives between front end and back end --- checkstyle.xml | 10 ------ .../{intermediate => compiler}/ArrayType.java | 2 +- .../ArrayValue.java | 2 +- .../Attributes.java | 2 +- .../BooleanType.java | 2 +- .../BooleanValue.java | 2 +- .../Connection.java | 2 +- .../ConnectionType.java | 2 +- .../Constraint.java | 2 +- .../ConstraintType.java | 2 +- .../IntegerType.java | 2 +- .../IntegerValue.java | 2 +- .../InvalidAttributeException.java | 4 ++- .../InvalidIdentifierException.java | 4 ++- .../MultipleAssignmentException.java | 4 ++- .../MultipleDefinitionException.java | 4 ++- .../{intermediate => compiler}/Node.java | 3 +- .../{intermediate => compiler}/NodeType.java | 2 +- .../{intermediate => compiler}/Port.java | 2 +- .../{intermediate => compiler}/PortType.java | 2 +- .../StringType.java | 2 +- .../StringValue.java | 3 +- .../{intermediate => compiler}/Type.java | 2 +- .../TypeMismatchException.java | 4 ++- .../UndeclaredAttributeException.java | 4 ++- .../UndeclaredIdentifierException.java | 4 ++- .../UndefinedBehaviourError.java | 2 +- .../{intermediate => compiler}/Value.java | 2 +- .../back}/Schematic.java | 17 +++++++++- .../back}/SchematicException.java | 2 +- .../syntaxtree => compiler/front}/.gitkeep | 0 .../compiler/front/BooleanTypeValue.java | 14 ++++++++ .../front/BooleanValue.java} | 14 ++++---- .../front}/EnumIdentifierNotDefined.java | 2 +- .../front}/EnumTypeValue.java | 2 +- .../front}/EnumValue.java | 2 +- .../front}/Expression.java | 2 +- .../front}/LiteralExpression.java | 2 +- .../front}/MultipleAssignmentException.java | 2 +- .../front}/MultipleDefinitionException.java | 2 +- .../front}/Namespace.java | 2 +- .../front}/NamespaceIdentifier.java | 2 +- .../syntaxtree => compiler/front}/Scope.java | 2 +- .../manifold/compiler/front/Statement.java | 5 +++ .../front}/TypeMismatchException.java | 2 +- .../front}/TypeTypeValue.java | 2 +- .../front}/TypeValue.java | 2 +- .../syntaxtree => compiler/front}/Value.java | 2 +- .../front}/Variable.java | 2 +- .../front}/VariableIdentifier.java | 2 +- .../front}/VariableNotAssignedException.java | 2 +- .../front}/VariableNotDefinedException.java | 2 +- .../frontend/syntaxtree/BitTypeValue.java | 14 -------- .../frontend/syntaxtree/Statement.java | 5 --- .../TestArrayType.java | 2 +- .../TestAtomicTypes.java | 2 +- .../compiler/TestBooleanTypeValue.java | 29 +++++++++++++++++ .../TestBooleanValue.java} | 18 ++++++----- .../TestConnection.java | 9 +++--- .../TestConstraint.java | 9 +++--- .../TestEnumTypeValue.java | 20 ++++++++---- .../TestEnumValue.java | 32 ++++++++++++++----- .../{intermediate => compiler}/TestNode.java | 9 +++--- .../{intermediate => compiler}/TestPort.java | 5 +-- .../TestSerialization.java | 4 ++- .../TestTypeMismatchException.java | 11 +++++-- .../TestTypeTypeValue.java | 6 ++-- .../TestTypeValue.java | 11 ++++--- .../{intermediate => compiler}/TestValue.java | 3 +- .../back}/TestSchematic.java | 21 ++++++++++-- .../TestMultipleAssignmentException.java | 4 +-- .../TestMultipleDefinitionException.java | 2 +- .../front}/TestNamespace.java | 4 +-- .../front}/TestNamespaceIdentifier.java | 2 +- .../front}/TestScope.java | 6 ++-- .../front}/TestVariable.java | 12 +++---- .../front}/TestVariableIdentifier.java | 2 +- .../TestVariableNotAssignedException.java | 4 +-- .../TestVariableNotDefinedException.java | 2 +- .../frontend/syntaxtree/TestBitTypeValue.java | 28 ---------------- .../frontend/syntaxtree/TestValue.java | 3 -- 81 files changed, 261 insertions(+), 186 deletions(-) rename src/main/java/org/manifold/{intermediate => compiler}/ArrayType.java (86%) rename src/main/java/org/manifold/{intermediate => compiler}/ArrayValue.java (96%) rename src/main/java/org/manifold/{intermediate => compiler}/Attributes.java (96%) rename src/main/java/org/manifold/{intermediate => compiler}/BooleanType.java (85%) rename src/main/java/org/manifold/{intermediate => compiler}/BooleanValue.java (81%) rename src/main/java/org/manifold/{intermediate => compiler}/Connection.java (96%) rename src/main/java/org/manifold/{intermediate => compiler}/ConnectionType.java (91%) rename src/main/java/org/manifold/{intermediate => compiler}/Constraint.java (92%) rename src/main/java/org/manifold/{intermediate => compiler}/ConstraintType.java (91%) rename src/main/java/org/manifold/{intermediate => compiler}/IntegerType.java (85%) rename src/main/java/org/manifold/{intermediate => compiler}/IntegerValue.java (82%) rename src/main/java/org/manifold/{intermediate => compiler}/InvalidAttributeException.java (79%) rename src/main/java/org/manifold/{intermediate => compiler}/InvalidIdentifierException.java (81%) rename src/main/java/org/manifold/{intermediate => compiler}/MultipleAssignmentException.java (85%) rename src/main/java/org/manifold/{intermediate => compiler}/MultipleDefinitionException.java (84%) rename src/main/java/org/manifold/{intermediate => compiler}/Node.java (94%) rename src/main/java/org/manifold/{intermediate => compiler}/NodeType.java (93%) rename src/main/java/org/manifold/{intermediate => compiler}/Port.java (94%) rename src/main/java/org/manifold/{intermediate => compiler}/PortType.java (90%) rename src/main/java/org/manifold/{intermediate => compiler}/StringType.java (85%) rename src/main/java/org/manifold/{intermediate => compiler}/StringValue.java (81%) rename src/main/java/org/manifold/{intermediate => compiler}/Type.java (88%) rename src/main/java/org/manifold/{intermediate => compiler}/TypeMismatchException.java (86%) rename src/main/java/org/manifold/{intermediate => compiler}/UndeclaredAttributeException.java (80%) rename src/main/java/org/manifold/{intermediate => compiler}/UndeclaredIdentifierException.java (81%) rename src/main/java/org/manifold/{intermediate => compiler}/UndefinedBehaviourError.java (90%) rename src/main/java/org/manifold/{intermediate => compiler}/Value.java (83%) rename src/main/java/org/manifold/{intermediate => compiler/back}/Schematic.java (91%) rename src/main/java/org/manifold/{intermediate => compiler/back}/SchematicException.java (89%) rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/.gitkeep (100%) create mode 100644 src/main/java/org/manifold/compiler/front/BooleanTypeValue.java rename src/main/java/org/manifold/{frontend/syntaxtree/BitValue.java => compiler/front/BooleanValue.java} (54%) rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/EnumIdentifierNotDefined.java (89%) rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/EnumTypeValue.java (91%) rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/EnumValue.java (92%) rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/Expression.java (85%) rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/LiteralExpression.java (88%) rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/MultipleAssignmentException.java (89%) rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/MultipleDefinitionException.java (89%) rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/Namespace.java (93%) rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/NamespaceIdentifier.java (97%) rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/Scope.java (98%) create mode 100644 src/main/java/org/manifold/compiler/front/Statement.java rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/TypeMismatchException.java (92%) rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/TypeTypeValue.java (91%) rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/TypeValue.java (95%) rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/Value.java (93%) rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/Variable.java (97%) rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/VariableIdentifier.java (96%) rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/VariableNotAssignedException.java (90%) rename src/main/java/org/manifold/{frontend/syntaxtree => compiler/front}/VariableNotDefinedException.java (89%) delete mode 100644 src/main/java/org/manifold/frontend/syntaxtree/BitTypeValue.java delete mode 100644 src/main/java/org/manifold/frontend/syntaxtree/Statement.java rename src/test/java/org/manifold/{intermediate => compiler}/TestArrayType.java (91%) rename src/test/java/org/manifold/{intermediate => compiler}/TestAtomicTypes.java (95%) create mode 100644 src/test/java/org/manifold/compiler/TestBooleanTypeValue.java rename src/test/java/org/manifold/{frontend/syntaxtree/TestBitValue.java => compiler/TestBooleanValue.java} (60%) rename src/test/java/org/manifold/{intermediate => compiler}/TestConnection.java (88%) rename src/test/java/org/manifold/{intermediate => compiler}/TestConstraint.java (79%) rename src/test/java/org/manifold/{frontend/syntaxtree => compiler}/TestEnumTypeValue.java (57%) rename src/test/java/org/manifold/{frontend/syntaxtree => compiler}/TestEnumValue.java (52%) rename src/test/java/org/manifold/{intermediate => compiler}/TestNode.java (91%) rename src/test/java/org/manifold/{intermediate => compiler}/TestPort.java (89%) rename src/test/java/org/manifold/{intermediate => compiler}/TestSerialization.java (93%) rename src/test/java/org/manifold/{frontend/syntaxtree => compiler}/TestTypeMismatchException.java (63%) rename src/test/java/org/manifold/{frontend/syntaxtree => compiler}/TestTypeTypeValue.java (78%) rename src/test/java/org/manifold/{frontend/syntaxtree => compiler}/TestTypeValue.java (79%) rename src/test/java/org/manifold/{intermediate => compiler}/TestValue.java (83%) rename src/test/java/org/manifold/{intermediate => compiler/back}/TestSchematic.java (94%) rename src/test/java/org/manifold/{frontend/syntaxtree => compiler/front}/TestMultipleAssignmentException.java (90%) rename src/test/java/org/manifold/{frontend/syntaxtree => compiler/front}/TestMultipleDefinitionException.java (95%) rename src/test/java/org/manifold/{frontend/syntaxtree => compiler/front}/TestNamespace.java (89%) rename src/test/java/org/manifold/{frontend/syntaxtree => compiler/front}/TestNamespaceIdentifier.java (97%) rename src/test/java/org/manifold/{frontend/syntaxtree => compiler/front}/TestScope.java (96%) rename src/test/java/org/manifold/{frontend/syntaxtree => compiler/front}/TestVariable.java (85%) rename src/test/java/org/manifold/{frontend/syntaxtree => compiler/front}/TestVariableIdentifier.java (98%) rename src/test/java/org/manifold/{frontend/syntaxtree => compiler/front}/TestVariableNotAssignedException.java (90%) rename src/test/java/org/manifold/{frontend/syntaxtree => compiler/front}/TestVariableNotDefinedException.java (95%) delete mode 100644 src/test/java/org/manifold/frontend/syntaxtree/TestBitTypeValue.java delete mode 100644 src/test/java/org/manifold/frontend/syntaxtree/TestValue.java diff --git a/checkstyle.xml b/checkstyle.xml index b35528a..157235f 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -52,16 +52,6 @@ page at http://checkstyle.sourceforge.net/config.html --> - - - - - - - - - -