/** Constructor.
                                        * @param base       the production we are being factored out of.
                                        * @param lhs_sym    the LHS symbol for this production.
                                        * @param rhs_parts  array of production parts for the RHS.
                                        * @param rhs_len    how much of the rhs_parts array is valid.
                                        * @param action_str the trailing reduce action for this production.
                                        */
        public action_production(
		production      cbase,
		non_terminal    lhs_sym, 
			production_part[] rhs_parts,
		int             rhs_len,
			string          action_str)
            : base(lhs_sym, rhs_parts, rhs_len, action_str)
        {
            _base_production = cbase;
        }
        /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
        /** Equality comparison. */
        public bool Equals(production_part other)
        {
            if (other == null) return false;

            /* compare the labels */
            if (label() != null)
                return label().Equals(other.label());
            else
                return other.label() == null;
        }
Пример #3
0
        /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/

        /** Equality comparison. */
        public bool Equals(production_part other)
        {
            if (other == null)
            {
                return(false);
            }

            /* compare the labels */
            if (label() != null)
            {
                return(label().Equals(other.label()));
            }
            else
            {
                return(other.label() == null);
            }
        }