/[bison]/bison/src/print_graph.c
ViewVC logotype

Diff of /bison/src/print_graph.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.44 by akim, Sun Jun 30 17:32:17 2002 UTC revision 1.45 by akim, Sun Jun 30 17:33:37 2002 UTC
# Line 127  print_actions (state_t *state, const cha Line 127  print_actions (state_t *state, const cha
127  {  {
128    int i;    int i;
129    
130    shifts_t     *shiftp = state->shifts;    transitions_t     *transitions = state->shifts;
131    reductions_t *redp = state->reductions;    reductions_t *redp = state->reductions;
132    
133    static char buff[10];    static char buff[10];
134    edge_t edge;    edge_t edge;
135    
136    if (!shiftp->nshifts && !redp)    if (!transitions->num && !redp)
137      return;      return;
138    
139    for (i = 0; i < shiftp->nshifts; i++)    for (i = 0; i < transitions->num; i++)
140      if (!SHIFT_IS_DISABLED (shiftp, i))      if (!TRANSITION_IS_DISABLED (transitions, i))
141        {        {
142          state_number_t state1 = shiftp->shifts[i];          state_number_t state1 = transitions->states[i];
143          symbol_number_t symbol = states[state1]->accessing_symbol;          symbol_number_t symbol = states[state1]->accessing_symbol;
144    
145          new_edge (&edge);          new_edge (&edge);
# Line 152  print_actions (state_t *state, const cha Line 152  print_actions (state_t *state, const cha
152          sprintf (buff, "%d", state1);          sprintf (buff, "%d", state1);
153          edge.targetname = buff;          edge.targetname = buff;
154          /* Shifts are blue, gotos are green, and error is red. */          /* Shifts are blue, gotos are green, and error is red. */
155          if (SHIFT_IS_ERROR (shiftp, i))          if (TRANSITION_IS_ERROR (transitions, i))
156            edge.color = red;            edge.color = red;
157          else          else
158            edge.color = SHIFT_IS_SHIFT(shiftp, i) ? blue : green;            edge.color = TRANSITION_IS_SHIFT(transitions, i) ? blue : green;
159          edge.label = symbol_tag_get (symbols[symbol]);          edge.label = symbol_tag_get (symbols[symbol]);
160          output_edge (&edge, fgraph);          output_edge (&edge, fgraph);
161          close_edge (fgraph);          close_edge (fgraph);

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.45

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26