spot  2.5.3
parsetl.hh
Go to the documentation of this file.
1 // A Bison parser, made by GNU Bison 3.0.4.
2 
3 // Skeleton interface for Bison LALR(1) parsers in C++
4 
5 // Copyright (C) 2002-2015 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 35 "parsetl.yy" // lalr1.cc:377
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:377
54 
55 
56 # include <cstdlib> // std::abort
57 # include <iostream>
58 # include <stdexcept>
59 # include <string>
60 # include <vector>
61 # include "stack.hh"
62 
63 
64 
65 #ifndef YY_ATTRIBUTE
66 # if (defined __GNUC__ \
67  && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
68  || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
69 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
70 # else
71 # define YY_ATTRIBUTE(Spec) /* empty */
72 # endif
73 #endif
74 
75 #ifndef YY_ATTRIBUTE_PURE
76 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
77 #endif
78 
79 #ifndef YY_ATTRIBUTE_UNUSED
80 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
81 #endif
82 
83 #if !defined _Noreturn \
84  && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
85 # if defined _MSC_VER && 1200 <= _MSC_VER
86 # define _Noreturn __declspec (noreturn)
87 # else
88 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
89 # endif
90 #endif
91 
92 /* Suppress unused-variable warnings by "using" E. */
93 #if ! defined lint || defined __GNUC__
94 # define YYUSE(E) ((void) (E))
95 #else
96 # define YYUSE(E) /* empty */
97 #endif
98 
99 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
100 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
101 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
102  _Pragma ("GCC diagnostic push") \
103  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
104  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
105 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
106  _Pragma ("GCC diagnostic pop")
107 #else
108 # define YY_INITIAL_VALUE(Value) Value
109 #endif
110 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
111 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
112 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
113 #endif
114 #ifndef YY_INITIAL_VALUE
115 # define YY_INITIAL_VALUE(Value) /* Nothing. */
116 #endif
117 
118 /* Debug traces. */
119 #ifndef YYDEBUG
120 # define YYDEBUG 1
121 #endif
122 
123 
124 namespace tlyy {
125 #line 126 "parsetl.hh" // lalr1.cc:377
126 
127 
128 
129 
130 
132  class parser
133  {
134  public:
135 #ifndef YYSTYPE
136  union semantic_type
138  {
139  #line 49 "parsetl.yy" // lalr1.cc:377
140 
141  std::string* str;
142  const spot::fnode* ltl;
143  unsigned num;
144  minmax_t minmax;
145 
146 #line 147 "parsetl.hh" // lalr1.cc:377
147  };
148 #else
149  typedef YYSTYPE semantic_type;
150 #endif
151  typedef spot::location location_type;
153 
155  struct syntax_error : std::runtime_error
156  {
157  syntax_error (const location_type& l, const std::string& m);
158  location_type location;
159  };
160 
162  struct token
163  {
164  enum yytokentype
165  {
166  START_LTL = 258,
167  START_LBT = 259,
168  START_SERE = 260,
169  START_BOOL = 261,
170  PAR_OPEN = 262,
171  PAR_CLOSE = 263,
172  PAR_BLOCK = 264,
173  BRA_BLOCK = 265,
174  BRA_BANG_BLOCK = 266,
175  BRACE_OPEN = 267,
176  BRACE_CLOSE = 268,
177  BRACE_BANG_CLOSE = 269,
178  OP_OR = 270,
179  OP_XOR = 271,
180  OP_AND = 272,
181  OP_SHORT_AND = 273,
182  OP_IMPLIES = 274,
183  OP_EQUIV = 275,
184  OP_U = 276,
185  OP_R = 277,
186  OP_W = 278,
187  OP_M = 279,
188  OP_F = 280,
189  OP_G = 281,
190  OP_X = 282,
191  OP_NOT = 283,
192  OP_STAR = 284,
193  OP_BSTAR = 285,
194  OP_BFSTAR = 286,
195  OP_PLUS = 287,
196  OP_FPLUS = 288,
197  OP_STAR_OPEN = 289,
198  OP_FSTAR_OPEN = 290,
199  OP_EQUAL_OPEN = 291,
200  OP_GOTO_OPEN = 292,
201  OP_SQBKT_CLOSE = 293,
202  OP_SQBKT_NUM = 294,
203  OP_UNBOUNDED = 295,
204  OP_SQBKT_SEP = 296,
205  OP_UCONCAT = 297,
206  OP_ECONCAT = 298,
207  OP_UCONCAT_NONO = 299,
208  OP_ECONCAT_NONO = 300,
209  ATOMIC_PROP = 301,
210  OP_CONCAT = 302,
211  OP_FUSION = 303,
212  CONST_TRUE = 304,
213  CONST_FALSE = 305,
214  END_OF_INPUT = 306,
215  OP_POST_NEG = 307,
216  OP_POST_POS = 308
217  };
218  };
219 
221  typedef token::yytokentype token_type;
222 
224  typedef int symbol_number_type;
225 
227  enum { empty_symbol = -2 };
228 
230  typedef unsigned char token_number_type;
231 
238  template <typename Base>
239  struct basic_symbol : Base
240  {
242  typedef Base super_type;
243 
245  basic_symbol ();
246 
248  basic_symbol (const basic_symbol& other);
249 
251  basic_symbol (typename Base::kind_type t,
252  const location_type& l);
253 
255  basic_symbol (typename Base::kind_type t,
256  const semantic_type& v,
257  const location_type& l);
258 
260  ~basic_symbol ();
261 
263  void clear ();
264 
266  bool empty () const;
267 
269  void move (basic_symbol& s);
270 
272  semantic_type value;
273 
275  location_type location;
276 
277  private:
279  basic_symbol& operator= (const basic_symbol& other);
280  };
281 
283  struct by_type
284  {
286  by_type ();
287 
289  by_type (const by_type& other);
290 
292  typedef token_type kind_type;
293 
295  by_type (kind_type t);
296 
298  void clear ();
299 
301  void move (by_type& that);
302 
305  symbol_number_type type_get () const;
306 
308  token_type token () const;
309 
313  int type;
314  };
315 
318 
319 
321  parser (spot::parse_error_list &error_list_yyarg, spot::environment &parse_environment_yyarg, spot::formula &result_yyarg);
322  virtual ~parser ();
323 
326  virtual int parse ();
327 
328 #if YYDEBUG
329  std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
332  void set_debug_stream (std::ostream &);
333 
335  typedef int debug_level_type;
337  debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
339  void set_debug_level (debug_level_type l);
340 #endif
341 
345  virtual void error (const location_type& loc, const std::string& msg);
346 
348  void error (const syntax_error& err);
349 
350  private:
352  parser (const parser&);
353  parser& operator= (const parser&);
354 
356  typedef int state_type;
357 
361  virtual std::string yysyntax_error_ (state_type yystate,
362  const symbol_type& yyla) const;
363 
367  state_type yy_lr_goto_state_ (state_type yystate, int yysym);
368 
371  static bool yy_pact_value_is_default_ (int yyvalue);
372 
375  static bool yy_table_value_is_error_ (int yyvalue);
376 
377  static const signed char yypact_ninf_;
378  static const signed char yytable_ninf_;
379 
381  static token_number_type yytranslate_ (int t);
382 
383  // Tables.
384  // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
385  // STATE-NUM.
386  static const short int yypact_[];
387 
388  // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
389  // Performed when YYTABLE does not specify something else to do. Zero
390  // means the default is an error.
391  static const unsigned char yydefact_[];
392 
393  // YYPGOTO[NTERM-NUM].
394  static const short int yypgoto_[];
395 
396  // YYDEFGOTO[NTERM-NUM].
397  static const short int yydefgoto_[];
398 
399  // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
400  // positive, shift that token. If negative, reduce the rule whose
401  // number is the opposite. If YYTABLE_NINF, syntax error.
402  static const short int yytable_[];
403 
404  static const short int yycheck_[];
405 
406  // YYSTOS[STATE-NUM] -- The (internal number of the) accessing
407  // symbol of state STATE-NUM.
408  static const unsigned char yystos_[];
409 
410  // YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
411  static const unsigned char yyr1_[];
412 
413  // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
414  static const unsigned char yyr2_[];
415 
416 
418  static std::string yytnamerr_ (const char *n);
419 
420 
422  static const char* const yytname_[];
423 #if YYDEBUG
424  // YYRLINE[YYN] -- Source line where rule number YYN was defined.
425  static const unsigned short int yyrline_[];
427  virtual void yy_reduce_print_ (int r);
429  virtual void yystack_print_ ();
430 
431  // Debugging.
432  int yydebug_;
433  std::ostream* yycdebug_;
434 
438  template <typename Base>
439  void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
440 #endif
441 
446  template <typename Base>
447  void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
448 
449  private:
451  struct by_state
452  {
454  by_state ();
455 
457  typedef state_type kind_type;
458 
460  by_state (kind_type s);
461 
463  by_state (const by_state& other);
464 
466  void clear ();
467 
469  void move (by_state& that);
470 
473  symbol_number_type type_get () const;
474 
476  enum { empty_state = -1 };
477 
480  state_type state;
481  };
482 
484  struct stack_symbol_type : basic_symbol<by_state>
485  {
487  typedef basic_symbol<by_state> super_type;
489  stack_symbol_type ();
491  stack_symbol_type (state_type s, symbol_type& sym);
493  stack_symbol_type& operator= (const stack_symbol_type& that);
494  };
495 
498 
500  stack_type yystack_;
501 
507  void yypush_ (const char* m, stack_symbol_type& s);
508 
515  void yypush_ (const char* m, state_type s, symbol_type& sym);
516 
518  void yypop_ (unsigned int n = 1);
519 
521  enum
522  {
523  yyeof_ = 0,
524  yylast_ = 1425,
525  yynnts_ = 21,
526  yyfinal_ = 69,
527  yyterror_ = 1,
528  yyerrcode_ = 256,
529  yyntokens_ = 70
530  };
531 
532 
533  // User arguments.
534  spot::parse_error_list &error_list;
535  spot::environment &parse_environment;
536  spot::formula &result;
537  };
538 
539 
540 
541 } // tlyy
542 #line 543 "parsetl.hh" // lalr1.cc:377
543 
544 
545 
546 
547 #endif // !YY_TLYY_PARSETL_HH_INCLUDED
spot::location location_type
Symbol locations.
Definition: parsetl.hh:152
Definition: parsetl.hh:124
Symbol semantic values.
Definition: parsetl.hh:137
Type access provider for token (enum) based symbols.
Definition: parsetl.hh:283
An environment that describes atomic propositions.
Definition: environment.hh:32
LTL/PSL formula interface.
A Bison parser.
Definition: parsetl.hh:132
Definition: formula.hh:1703
semantic_type value
The semantic value.
Definition: parsetl.hh:272
int symbol_number_type
Symbol type: an internal symbol number.
Definition: parsetl.hh:224
Main class for temporal logic formula.
Definition: formula.hh:682
token_type kind_type
The symbol type as needed by the constructor.
Definition: parsetl.hh:292
std::list< one_parse_error > parse_error_list
A list of parser diagnostics, as filled by parse.
Definition: parse.hh:42
location_type location
The location.
Definition: parsetl.hh:275
basic_symbol< by_type > symbol_type
"External" symbols: returned by the scanner.
Definition: parsetl.hh:317
int debug_level_type
Type for debugging levels.
Definition: parsetl.hh:335
Tokens.
Definition: parsetl.hh:162
Definition: parsetl.hh:51
token::yytokentype token_type
(External) token type, as returned by yylex.
Definition: parsetl.hh:221
Definition: parsetl.hh:239
Actual storage for formula nodes.
Definition: formula.hh:110
Definition: parseaut.hh:379
Syntax errors thrown from user actions.
Definition: parsetl.hh:155
int type
Definition: parsetl.hh:313
Base super_type
Alias to Base.
Definition: parsetl.hh:242
unsigned char token_number_type
Internal symbol number for tokens (subsumed by symbol_number_type).
Definition: parsetl.hh:230

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Fri Feb 27 2015 10:00:07 for spot by doxygen 1.8.13