public static void Parse(Compiler compiler, StreamReader reader) { var content = reader.ReadToEnd(); reader.Dispose(); content = content.Replace("\r", "").Replace("\n", " "); content = Regex.Replace(Regex.Replace(content, "\\s+", " "), "^\\s*|\\s*$", ""); var fileParser = new FileParser(compiler); while (!string.IsNullOrEmpty(content) && content != "end"){ var parser = Regex.Split(content, MethodPattern); content = fileParser.ProcessMethod(fileParser.compiler, parser[1], parser[2]); } var x = fileParser.compiler; }
public FileParser(Compiler compiler) { this.compiler = compiler; }