/** Simple constructor. Note: this should not be used until the number of * terminals in the grammar has been established. */ public parse_action_row() { /* make sure the size is set */ if (_size <= 0 ) _size = terminal.number(); /* allocate the array */ under_term = new parse_action[size()]; /* set each element to an error action */ for (int i=0; i<_size; i++) under_term[i] = new parse_action(); }
/** Simple constructor. Note: this should not be used until the number of * terminals in the grammar has been established. */ public parse_action_row() { /* make sure the size is set */ if (_size <= 0 ) _size = terminal.number(); /* allocate the array */ under_term = new parse_action[size()]; /* set each element to an error action */ for (int i=0; i<_size; i++) under_term[i] = new parse_action(); }
/** Simple constructor. Note: this should not be used until the number of * terminals in the grammar has been established. */ public parse_action_row() { /* make sure the size is set */ if (_size <= 0 ) _size = terminal.number(); /* allocate the array */ under_term = new parse_action[size()]; /* set each element to an error action */ for (int i=0; i<_size; i++) under_term[i] = new parse_action(); }
/** Simple constructor. Note: this should not be used until the number of * terminals in the grammar has been established. */ public parse_action_row() { /* make sure the size is set */ if (_size <= 0 ) _size = terminal.number(); /* allocate the array */ under_term = new parse_action[size()]; /* set each element to an error action */ for (int i=0; i<_size; i++) under_term[i] = new parse_action(); }
/** Simple constructor. Note: this should not be used until the number of * terminals in the grammar has been established. */ public parse_action_row() { /* make sure the size is set */ if (_size <= 0 ) _size = terminal.number(); /* allocate the array */ under_term = new parse_action[size()]; /* set each element to an error action */ for (int i=0; i<_size; i++) under_term[i] = new parse_action(); }
/** Simple constructor. Note: this should not be used until the number of * terminals in the grammar has been established. */ public parse_action_row() { /* make sure the size is set */ if (_size <= 0 ) _size = terminal.number(); /* allocate the array */ under_term = new parse_action[size()]; /* set each element to an error action */ for (int i=0; i<_size; i++) under_term[i] = new parse_action(); }
/** Simple constructor. Note: this should not be used until the number of * terminals in the grammar has been established. */ public parse_action_row() { /* make sure the size is set */ if (_size <= 0 ) _size = terminal.number(); /* allocate the array */ under_term = new parse_action[size()]; /* set each element to an error action */ for (int i=0; i<_size; i++) under_term[i] = new parse_action(); }
public String toString() { String result; int cnt; result = "-------- ACTION_TABLE --------\n"; for (int row = 0; row < num_states(); row++) { result += "From state #" + row + "\n"; cnt = 0; for (int col = 0; col < under_state[row].size(); col++) { /* if the action is not an error print it */ if (under_state[row].under_term[col].kind() != parse_action.ERROR) { result += " [term " + col + ":" + under_state[row].under_term[col] + "]"; /* end the line after the 2nd one */ cnt++; if (cnt == 2) { result += "\n"; cnt = 0; } } } /* finish the line if we haven't just done that */ if (cnt != 0) result += "\n"; } result += "------------------------------"; return result; }
public String toString() { String result; int cnt; result = "-------- ACTION_TABLE --------\n"; for (int row = 0; row < num_states(); row++) { result += "From state #" + row + "\n"; cnt = 0; for (int col = 0; col < under_state[row].size(); col++) { /* if the action is not an error print it */ if (under_state[row].under_term[col].kind() != parse_action.ERROR) { result += col + ":" + under_state[row].under_term[col] + " "; /* end the line after the 3rd one */ cnt++; if (cnt == 3) { result += "\n"; cnt = 0; } } } /* finish the line if we haven't just done that */ if (cnt != 0) result += "\n"; } result += "------------------------------"; return result; }
public String toString() { String result; int cnt; result = "-------- ACTION_TABLE --------\n"; for (int row = 0; row < num_states(); row++) { result += "From state #" + row + "\n"; cnt = 0; for (int col = 0; col < under_state[row].size(); col++) { /* if the action is not an error print it */ if (under_state[row].under_term[col].kind() != parse_action.ERROR) { result += " [term " + col + ":" + under_state[row].under_term[col] + "]"; /* end the line after the 2nd one */ cnt++; if (cnt == 2) { result += "\n"; cnt = 0; } } } /* finish the line if we haven't just done that */ if (cnt != 0) result += "\n"; } result += "------------------------------"; return result; }
public String toString() { String result; int cnt; result = "-------- ACTION_TABLE --------\n"; for (int row = 0; row < num_states(); row++) { result += "From state #" + row + "\n"; cnt = 0; for (int col = 0; col < under_state[row].size(); col++) { /* if the action is not an error print it */ if (under_state[row].under_term[col].kind() != parse_action.ERROR) { result += " [term " + col + ":" + under_state[row].under_term[col] + "]"; /* end the line after the 2nd one */ cnt++; if (cnt == 2) { result += "\n"; cnt = 0; } } } /* finish the line if we haven't just done that */ if (cnt != 0) result += "\n"; } result += "------------------------------"; return result; }
public String toString() { String result; int cnt; result = "-------- ACTION_TABLE --------\n"; for (int row = 0; row < num_states(); row++) { result += "From state #" + row + "\n"; cnt = 0; for (int col = 0; col < under_state[row].size(); col++) { /* if the action is not an error print it */ if (under_state[row].under_term[col].kind() != parse_action.ERROR) { result += " [term " + col + ":" + under_state[row].under_term[col] + "]"; /* end the line after the 2nd one */ cnt++; if (cnt == 2) { result += "\n"; cnt = 0; } } } /* finish the line if we haven't just done that */ if (cnt != 0) result += "\n"; } result += "------------------------------"; return result; }
public String toString() { String result; int cnt; result = "-------- ACTION_TABLE --------\n"; for (int row = 0; row < num_states(); row++) { result += "From state #" + row + "\n"; cnt = 0; for (int col = 0; col < parse_action_row.size(); col++) { /* if the action is not an error print it */ if (under_state[row].under_term[col].kind() != parse_action.ERROR) { result += " [term " + col + ":" + under_state[row].under_term[col] + "]"; /* end the line after the 2nd one */ cnt++; if (cnt == 2) { result += "\n"; cnt = 0; } } } /* finish the line if we haven't just done that */ if (cnt != 0) result += "\n"; } result += "------------------------------"; return result; }
public String toString() { String result; int cnt; result = "-------- ACTION_TABLE --------\n"; for (int row = 0; row < num_states(); row++) { result += "From state #" + row + "\n"; cnt = 0; for (int col = 0; col < parse_action_row.size(); col++) { /* if the action is not an error print it */ if (under_state[row].under_term[col].kind() != parse_action.ERROR) { result += " [term " + col + ":" + under_state[row].under_term[col] + "]"; /* end the line after the 2nd one */ cnt++; if (cnt == 2) { result += "\n"; cnt = 0; } } } /* finish the line if we haven't just done that */ if (cnt != 0) result += "\n"; } result += "------------------------------"; return result; }
for (i = 0; i < size(); i++) if (under_term[i].kind() == parse_action.REDUCE)
for (i = 0; i < size(); i++) if (under_term[i].kind() == parse_action.REDUCE)
for (i = 0; i < size(); i++) if (under_term[i].kind() == parse_action.REDUCE)
for (i = 0; i < size(); i++) if (under_term[i].kind() == parse_action.REDUCE)
for (int col = 0; col < parse_action_row.size(); col++)
for (int col = 0; col < parse_action_row.size(); col++)