new_prod = new action_production(this, new_nt, null, 0, declare_str + ((action_part)rhs(act_loc)).code_string(), (lastLocation==-1)?-1:(act_loc-lastLocation));
int lastResult = ((action_production)prod).getIndexOfIntermediateResult(); if (lastResult!=-1) { result = "(" + prod.lhs().the_symbol().stack_type() + ") " +
action_production.clear(); emit.clear(); non_terminal.clear();
/** Remove all embedded actions from a production by factoring them * out into individual action production using new non terminals. * if the original production was: <pre> * A ::= B {action1} C {action2} D * </pre> * then it will be factored into: <pre> * A ::= B NT$1 C NT$2 D * NT$1 ::= {action1} * NT$2 ::= {action2} * </pre> * where NT$1 and NT$2 are new system created non terminals. */ protected void remove_embedded_actions() throws internal_error { non_terminal new_nt; production new_prod; /* walk over the production and process each action */ for (int act_loc = 0; act_loc < rhs_length(); act_loc++) if (rhs(act_loc).is_action()) { /* create a new non terminal for the action production */ new_nt = non_terminal.create_new(); /* create a new production with just the action */ new_prod = new action_production(this, new_nt, null, 0, ((action_part)rhs(act_loc)).code_string()); /* replace the action with the generated non terminal */ _rhs[act_loc] = new symbol_part(new_nt); } }
int lastResult = ((action_production)prod).getIndexOfIntermediateResult(); if (lastResult!=-1) { result = "(" + prod.lhs().the_symbol().stack_type() + ") " +
new_prod = new action_production(this, new_nt, null, 0, declare_str + ((action_part)rhs(act_loc)).code_string());
new_prod = new action_production(this, new_nt, null, 0, declare_str + ((action_part)rhs(act_loc)).code_string());
new_prod = new action_production(this, new_nt, null, 0, declare_str + ((action_part)rhs(act_loc)).code_string());
new_prod = new action_production(this, new_nt, null, 0, declare_str + ((action_part)rhs(act_loc)).code_string());
new_prod = new action_production(this, new_nt, null, 0, declare_str + ((action_part)rhs(act_loc)).code_string(), (lastLocation==-1)?-1:(act_loc-lastLocation));