}
private WeaselGenericInformation[] makeGenericInformations(WeaselToken token) throws WeaselCompilerException{
List<WeaselGenericInformation> genericList = new ArrayList<WeaselGenericInformation>();
List<WeaselTreeGenericElement> genericListClass = new ArrayList<WeaselTreeGenericElement>();
WeaselTreeGenericElement lwtge = null;
if(token.tokenType==WeaselTokenType.OPERATOR && token.param == WeaselOperator.LESS){
do{
token = getNextToken();
WeaselCompiler.expect(token, WeaselTokenType.IDENT);
String generic = (String)token.param;
token = getNextToken();
WeaselClass genericClass;
if(token.tokenType == WeaselTokenType.KEYWORD && token.param == WeaselKeyWord.EXTENDS){
ListIterator<WeaselToken> li;
genericListClass.add(lwtge = new WeaselTreeGenericElement(li = tokenParser.listIterator()));
if(lwtge.close){
genericList.add(new WeaselGenericInformation(generic, lwtge.getWeaselClass(interpreter), -1));
break;
}
token = li.next();
genericClass = lwtge.getWeaselClass(interpreter);
}else{
genericClass = interpreter.baseTypes.getObjectClass();
genericListClass.add(null);
lwtge = null;
}
genericList.add(new WeaselGenericInformation(generic, genericClass, -1));
}while(token.tokenType == WeaselTokenType.COMMA);
if(!(lwtge!=null && lwtge.close) && !(token.tokenType==WeaselTokenType.OPERATOR && token.param == WeaselOperator.GREATER)){
throw new WeaselCompilerException(token.line, "WeaselCompiler.expect > at end of generic declaration but got %s", token);
}
}else{
setNextToken(token);
}
genericInformation = genericList.toArray(new WeaselGenericInformation[0]);
for(int i=0; i<genericInformation.length; i++){
WeaselTreeGenericElement wtge = genericListClass.get(i);
if(wtge!=null){
genericInformation[i].genericInfo = wtge.getGenericClassInfo(this);
}
}
return genericInformation;
}