public static Statement InterpretStatement(Context context, string text) { // example statement: // select *.md -recursive >> markdown >> template template.html >> save .html Statement statement = new Statement(); string[] sentences = text.Split(new string[] { ">>" }, StringSplitOptions.RemoveEmptyEntries); statement.Selector = InterpretSelector(context, sentences.First()); foreach (string s in sentences.Skip(1)) { IProcessor processor = InterpretProcessor(context, s); if (processor != null) { statement.PipeLine.Add(processor); } } return statement; }
public static void Append(this Bulk bulk, ISelector filter, PipeLine pipeline) { var statement = new Statement() { Selector = filter, PipeLine = pipeline }; bulk.Append(statement); }