(root)/
bison-3.8.2/
src/
lssi.h
       1  /* Lookahead sensitive state item searches for counterexample generation
       2  
       3     Copyright (C) 2020-2021 Free Software Foundation, Inc.
       4  
       5     This file is part of Bison, the GNU Compiler Compiler.
       6  
       7     This program is free software: you can redistribute it and/or modify
       8     it under the terms of the GNU General Public License as published by
       9     the Free Software Foundation, either version 3 of the License, or
      10     (at your option) any later version.
      11  
      12     This program is distributed in the hope that it will be useful,
      13     but WITHOUT ANY WARRANTY; without even the implied warranty of
      14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      15     GNU General Public License for more details.
      16  
      17     You should have received a copy of the GNU General Public License
      18     along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
      19  
      20  #ifndef LSSI_H
      21  # define LSSI_H
      22  
      23  # include "state-item.h"
      24  
      25  /*
      26    All state-item graph nodes should also include a precise follow set (follow_L).
      27    However, ignoring follow_L saves a lot of memory and is a pretty good approximation.
      28    These functions exist to enforce restrictions caused by follow_L sets.
      29   */
      30  
      31  /*
      32   * find shortest lookahead-sensitive path of state-items to target such that
      33   * next_sym is in the follow_L set of target in that position.
      34  */
      35  state_item_list shortest_path_from_start (state_item_number target,
      36                                            symbol_number next_sym);
      37  
      38  /**
      39   * Determine if the given terminal is in the given symbol set or can begin
      40   * a nonterminal in the given symbol set.
      41   */
      42  bool intersect_symbol (symbol_number sym, bitset syms);
      43  
      44  /**
      45   * Determine if any symbol in ts is in syms
      46   * or can begin with a nonterminal in syms.
      47   */
      48  bool intersect (bitset ts, bitset syms);
      49  
      50  /**
      51   * Compute a set of sequences of state-items that can make production steps
      52   * to this state-item such that the resulting possible lookahead symbols are
      53   * as given.
      54   */
      55  state_item_list lssi_reverse_production (const state_item *si, bitset lookahead);
      56  
      57  #endif /* LSSI_H */