/// <summary> /// Splits data between parts /// </summary> /// <param name="cur">Data</param> public void AddData(List <Token> cur) { List <Token> data = new List <Token>(); ICompilable last = null; foreach (var x in cur) { switch (x.t) { case TType.ou: FinishBlock(ref data, last); last = new OutInit(); break; case TType.init: FinishBlock(ref data, last); last = new Init(); break; case TType.Beg: FinishBlock(ref data, last); last = new Body(); break; case TType.End: FinishBlock(ref data, last); break; default: data.Add(x); break; } } var v = new After(); v.AddData(data); com.Add(v); }