spot  2.6
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 "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 50 "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_STAR = 284,
194  OP_BSTAR = 285,
195  OP_BFSTAR = 286,
196  OP_PLUS = 287,
197  OP_FPLUS = 288,
198  OP_STAR_OPEN = 289,
199  OP_FSTAR_OPEN = 290,
200  OP_EQUAL_OPEN = 291,
201  OP_GOTO_OPEN = 292,
202  OP_SQBKT_CLOSE = 293,
203  OP_SQBKT_NUM = 294,
204  OP_UNBOUNDED = 295,
205  OP_SQBKT_SEP = 296,
206  OP_UCONCAT = 297,
207  OP_ECONCAT = 298,
208  OP_UCONCAT_NONO = 299,
209  OP_ECONCAT_NONO = 300,
210  ATOMIC_PROP = 301,
211  OP_CONCAT = 302,
212  OP_FUSION = 303,
213  CONST_TRUE = 304,
214  CONST_FALSE = 305,
215  END_OF_INPUT = 306,
216  OP_POST_NEG = 307,
217  OP_POST_POS = 308
218  };
219  };
220 
222  typedef token::yytokentype token_type;
223 
225  typedef int symbol_number_type;
226 
228  enum { empty_symbol = -2 };
229 
231  typedef unsigned char token_number_type;
232 
239  template <typename Base>
240  struct basic_symbol : Base
241  {
243  typedef Base super_type;
244 
246  basic_symbol ();
247 
249  basic_symbol (const basic_symbol& other);
250 
252  basic_symbol (typename Base::kind_type t,
253  const location_type& l);
254 
256  basic_symbol (typename Base::kind_type t,
257  const semantic_type& v,
258  const location_type& l);
259 
261  ~basic_symbol ();
262 
264  void clear ();
265 
267  bool empty () const;
268 
270  void move (basic_symbol& s);
271 
273  semantic_type value;
274 
276  location_type location;
277 
278  private:
280  basic_symbol& operator= (const basic_symbol& other);
281  };
282 
284  struct by_type
285  {
287  by_type ();
288 
290  by_type (const by_type& other);
291 
293  typedef token_type kind_type;
294 
296  by_type (kind_type t);
297 
299  void clear ();
300 
302  void move (by_type& that);
303 
306  symbol_number_type type_get () const;
307 
309  token_type token () const;
310 
314  int type;
315  };
316 
319 
320 
322  parser (spot::parse_error_list &error_list_yyarg, spot::environment &parse_environment_yyarg, spot::formula &result_yyarg);
323  virtual ~parser ();
324 
327  virtual int parse ();
328 
329 #if YYDEBUG
330  std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
333  void set_debug_stream (std::ostream &);
334 
336  typedef int debug_level_type;
338  debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
340  void set_debug_level (debug_level_type l);
341 #endif
342 
346  virtual void error (const location_type& loc, const std::string& msg);
347 
349  void error (const syntax_error& err);
350 
351  private:
353  parser (const parser&);
354  parser& operator= (const parser&);
355 
357  typedef int state_type;
358 
362  virtual std::string yysyntax_error_ (state_type yystate,
363  const symbol_type& yyla) const;
364 
368  state_type yy_lr_goto_state_ (state_type yystate, int yysym);
369 
372  static bool yy_pact_value_is_default_ (int yyvalue);
373 
376  static bool yy_table_value_is_error_ (int yyvalue);
377 
378  static const signed char yypact_ninf_;
379  static const signed char yytable_ninf_;
380 
382  static token_number_type yytranslate_ (int t);
383 
384  // Tables.
385  // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
386  // STATE-NUM.
387  static const short int yypact_[];
388 
389  // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
390  // Performed when YYTABLE does not specify something else to do. Zero
391  // means the default is an error.
392  static const unsigned char yydefact_[];
393 
394  // YYPGOTO[NTERM-NUM].
395  static const short int yypgoto_[];
396 
397  // YYDEFGOTO[NTERM-NUM].
398  static const short int yydefgoto_[];
399 
400  // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
401  // positive, shift that token. If negative, reduce the rule whose
402  // number is the opposite. If YYTABLE_NINF, syntax error.
403  static const short int yytable_[];
404 
405  static const short int yycheck_[];
406 
407  // YYSTOS[STATE-NUM] -- The (internal number of the) accessing
408  // symbol of state STATE-NUM.
409  static const unsigned char yystos_[];
410 
411  // YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
412  static const unsigned char yyr1_[];
413 
414  // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
415  static const unsigned char yyr2_[];
416 
417 
419  static std::string yytnamerr_ (const char *n);
420 
421 
423  static const char* const yytname_[];
424 #if YYDEBUG
425  // YYRLINE[YYN] -- Source line where rule number YYN was defined.
426  static const unsigned short int yyrline_[];
428  virtual void yy_reduce_print_ (int r);
430  virtual void yystack_print_ ();
431 
432  // Debugging.
433  int yydebug_;
434  std::ostream* yycdebug_;
435 
439  template <typename Base>
440  void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
441 #endif
442 
447  template <typename Base>
448  void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
449 
450  private:
452  struct by_state
453  {
455  by_state ();
456 
458  typedef state_type kind_type;
459 
461  by_state (kind_type s);
462 
464  by_state (const by_state& other);
465 
467  void clear ();
468 
470  void move (by_state& that);
471 
474  symbol_number_type type_get () const;
475 
477  enum { empty_state = -1 };
478 
481  state_type state;
482  };
483 
485  struct stack_symbol_type : basic_symbol<by_state>
486  {
488  typedef basic_symbol<by_state> super_type;
490  stack_symbol_type ();
492  stack_symbol_type (state_type s, symbol_type& sym);
494  stack_symbol_type& operator= (const stack_symbol_type& that);
495  };
496 
499 
501  stack_type yystack_;
502 
508  void yypush_ (const char* m, stack_symbol_type& s);
509 
516  void yypush_ (const char* m, state_type s, symbol_type& sym);
517 
519  void yypop_ (unsigned int n = 1);
520 
522  enum
523  {
524  yyeof_ = 0,
525  yylast_ = 1425,
526  yynnts_ = 21,
527  yyfinal_ = 69,
528  yyterror_ = 1,
529  yyerrcode_ = 256,
530  yyntokens_ = 70
531  };
532 
533 
534  // User arguments.
535  spot::parse_error_list &error_list;
536  spot::environment &parse_environment;
537  spot::formula &result;
538  };
539 
540 
541 
542 } // tlyy
543 #line 544 "parsetl.hh" // lalr1.cc:377
544 
545 
546 
547 
548 #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:284
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:273
int symbol_number_type
Symbol type: an internal symbol number.
Definition: parsetl.hh:225
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:293
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:276
basic_symbol< by_type > symbol_type
"External" symbols: returned by the scanner.
Definition: parsetl.hh:318
int debug_level_type
Type for debugging levels.
Definition: parsetl.hh:336
Tokens.
Definition: parsetl.hh:163
Definition: parsetl.hh:52
token::yytokentype token_type
(External) token type, as returned by yylex.
Definition: parsetl.hh:222
Definition: parsetl.hh:240
Actual storage for formula nodes.
Definition: formula.hh:110
Definition: parseaut.hh:391
Syntax errors thrown from user actions.
Definition: parsetl.hh:156
int type
Definition: parsetl.hh:314
Base super_type
Alias to Base.
Definition: parsetl.hh:243
unsigned char token_number_type
Internal symbol number for tokens (subsumed by symbol_number_type).
Definition: parsetl.hh:231

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