public override object Read(string path) { var rawData = new pdData(); string txt; using (var reader = new StreamReader(path)) { txt = reader.ReadToEnd(); } var grammar = new OpenFoamGrammar(); var parser = new Parser(grammar); var tree = parser.Parse(txt); foreach (ParseTreeNode rootEntryNode in tree.Root.FindDictEntries(null)) { var identifier = rootEntryNode.GetEntryIdentifier(); switch (identifier) { //case "turbineArrayOn": // rawData.TurbineArrayOn = rootEntryNode.GetBasicValBool(); // break; } } return(rawData); }
public override object Read(string path) { var rawData = new pdData(); string txt; using (var reader = new StreamReader(path)) { txt = reader.ReadToEnd(); } var grammar = new OpenFoamGrammar(); var parser = new Parser(grammar); var tree = parser.Parse(txt); foreach (ParseTreeNode rootEntryNode in tree.Root.FindDictEntries(null)) { var identifier = rootEntryNode.GetEntryIdentifier(); switch (identifier) { //case "turbineArrayOn": // rawData.TurbineArrayOn = rootEntryNode.GetBasicValBool(); // break; } } return rawData; }