gnulib: update
[bison.git] / src / lssi.h
blobe7feba3ceeb2561f43c605d539a9c62c6bff51df
1 /* Lookahead sensitive state item searches for counterexample generation
3 Copyright (C) 2020-2021 Free Software Foundation, Inc.
5 This file is part of Bison, the GNU Compiler Compiler.
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.
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.
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/>. */
20 #ifndef LSSI_H
21 # define LSSI_H
23 # include "state-item.h"
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.
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.
35 state_item_list shortest_path_from_start (state_item_number target,
36 symbol_number next_sym);
38 /**
39 * Determine if the given terminal is in the given symbol set or can begin
40 * a nonterminal in the given symbol set.
42 bool intersect_symbol (symbol_number sym, bitset syms);
44 /**
45 * Determine if any symbol in ts is in syms
46 * or can begin with a nonterminal in syms.
48 bool intersect (bitset ts, bitset syms);
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.
55 state_item_list lssi_reverse_production (const state_item *si, bitset lookahead);
57 #endif /* LSSI_H */