public void Init(ref TPredicateItemBig AHead, ref TPredicateTree APredicateTree) { string SC; bool pass; TPredicateItemBase Base, NC; f_PrStruct = ""; f_PrRab = ""; f_PrControlRab = ""; f_PrControlFunc = ""; f_PrCheckCondition = ""; TDynamicArray m_Stack = new TDynamicArray(); m_Stack.InsertToFirst(AHead); Base = (TPredicateItemBase)(m_Stack.Pop()); while (Base != null) { NC = DoParseItem(ref Base, ref m_Stack); if (NC != null) { f_BTree.insert(NC); } Base = (TPredicateItemBase)(m_Stack.Pop()); } m_Stack = null; SharedConst.lcList.clear(); f_BTree.inorder(acp); SharedConst.lcList.first(); for (int i = 0; i <= SharedConst.lcList.length() - 1; i++) { // TGlsListNode tmpNode = (TGlsListNode)SharedConst.lcList.val(); // TPredicateItemTFS tmpPredicateItem = (TPredicateItemTFS)(tmpNode.Val); // TPredicateItemPWork Base = (TPredicateItemBase)(SharedConst.lcList.val()); f_Item.Make(Base, Base.EnvelopeBIG); SC = f_Item.OutString; if (SC.Length > 0) { f_PrStruct = f_PrStruct + SC + "\r\n"; MakeElement(Base); if (APredicateTree != null) { AddElementToTree(APredicateTree); } } // MakeElement(Base); // f_Tran.AddGTItem(f_Item); SharedConst.lcList.next(); } bool acp(object A) { SharedConst.lcList.append(A); return(true); } // f_TextRecalc = f_Tran.Make(); }
public void InitData() { TBaseWorkShape WS; TBaseShape TFE; TGlsBinaryTree BTree = new TGlsBinaryTree(OPM_CompareNode); for (int i = 0; i <= MassWork.Count - 1; i++) { WS = (TBaseWorkShape)(MassWork.GetItems(i)); for (int j = 0; j <= WS.WorkShapesCount - 1; j++) { TFE = (TBaseShape)(WS.GetWorkShape(j)); BTree.insert(TFE); } } MassWork.Clear(); BTree.inorder(OPM_Inorder); // delete BTree; CheckCol(); }
void DoCreateBasis() { TGlsBinaryTree mTree; TAlternativeParserGrpItemTFS Tfs; TAlternativeParserGrpItemList Item; TDynamicArray D = new TDynamicArray(); SharedConst.lc = new List <object>(); f_Basis.Clear(); for (int i = 0; i <= Count - 1; i++) { Item = GetItems(i); for (int j = 0; j <= Item.Count - 1; j++) { Tfs = Item.GetItems(j); if (D.Find(Tfs.TFS) == null) { MessageBox.Show("ДЕЛАЮ на УГАД, эту строчку НУЖНО ДЕБАЖИТЬ", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Warning); } // D.AppendInteger((int)Tfs, Tfs.TFS); // ХЗ ДЕЛАЮ на УГАД, эту строчку НУЖНО ДЕБАЖИТЬ } } mTree = new TGlsBinaryTree(SharedConst.APC_CompareNode); for (int i = 0; i <= D.Count - 1; i++) { object tmp = D.GetPosition(i).Int_Value; Tfs = (TAlternativeParserGrpItemTFS)tmp; mTree.insert(Tfs); } mTree.inorder(SharedConst.APC_Inorder); for (int i = 0; i <= SharedConst.lc.Count - 1; i++) { Tfs = (TAlternativeParserGrpItemTFS)(SharedConst.lc.ElementAt(i)); f_Basis.Add(Tfs); } mTree = null; D = null; SharedConst.lc = null; }