diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator.java b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator.java index 4b5c1d64..c81bb537 100644 --- a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator.java +++ b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator.java @@ -53,48 +53,23 @@ public class SyntaxTreeGenerator{ List classes = new ArrayList<>(); this.getNames(ctx); for(Java8Parser.TypeDeclarationContext typeDecl : ctx.typeDeclaration()){ - ClassOrInterface newClass = convert(typeDecl); + ClassOrInterface newClass = null; + if(typeDecl.classDeclaration() != null){ + newClass = convertCl(typeDecl.classDeclaration()); + } + else{ + newClass = convertIf(typeDecl.interfaceDeclaration()); + } classes.add(newClass); } return new SourceFile(this.pkgName, classes, this.imports); } - private ClassOrInterface convert(Java8Parser.TypeDeclarationContext ctx) { - Java8Parser.ClassDeclarationContext cl = ctx.classDeclaration(); - Java8Parser.InterfaceDeclarationContext id = ctx.interfaceDeclaration(); - if(cl != null){ - Java8Parser.NormalClassDeclarationContext nc = cl.normalClassDeclaration(); - if(nc != null){ - Modifiers modifiers = null; - if(nc.classModifier() != null){ - List modList = new ArrayList(); - for(Java8Parser.ClassModifierContext mod : nc.classModifier()){ - Modifier m = convert(mod); - modList.add(m); - } - modifiers = new Modifiers(modList); - } - JavaClassName name = null; - if(this.pkgName != null){ - name = new JavaClassName(this.pkgName +"."+ nc.Identifier().toString()); - } - else{ - name = new JavaClassName(nc.Identifier().toString()); - } - Block class_block = null; - List fielddecl = null; - GenericDeclarationList genericClassParameters = null; - int offset = 0; - RefType superClass = null; - Boolean isInterface = false; - List implementedInterfaces = null; - return new ClassOrInterface(modifiers, name, class_block, fielddecl, genericClassParameters, offset, superClass, isInterface, implementedInterfaces); - } - } + private ClassOrInterface convertCl(Java8Parser.ClassDeclarationContext ctx) { return null; } - private Modifier convert(Java8Parser.ClassModifierContext ctx){ + private ClassOrInterface convertIf(Java8Parser.InterfaceDeclarationContext ctx){ return null; } }