public override SymbolCollection parseFile(string filename, out List<CodeBlock> newCodeBlocks, out List<AxisHelper> newAxisHelpers)
{
newCodeBlocks = new List<CodeBlock>();
SymbolCollection newSymbols = new SymbolCollection();
newAxisHelpers = new List<AxisHelper>();
byte[] allBytes = File.ReadAllBytes(filename);
string boschnumber = ExtractBoschPartnumber(allBytes);
string softwareNumber = ExtractSoftwareNumber(allBytes);
partNumberConverter pnc = new partNumberConverter();
VerifyCodeBlocks(allBytes, newSymbols, newCodeBlocks);
for (int t = 0; t < allBytes.Length - 1; t+=2)
{
int len2skip = 0;
if (CheckMap(t, allBytes, newSymbols, newCodeBlocks, out len2skip))
{
if (len2skip > 2) len2skip -= 2; // make sure we don't miss maps
if ((len2skip % 2) > 0) len2skip -= 1;
if (len2skip < 0) len2skip = 0;
t += len2skip;
}
}
newSymbols.SortColumn = "Flash_start_address";
newSymbols.SortingOrder = GenericComparer.SortOrder.Ascending;
newSymbols.Sort();
NameKnownMaps(allBytes, newSymbols, newCodeBlocks);
BuildAxisIDList(newSymbols, newAxisHelpers);
MatchAxis(newSymbols, newAxisHelpers);
RemoveNonSymbols(newSymbols, newCodeBlocks);
FindSVBL(allBytes, filename, newSymbols, newCodeBlocks);
SymbolTranslator strans = new SymbolTranslator();
foreach (SymbolHelper sh in newSymbols)
{
sh.Description = strans.TranslateSymbolToHelpText(sh.Varname);
}
// check for must have maps... if there are maps missing, report it
return newSymbols;
}