public RantAction Compile()
{
var parser = Parser.Get <SequenceParser>();
var stack = new Stack <IEnumerator <Parser> >();
var actionList = new List <RantAction>();
_nextActionCallback = a => actionList.Add(a);
stack.Push(parser.Parse(this, _nextContext, _reader, _nextActionCallback));
top:
while (stack.Any())
{
var p = stack.Peek();
while (p.MoveNext())
{
if (p.Current == null)
{
continue;
}
stack.Push(p.Current.Parse(this, _nextContext, _reader, _nextActionCallback));
goto top;
}
stack.Pop();
}
return(new RASequence(actionList, _source));
}