// The second to (n-1) child not of this node are optional and declares parameter variables used in this formula. (Here "x" and "y"
//
int functionVariables = 0;
ASTUserDefinedFunctionDef def = (ASTUserDefinedFunctionDef) children[0];
UserDefinedFunction function = def.getFunction();
for (int i = 1; i < children.length; i++) {
if (children[i] instanceof ASTUserDefinedFunctionVariable) {
functionVariables++;
} else {
function.setFunction(children[i]);
}
}
ASTUserDefinedFunctionVariable[] var = new ASTUserDefinedFunctionVariable[functionVariables];
for (int i = 0; i < functionVariables; i++) {
var[i] = (ASTUserDefinedFunctionVariable) children[i + 1];
}
function.setVariables(var);
}