public ParsedFile Parse(params string[] lines) { var controller = new ParserController(); // Use index-based loop for deterministic iteration order for (var i = 0; i < lines.Length; i++) { controller.BeginLine(); if (lines[i].Length > 0) { var tokens = lines[i].Split(' '); // Same above for (var j = 0; j < tokens.Length; j++) { controller.Accept(tokens[j]); } } controller.EndLine(); if (controller.isTerminated()) // Can happen if there is .END pseudo-instruction { break; } } return(controller.Assemble()); }
public void Process(ParserController controller, params string[] arguments) => _impl(controller, arguments);