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

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