public static ISerializableEvaluation unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException { final boolean qualified = (firstBytes & FLAG_QUALIFIED) != 0; final boolean addressOf = (firstBytes & FLAG_ADDRESS_OF) != 0; if ((firstBytes & FLAG_HAS_FUNCTION_SET) != 0) { int bindingCount = buffer.getInt(); ICPPFunction[] bindings = new ICPPFunction[bindingCount]; for (int i = 0; i < bindings.length; i++) { bindings[i] = (ICPPFunction) buffer.unmarshalBinding(); } ICPPTemplateArgument[] args = null; if ((firstBytes & FLAG_HAS_TEMPLATE_ARGS) != 0) { int len = buffer.getInt(); args = new ICPPTemplateArgument[len]; for (int i = 0; i < args.length; i++) { args[i] = buffer.unmarshalTemplateArgument(); } } IType impliedObjectType = buffer.unmarshalType(); IBinding templateDefinition = buffer.unmarshalBinding(); return new EvalFunctionSet( new CPPFunctionSet(bindings, args, null), qualified, addressOf, impliedObjectType, templateDefinition); } else { char[] name = buffer.getCharArray(); IBinding templateDefinition = buffer.unmarshalBinding(); return new EvalFunctionSet(name, qualified, addressOf, templateDefinition); } }
public static ISerializableExecution unmarshal(short firstBytes, ITypeMarshalBuffer buffer) throws CoreException { ICPPEvaluation controllerExprEval = (ICPPEvaluation) buffer.unmarshalEvaluation(); ExecSimpleDeclaration controllerDeclExec = (ExecSimpleDeclaration) buffer.unmarshalExecution(); int len = buffer.getInt(); ICPPExecution[] bodyStmtExecutions = new ICPPExecution[len]; for (int i = 0; i < bodyStmtExecutions.length; i++) { bodyStmtExecutions[i] = (ICPPExecution) buffer.unmarshalExecution(); } return new ExecSwitch(controllerExprEval, controllerDeclExec, bodyStmtExecutions); }