diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-03-09 18:11:17 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-03-09 18:11:17 +0000 |
| commit | 20dc1e124d606cf4298d5112b6d3c4f6c74e9b68 (patch) | |
| tree | 47914e8b0356b2f40e3723eae650d3bb6f100dd4 /src/main/java/org/zwobble/couscous/ast/ClassNode.java | |
| parent | 8ac6cb16b727b5e3d28ab89fee1d169a4f74d9a1 (diff) | |
Introduce Type interface
Diffstat (limited to 'src/main/java/org/zwobble/couscous/ast/ClassNode.java')
| -rw-r--r-- | src/main/java/org/zwobble/couscous/ast/ClassNode.java | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/main/java/org/zwobble/couscous/ast/ClassNode.java b/src/main/java/org/zwobble/couscous/ast/ClassNode.java index 2342315..d50051c 100644 --- a/src/main/java/org/zwobble/couscous/ast/ClassNode.java +++ b/src/main/java/org/zwobble/couscous/ast/ClassNode.java @@ -1,5 +1,7 @@ package org.zwobble.couscous.ast; +import org.zwobble.couscous.ast.types.ScalarType; +import org.zwobble.couscous.ast.types.Type; import org.zwobble.couscous.ast.visitors.NodeMapper; import org.zwobble.couscous.ast.visitors.NodeTransformer; @@ -7,7 +9,7 @@ import java.util.List; import java.util.Set; public class ClassNode implements TypeNode { - public static ClassNodeBuilder builder(TypeName name) { + public static ClassNodeBuilder builder(ScalarType name) { return new ClassNodeBuilder(name); } public static ClassNodeBuilder builder(String name) { @@ -15,9 +17,9 @@ public class ClassNode implements TypeNode { } public static ClassNode declareClass( - TypeName name, + ScalarType name, List<FormalTypeParameterNode> typeParameters, - Set<TypeName> superTypes, + Set<Type> superTypes, List<FieldDeclarationNode> fields, List<StatementNode> staticConstructor, ConstructorNode constructor, @@ -26,18 +28,18 @@ public class ClassNode implements TypeNode { return new ClassNode(name, typeParameters, superTypes, fields, staticConstructor, constructor, methods); } - private final TypeName name; + private final ScalarType name; private final List<FormalTypeParameterNode> typeParameters; - private final Set<TypeName> superTypes; + private final Set<Type> superTypes; private final List<FieldDeclarationNode> fields; private final List<StatementNode> staticConstructor; private final ConstructorNode constructor; private final List<MethodNode> methods; public ClassNode( - TypeName name, + ScalarType name, List<FormalTypeParameterNode> typeParameters, - Set<TypeName> superTypes, + Set<Type> superTypes, List<FieldDeclarationNode> fields, List<StatementNode> staticConstructor, ConstructorNode constructor, @@ -53,7 +55,7 @@ public class ClassNode implements TypeNode { } @Override - public TypeName getName() { + public ScalarType getName() { return name; } @@ -63,7 +65,7 @@ public class ClassNode implements TypeNode { } @Override - public Set<TypeName> getSuperTypes() { + public Set<Type> getSuperTypes() { return superTypes; } |
