if(action.isMethod()){
//search for the semantic action within the method proposal list
for(int i=0; i<methods.size();i++){
if(methods.get(i).getName().equals(action.getName())){
//proposal has been found
IMethodBinding b = methods.get(i).getBinding();
ITypeBinding type = b.getReturnType();
if(arrayLevel > type.getDimensions()){
//the number of array parameters written at the operation has exceeded the actual array dimension of this type
return null;
}
while (arrayLevel > 0){
//get the containing element of the array
type = type.getComponentType();
arrayLevel--;
}
//if the return type of the method is void, ignore this Method
if(!type.getName().equals("void")){
completionProposals = calculateSemanticFieldsAndMethds(type);
if(iteration == size){
//end of Statement has been reached, return the calculated proposals
return completionProposals;
}
else{
//calculate the semantic proposals for the next iteration
completionProposals = calculateSemanticFieldsAndMethods(iteration+1, semanticActions, extractFields(completionProposals), extractMethods(completionProposals));
if(completionProposals!=null){
return completionProposals;
}
}
}
}
}
}
else{ // if action is a Variable
//search for the semantic action within the variable proposal list
for(int i=0; i<fields.size(); i++){
if(fields.get(i).getName().equals(action.getName())){
//proposal has been found
IVariableBinding b = fields.get(i).getBinding();
ITypeBinding type = b.getType();
if(arrayLevel > type.getDimensions()){
//the number of array parameters written at the operation has exceeded the actual array dimension of this type
return null;
}
while (arrayLevel > 0){