/** Helper function to test for a null object and throw an exception if * one is found. * @param obj the object we are testing. */ protected void not_null(Object obj) throws internal_error { if (obj == null) throw new internal_error("Null object used in set operation"); }
/** Simple constructor. * @param prod the production this action reduces with. */ public reduce_action(production prod ) throws internal_error { /* sanity check */ if (prod == null) throw new internal_error( "Attempt to create a reduce_action with a null production"); _reduce_with = prod; }
/** Helper function for null test. Throws an interal_error exception if its * parameter is null. * @param obj the object we are testing. */ protected void not_null(Object obj) throws internal_error { if (obj == null) throw new internal_error("Null object used in set operation"); }
/** Helper function for null test. Throws an interal_error exception if its * parameter is null. * @param obj the object we are testing. */ protected void not_null(Object obj) throws internal_error { if (obj == null) throw new internal_error("Null object used in set operation"); }
/** Full constructor. * @param sym the symbol that this part is made up of. * @param lab an optional label string for the part. */ public symbol_part(symbol sym, String lab) throws internal_error { super(lab); if (sym == null) throw new internal_error( "Attempt to construct a symbol_part with a null symbol"); _the_symbol = sym; }
/** Full constructor. * @param sym the symbol that this part is made up of. * @param lab an optional label string for the part. */ public symbol_part(symbol sym, String lab) throws internal_error { super(lab); if (sym == null) throw new internal_error( "Attempt to construct a symbol_part with a null symbol"); _the_symbol = sym; }
/** Helper function to test for a null object and throw an exception if * one is found. * @param obj the object we are testing. */ protected void not_null(Object obj) throws internal_error { if (obj == null) throw new internal_error("Null object used in set operation"); }
/** Simple constructor. * @param prod the production this action reduces with. */ public reduce_action(production prod ) throws internal_error { /* sanity check */ if (prod == null) throw new internal_error( "Attempt to create a reduce_action with a null production"); _reduce_with = prod; }
/** Helper function to test for a null object and throw an exception * if one is found. * @param obj the object we are testing. */ protected void not_null(Object obj) throws internal_error { if (obj == null) throw new internal_error("Null object used in set operation"); }
/** Helper function to test for a null object and throw an exception if * one is found. * @param obj the object we are testing. */ protected void not_null(Object obj) throws internal_error { if (obj == null) throw new internal_error("Null object used in set operation"); }
/** Access to the collection of parts for the right hand side. */ public production_part rhs(int indx) throws internal_error { if (indx >= 0 && indx < _rhs_length) return _rhs[indx]; else throw new internal_error( "Index out of range for right hand side of production"); }
/** Helper function for null test. Throws an interal_error exception if its * parameter is null. * @param obj the object we are testing. */ protected void not_null(Object obj) throws internal_error { if (obj == null) throw new internal_error("Null object used in set operation"); }
/** Simple constructor. * @param shft_to the state that this action shifts to. */ public shift_action(lalr_state shft_to) throws internal_error { /* sanity check */ if (shft_to == null) throw new internal_error( "Attempt to create a shift_action to a null state"); _shift_to = shft_to; }
/** Access to the collection of parts for the right hand side. */ public production_part rhs(int indx) throws internal_error { if (indx >= 0 && indx < _rhs_length) return _rhs[indx]; else throw new internal_error( "Index out of range for right hand side of production"); }
/** Access to the collection of parts for the right hand side. */ public production_part rhs(int indx) throws internal_error { if (indx >= 0 && indx < _rhs_length) return _rhs[indx]; else throw new internal_error( "Index out of range for right hand side of production"); }
/** Helper function to test for a null object and throw an exception * if one is found. * @param obj the object we are testing. */ protected void not_null(Object obj) throws internal_error { if (obj == null) throw new internal_error("Null object used in set operation"); }
/** Helper function for null test. Throws an interal_error exception if its * parameter is null. * @param obj the object we are testing. */ protected void not_null(Object obj) throws internal_error { if (obj == null) throw new internal_error("Null object used in set operation"); }
/** Produce a new lr_item_core that results from shifting the dot one * position to the right. */ public lr_item_core shift_core() throws internal_error { if (dot_at_end()) throw new internal_error( "Attempt to shift past end of an lr_item_core"); return new lr_item_core(_the_production, _dot_pos+1); }
/** Produce a new lr_item_core that results from shifting the dot one * position to the right. */ public lr_item_core shift_core() throws internal_error { if (dot_at_end()) throw new internal_error( "Attempt to shift past end of an lr_item_core"); return new lr_item_core(_the_production, _dot_pos+1); }
/** Add a production to our set of productions. */ public void add_production(production prod) throws internal_error { /* catch improper productions */ if (prod == null || prod.lhs() == null || prod.lhs().the_symbol() != this) throw new internal_error( "Attempt to add invalid production to non terminal production table"); /* add it to the table, keyed with itself */ _productions.put(prod,prod); }