Ejemplo n.º 1
0
        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);
                }
            }
        }
Ejemplo n.º 2
0
        /*----------------------------------------*/
        public static int CompareNode(object A, object B)
        {
            TPredicateItemBase m_A = (TPredicateItemBase)(A);
            TPredicateItemBase m_B = (TPredicateItemBase)(B);
            int A_ID = ParentID(m_A);
            int B_ID = ParentID(m_B);
            int ANum = Sign(A_ID);
            int BNum = Sign(B_ID);

            if ((A_ID > 0) || (B_ID > 0))
            {
                if ((A_ID > 0) && (B_ID > 0))
                {
                    if (A_ID > B_ID)
                    {
                        return(1);
                    }
                    else
                    {
                        return(-1);
                    }
                }
                return(1);
            }
            else
            {
                return(CompareNum(A_ID, m_A.NumAlt, B_ID, m_B.NumAlt, ((ANum <= 0) && (BNum <= 0))));
            }
        }
Ejemplo n.º 3
0
 /*    AnsiString __fastcall GetText();
  *       public:*/
 public TPredicatePathNode(TPredicateItemBase AParentItemBase, int AID, int ANumAlt)
 {
     f_Cnt            = 0;
     f_ID             = AID;
     f_ParentItemBase = AParentItemBase;
     f_NumAlt         = ANumAlt;
     f_List           = new List <object>();
 }
Ejemplo n.º 4
0
        public void DeleteItemToList(TPredicateItemBase AItem)
        {
            int index = f_List.IndexOf(AItem);

            if (index >= 0)
            {
                f_List.RemoveAt(index);
            }
        }
Ejemplo n.º 5
0
        bool CheckPath(TPredicateItemBig AHead, TPredicateItemBase AItem)
        {
            TPredicatePathNode N = FillPathNode(AHead, AItem);

            if (N != null && f_UsedPath.FindLikePathNode(N) == null)
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 6
0
 public void ApplyStyle(TPredicateItemBig AHead, TPredicateItemBase AItem)
 {
     if (f_PathStyle == 0)
     {
         FillPathNode(AHead, AItem);
     }
     if (f_PathStyle == 1)
     {
         f_TryPath = CheckPath(AHead, AItem);
     }
 }
Ejemplo n.º 7
0
 public static int ParentID(TPredicateItemBase AItem)
 {
     if (AItem.EnvelopeBIG == null)
     {
         return(0);
     }
     if (AItem.EnvelopeBIG.Rfc != null)
     {
         TAlternativeParserItemTFE ITE = AItem.EnvelopeBIG.Rfc.ParentTFE;
         if (ITE != null)
         {
             return(ITE.TFE.BaseShape.ID);
         }
     }
     return(AItem.EnvelopeBIG.ID);
 }
Ejemplo n.º 8
0
        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);
        }
Ejemplo n.º 9
0
        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);
                    }
                }
            }
        }
Ejemplo n.º 10
0
        /*       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);
        }
Ejemplo n.º 11
0
        /*     AnsiString __fastcall GetText();*/
        public TPredicatePathNodeItem FindPathNodeByParent(TPredicateItemBase AParent)
        {
            TPredicatePathNode     Item;
            TPredicatePathNodeItem NItem;

            for (int i = 0; i <= NodeCount - 1; i++)
            {
                Item = GetNodeItems(i);
                for (int j = 0; j <= Item.Count - 1; j++)
                {
                    NItem = Item.GetItems(j);
                    if (NItem.ItemBase == AParent)
                    {
                        return(NItem);
                    }
                }
            }
            return(null);
        }
Ejemplo n.º 12
0
        public TPredicatePathNode CreatePathNode(TPredicateItemBase AParentItemBase)
        {
            int mID = 0;
            int Num = 0;

            if (AParentItemBase != null)
            {
                Num = ((TPredicateItemBig)AParentItemBase).NumAlt;
                TPredicatePathNodeItem NI = FindPathNodeByParent(AParentItemBase);
                if (NI != null)
                {
                    mID = NI.BlockID;
                }
            }
            TPredicatePathNode N = new TPredicatePathNode(AParentItemBase, mID, Num);

            f_List.Add(N);
            return(N);
        }
Ejemplo n.º 13
0
        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);
            }
        }
Ejemplo n.º 14
0
        /*        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);
        }
Ejemplo n.º 15
0
 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);
     }
 }
Ejemplo n.º 16
0
        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);
                }
            }
        }
Ejemplo n.º 17
0
        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);
        }
Ejemplo n.º 18
0
 public TGraphTFEConvertorItem()
 {
     f_Out    = "";
     f_Item   = null;
     f_Parent = null;
 }
Ejemplo n.º 19
0
 public TPredicateItemPWork()
 {
     f_Item1 = null;
     f_Item2 = null;
 }
Ejemplo n.º 20
0
 public TPredicatePathNodeItem()
 {
     f_Index = 0; f_BlockID = 0; f_ItemBase = null; f_TFS = null;
 }
Ejemplo n.º 21
0
 void SwapNumAlt(TPredicateItemBase ADest, TPredicateItemBase ASource)
 {
     ADest.NumAlt   = ASource.NumAlt;
     ASource.NumAlt = 0;
 }
Ejemplo n.º 22
0
 public void Make(TPredicateItemBase AItem, TPredicateItemBig AParent)
 {
     f_Item   = AItem;
     f_Parent = AParent;
     DoMake();
 }
Ejemplo n.º 23
0
 public void AddItem(TPredicateItemBase AItem)
 {
     f_List.Add(AItem);
 }