/** Method for creating a new uniquely named hidden non-terminal using * the given string as a base for the name (or "NT$" if null is passed). * @param prefix base name to construct unique name from. */ static non_terminal create_new(String prefix) throws internal_error { if (prefix == null) prefix = "NT$"; return new non_terminal(prefix + next_nt++); }
/** static routine for creating a new uniquely named hidden non-terminal */ static non_terminal create_new() throws internal_error { return create_new(null); } /**
for (e=all(); e.hasMoreElements(); ) if (!nt.nullable()) if (nt.looks_nullable())
for (n = all(); n.hasMoreElements(); ) for (p = nt.productions(); p.hasMoreElements(); )
non_terminal.compute_nullability(); non_terminal.compute_first_sets();
lhs_sym.note_use(); lhs_sym.add_production(this);
/** 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()]; }
rhs_parts, rhs_l, action_str, lhs_sym.stack_type()); lhs_sym.note_use(); lhs_sym.add_production(this);
/** convert to string */ public String toString() { return super.toString() + "[" + index() + "]" + (nullable() ? "*" : ""); }
lhs_sym.add_production(this);
for (e=all(); e.hasMoreElements(); ) if (!nt.nullable()) if (nt.looks_nullable())
for (n = all(); n.hasMoreElements(); ) for (p = nt.productions(); p.hasMoreElements(); )
non_terminal.compute_nullability(); non_terminal.compute_first_sets();