spot 2.3.4

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
parsetl.hh
Go to the documentation of this file.
1 // A Bison parser, made by GNU Bison 3.0.2.
2
3 // Skeleton interface for Bison LALR(1) parsers in C++
4
5 // Copyright (C) 2002-2013 Free Software Foundation, Inc.
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 <http://www.gnu.org/licenses/>.
19
20 // As a special exception, you may create a larger work that contains
21 // part or all of the Bison parser skeleton and distribute that work
22 // under terms of your choice, so long as that work isn't itself a
23 // parser generator using the skeleton or a modified version thereof
24 // as a parser skeleton. Alternatively, if you modify or redistribute
25 // the parser skeleton itself, you may (at your option) remove this
26 // special exception, which will cause the skeleton and the resulting
27 // Bison output files to be licensed under the GNU General Public
28 // License without this special exception.
29
30 // This special exception was added by the Free Software Foundation in
31 // version 2.2 of Bison.
32
38 // C++ LALR(1) parser skeleton written by Akim Demaille.
39
40 #ifndef YY_TLYY_PARSETL_HH_INCLUDED
41 # define YY_TLYY_PARSETL_HH_INCLUDED
42 // // "%code requires" blocks.
43 #line 34 "parsetl.yy" // lalr1.cc:372
44
45 #include <string>
46 #include <sstream>
47 #include <spot/tl/parse.hh>
48 #include <spot/tl/formula.hh>
49 #include <spot/tl/print.hh>
50
51 struct minmax_t { unsigned min, max; };
52
53 #line 54 "parsetl.hh" // lalr1.cc:372
54
55
56 # include <vector>
57 # include <iostream>
58 # include <stdexcept>
59 # include <string>
60 # include "stack.hh"
61
62
63
64 #ifndef YY_ATTRIBUTE
65 # if (defined __GNUC__ \
66 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
67 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
68 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
69 # else
70 # define YY_ATTRIBUTE(Spec) /* empty */
71 # endif
72 #endif
73
74 #ifndef YY_ATTRIBUTE_PURE
75 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
76 #endif
77
78 #ifndef YY_ATTRIBUTE_UNUSED
79 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
80 #endif
81
82 #if !defined _Noreturn \
83 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
84 # if defined _MSC_VER && 1200 <= _MSC_VER
85 # define _Noreturn __declspec (noreturn)
86 # else
87 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
88 # endif
89 #endif
90
91 /* Suppress unused-variable warnings by "using" E. */
92 #if ! defined lint || defined __GNUC__
93 # define YYUSE(E) ((void) (E))
94 #else
95 # define YYUSE(E) /* empty */
96 #endif
97
98 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
99 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
100 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
101 _Pragma ("GCC diagnostic push") \
102 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
103 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
104 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
105 _Pragma ("GCC diagnostic pop")
106 #else
107 # define YY_INITIAL_VALUE(Value) Value
108 #endif
109 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
110 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
111 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
112 #endif
113 #ifndef YY_INITIAL_VALUE
114 # define YY_INITIAL_VALUE(Value) /* Nothing. */
115 #endif
116
117 /* Debug traces. */
118 #ifndef YYDEBUG
119 # define YYDEBUG 1
120 #endif
121
122
123 namespace tlyy {
124 #line 125 "parsetl.hh" // lalr1.cc:372
125
126
127
128
129
131 class parser
132 {
133 public:
134 #ifndef YYSTYPE
135 union semantic_type
137 {
138 #line 48 "parsetl.yy" // lalr1.cc:372
139
140 std::string* str;
141 const spot::fnode* ltl;
142 unsigned num;
143 minmax_t minmax;
144
145 #line 146 "parsetl.hh" // lalr1.cc:372
146 };
147 #else
148 typedef YYSTYPE semantic_type;
149 #endif
150 typedef spot::location location_type;
152
154 struct syntax_error : std::runtime_error
155 {
156 syntax_error (const location_type& l, const std::string& m);
157 location_type location;
158 };
159
161 struct token
162 {
163 enum yytokentype
164 {
165 START_LTL = 258,
166 START_LBT = 259,
167 START_SERE = 260,
168 START_BOOL = 261,
169 PAR_OPEN = 262,
170 PAR_CLOSE = 263,
171 PAR_BLOCK = 264,
172 BRA_BLOCK = 265,
173 BRA_BANG_BLOCK = 266,
174 BRACE_OPEN = 267,
175 BRACE_CLOSE = 268,
176 BRACE_BANG_CLOSE = 269,
177 OP_OR = 270,
178 OP_XOR = 271,
179 OP_AND = 272,
180 OP_SHORT_AND = 273,
181 OP_IMPLIES = 274,
182 OP_EQUIV = 275,
183 OP_U = 276,
184 OP_R = 277,
185 OP_W = 278,
186 OP_M = 279,
187 OP_F = 280,
188 OP_G = 281,
189 OP_X = 282,
190 OP_NOT = 283,
191 OP_STAR = 284,
192 OP_BSTAR = 285,
193 OP_BFSTAR = 286,
194 OP_PLUS = 287,
195 OP_FPLUS = 288,
196 OP_STAR_OPEN = 289,
197 OP_FSTAR_OPEN = 290,
198 OP_EQUAL_OPEN = 291,
199 OP_GOTO_OPEN = 292,
200 OP_SQBKT_CLOSE = 293,
201 OP_SQBKT_NUM = 294,
202 OP_UNBOUNDED = 295,
203 OP_SQBKT_SEP = 296,
204 OP_UCONCAT = 297,
205 OP_ECONCAT = 298,
206 OP_UCONCAT_NONO = 299,
207 OP_ECONCAT_NONO = 300,
208 ATOMIC_PROP = 301,
209 OP_CONCAT = 302,
210 OP_FUSION = 303,
211 CONST_TRUE = 304,
212 CONST_FALSE = 305,
213 END_OF_INPUT = 306,
214 OP_POST_NEG = 307,
215 OP_POST_POS = 308
216 };
217 };
218
220 typedef token::yytokentype token_type;
221
223 typedef int symbol_number_type;
224
226 typedef unsigned char token_number_type;
227
234 template <typename Base>
235 struct basic_symbol : Base
236 {
238 typedef Base super_type;
239
241 basic_symbol ();
242
244 basic_symbol (const basic_symbol& other);
245
247 basic_symbol (typename Base::kind_type t,
248 const location_type& l);
249
251 basic_symbol (typename Base::kind_type t,
252 const semantic_type& v,
253 const location_type& l);
254
255 ~basic_symbol ();
256
258 void move (basic_symbol& s);
259
261 semantic_type value;
262
264 location_type location;
265
266 private:
268 basic_symbol& operator= (const basic_symbol& other);
269 };
270
272 struct by_type
273 {
275 by_type ();
276
278 by_type (const by_type& other);
279
281 typedef token_type kind_type;
282
284 by_type (kind_type t);
285
287 void move (by_type& that);
288
291 symbol_number_type type_get () const;
292
294 token_type token () const;
295
296 enum { empty = 0 };
297
300 token_number_type type;
301 };
302
304 typedef basic_symbol<by_type> symbol_type;
305
306
308 parser (spot::parse_error_list &error_list_yyarg, spot::environment &parse_environment_yyarg, spot::formula &result_yyarg);
309 virtual ~parser ();
310
313 virtual int parse ();
314
315 #if YYDEBUG
316 std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
319 void set_debug_stream (std::ostream &);
320
322 typedef int debug_level_type;
324 debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
326 void set_debug_level (debug_level_type l);
327 #endif
328
332 virtual void error (const location_type& loc, const std::string& msg);
333
335 void error (const syntax_error& err);
336
337 private:
339 parser (const parser&);
340 parser& operator= (const parser&);
341
343 typedef int state_type;
344
348 virtual std::string yysyntax_error_ (state_type yystate,
349 symbol_number_type yytoken) const;
350
354 state_type yy_lr_goto_state_ (state_type yystate, int yysym);
355
358 static bool yy_pact_value_is_default_ (int yyvalue);
359
362 static bool yy_table_value_is_error_ (int yyvalue);
363
364 static const signed char yypact_ninf_;
365 static const signed char yytable_ninf_;
366
368 static token_number_type yytranslate_ (int t);
369
370 // Tables.
371 // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
372 // STATE-NUM.
373 static const short int yypact_[];
374
375 // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
376 // Performed when YYTABLE does not specify something else to do. Zero
377 // means the default is an error.
378 static const unsigned char yydefact_[];
379
380 // YYPGOTO[NTERM-NUM].
381 static const short int yypgoto_[];
382
383 // YYDEFGOTO[NTERM-NUM].
384 static const short int yydefgoto_[];
385
386 // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
387 // positive, shift that token. If negative, reduce the rule whose
388 // number is the opposite. If YYTABLE_NINF, syntax error.
389 static const short int yytable_[];
390
391 static const short int yycheck_[];
392
393 // YYSTOS[STATE-NUM] -- The (internal number of the) accessing
394 // symbol of state STATE-NUM.
395 static const unsigned char yystos_[];
396
397 // YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
398 static const unsigned char yyr1_[];
399
400 // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
401 static const unsigned char yyr2_[];
402
403
405 static std::string yytnamerr_ (const char *n);
406
407
409 static const char* const yytname_[];
410 #if YYDEBUG
411 // YYRLINE[YYN] -- Source line where rule number YYN was defined.
412 static const unsigned short int yyrline_[];
414 virtual void yy_reduce_print_ (int r);
416 virtual void yystack_print_ ();
417
418 // Debugging.
419 int yydebug_;
420 std::ostream* yycdebug_;
421
425 template <typename Base>
426 void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
427 #endif
428
433 template <typename Base>
434 void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
435
436 private:
438 struct by_state
439 {
441 by_state ();
442
444 typedef state_type kind_type;
445
447 by_state (kind_type s);
448
450 by_state (const by_state& other);
451
453 void move (by_state& that);
454
457 symbol_number_type type_get () const;
458
459 enum { empty = 0 };
460
462 state_type state;
463 };
464
466 struct stack_symbol_type : basic_symbol<by_state>
467 {
469 typedef basic_symbol<by_state> super_type;
471 stack_symbol_type ();
473 stack_symbol_type (state_type s, symbol_type& sym);
475 stack_symbol_type& operator= (const stack_symbol_type& that);
476 };
477
479 typedef stack<stack_symbol_type> stack_type;
480
482 stack_type yystack_;
483
489 void yypush_ (const char* m, stack_symbol_type& s);
490
497 void yypush_ (const char* m, state_type s, symbol_type& sym);
498
500 void yypop_ (unsigned int n = 1);
501
502 // Constants.
503 enum
504 {
505 yyeof_ = 0,
506 yylast_ = 1392,
507 yynnts_ = 20,
508 yyempty_ = -2,
509 yyfinal_ = 68,
510 yyterror_ = 1,
511 yyerrcode_ = 256,
512 yyntokens_ = 70
513 };
514
515
516 // User arguments.
517 spot::parse_error_list &error_list;
518 spot::environment &parse_environment;
519 spot::formula &result;
520 };
521
522
523
524 } // tlyy
525 #line 526 "parsetl.hh" // lalr1.cc:372
526
527
528
529
530 #endif // !YY_TLYY_PARSETL_HH_INCLUDED
tlyy::parser::by_type::type_get
symbol_number_type type_get() const
tlyy::parser::location_type
spot::location location_type
Symbol locations.
Definition: parsetl.hh:151
tlyy::parser::debug_level
debug_level_type debug_level() const
The current debugging level.
tlyy
Definition: parsetl.hh:123
tlyy::parser::by_type::type
token_number_type type
Definition: parsetl.hh:300
tlyy::parser::semantic_type
Symbol semantic values.
Definition: parsetl.hh:136
tlyy::parser::by_type
Type access provider for token (enum) based symbols.
Definition: parsetl.hh:272
spot::environment
An environment that describes atomic propositions.
Definition: environment.hh:32
formula.hh
LTL/PSL formula interface.
tlyy::parser
A Bison parser.
Definition: parsetl.hh:131
tlyy::parser::set_debug_level
void set_debug_level(debug_level_type l)
Set the current debugging level.
std
Definition: formula.hh:1671
tlyy::parser::basic_symbol::value
semantic_type value
The semantic value.
Definition: parsetl.hh:261
tlyy::parser::symbol_number_type
int symbol_number_type
Internal symbol number.
Definition: parsetl.hh:223
spot::formula
Main class for temporal logic formula.
Definition: formula.hh:669
tlyy::parser::by_type::by_type
by_type()
Default constructor.
tlyy::parser::by_type::kind_type
token_type kind_type
The symbol type as needed by the constructor.
Definition: parsetl.hh:281
spot::parse_error_list
std::list< one_parse_error > parse_error_list
A list of parser diagnostics, as filled by parse.
Definition: parse.hh:42
tlyy::parser::basic_symbol::location
location_type location
The location.
Definition: parsetl.hh:264
tlyy::parser::basic_symbol::basic_symbol
basic_symbol()
Default constructor.
tlyy::parser::symbol_type
basic_symbol< by_type > symbol_type
"External" symbols: returned by the scanner.
Definition: parsetl.hh:304
tlyy::parser::debug_stream
std::ostream & debug_stream() const
The current debugging stream.
tlyy::parser::error
virtual void error(const location_type &loc, const std::string &msg)
tlyy::parser::parser
parser(spot::parse_error_list &error_list_yyarg, spot::environment &parse_environment_yyarg, spot::formula &result_yyarg)
Build a parser object.
tlyy::parser::debug_level_type
int debug_level_type
Type for debugging levels.
Definition: parsetl.hh:322
tlyy::parser::token
Tokens.
Definition: parsetl.hh:161
tlyy::parser::basic_symbol::move
void move(basic_symbol &s)
Destructive move, s is emptied into this.
tlyy::parser::by_type::move
void move(by_type &that)
Steal the symbol type from that.
tlyy::parser::set_debug_stream
void set_debug_stream(std::ostream &)
Set the current debugging stream.
minmax_t
Definition: parsetl.hh:51
tlyy::parser::by_type::token
token_type token() const
The token.
tlyy::parser::token_type
token::yytokentype token_type
(External) token type, as returned by yylex.
Definition: parsetl.hh:220
tlyy::parser::basic_symbol
Definition: parsetl.hh:235
spot::fnode
Actual storage for formula nodes.
Definition: formula.hh:107
hoayy::parser::basic_symbol
Definition: parseaut.hh:374
tlyy::parser::syntax_error
Syntax errors thrown from user actions.
Definition: parsetl.hh:154
tlyy::parser::basic_symbol::super_type
Base super_type
Alias to Base.
Definition: parsetl.hh:238
tlyy::parser::token_number_type
unsigned char token_number_type
Internal symbol number for tokens (subsumed by symbol_number_type).
Definition: parsetl.hh:226
tlyy::parser::parse
virtual int parse()

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.