void DoProcessItemTFS(TPredicateItemBase ABase, TDynamicArray AStack) { TPredicateItemTFS m_Tfs; TPredicateItemTFE m_Tfe; if (ABase != null) { int m_type = ABase.Who(); if (m_type == 0) { m_Tfs = (TPredicateItemTFS)(ABase); for (int j = 0; j <= m_Tfs.TFECount - 1; j++) { m_Tfe = m_Tfs.GetTFEItems(j); if (m_Tfe.Big != null) { AStack.InsertToFirst(m_Tfe.Big); } } } if (m_type == 1) { AStack.InsertToFirst(ABase); } } }
public override void ListIDFill(TDynamicArray AList) { int id; TPredicateItemTFS mTfs; //мб только укрупненная или просто рабочая операция id = f_Item1.Who(); if (id == 0) { mTfs = (TPredicateItemTFS)(f_Item1); id = mTfs.GetTFEItems(0).TFE.BaseShape.ID; AList.AppendInteger(id, mTfs.GetTFEItems(0).TFE.BaseShape); } else { AList.AppendInteger(f_Item1.ID, null); } id = f_Item2.Who(); if (id == 0) { mTfs = (TPredicateItemTFS)(f_Item2); id = mTfs.GetTFEItems(0).TFE.BaseShape.ID; AList.AppendInteger(id, mTfs.GetTFEItems(0).TFE.BaseShape); } else { AList.AppendInteger(f_Item2.ID, null); } }
TPredicatePathNode FillPathNode(TPredicateItemBig AHead, TPredicateItemBase AItem) { TPredicatePathNode N = null; int m_who = AItem.Who(); bool valid = m_who == 0; if (m_who == 1) { valid = ((TPredicateItemBig)(AItem)).ValidDescendant(); } if (valid) { N = f_BasePath.CreatePathNode(AHead); N.AddItem(AItem); } return(N); }
void DoSetIDItemTFS(TPredicateItemBase ABase, TDynamicArray AStack) { int m_type; TPredicateItemPWork m_PW; if (ABase != null) { m_type = ABase.Who(); if (m_type == 0) { PushTFS((TPredicateItemTFS)(ABase), AStack); } if (m_type == 1) { AStack.InsertToFirst(ABase); } if (m_type == 2) { m_PW = (TPredicateItemPWork)(ABase); //1 m_type = m_PW.Item1.Who(); if (m_type == 0) { PushTFS((TPredicateItemTFS)(m_PW.Item1), AStack); } if (m_type == 1) { AStack.InsertToFirst(m_PW.Item1); } //2 m_type = m_PW.Item2.Who(); if (m_type == 0) { PushTFS((TPredicateItemTFS)(m_PW.Item2), AStack); } if (m_type == 1) { AStack.InsertToFirst(m_PW.Item2); } } } }
/* TPredicatePathNodeItem* CreateItem();*/ public void AddItem(TPredicateItemBase AItem) { TPredicatePathNodeItem N = new TPredicatePathNodeItem(); if (AItem.Who() == 0) { N.TFS = ((TPredicateItemTFS)AItem).TFS.BaseWorkShape; N.BlockID = N.TFS.BlockId; } else { N.BlockID = SharedConst.PredicatePathNextNum(); } N.f_Index = f_Cnt; N.ItemBase = AItem; f_Cnt++; f_List.Add(N); }
void MakeElement(TPredicateItemBase AElement) { int m_who = AElement.Who(); if (m_who == 1) { //throw(Exception("недопустимо использование MakeElement(TPredicateItemBase* AElement). Обратитесь к разработчикам!")); } if (m_who == 2) { TPredicateItemPWork m_PW = (TPredicateItemPWork)(AElement); MakeElement(m_PW.Item1); MakeElement(m_PW.Item2); } if (m_who == 0) { TPredicateItemTFS m_TFS = (TPredicateItemTFS)(AElement); MakeElementTFS(m_TFS); } }
/* AnsiString PrintPWork(TPredicateItemPWork* APWork, TDynamicArray* AStack); * AnsiString PrintBig(TPredicateItemBig* ABig, TDynamicArray* AStack); * AnsiString ParseItem(TPredicateItemBase* ABase, TDynamicArray* AStack);*/ TPredicateItemBase DoParseItem(ref TPredicateItemBase ABase, ref TDynamicArray AStack) { TPredicateItemBase Res = null; int m_who = ABase.Who(); if (m_who == 1) { TPredicateItemBig m_Big = (TPredicateItemBig)(ABase); Res = DoPrintBig(ref m_Big, ref AStack); } if (m_who == 2) { TPredicateItemPWork m_PW = (TPredicateItemPWork)(ABase); Res = DoPrintPWork(ref m_PW, ref AStack); } if (m_who == 0) { Res = ABase; } return(Res); }
void PushBig(TPredicateItemBig ABig, ref TDynamicArray AStack) { if (ABig.Envelope) { TPredicateItemBase B = ABig.GetItems(0); B.EnvelopeBIG = ABig; int m_who = B.Who(); if ((m_who == 2) || (m_who == 1)) { AStack.InsertToFirst(B); } if (m_who == 0) { PushTFS((TPredicateItemTFS)(B), ref AStack); } } else { AStack.InsertToFirst(ABig); } }
void CheckParseItem(ref TPredicateItemBase ABase, ref TDynamicArray AStack) { int m_type; TPredicateItemPWork m_PW; if (ABase != null) { m_type = ABase.Who(); if (m_type == 0) { PushTFS((TPredicateItemTFS)(ABase), ref AStack); } if (m_type == 1) { PushBig((TPredicateItemBig)(ABase), ref AStack); } if (m_type == 2) { PushPWork((TPredicateItemPWork)(ABase), ref AStack); } } }
TPredicateItemBase EnvelopeToBig(TPredicateItemBase ASource) { TPredicateItemTFS mTfs; TPredicateItemBig nBig; int m_who = ASource.Who(); if (m_who == 1) { return(ASource); } if (m_who == 0) { mTfs = (TPredicateItemTFS)(ASource); if (mTfs.TFS.BaseWorkShape.TypeShape == 1) { return(ASource); } } nBig = new TPredicateItemBig(); nBig.Envelope = true; nBig.AddItem(ASource); SwapNumAlt(nBig, ASource); return(nBig); }
string GetAlias() { string Res = ""; int mType = f_Item.Who(); if (mType == 1) { return("rab_oper"); } if (mType == 2) { return("rab_oper_posl"); } mType = ((TPredicateItemTFS)(f_Item)).TFS.BaseWorkShape.TypeShape; switch (mType) { case 1: { Res = "rab_oper"; break; } case 2: { Res = "rab_oper_par_AND"; break; } case 3: { Res = "rab_oper_par_OR"; break; } case 4: { Res = "diagn_control_rab"; break; } case 5: { Res = "diagn_func_coltrol"; break; } case 6: { Res = "rasvilka"; break; } case 7: { Res = "proverka_if"; break; } case 8: { Res = "while_do_control_rab"; break; } case 9: { Res = "do_while_do_control_rab"; break; } case 10: { Res = "do_while_do_control_func"; break; } case 11: { Res = "proverka_uslovia"; break; } } return(Res); }