if (tail != null) for (Node n : tail) if (n != null) result.superInterfaces.add(n);
return posify(result);
}
public Node createInterfaceDeclaration(Node modifiers, Node name, Node params, Node body, List<Node> addons) {
InterfaceDeclaration decl = new InterfaceDeclaration().astName(createIdentifierIfNeeded(name, currentPos())).rawBody(body);
if (modifiers != null) decl.astModifiers(createModifiersIfNeeded(modifiers, currentPos()));
if (params instanceof TemporaryNode.OrphanedTypeVariables) {
TemporaryNode.OrphanedTypeVariables otv = (TemporaryNode.OrphanedTypeVariables)params;
if (otv.variables != null) for (Node typeParameter : otv.variables) {
if (typeParameter != null) decl.rawTypeVariables().addToEnd(typeParameter);
}
}
if (addons != null) for (Node n : addons) {
if (n instanceof TemporaryNode.ExtendsClause) {
//if (!decl.extending().isEmpty()) //TODO add error node: multiple extends clauses.
List<Node> superClasses = ((TemporaryNode.ExtendsClause)n).superTypes;
if (superClasses != null) for (Node superClass : superClasses) if (superClass != null) decl.rawExtending().addToEnd(superClass);
}
//if (n instanceof TemporaryNode.ImplementsClause) //TODO add error node: implements not allowed here.
}