Пример #1
0
		/*-----------------------------------------------------------*/
		/*--- Constructor(s) ----------------------------------------*/
		/*-----------------------------------------------------------*/

		/** Simple constructor. Note: this should not be used until the number
		 *  of terminals in the grammar has been established.
		 */
		public parse_reduce_row()
		{
			/* make sure the size is Set */
			if (_size <= 0 )  _size = non_terminal.number();

			/* allocate the array */
			under_non_term = new lalr_state[size()];
		}
Пример #2
0
		/*-----------------------------------------------------------*/
		/*--- Constructor(s) ----------------------------------------*/
		/*-----------------------------------------------------------*/

		/** Simple constructor. 
		 * @param shft_to the state that this action shifts to.
		 */
		public shift_action(lalr_state shft_to) 
												{
													/* sanity check */
													if (shft_to == null)
		throw new internal_error(
				  "Attempt to create a shift_action to a null state");

		_shift_to = shft_to;
	}
Пример #3
0
        /*-----------------------------------------------------------*/
        /*--- Constructor(s) ----------------------------------------*/
        /*-----------------------------------------------------------*/

        /** Simple constructor.
         * @param shft_to the state that this action shifts to.
         */
        public shift_action(lalr_state shft_to)
        {
            /* sanity check */
            if (shft_to == null)
            {
                throw new internal_error(
                          "Attempt to create a shift_action to a null state");
            }

            _shift_to = shft_to;
        }
Пример #4
0
        /*-----------------------------------------------------------*/
        /*--- Constructor(s) ----------------------------------------*/
        /*-----------------------------------------------------------*/

        /** Simple constructor. Note: this should not be used until the number
         *  of terminals in the grammar has been established.
         */
        public parse_reduce_row()
        {
            /* make sure the size is Set */
            if (_size <= 0)
            {
                _size = non_terminal.number();
            }

            /* allocate the array */
            under_non_term = new lalr_state[size()];
        }
        /*-----------------------------------------------------------*/
        /*--- Constructor(s) ----------------------------------------*/
        /*-----------------------------------------------------------*/
        /** Full constructor.
         * @param on_sym  symbol we are transitioning on.
         * @param to_st   state we transition to.
         * @param nxt     next transition in linked list.
         */
        public lalr_transition(symbol on_sym, lalr_state to_st, lalr_transition nxt)
        {
            /* sanity checks */
                if (on_sym == null)
            throw new internal_error("Attempt to create transition on null symbol");
            if (to_st == null)
            throw new internal_error("Attempt to create transition to null state");

            /* initialize */
            _on_symbol = on_sym;
            _to_state  = to_st;
            _next      = nxt;
        }
        /*-----------------------------------------------------------*/
        /*--- Constructor(s) ----------------------------------------*/
        /*-----------------------------------------------------------*/

        /** Full constructor.
         * @param on_sym  symbol we are transitioning on.
         * @param to_st   state we transition to.
         * @param nxt     next transition in linked list.
         */
        public lalr_transition(symbol on_sym, lalr_state to_st, lalr_transition nxt)

        {
            /* sanity checks */
            if (on_sym == null)
            {
                throw new internal_error("Attempt to create transition on null symbol");
            }
            if (to_st == null)
            {
                throw new internal_error("Attempt to create transition to null state");
            }

            /* initialize */
            _on_symbol = on_sym;
            _to_state  = to_st;
            _next      = nxt;
        }
 /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
 /** Constructor with null next.
  * @param on_sym  symbol we are transitioning on.
  * @param to_st   state we transition to.
  */
 public lalr_transition(symbol on_sym, lalr_state to_st)
     : this(on_sym,to_st,null)
 {
     //	this(on_sym, to_st, null);
 }
        /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/

        /** Constructor with null next.
         * @param on_sym  symbol we are transitioning on.
         * @param to_st   state we transition to.
         */
        public lalr_transition(symbol on_sym, lalr_state to_st) : this(on_sym, to_st, null)
        {
//	this(on_sym, to_st, null);
        }