Ejemplo n.º 1
0
        /// <summary>
        /// This method is used for traversing nodes after the
        /// first stage of compilation.
        /// </summary>
        ///
        public override void ProcessSecondPass()
        {
            this.isSecondPassVisited = true;

            if (fSet != null && !fSet.isSecondPassVisited)
            {
                /*
                 * Add here code to do during the pass
                 */

                /*
                 * End code to do during the pass
                 */
                fSet.ProcessSecondPass();
            }

            if (children != null)
            {
                int childrenSize = children.Count;

                for (int i = 0; i < childrenSize; i++)
                {
                    AbstractSet child = (AbstractSet)children[i];

                    /*
                     * Add here code to do during the pass
                     */

                    JointSet set = child.ProcessBackRefReplacement();

                    if (set != null)
                    {
                        child.isSecondPassVisited = true;
                        ILOG.J2CsMapping.Collections.Collections.RemoveAt(children, i);
                        children.Insert(i, set);
                        child = (AbstractSet)set;
                    }

                    /*
                     * End code to do during the pass
                     */
                    if (!child.isSecondPassVisited)
                    {
                        child.ProcessSecondPass();
                    }
                }
            }

            if (next != null)
            {
                base.ProcessSecondPass();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// This method is used for traversing nodes after the
        /// first stage of compilation.
        /// </summary>
        ///
        public virtual void ProcessSecondPass()
        {
            this.isSecondPassVisited = true;

            if (next != null)
            {
                if (!next.isSecondPassVisited)
                {
                    /*
                     * Add here code to do during the pass
                     */
                    JointSet set = next.ProcessBackRefReplacement();

                    if (set != null)
                    {
                        next.isSecondPassVisited = true;
                        next = (AbstractSet)set;
                    }

                    /*
                     * End code to do during the pass
                     */
                    next.ProcessSecondPass();
                }
                else
                {
                    /*
                     * We reach node through next but it is already traversed.
                     * You can see this situation for AltGroupQuantifierSet.next
                     * when we reach this node through
                     * AltGroupQuantifierSet.innerset. ... .next
                     */

                    /*
                     * Add here code to do during the pass
                     */
                    if (next  is  SingleSet &&
                        ((FSet)((JointSet)next).fSet).isBackReferenced)
                    {
                        next = next.next;
                    }

                    /*
                     * End code to do during the pass
                     */
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// This method is used for traversing nodes after the
        /// first stage of compilation.
        /// </summary>
        ///
        public override void ProcessSecondPass()
        {
            this.isSecondPassVisited = true;

            if (fSet != null && !fSet.isSecondPassVisited)
            {
                /*
                 * Add here code to do during the pass
                 */

                /*
                 * End code to do during the pass
                 */
                fSet.ProcessSecondPass();
            }

            if (kid != null && !kid.isSecondPassVisited)
            {
                /*
                 * Add here code to do during the pass
                 */
                JointSet set = kid.ProcessBackRefReplacement();

                if (set != null)
                {
                    kid.isSecondPassVisited = true;
                    kid = (AbstractSet)set;
                }

                /*
                 * End code to do during the pass
                 */

                kid.ProcessSecondPass();
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// This method is used for traversing nodes after the
        /// first stage of compilation.
        /// </summary>
        ///
        public override void ProcessSecondPass()
        {
            this.isSecondPassVisited = true;

            if (next != null)
            {
                if (!next.isSecondPassVisited)
                {
                    /*
                     * Add here code to do during the pass
                     */
                    JointSet set = next.ProcessBackRefReplacement();

                    if (set != null)
                    {
                        next.isSecondPassVisited = true;
                        next = (AbstractSet)set;
                    }

                    /*
                     * End code to do during the pass
                     */
                    next.ProcessSecondPass();
                }
            }

            if (innerSet != null)
            {
                if (!innerSet.isSecondPassVisited)
                {
                    /*
                     * Add here code to do during the pass
                     */
                    JointSet set_0 = innerSet.ProcessBackRefReplacement();

                    if (set_0 != null)
                    {
                        innerSet.isSecondPassVisited = true;
                        innerSet = (AbstractSet)set_0;
                    }

                    /*
                     * End code to do during the pass
                     */
                    innerSet.ProcessSecondPass();
                }
                else
                {
                    /*
                     * We reach node through innerSet but it is already traversed.
                     * You can see this situation for GroupQuantifierSet.innerset
                     * if we compile smth like "(a)+ when
                     * GroupQuantifierSet == GroupQuantifierSet.innerset.fSet.next
                     */

                    /*
                     * Add here code to do during the pass
                     */
                    if (innerSet  is  SingleSet &&
                        ((FSet)((JointSet)innerSet).fSet).isBackReferenced)
                    {
                        innerSet = innerSet.next;
                    }

                    /*
                     * End code to do during the pass
                     */
                }
            }
        }