class FunctionInstructionFactory extends InstructionFactory {
    @Override
    public boolean createInstruction(ExpressRunner expressRunner, InstructionSet result,
        Stack<ForRelBreakContinue> forStack, ExpressNode node, boolean isRoot)
        throws Exception {<FILL_FUNCTION_BODY>}
}

        ExpressNode[] children = node.getChildrenArray();
        if (children.length != 3) {
            throw new QLException("function 操作符需要3个操作数 ");
        }
        String functionName = children[0].getValue();
        ExpressNode[] varDefines = children[1].getChildrenArray();
        int point = 0;

        String instructionSetType;
        if (node.isTypeEqualsOrChild("class")) {
            instructionSetType = InstructionSet.TYPE_CLASS;
        } else {
            instructionSetType = InstructionSet.TYPE_FUNCTION;
        }
        InstructionSet functionSet = new InstructionSet(instructionSetType);

        while (point < varDefines.length) {
            if (!varDefines[point].isTypeEqualsOrChild("def")) {
                throw new QLException("function的参数定义错误," + varDefines[point] + "不是一个Class");
            }
            Class<?> varClass = (Class<?>)varDefines[point].getChildrenArray()[0].getObjectValue();
            String varName = varDefines[point].getChildrenArray()[1].getValue();
            OperateDataLocalVar tmpVar = new OperateDataLocalVar(varName, varClass);
            functionSet.addParameter(tmpVar);
            point = point + 1;
        }

        ExpressNode functionRoot = new ExpressNode(expressRunner.getNodeTypeManager().findNodeType("FUNCTION_DEFINE"),
            "function-" + functionName);
        for (ExpressNode expressNode : children[2].getChildrenArray()) {
            functionRoot.addChild(expressNode);
        }
        expressRunner.createInstructionSet(functionRoot, functionSet);
        result.addMacroDefine(functionName, new FunctionInstructionSet(functionName, instructionSetType, functionSet));
        return false;
    
<methods>public non-sealed void <init>() ,public abstract boolean createInstruction(com.ql.util.express.ExpressRunner, com.ql.util.express.InstructionSet, Stack<com.ql.util.express.instruction.ForRelBreakContinue>, com.ql.util.express.parse.ExpressNode, boolean) throws java.lang.Exception,public static com.ql.util.express.instruction.InstructionFactory getInstructionFactory(java.lang.String) <variables>private static final Map<java.lang.String,com.ql.util.express.instruction.InstructionFactory> INSTRUCTION_FACTORY_MAP