home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / jikepg12.zip / jikespg / src / reduce.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-11-04  |  2.5 KB  |  46 lines

  1. /* $Id: reduce.h,v 1.2 1999/11/04 14:02:23 shields Exp $ */
  2. /*
  3.  This software is subject to the terms of the IBM Jikes Compiler
  4.  License Agreement available at the following URL:
  5.  http://www.ibm.com/research/jikes.
  6.  Copyright (C) 1983, 1999, International Business Machines Corporation
  7.  and others.  All Rights Reserved.
  8.  You must accept the terms of that agreement to use this software.
  9. */
  10. #ifndef REDUCE_INCLUDED
  11. #define REDUCE_INCLUDED
  12.  
  13. /***************************************************************************/
  14. /* CONFLICT_SYMBOLS is a mapping from each state into a set of terminal    */
  15. /* symbols on which an LALR(1) conflict was detected in the state in       */
  16. /* question.                                                               */
  17. /*                                                                         */
  18. /* LA_INDEX and LA_SET are temporary look-ahead sets, each of which will   */
  19. /* be pointed to by a GOTO action, and the associated set will be          */
  20. /* initialized to READ_SET(S), where S is the state identified by the GOTO */
  21. /* action in question. READ_SET(S) is a set of terminals on which an action*/
  22. /* is defined in state S. See COMPUTE_READ for more details.               */
  23. /* LA_TOP is used to compute the number of such sets needed.               */
  24. /*                                                                         */
  25. /* The boolean variable NOT_LRK is used to mark whether or not a grammar   */
  26. /* is not LR(k) for any k. NOT_LRK is marked true when either:             */
  27. /*    1. The grammar contains a nonterminal A such that A =>+rm A          */
  28. /*    2. The automaton contains a cycle with each of its edges labeled     */
  29. /*       with a nullable nonterminal.                                      */
  30. /* (Note that these are not the only conditions under which a grammar is   */
  31. /*  not LR(k). In fact, it is an undecidable problem.)                     */
  32. /* The variable HIGHEST_LEVEL is used to indicate the highest number of    */
  33. /* lookahead that was necessary to resolve all conflicts for a given       */
  34. /* grammar. If we can detect that the grammar is not LALR(k), we set       */
  35. /* HIGHEST_LEVEL to INFINITY.                                              */
  36. /***************************************************************************/
  37. extern struct node **conflict_symbols;
  38. extern BOOLEAN_CELL *read_set,
  39.                     *la_set;
  40. extern int highest_level;
  41. extern long la_top;
  42. extern short *la_index;
  43. extern BOOLEAN not_lrk;
  44.  
  45. #endif /* REDUCE_INCLUDED */
  46.