Example #1
0
        TPredicateItemBig DoPrintBig(ref TPredicateItemBig ABig, ref TDynamicArray AStack)
        {
            TPredicateItemBig  Res = null;
            TPredicateItemBase m_Base;

            if (!ABig.Envelope)
            {
                if (ABig.Rfc.ParentTFE == null && ABig.Print)
                {
                    Res = ABig;
                }
                int m_cnt = ABig.Count;
                for (int i = 0; i <= m_cnt - 1; i++)
                {
                    m_Base             = ABig.GetItems(i);
                    m_Base.EnvelopeBIG = ABig;
                    CheckParseItem(ref m_Base, ref AStack);
                }
            }
            return(Res);
        }
Example #2
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);
     }
 }
Example #3
0
        void DoProcessItem(TPredicateItemBig AHead, TDynamicArray AStack)
        {
            int m_type, m_cnt, m_idx;
            TPredicateItemBase  m_Base;
            TPredicateItemBase  m_BaseItem1, m_BaseItem2;
            TPredicateItemPWork m_PWork, m_PW;
            TPredicateItemBig   m_Big;
            TPredicateItemTFS   m_Tfs;
            TPredicateItemTFE   m_Tfe;
            TDynamicArray       m_D     = new TDynamicArray();
            TDynamicArray       m_DTail = new TDynamicArray();
            TDynamicArray       m_DLN   = new TDynamicArray();

            m_cnt = AHead.Count;
            if (m_cnt == 1)
            {
                m_Base = AHead.GetItems(0);
                DoProcessItemTFS(m_Base, AStack);
                if (m_Base.Who() == 1)
                {
                    ((TPredicateItemBig)(m_Base)).Print = true;
                }

                ApplyStyle(AHead, m_Base);
            }
            if (m_cnt > 1)
            {
                for (int i = 0; i <= m_cnt - 1; i++)
                {
                    m_Base = AHead.GetItems(i);
                    m_type = m_Base.Who();
                    if (m_type == 1)
                    {
                        m_Big = (TPredicateItemBig)(m_Base);
                        if (m_Big.NumAlt > 0 || m_Big.Rfc.Cross)
                        {
                            m_DTail.Append(m_Big);
                            m_Big.Print = true;
                        }
                        else
                        {
                            m_DLN.Append(m_Base);
                            // m_Big.Print = m_Big.Rfc.CrossMain;
                        }
                    }
                    else
                    {
                        m_DLN.Append(m_Base);
                    }
                }
                if (m_DLN.Count == 1)
                {
                    m_Base = (TPredicateItemBase)(m_DLN.GetItems(0));
                    DoProcessItemTFS(m_Base, AStack);
                    ApplyStyle(AHead, m_Base);
                }
                else
                if (m_DLN.Count > 1)
                {
                    ApplyStyle(AHead, m_DLN);
                    m_BaseItem1 = (TPredicateItemBase)(m_DLN.GetItems(0));
                    m_BaseItem2 = (TPredicateItemBase)(m_DLN.GetItems(1));
                    DoProcessItemTFS(m_BaseItem1, AStack);
                    DoProcessItemTFS(m_BaseItem2, AStack);
                    for (int i = 2; i <= m_DLN.Count - 1; i++)
                    {
                        m_D.Append(m_DLN.GetItems(i));
                    }

                    AHead.DeleteItemToList(m_BaseItem1);
                    AHead.DeleteItemToList(m_BaseItem2);


                    m_BaseItem1 = EnvelopeToBig(m_BaseItem1);
                    m_BaseItem2 = EnvelopeToBig(m_BaseItem2);

                    m_PWork       = new TPredicateItemPWork();
                    m_PWork.Item1 = m_BaseItem1;
                    m_PWork.Item2 = m_BaseItem2;
                    SwapNumAlt(m_PWork, m_BaseItem1);



                    while (m_D.Count >= 1)
                    {
                        m_Big = (TPredicateItemBig)(EnvelopeToBig(m_PWork));

                        m_BaseItem1 = m_Big;
                        m_BaseItem2 = (TPredicateItemBase)(m_D.GetItems(0));
                        DoProcessItemTFS(m_BaseItem2, AStack);
                        AHead.DeleteItemToList(m_BaseItem2);

                        m_PW = new TPredicateItemPWork();
                        //m_PW.Envelope = true;
                        m_PW.Item1 = m_BaseItem1;
                        m_PW.Item2 = EnvelopeToBig(m_BaseItem2);
                        SwapNumAlt(m_PW, m_Big);
                        m_D.Delete(m_BaseItem2);
                        m_PWork = m_PW;
                    }

                    AHead.AddItem(m_PWork);
                }

                for (int i = 0; i <= m_DTail.Count - 1; i++)
                {
                    m_Base = (TPredicateItemBase)(m_DTail.GetItems(i));
                    AStack.InsertToFirst(m_Base);
                }

                m_DTail = null;
                m_DLN   = null;
                m_D     = null;
            }
        }
Example #4
0
        void DoSetIDItem(TPredicateItemBig AHead, TDynamicArray AStack)
        {
            int m_who;
            TPredicateItemBase  m_Base;
            TPredicateItemPWork m_PW;
            int m_cnt = AHead.Count;

            for (int i = 0; i <= m_cnt - 1; i++)
            {
                m_Base = AHead.GetItems(i);
                m_who  = m_Base.Who();
                if (m_who == 1)
                {
                    TPredicateItemBig mBig = (TPredicateItemBig)(m_Base);
                    if (CheckEnlargeNum(mBig))
                    {
                        return;
                    }
                    m_Base.ID = f_NGen.NextLowNum();
                }
                if (m_who == 2)
                {
                    m_PW = (TPredicateItemPWork)(m_Base);

                    m_who = m_PW.Item1.Who();
                    if (m_who == 1)
                    {
                        TPredicateItemBig mBig = (TPredicateItemBig)(m_PW.Item1);
                        if (mBig.Rfc != null && mBig.Rfc.Enlarge > 0)
                        {
                            if (!CheckEnlargeNum(mBig))
                            {
                                m_PW.Item1.ID = f_NGen.NextLowNum();
                            }
                        }
                        else
                        {
                            m_PW.Item1.ID = f_NGen.NextLowNum();
                        }
                    }

                    m_who = m_PW.Item2.Who();
                    if (m_who == 1)
                    {
                        TPredicateItemBig mBig = (TPredicateItemBig)(m_PW.Item2);
                        if (mBig.Rfc != null && mBig.Rfc.Enlarge > 0)
                        {
                            if (!CheckEnlargeNum(mBig))
                            {
                                m_PW.Item2.ID = f_NGen.NextLowNum();
                            }
                        }
                        else
                        {
                            m_PW.Item2.ID = f_NGen.NextLowNum();
                        }
                    }


                    //        m_PW.Item2.ID = f_NGen.NextLowNum();
                }
                DoSetIDItemTFS(m_Base, AStack);
            }
        }