From ee1fa17aba5e47ea279b4f102a63ccfe91c2636c Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Wed, 30 May 2018 15:29:59 +0200 Subject: [PATCH] Implement convert(ClassOrInterfaceType) --- .../parser/SyntaxTreeGenerator/TypeGenerator.java | 11 +++++------ src/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java | 1 - 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java index 00a0f778..d36fd172 100644 --- a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java +++ b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java @@ -92,7 +92,7 @@ public class TypeGenerator { return ret; } if(typeBoundContext.classOrInterfaceType() != null){ - ret.add(convert(typeBoundContext.classOrInterfaceType())); + ret.add(convert(typeBoundContext.classOrInterfaceType(), reg, generics)); if(typeBoundContext.additionalBound() != null) for(Java8Parser.AdditionalBoundContext addCtx : typeBoundContext.additionalBound()){ ret.add(convert(addCtx.interfaceType())); @@ -103,8 +103,9 @@ public class TypeGenerator { } } - private static RefTypeOrTPHOrWildcardOrGeneric convert(Java8Parser.ClassOrInterfaceTypeContext classOrInterfaceTypeContext) { - throw new NotImplementedException(); + private static RefTypeOrTPHOrWildcardOrGeneric convert(Java8Parser.ClassOrInterfaceTypeContext classOrInterfaceTypeContext, JavaClassRegistry reg, GenericsRegistry generics) { + Java8Parser.ClassType_lfno_classOrInterfaceTypeContext ctx = classOrInterfaceTypeContext.classType_lfno_classOrInterfaceType(); + return convertTypeName(ctx.Identifier().toString(), ctx.typeArguments(),classOrInterfaceTypeContext.getStart(), reg, generics); } private static RefTypeOrTPHOrWildcardOrGeneric convert(Java8Parser.InterfaceTypeContext interfaceTypeContext) { @@ -114,9 +115,7 @@ public class TypeGenerator { public static RefTypeOrTPHOrWildcardOrGeneric convert(Java8Parser.ReferenceTypeContext referenceTypeContext, JavaClassRegistry reg, GenericsRegistry generics) { if(referenceTypeContext.classOrInterfaceType() != null){ if(referenceTypeContext.classOrInterfaceType().classType_lfno_classOrInterfaceType()!= null){ - Java8Parser.ClassType_lfno_classOrInterfaceTypeContext ctx = referenceTypeContext.classOrInterfaceType().classType_lfno_classOrInterfaceType(); - return convertTypeName(ctx.Identifier().toString(), ctx.typeArguments(),referenceTypeContext.getStart(), reg, generics); - //return convertTypeName(referenceTypeContext.getText(), ctx.typeArguments(),referenceTypeContext.getStart(), reg, generics); + return convert(referenceTypeContext.classOrInterfaceType(), reg, generics);//return convertTypeName(referenceTypeContext.getText(), ctx.typeArguments(),referenceTypeContext.getStart(), reg, generics); }else{ throw new NotImplementedException(); } diff --git a/src/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java b/src/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java index 00788b63..b9a63346 100644 --- a/src/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java +++ b/src/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java @@ -1,6 +1,5 @@ package de.dhbwstuttgart.syntaxtree; -import com.sun.org.apache.xpath.internal.operations.Mod; import de.dhbwstuttgart.core.IItemWithOffset; import de.dhbwstuttgart.exceptions.DebugException; import de.dhbwstuttgart.parser.scope.JavaClassName;