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))
291 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
293 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
294 _Pragma ("GCC diagnostic push") \
295 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
296 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
297 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
298 _Pragma ("GCC diagnostic pop")
300 # define YY_INITIAL_VALUE(Value) Value
302 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
303 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
304 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
306 #ifndef YY_INITIAL_VALUE
307 # define YY_INITIAL_VALUE(Value)
310 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
311 # define YY_IGNORE_USELESS_CAST_BEGIN \
312 _Pragma ("GCC diagnostic push") \
313 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
314 # define YY_IGNORE_USELESS_CAST_END \
315 _Pragma ("GCC diagnostic pop")
317 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
318 # define YY_IGNORE_USELESS_CAST_BEGIN
319 # define YY_IGNORE_USELESS_CAST_END
324 # define YY_CAST(Type, Val) static_cast<Type> (Val)
325 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
327 # define YY_CAST(Type, Val) ((Type) (Val))
328 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
332 # if defined __cplusplus
333 # if 201103L <= __cplusplus
334 # define YY_NULLPTR nullptr
336 # define YY_NULLPTR 0
339 # define YY_NULLPTR ((void*)0)
347 # define HOAYYDEBUG 1
349 # define HOAYYDEBUG 0
352 # define HOAYYDEBUG 1
357 #line 358 "parseaut.hh"
370 #line 211 "parseaut.yy"
377 std::list<pair>* list;
379 std::vector<unsigned>* states;
381 #line 382 "parseaut.hh"
394 : std::runtime_error (m)
399 : std::runtime_error (s.what ())
400 , location (s.location)
424 CONTROLLABLE_AP = 265,
431 SPOT_HIGHLIGHT_EDGES = 272,
432 SPOT_HIGHLIGHT_STATES = 273,
433 SPOT_STATE_PLAYER = 274,
498 S_CONTROLLABLE_AP = 10,
505 S_SPOT_HIGHLIGHT_EDGES = 17,
506 S_SPOT_HIGHLIGHT_STATES = 18,
507 S_SPOT_STATE_PLAYER = 19,
514 S_LINEDIRECTIVE = 26,
569 S_81_format_version = 81,
571 S_83_controllable_aps = 83,
574 S_86_header_items = 86,
575 S_87_header_item = 87,
585 S_97_highlight_edges = 97,
586 S_98_highlight_states = 98,
587 S_99_state_player = 99,
588 S_100_header_spec = 100,
589 S_101_state_conj_2 = 101,
590 S_102_init_state_conj_2 = 102,
591 S_103_label_expr = 103,
593 S_105_acceptance_cond = 105,
595 S_107_state_num = 107,
596 S_108_checked_state_num = 108,
599 S_111_state_name = 111,
601 S_113_state_label_opt = 113,
602 S_114_trans_label = 114,
604 S_116_acc_sets = 116,
605 S_117_state_acc_opt = 117,
606 S_118_trans_acc_opt = 118,
607 S_119_labeled_edges = 119,
608 S_120_some_labeled_edges = 120,
609 S_121_incorrectly_unlabeled_edge = 121,
610 S_122_labeled_edge = 122,
611 S_123_state_conj_checked = 123,
612 S_124_unlabeled_edges = 124,
613 S_125_unlabeled_edge = 125,
614 S_126_incorrectly_labeled_edge = 126,
617 S_dstar_header = 129,
619 S_dstar_state_id = 131,
621 S_dstar_accsigs = 133,
622 S_dstar_state_accsig = 134,
623 S_dstar_transitions = 135,
624 S_dstar_states = 136,
632 S_144_nc_states = 144,
633 S_145_nc_one_ident = 145,
634 S_146_nc_ident_list = 146,
635 S_147_nc_transition_block = 147,
636 S_148_nc_state = 148,
637 S_149_nc_transitions = 149,
638 S_150_nc_formula_or_ident = 150,
639 S_151_nc_formula = 151,
640 S_152_nc_opt_dest = 152,
641 S_153_nc_src_dest = 153,
642 S_154_nc_transition = 154,
644 S_156_lbtt_header_states = 156,
645 S_157_lbtt_header = 157,
646 S_158_lbtt_body = 158,
647 S_159_lbtt_states = 159,
648 S_160_lbtt_state = 160,
649 S_161_lbtt_acc = 161,
650 S_162_lbtt_guard = 162,
651 S_163_lbtt_transitions = 163
667 template <
typename Base>
679 #if 201103L <= YY_CPLUSPLUS
682 : Base (std::move (that))
683 , value (std::move (that.value))
684 , location (std::move (that.location))
712 std::string
name () const YY_NOEXCEPT
714 return parser::symbol_name (this->kind ());
721 bool empty () const YY_NOEXCEPT;
733 #if YY_CPLUSPLUS < 201103L
745 #if 201103L <= YY_CPLUSPLUS
785 parser (
void* scanner_yyarg,
result_& res_yyarg, spot::location initial_loc_yyarg);
788 #if 201103L <= YY_CPLUSPLUS
807 void set_debug_stream (std::ostream &);
835 const symbol_type& lookahead ()
const YY_NOEXCEPT {
return yyla_; }
837 const location_type& location ()
const YY_NOEXCEPT {
return yyla_.location; }
850 #if YY_CPLUSPLUS < 201103L
859 typedef short state_type;
862 int yy_syntax_error_arguments_ (
const context& yyctx,
867 virtual std::string yysyntax_error_ (
const context& yyctx)
const;
871 static state_type yy_lr_goto_state_ (state_type yystate,
int yysym);
875 static bool yy_pact_value_is_default_ (
int yyvalue);
879 static bool yy_table_value_is_error_ (
int yyvalue);
881 static const short yypact_ninf_;
882 static const short yytable_ninf_;
890 static std::string yytnamerr_ (
const char *yystr);
893 static const char*
const yytname_[];
899 static const short yypact_[];
904 static const unsigned char yydefact_[];
907 static const short yypgoto_[];
910 static const short yydefgoto_[];
915 static const short yytable_[];
917 static const short yycheck_[];
921 static const unsigned char yystos_[];
924 static const unsigned char yyr1_[];
927 static const signed char yyr2_[];
932 static const short yyrline_[];
934 virtual void yy_reduce_print_ (
int r)
const;
936 virtual void yy_stack_print_ ()
const;
941 std::ostream* yycdebug_;
946 template <
typename Base>
954 template <
typename Base>
962 by_state () YY_NOEXCEPT;
965 typedef state_type kind_type;
968 by_state (kind_type s) YY_NOEXCEPT;
971 by_state (const by_state& that) YY_NOEXCEPT;
974 void clear () YY_NOEXCEPT;
977 void move (by_state& that);
985 enum { empty_state = 0 };
993 struct stack_symbol_type : basic_symbol<by_state>
996 typedef basic_symbol<by_state> super_type;
998 stack_symbol_type ();
1000 stack_symbol_type (YY_RVREF (stack_symbol_type) that);
1002 stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
1003 #if YY_CPLUSPLUS < 201103L
1006 stack_symbol_type& operator= (stack_symbol_type& that);
1010 stack_symbol_type& operator= (
const stack_symbol_type& that);
1015 template <
typename T,
typename S = std::vector<T> >
1020 typedef typename S::iterator iterator;
1021 typedef typename S::const_iterator const_iterator;
1022 typedef typename S::size_type size_type;
1023 typedef typename std::ptrdiff_t index_type;
1025 stack (size_type n = 200)
1029 #if 201103L <= YY_CPLUSPLUS
1031 stack (
const stack&) =
delete;
1033 stack& operator= (
const stack&) =
delete;
1040 operator[] (index_type i)
const
1042 return seq_[size_type (size () - 1 - i)];
1049 operator[] (index_type i)
1051 return seq_[size_type (size () - 1 - i)];
1058 push (YY_MOVE_REF (T) t)
1060 seq_.push_back (T ());
1061 operator[] (0).move (t);
1066 pop (std::ptrdiff_t n = 1) YY_NOEXCEPT
1074 clear () YY_NOEXCEPT
1081 size () const YY_NOEXCEPT
1083 return index_type (seq_.size ());
1088 begin () const YY_NOEXCEPT
1090 return seq_.begin ();
1095 end () const YY_NOEXCEPT
1104 slice (
const stack& stack, index_type range)
1110 operator[] (index_type i)
const
1112 return stack_[range_ - i];
1116 const stack& stack_;
1121 #if YY_CPLUSPLUS < 201103L
1123 stack (
const stack&);
1125 stack& operator= (
const stack&);
1133 typedef stack<stack_symbol_type> stack_type;
1136 stack_type yystack_;
1143 void yypush_ (
const char* m, YY_MOVE_REF (stack_symbol_type) sym);
1151 void yypush_ (
const char* m, state_type s, YY_MOVE_REF (
symbol_type) sym);
1154 void yypop_ (
int n = 1);
1168 spot::location initial_loc;
1174 #line 1175 "parseaut.hh"
Definition: parseaut.hh:832
int expected_tokens(symbol_kind_type yyarg[], int yyargn) const
Present a slice of the top of a stack.
Definition: parseaut.hh:1102
A Bison parser.
Definition: parseaut.hh:364
void error(const syntax_error &err)
Report a syntax error.
token_kind_type token_type
Backward compatibility alias (Bison 3.6).
Definition: parseaut.hh:479
symbol_kind::symbol_kind_type symbol_kind_type
(Internal) symbol kind.
Definition: parseaut.hh:656
std::ostream & debug_stream() const
The current debugging stream.
token::yytokentype token_kind_type
Token kind, as returned by yylex.
Definition: parseaut.hh:476
spot::location location_type
Symbol locations.
Definition: parseaut.hh:388
static std::string symbol_name(symbol_kind_type yysymbol)
int debug_level_type
Type for debugging levels.
Definition: parseaut.hh:810
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:669
Base super_type
Alias to Base.
Definition: parseaut.hh:671
basic_symbol()
Default constructor.
Definition: parseaut.hh:674
symbol_kind_type type_get() const
Backward compatibility (Bison 3.6).
void clear()
Destroy contents, and record that is empty.
Definition: parseaut.hh:706
basic_symbol(const basic_symbol &that)
Copy constructor.
basic_symbol(typename Base::kind_type t, location_type &l)
Constructor for valueless symbols.
basic_symbol(typename Base::kind_type t, const semantic_type &v, const location_type &l)
Constructor for symbols with semantic value.
std::string name() const
The user-facing name of this symbol.
Definition: parseaut.hh:712
~basic_symbol()
Destroy the symbol.
Definition: parseaut.hh:700
Type access provider for token (enum) based symbols.
Definition: parseaut.hh:741
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:754
Symbol kinds.
Definition: parseaut.hh:483
symbol_kind_type
Definition: parseaut.hh:485
"External" symbols: returned by the scanner.
Definition: parseaut.hh:782
Syntax errors thrown from user actions.
Definition: parseaut.hh:392
Token kinds.
Definition: parseaut.hh:410
token_kind_type yytokentype
Backward compatibility alias (Bison 3.6).
Definition: parseaut.hh:472
Definition: parseaut.hh:142
Definition: parseaut.hh:102
Definition: parseaut.hh:100
An acceptance formula.
Definition: acc.hh:479
An acceptance mark.
Definition: acc.hh:85
Definition: public.hh:100
Symbol semantic values.
Definition: parseaut.hh:369