internal static PexObjectFunction Create(PexParseMeta parse) { var ret = new PexObjectFunction(); ret.ReturnTypeName = parse.ReadString(); ret.DocString = parse.ReadString(); ret.RawUserFlags = parse.Reader.ReadUInt32(); ret.Flags = (FunctionFlags)parse.Reader.ReadUInt8(); var parameters = parse.Reader.ReadUInt16(); for (var i = 0; i < parameters; i++) { var parameter = PexObjectFunctionVariable.Create(parse); ret.Parameters.Add(parameter); } var locals = parse.Reader.ReadUInt16(); for (var i = 0; i < locals; i++) { var local = PexObjectFunctionVariable.Create(parse); ret.Locals.Add(local); } var instructions = parse.Reader.ReadUInt16(); for (var i = 0; i < instructions; i++) { var instruction = PexObjectFunctionInstruction.Create(parse); ret.Instructions.Add(instruction); } return(ret); }
internal static PexObjectFunctionVariable Create(PexParseMeta parse) { var ret = new PexObjectFunctionVariable(); ret.Name = parse.ReadString(); ret.TypeName = parse.ReadString(); return(ret); }