Exemple #1
0
        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();
        }
Exemple #2
0
        void AddElementToTree(TPredicateTree APredicateTree)
        {
            TPredicateTreeItem N = new TPredicateTreeItem();

            N.ParentID    = f_Item.ParentID;
            N.ParentShape = f_Item.ParentBaseShape;
            N.NumAlt      = f_Item.Item.NumAlt + 1;
            int m_type, m_who = f_Item.Item.Who();

            m_type = -1;
            if (m_who == 0)
            {
                N.BaseWorkShape = ((TPredicateItemTFS)f_Item.Item).TFS.BaseWorkShape;
                m_type          = N.BaseWorkShape.TypeShape;
            }
            if (m_who == 1)
            {
                m_type = 12;
            }
            if (m_who == 2)
            {
                m_type = 13;
            }
            N.TypeWorkShape = m_type;

            TDynamicArray D = new TDynamicArray();

            f_Item.Item.ListIDFill(D);
            int cnt = D.Count;

            for (int i = 0; i <= cnt - 1; i++)
            {
                N.AddBaseShape((TBaseShape)(D.GetPosition(i).P), D.GetPosition(i).Int_Value);
            }
            D = null;

            APredicateTree.AddPredicateTreeItem(N);
        }