public override void AddContent(SitcomFile.Keyword keyword) { if (mLeft != null) { mLeft.AddContent(keyword); } }
public bool Read(SitcomFile sitcom) { if (sitcom.NextCmd()) { mKeys.Clear(); while (sitcom.NextKeyword()) { mKeys.Add(sitcom.keyword); } ISitcomOper replaced; var dom = new SitcomDomainOper(); dom.keyword = sitcom.keyword; mOper = dom; for (int i = 0; i < mKeys.Count; i++) { var oper = SitcomFactory.Instance.GetOperator(mKeys[i]); var root = GetRoot(mOper, oper.Priority); if (!root.IsBlock && root.Priority >= oper.Priority) { oper.AddLeftChild(root); mOper = oper; } else { mOper = root.AddRightChild(oper, out replaced); if (replaced != null) { oper.AddLeftChild(replaced); } } } while (mOper.Parent != null) { mOper = mOper.Parent; } if (mOper.RequireContent && sitcom.NextContent()) { mOper.AddContent(sitcom.keyword); } mOper.Compile(); return(true); } else { mOper = null; return(false); } }