45 #ifndef YY_HOAYY_PARSEAUT_HH_INCLUDED
46 # define YY_HOAYY_PARSEAUT_HH_INCLUDED
48 #line 33 "parseaut.yy"
51 #include <spot/misc/common.hh>
52 #include <spot/priv/robin_hood.hh>
56 #include <unordered_map>
58 #include <spot/twa/formula2bdd.hh>
59 #include <spot/parseaut/public.hh>
60 #include "spot/priv/accmap.hh"
61 #include <spot/tl/parse.hh>
62 #include <spot/twaalgos/alternation.hh>
64 using namespace std::string_literals;
66 #ifndef HAVE_STRVERSCMP
68 extern "C" int strverscmp(
const char *s1,
const char *s2);
73 #define PARSE_ERROR_LIST res.h->errors, res.fcache
75 inline namespace hoayy_support
77 typedef std::map<int, bdd> map_t;
84 typedef robin_hood::unordered_flat_map<std::string, bdd> formula_cache;
86 typedef std::pair<int, std::string*> pair;
94 enum label_style_t { Mixed_Labels, State_Labels, Trans_Labels,
96 enum acc_style_t { Mixed_Acc, State_Acc, Trans_Acc };
102 bool declared =
false;
104 spot::location used_loc;
106 spot::parsed_aut_ptr h;
107 spot::twa_ptr aut_or_ks;
109 std::string format_version;
110 spot::location format_version_loc;
112 formula_cache fcache;
114 spot::acc_mapper_int* acc_mapper =
nullptr;
116 std::vector<int> controllable_ap;
117 bool has_controllable_ap =
false;
118 std::vector<spot::location> controllable_ap_loc;
119 spot::location controllable_aps_loc;
120 std::vector<bdd> guards;
121 std::vector<bdd>::const_iterator cur_guard;
131 int unknown_ap_max = -1;
132 spot::location unknown_ap_max_location;
133 bool in_alias =
false;
135 std::vector<state_info> info_states;
136 std::vector<std::pair<spot::location,
137 std::vector<unsigned>>> start;
138 std::unordered_map<std::string, bdd> alias;
139 std::vector<std::string> alias_order;
144 operator bool()
const
149 std::unordered_map<std::string, prop_info> props;
150 spot::location states_loc;
151 spot::location ap_loc;
152 spot::location state_label_loc;
153 spot::location accset_loc;
159 std::vector<std::string>* state_names =
nullptr;
160 std::map<unsigned, unsigned>* highlight_edges =
nullptr;
161 std::map<unsigned, unsigned>* highlight_states =
nullptr;
162 std::map<unsigned, unsigned> states_map;
163 std::vector<bool>* state_player =
nullptr;
164 spot::location state_player_loc;
165 std::set<int> ap_set;
172 bool has_state_label =
false;
173 bool ignore_more_ap =
false;
175 bool ignore_acc =
false;
177 bool ignore_acc_silent =
false;
178 bool ignore_more_acc =
false;
181 label_style_t label_style = Mixed_Labels;
182 acc_style_t acc_style = Mixed_Acc;
184 bool accept_all_needed =
false;
185 bool accept_all_seen =
false;
186 bool aliased_states =
false;
191 bool trans_acc_seen =
false;
193 std::map<std::string, spot::location> labels;
195 prop_info prop_is_true(
const std::string& p)
197 auto i = props.find(p);
198 if (i == props.end())
199 return prop_info{spot::location(),
false};
203 prop_info prop_is_false(
const std::string& p)
205 auto i = props.find(p);
206 if (i == props.end())
207 return prop_info{spot::location(),
false};
208 return prop_info{i->second.loc, !i->second.val};
219 #line 220 "parseaut.hh"
224 # include <stdexcept>
228 #if defined __cplusplus
229 # define YY_CPLUSPLUS __cplusplus
231 # define YY_CPLUSPLUS 199711L
235 #if 201103L <= YY_CPLUSPLUS
236 # define YY_MOVE std::move
237 # define YY_MOVE_OR_COPY move
238 # define YY_MOVE_REF(Type) Type&&
239 # define YY_RVREF(Type) Type&&
240 # define YY_COPY(Type) Type
243 # define YY_MOVE_OR_COPY copy
244 # define YY_MOVE_REF(Type) Type&
245 # define YY_RVREF(Type) const Type&
246 # define YY_COPY(Type) const Type&
250 #if 201103L <= YY_CPLUSPLUS
251 # define YY_NOEXCEPT noexcept
255 # define YY_NOTHROW throw ()
259 #if 201703 <= YY_CPLUSPLUS
260 # define YY_CONSTEXPR constexpr
262 # define YY_CONSTEXPR
267 #ifndef YY_ATTRIBUTE_PURE
268 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
269 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
271 # define YY_ATTRIBUTE_PURE
275 #ifndef YY_ATTRIBUTE_UNUSED
276 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
277 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
279 # define YY_ATTRIBUTE_UNUSED
284 #if ! defined lint || defined __GNUC__
285 # define YY_USE(E) ((void) (E))
291 #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
292 # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
293 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
294 _Pragma ("GCC diagnostic push") \
295 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
297 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
298 _Pragma ("GCC diagnostic push") \
299 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
300 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
302 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
303 _Pragma ("GCC diagnostic pop")
305 # define YY_INITIAL_VALUE(Value) Value
307 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
308 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
309 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
311 #ifndef YY_INITIAL_VALUE
312 # define YY_INITIAL_VALUE(Value)
315 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
316 # define YY_IGNORE_USELESS_CAST_BEGIN \
317 _Pragma ("GCC diagnostic push") \
318 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
319 # define YY_IGNORE_USELESS_CAST_END \
320 _Pragma ("GCC diagnostic pop")
322 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
323 # define YY_IGNORE_USELESS_CAST_BEGIN
324 # define YY_IGNORE_USELESS_CAST_END
329 # define YY_CAST(Type, Val) static_cast<Type> (Val)
330 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
332 # define YY_CAST(Type, Val) ((Type) (Val))
333 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
337 # if defined __cplusplus
338 # if 201103L <= __cplusplus
339 # define YY_NULLPTR nullptr
341 # define YY_NULLPTR 0
344 # define YY_NULLPTR ((void*)0)
352 # define HOAYYDEBUG 1
354 # define HOAYYDEBUG 0
357 # define HOAYYDEBUG 1
362 #line 363 "parseaut.hh"
373 # pragma GCC message "bison: do not #define HOAYYSTYPE in C++, use %define api.value.type"
380 #line 210 "parseaut.yy"
387 std::list<pair>* list;
389 std::vector<unsigned>* states;
391 #line 392 "parseaut.hh"
405 : std::runtime_error (m)
410 : std::runtime_error (s.what ())
411 , location (s.location)
435 CONTROLLABLE_AP = 265,
442 SPOT_HIGHLIGHT_EDGES = 272,
443 SPOT_HIGHLIGHT_STATES = 273,
444 SPOT_STATE_PLAYER = 274,
507 S_CONTROLLABLE_AP = 10,
514 S_SPOT_HIGHLIGHT_EDGES = 17,
515 S_SPOT_HIGHLIGHT_STATES = 18,
516 S_SPOT_STATE_PLAYER = 19,
530 S_LINEDIRECTIVE = 33,
575 S_78_format_version = 78,
577 S_80_controllable_aps = 80,
580 S_83_header_items = 83,
581 S_84_header_item = 84,
591 S_94_highlight_edges = 94,
592 S_95_highlight_states = 95,
593 S_96_state_player = 96,
594 S_97_header_spec = 97,
595 S_98_state_conj_2 = 98,
596 S_99_init_state_conj_2 = 99,
597 S_100_label_expr = 100,
599 S_102_acceptance_cond = 102,
601 S_104_state_num = 104,
602 S_105_checked_state_num = 105,
605 S_108_state_name = 108,
607 S_110_state_label_opt = 110,
608 S_111_trans_label = 111,
610 S_113_acc_sets = 113,
611 S_114_state_acc_opt = 114,
612 S_115_trans_acc_opt = 115,
613 S_116_labeled_edges = 116,
614 S_117_some_labeled_edges = 117,
615 S_118_incorrectly_unlabeled_edge = 118,
616 S_119_labeled_edge = 119,
617 S_120_state_conj_checked = 120,
618 S_121_unlabeled_edges = 121,
619 S_122_unlabeled_edge = 122,
620 S_123_incorrectly_labeled_edge = 123,
623 S_dstar_header = 126,
625 S_dstar_state_id = 128,
627 S_dstar_accsigs = 130,
628 S_dstar_state_accsig = 131,
629 S_dstar_transitions = 132,
630 S_dstar_states = 133,
633 S_136_nc_states = 136,
634 S_137_nc_one_ident = 137,
635 S_138_nc_ident_list = 138,
636 S_139_nc_transition_block = 139,
637 S_140_nc_state = 140,
638 S_141_nc_transitions = 141,
639 S_142_nc_formula_or_ident = 142,
640 S_143_nc_formula = 143,
641 S_144_nc_opt_dest = 144,
642 S_145_nc_src_dest = 145,
643 S_146_nc_transition = 146,
645 S_148_lbtt_header_states = 148,
646 S_149_lbtt_header = 149,
647 S_150_lbtt_body = 150,
648 S_151_lbtt_states = 151,
649 S_152_lbtt_state = 152,
650 S_153_lbtt_acc = 153,
651 S_154_lbtt_guard = 154,
652 S_155_lbtt_transitions = 155
668 template <
typename Base>
680 #if 201103L <= YY_CPLUSPLUS
683 : Base (std::move (that))
684 , value (std::move (that.value))
685 , location (std::move (that.location))
715 std::string
name () const YY_NOEXCEPT
717 return parser::symbol_name (this->kind ());
724 bool empty () const YY_NOEXCEPT;
736 #if YY_CPLUSPLUS < 201103L
751 #if 201103L <= YY_CPLUSPLUS
790 parser (
void* scanner_yyarg,
result_& res_yyarg, spot::location initial_loc_yyarg);
793 #if 201103L <= YY_CPLUSPLUS
812 void set_debug_stream (std::ostream &);
840 const symbol_type& lookahead ()
const YY_NOEXCEPT {
return yyla_; }
842 const location_type& location ()
const YY_NOEXCEPT {
return yyla_.location; }
855 #if YY_CPLUSPLUS < 201103L
864 typedef short state_type;
867 int yy_syntax_error_arguments_ (
const context& yyctx,
872 virtual std::string yysyntax_error_ (
const context& yyctx)
const;
876 static state_type yy_lr_goto_state_ (state_type yystate,
int yysym);
880 static bool yy_pact_value_is_default_ (
int yyvalue) YY_NOEXCEPT;
884 static bool yy_table_value_is_error_ (
int yyvalue) YY_NOEXCEPT;
886 static const short yypact_ninf_;
887 static const short yytable_ninf_;
895 static std::string yytnamerr_ (
const char *yystr);
898 static const char*
const yytname_[];
904 static const short yypact_[];
909 static const unsigned char yydefact_[];
912 static const short yypgoto_[];
915 static const short yydefgoto_[];
920 static const short yytable_[];
922 static const short yycheck_[];
926 static const unsigned char yystos_[];
929 static const unsigned char yyr1_[];
932 static const signed char yyr2_[];
937 static const short yyrline_[];
939 virtual void yy_reduce_print_ (
int r)
const;
941 virtual void yy_stack_print_ ()
const;
946 std::ostream* yycdebug_;
951 template <
typename Base>
959 template <
typename Base>
967 by_state () YY_NOEXCEPT;
970 typedef state_type kind_type;
973 by_state (kind_type s) YY_NOEXCEPT;
976 by_state (const by_state& that) YY_NOEXCEPT;
979 void clear () YY_NOEXCEPT;
982 void move (by_state& that);
990 enum { empty_state = 0 };
998 struct stack_symbol_type : basic_symbol<by_state>
1001 typedef basic_symbol<by_state> super_type;
1003 stack_symbol_type ();
1005 stack_symbol_type (YY_RVREF (stack_symbol_type) that);
1007 stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
1008 #if YY_CPLUSPLUS < 201103L
1011 stack_symbol_type& operator= (stack_symbol_type& that);
1015 stack_symbol_type& operator= (
const stack_symbol_type& that);
1020 template <
typename T,
typename S = std::vector<T> >
1025 typedef typename S::iterator iterator;
1026 typedef typename S::const_iterator const_iterator;
1027 typedef typename S::size_type size_type;
1028 typedef typename std::ptrdiff_t index_type;
1030 stack (size_type n = 200) YY_NOEXCEPT
1034 #if 201103L <= YY_CPLUSPLUS
1036 stack (
const stack&) =
delete;
1038 stack& operator= (
const stack&) =
delete;
1045 operator[] (index_type i)
const
1047 return seq_[size_type (size () - 1 - i)];
1054 operator[] (index_type i)
1056 return seq_[size_type (size () - 1 - i)];
1063 push (YY_MOVE_REF (T) t)
1065 seq_.push_back (T ());
1066 operator[] (0).move (t);
1071 pop (std::ptrdiff_t n = 1) YY_NOEXCEPT
1079 clear () YY_NOEXCEPT
1086 size () const YY_NOEXCEPT
1088 return index_type (seq_.size ());
1093 begin () const YY_NOEXCEPT
1095 return seq_.begin ();
1100 end () const YY_NOEXCEPT
1109 slice (
const stack& stack, index_type range) YY_NOEXCEPT
1115 operator[] (index_type i)
const
1117 return stack_[range_ - i];
1121 const stack& stack_;
1126 #if YY_CPLUSPLUS < 201103L
1128 stack (
const stack&);
1130 stack& operator= (
const stack&);
1138 typedef stack<stack_symbol_type> stack_type;
1141 stack_type yystack_;
1148 void yypush_ (
const char* m, YY_MOVE_REF (stack_symbol_type) sym);
1156 void yypush_ (
const char* m, state_type s, YY_MOVE_REF (
symbol_type) sym);
1159 void yypop_ (
int n = 1) YY_NOEXCEPT;
1173 spot::location initial_loc;
1179 #line 1180 "parseaut.hh"
Definition: parseaut.hh:837
int expected_tokens(symbol_kind_type yyarg[], int yyargn) const
Present a slice of the top of a stack.
Definition: parseaut.hh:1107
A Bison parser.
Definition: parseaut.hh:369
void error(const syntax_error &err)
Report a syntax error.
token_kind_type token_type
Backward compatibility alias (Bison 3.6).
Definition: parseaut.hh:488
symbol_kind::symbol_kind_type symbol_kind_type
(Internal) symbol kind.
Definition: parseaut.hh:657
token::token_kind_type token_kind_type
Token kind, as returned by yylex.
Definition: parseaut.hh:485
std::ostream & debug_stream() const
The current debugging stream.
spot::location location_type
Symbol locations.
Definition: parseaut.hh:399
static std::string symbol_name(symbol_kind_type yysymbol)
int debug_level_type
Type for debugging levels.
Definition: parseaut.hh:815
value_type semantic_type
Backward compatibility (Bison 3.8).
Definition: parseaut.hh:396
virtual void error(const location_type &loc, const std::string &msg)
parser(void *scanner_yyarg, result_ &res_yyarg, spot::location initial_loc_yyarg)
Build a parser object.
An environment that describes atomic propositions.
Definition: environment.hh:33
A class implementing Kleene's three-valued logic.
Definition: trival.hh:34
Definition: parseaut.hh:670
Base super_type
Alias to Base.
Definition: parseaut.hh:672
basic_symbol()
Default constructor.
Definition: parseaut.hh:675
symbol_kind_type type_get() const
Backward compatibility (Bison 3.6).
void clear()
Destroy contents, and record that is empty.
Definition: parseaut.hh:709
basic_symbol(const basic_symbol &that)
Copy constructor.
basic_symbol(typename Base::kind_type t, const value_type &v, const location_type &l)
Constructor for symbols with semantic value.
basic_symbol(typename Base::kind_type t, location_type &l)
Constructor for valueless symbols.
std::string name() const
The user-facing name of this symbol.
Definition: parseaut.hh:715
~basic_symbol()
Destroy the symbol.
Definition: parseaut.hh:701
Type access provider for token (enum) based symbols.
Definition: parseaut.hh:744
by_kind()
Default constructor.
void clear()
Record that this symbol is empty.
by_kind(kind_type t)
Constructor from (external) token numbers.
by_kind(const by_kind &that)
Copy constructor.
token_kind_type kind_type
The symbol kind as needed by the constructor.
Definition: parseaut.hh:746
Symbol kinds.
Definition: parseaut.hh:492
symbol_kind_type
Definition: parseaut.hh:494
"External" symbols: returned by the scanner.
Definition: parseaut.hh:787
Syntax errors thrown from user actions.
Definition: parseaut.hh:403
Token kinds.
Definition: parseaut.hh:421
token_kind_type yytokentype
Backward compatibility alias (Bison 3.6).
Definition: parseaut.hh:481
Definition: parseaut.hh:141
Definition: parseaut.hh:101
Definition: parseaut.hh:99
An acceptance formula.
Definition: acc.hh:487
An acceptance mark.
Definition: acc.hh:89
Symbol semantic values.
Definition: parseaut.hh:379