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>
63 #include <spot/twaalgos/game.hh>
65 using namespace std::string_literals;
67 #ifndef HAVE_STRVERSCMP
69 extern "C" int strverscmp(
const char *s1,
const char *s2);
74 #define PARSE_ERROR_LIST res.h->errors, res.fcache
76 inline namespace hoayy_support
78 typedef std::map<int, bdd> map_t;
85 typedef robin_hood::unordered_flat_map<std::string, bdd> formula_cache;
87 typedef std::pair<int, std::string*> pair;
95 enum label_style_t { Mixed_Labels, State_Labels, Trans_Labels,
97 enum acc_style_t { Mixed_Acc, State_Acc, Trans_Acc };
103 bool declared =
false;
105 spot::location used_loc;
107 spot::parsed_aut_ptr h;
108 spot::twa_ptr aut_or_ks;
110 std::string format_version;
111 spot::location format_version_loc;
113 formula_cache fcache;
115 spot::acc_mapper_int* acc_mapper =
nullptr;
117 std::vector<int> controllable_ap;
118 bool has_controllable_ap =
false;
119 std::vector<spot::location> controllable_ap_loc;
120 spot::location controllable_aps_loc;
121 std::vector<bdd> guards;
122 std::vector<bdd>::const_iterator cur_guard;
132 int unknown_ap_max = -1;
133 spot::location unknown_ap_max_location;
134 bool in_alias =
false;
136 std::vector<state_info> info_states;
137 std::vector<std::pair<spot::location,
138 std::vector<unsigned>>> start;
139 std::unordered_map<std::string, bdd> alias;
140 std::vector<std::string> alias_order;
145 operator bool()
const
150 std::unordered_map<std::string, prop_info> props;
151 spot::location states_loc;
152 spot::location ap_loc;
153 spot::location state_label_loc;
154 spot::location accset_loc;
160 std::vector<std::string>* state_names =
nullptr;
161 std::map<unsigned, unsigned>* highlight_edges =
nullptr;
162 std::map<unsigned, unsigned>* highlight_states =
nullptr;
163 std::map<unsigned, unsigned> states_map;
164 std::vector<bool>* state_player =
nullptr;
165 spot::location state_player_loc;
166 std::set<int> ap_set;
173 bool has_state_label =
false;
174 bool ignore_more_ap =
false;
176 bool ignore_acc =
false;
178 bool ignore_acc_silent =
false;
179 bool ignore_more_acc =
false;
182 label_style_t label_style = Mixed_Labels;
183 acc_style_t acc_style = Mixed_Acc;
185 bool accept_all_needed =
false;
186 bool accept_all_seen =
false;
187 bool aliased_states =
false;
192 bool trans_acc_seen =
false;
194 std::map<std::string, spot::location> labels;
196 prop_info prop_is_true(
const std::string& p)
198 auto i = props.find(p);
199 if (i == props.end())
200 return prop_info{spot::location(),
false};
204 prop_info prop_is_false(
const std::string& p)
206 auto i = props.find(p);
207 if (i == props.end())
208 return prop_info{spot::location(),
false};
209 return prop_info{i->second.loc, !i->second.val};
220 #line 221 "parseaut.hh"
225 # include <stdexcept>
229 #if defined __cplusplus
230 # define YY_CPLUSPLUS __cplusplus
232 # define YY_CPLUSPLUS 199711L
236 #if 201103L <= YY_CPLUSPLUS
237 # define YY_MOVE std::move
238 # define YY_MOVE_OR_COPY move
239 # define YY_MOVE_REF(Type) Type&&
240 # define YY_RVREF(Type) Type&&
241 # define YY_COPY(Type) Type
244 # define YY_MOVE_OR_COPY copy
245 # define YY_MOVE_REF(Type) Type&
246 # define YY_RVREF(Type) const Type&
247 # define YY_COPY(Type) const Type&
251 #if 201103L <= YY_CPLUSPLUS
252 # define YY_NOEXCEPT noexcept
256 # define YY_NOTHROW throw ()
260 #if 201703 <= YY_CPLUSPLUS
261 # define YY_CONSTEXPR constexpr
263 # define YY_CONSTEXPR
268 #ifndef YY_ATTRIBUTE_PURE
269 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
270 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
272 # define YY_ATTRIBUTE_PURE
276 #ifndef YY_ATTRIBUTE_UNUSED
277 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
278 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
280 # define YY_ATTRIBUTE_UNUSED
285 #if ! defined lint || defined __GNUC__
286 # define YY_USE(E) ((void) (E))
292 #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
293 # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
294 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
295 _Pragma ("GCC diagnostic push") \
296 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
298 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
299 _Pragma ("GCC diagnostic push") \
300 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
301 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
303 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
304 _Pragma ("GCC diagnostic pop")
306 # define YY_INITIAL_VALUE(Value) Value
308 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
309 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
310 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
312 #ifndef YY_INITIAL_VALUE
313 # define YY_INITIAL_VALUE(Value)
316 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
317 # define YY_IGNORE_USELESS_CAST_BEGIN \
318 _Pragma ("GCC diagnostic push") \
319 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
320 # define YY_IGNORE_USELESS_CAST_END \
321 _Pragma ("GCC diagnostic pop")
323 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
324 # define YY_IGNORE_USELESS_CAST_BEGIN
325 # define YY_IGNORE_USELESS_CAST_END
330 # define YY_CAST(Type, Val) static_cast<Type> (Val)
331 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
333 # define YY_CAST(Type, Val) ((Type) (Val))
334 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
338 # if defined __cplusplus
339 # if 201103L <= __cplusplus
340 # define YY_NULLPTR nullptr
342 # define YY_NULLPTR 0
345 # define YY_NULLPTR ((void*)0)
353 # define HOAYYDEBUG 1
355 # define HOAYYDEBUG 0
358 # define HOAYYDEBUG 1
363 #line 364 "parseaut.hh"
374 # pragma GCC message "bison: do not #define HOAYYSTYPE in C++, use %define api.value.type"
381 #line 211 "parseaut.yy"
388 std::list<pair>* list;
390 std::vector<unsigned>* states;
392 #line 393 "parseaut.hh"
406 : std::runtime_error (m)
411 : std::runtime_error (s.what ())
412 , location (s.location)
436 CONTROLLABLE_AP = 265,
443 SPOT_HIGHLIGHT_EDGES = 272,
444 SPOT_HIGHLIGHT_STATES = 273,
445 SPOT_STATE_PLAYER = 274,
510 S_CONTROLLABLE_AP = 10,
517 S_SPOT_HIGHLIGHT_EDGES = 17,
518 S_SPOT_HIGHLIGHT_STATES = 18,
519 S_SPOT_STATE_PLAYER = 19,
526 S_LINEDIRECTIVE = 26,
581 S_81_format_version = 81,
583 S_83_controllable_aps = 83,
586 S_86_header_items = 86,
587 S_87_header_item = 87,
597 S_97_highlight_edges = 97,
598 S_98_highlight_states = 98,
599 S_99_state_player = 99,
600 S_100_header_spec = 100,
601 S_101_state_conj_2 = 101,
602 S_102_init_state_conj_2 = 102,
603 S_103_label_expr = 103,
605 S_105_acceptance_cond = 105,
607 S_107_state_num = 107,
608 S_108_checked_state_num = 108,
611 S_111_state_name = 111,
613 S_113_state_label_opt = 113,
614 S_114_trans_label = 114,
616 S_116_acc_sets = 116,
617 S_117_state_acc_opt = 117,
618 S_118_trans_acc_opt = 118,
619 S_119_labeled_edges = 119,
620 S_120_some_labeled_edges = 120,
621 S_121_incorrectly_unlabeled_edge = 121,
622 S_122_labeled_edge = 122,
623 S_123_state_conj_checked = 123,
624 S_124_unlabeled_edges = 124,
625 S_125_unlabeled_edge = 125,
626 S_126_incorrectly_labeled_edge = 126,
629 S_dstar_header = 129,
631 S_dstar_state_id = 131,
633 S_dstar_accsigs = 133,
634 S_dstar_state_accsig = 134,
635 S_dstar_transitions = 135,
636 S_dstar_states = 136,
644 S_144_nc_states = 144,
645 S_145_nc_one_ident = 145,
646 S_146_nc_ident_list = 146,
647 S_147_nc_transition_block = 147,
648 S_148_nc_state = 148,
649 S_149_nc_transitions = 149,
650 S_150_nc_formula_or_ident = 150,
651 S_151_nc_formula = 151,
652 S_152_nc_opt_dest = 152,
653 S_153_nc_src_dest = 153,
654 S_154_nc_transition = 154,
656 S_156_lbtt_header_states = 156,
657 S_157_lbtt_header = 157,
658 S_158_lbtt_body = 158,
659 S_159_lbtt_states = 159,
660 S_160_lbtt_state = 160,
661 S_161_lbtt_acc = 161,
662 S_162_lbtt_guard = 162,
663 S_163_lbtt_transitions = 163
679 template <
typename Base>
691 #if 201103L <= YY_CPLUSPLUS
694 : Base (std::move (that))
695 , value (std::move (that.value))
696 , location (std::move (that.location))
726 std::string
name () const YY_NOEXCEPT
728 return parser::symbol_name (this->kind ());
735 bool empty () const YY_NOEXCEPT;
747 #if YY_CPLUSPLUS < 201103L
762 #if 201103L <= YY_CPLUSPLUS
801 parser (
void* scanner_yyarg,
result_& res_yyarg, spot::location initial_loc_yyarg);
804 #if 201103L <= YY_CPLUSPLUS
823 void set_debug_stream (std::ostream &);
851 const symbol_type& lookahead ()
const YY_NOEXCEPT {
return yyla_; }
853 const location_type& location ()
const YY_NOEXCEPT {
return yyla_.location; }
866 #if YY_CPLUSPLUS < 201103L
875 typedef short state_type;
878 int yy_syntax_error_arguments_ (
const context& yyctx,
883 virtual std::string yysyntax_error_ (
const context& yyctx)
const;
887 static state_type yy_lr_goto_state_ (state_type yystate,
int yysym);
891 static bool yy_pact_value_is_default_ (
int yyvalue) YY_NOEXCEPT;
895 static bool yy_table_value_is_error_ (
int yyvalue) YY_NOEXCEPT;
897 static const short yypact_ninf_;
898 static const short yytable_ninf_;
906 static std::string yytnamerr_ (
const char *yystr);
909 static const char*
const yytname_[];
915 static const short yypact_[];
920 static const unsigned char yydefact_[];
923 static const short yypgoto_[];
926 static const short yydefgoto_[];
931 static const short yytable_[];
933 static const short yycheck_[];
937 static const unsigned char yystos_[];
940 static const unsigned char yyr1_[];
943 static const signed char yyr2_[];
948 static const short yyrline_[];
950 virtual void yy_reduce_print_ (
int r)
const;
952 virtual void yy_stack_print_ ()
const;
957 std::ostream* yycdebug_;
962 template <
typename Base>
970 template <
typename Base>
978 by_state () YY_NOEXCEPT;
981 typedef state_type kind_type;
984 by_state (kind_type s) YY_NOEXCEPT;
987 by_state (const by_state& that) YY_NOEXCEPT;
990 void clear () YY_NOEXCEPT;
993 void move (by_state& that);
1001 enum { empty_state = 0 };
1009 struct stack_symbol_type : basic_symbol<by_state>
1012 typedef basic_symbol<by_state> super_type;
1014 stack_symbol_type ();
1016 stack_symbol_type (YY_RVREF (stack_symbol_type) that);
1018 stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
1019 #if YY_CPLUSPLUS < 201103L
1022 stack_symbol_type& operator= (stack_symbol_type& that);
1026 stack_symbol_type& operator= (
const stack_symbol_type& that);
1031 template <
typename T,
typename S = std::vector<T> >
1036 typedef typename S::iterator iterator;
1037 typedef typename S::const_iterator const_iterator;
1038 typedef typename S::size_type size_type;
1039 typedef typename std::ptrdiff_t index_type;
1041 stack (size_type n = 200) YY_NOEXCEPT
1045 #if 201103L <= YY_CPLUSPLUS
1047 stack (
const stack&) =
delete;
1049 stack& operator= (
const stack&) =
delete;
1056 operator[] (index_type i)
const
1058 return seq_[size_type (size () - 1 - i)];
1065 operator[] (index_type i)
1067 return seq_[size_type (size () - 1 - i)];
1074 push (YY_MOVE_REF (T) t)
1076 seq_.push_back (T ());
1077 operator[] (0).move (t);
1082 pop (std::ptrdiff_t n = 1) YY_NOEXCEPT
1090 clear () YY_NOEXCEPT
1097 size () const YY_NOEXCEPT
1099 return index_type (seq_.size ());
1104 begin () const YY_NOEXCEPT
1106 return seq_.begin ();
1111 end () const YY_NOEXCEPT
1120 slice (
const stack& stack, index_type range) YY_NOEXCEPT
1126 operator[] (index_type i)
const
1128 return stack_[range_ - i];
1132 const stack& stack_;
1137 #if YY_CPLUSPLUS < 201103L
1139 stack (
const stack&);
1141 stack& operator= (
const stack&);
1149 typedef stack<stack_symbol_type> stack_type;
1152 stack_type yystack_;
1159 void yypush_ (
const char* m, YY_MOVE_REF (stack_symbol_type) sym);
1167 void yypush_ (
const char* m, state_type s, YY_MOVE_REF (
symbol_type) sym);
1170 void yypop_ (
int n = 1) YY_NOEXCEPT;
1184 spot::location initial_loc;
1190 #line 1191 "parseaut.hh"
Definition: parseaut.hh:848
int expected_tokens(symbol_kind_type yyarg[], int yyargn) const
Present a slice of the top of a stack.
Definition: parseaut.hh:1118
A Bison parser.
Definition: parseaut.hh:370
void error(const syntax_error &err)
Report a syntax error.
token_kind_type token_type
Backward compatibility alias (Bison 3.6).
Definition: parseaut.hh:491
symbol_kind::symbol_kind_type symbol_kind_type
(Internal) symbol kind.
Definition: parseaut.hh:668
token::token_kind_type token_kind_type
Token kind, as returned by yylex.
Definition: parseaut.hh:488
std::ostream & debug_stream() const
The current debugging stream.
spot::location location_type
Symbol locations.
Definition: parseaut.hh:400
static std::string symbol_name(symbol_kind_type yysymbol)
int debug_level_type
Type for debugging levels.
Definition: parseaut.hh:826
value_type semantic_type
Backward compatibility (Bison 3.8).
Definition: parseaut.hh:397
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:681
Base super_type
Alias to Base.
Definition: parseaut.hh:683
basic_symbol()
Default constructor.
Definition: parseaut.hh:686
symbol_kind_type type_get() const
Backward compatibility (Bison 3.6).
void clear()
Destroy contents, and record that is empty.
Definition: parseaut.hh:720
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:726
~basic_symbol()
Destroy the symbol.
Definition: parseaut.hh:712
Type access provider for token (enum) based symbols.
Definition: parseaut.hh:755
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:757
Symbol kinds.
Definition: parseaut.hh:495
symbol_kind_type
Definition: parseaut.hh:497
"External" symbols: returned by the scanner.
Definition: parseaut.hh:798
Syntax errors thrown from user actions.
Definition: parseaut.hh:404
Token kinds.
Definition: parseaut.hh:422
token_kind_type yytokentype
Backward compatibility alias (Bison 3.6).
Definition: parseaut.hh:484
Definition: parseaut.hh:142
Definition: parseaut.hh:102
Definition: parseaut.hh:100
An acceptance formula.
Definition: acc.hh:488
An acceptance mark.
Definition: acc.hh:90
Definition: public.hh:100
Symbol semantic values.
Definition: parseaut.hh:380