public static FunctionMetadataRegistry CreateRegistry() { using (StringReader br = new StringReader(Resource1.functionMetadata)) { FunctionDataBuilder fdb = new FunctionDataBuilder(400); try { while (true) { String line = br.ReadLine(); if (line == null) { break; } if (line.Length < 1 || line[0] == '#') { continue; } String TrimLine = line.Trim(); if (TrimLine.Length < 1) { continue; } ProcessLine(fdb, line); } } catch (IOException) { throw; } return(fdb.Build()); } }
private static void ProcessLine(FunctionDataBuilder fdb, String line) { Regex regex = new Regex(TAB_DELIM_PATTERN); String[] parts = regex.Split(line); if (parts.Length != 8) { throw new Exception("Bad line format '" + line + "' - expected 8 data fields"); } int functionIndex = ParseInt(parts[0]); String functionName = parts[1]; int minParams = ParseInt(parts[2]); int maxParams = ParseInt(parts[3]); byte returnClassCode = ParseReturnTypeCode(parts[4]); byte[] parameterClassCodes = ParseOperandTypeCodes(parts[5]); // 6 IsVolatile bool hasNote = parts[7].Length > 0; ValidateFunctionName(functionName); // TODO - make POI use IsVolatile fdb.Add(functionIndex, functionName, minParams, maxParams, returnClassCode, parameterClassCodes, hasNote); }