conflicts.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Find and resolve or report lookahead conflicts for bison,
  2. Copyright (C) 2000-2002, 2004, 2007, 2009-2015, 2018-2021 Free
  3. Software Foundation, Inc.
  4. This file is part of Bison, the GNU Compiler Compiler.
  5. This program is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <https://www.gnu.org/licenses/>. */
  15. #ifndef CONFLICTS_H_
  16. # define CONFLICTS_H_
  17. # include "state.h"
  18. void conflicts_solve (void);
  19. /**
  20. * Update state numbers recorded in internal arrays such that:
  21. * - \c nstates_old is the old number of states.
  22. * - Where \c i is the old state number, <tt>old_to_new[i]</tt> is either:
  23. * - \c nstates_old if state \c i is removed because it is unreachable.
  24. * - The new state number.
  25. * - The highest new state number is the number of remaining states - 1.
  26. * - The numerical order of the remaining states has not changed.
  27. */
  28. void conflicts_update_state_numbers (state_number old_to_new[],
  29. state_number nstates_old);
  30. void conflicts_print (void);
  31. int conflicts_total_count (void);
  32. void conflicts_output (FILE *out);
  33. void conflicts_free (void);
  34. bool has_conflicts (const state *s);
  35. /* Were there conflicts? */
  36. extern int expected_sr_conflicts;
  37. extern int expected_rr_conflicts;
  38. #endif /* !CONFLICTS_H_ */