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

Diff of /bison/src/state.c

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

revision 1.28 by eggert, Fri Dec 13 08:37:52 2002 UTC revision 1.29 by eggert, Mon Feb 3 15:35:57 2003 UTC
# Line 1  Line 1 
1  /* Type definitions for nondeterministic finite state machine for Bison.  /* Type definitions for nondeterministic finite state machine for Bison.
2    
3     Copyright (C) 2001, 2002 Free Software Foundation, Inc.     Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
4    
5     This file is part of Bison, the GNU Compiler Compiler.     This file is part of Bison, the GNU Compiler Compiler.
6    
# Line 49  transitions_new (int num, state **the_st Line 49  transitions_new (int num, state **the_st
49  }  }
50    
51    
52  /*-------------------------------------------------------------------.  /*-------------------------------------------------------.
53  | Return the state such these TRANSITIONS contain a shift/goto to it |  | Return the state such that SHIFTS contain a shift/goto |
54  | on S.  Abort if none found.                                        |  | to it on SYM.  Abort if none found.                    |
55  `-------------------------------------------------------------------*/  `-------------------------------------------------------*/
56    
57  state *  state *
58  transitions_to (transitions *shifts, symbol_number s)  transitions_to (transitions *shifts, symbol_number sym)
59  {  {
60    int j;    int j;
61    for (j = 0; j < shifts->num; j++)    for (j = 0; j < shifts->num; j++)
62      if (TRANSITION_SYMBOL (shifts, j) == s)      if (TRANSITION_SYMBOL (shifts, j) == sym)
63        return shifts->states[j];        return shifts->states[j];
64    abort ();    abort ();
65  }  }

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

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