Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
parse.hh
Go to the documentation of this file.
1 // A Bison parser, made by GNU Bison 3.0.2.13-aa0e.
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_YY_USERS_AKIM_SRC_LRDE_VAUCANSON2_LIB_VCSN_RAT_PARSE_HH_INCLUDED
41 # define YY_YY_USERS_AKIM_SRC_LRDE_VAUCANSON2_LIB_VCSN_RAT_PARSE_HH_INCLUDED
42 // // "%code requires" blocks.
43 #line 16 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/rat/parse.yy" // lalr1.cc:372
44 
45  #include <iostream>
46  #include <set>
47  #include <string>
48  #include <tuple>
49  #include "location.hh"
50  #include <vcsn/core/rat/ratexp.hh>
51  #include <lib/vcsn/rat/fwd.hh>
52 
53  namespace vcsn
54  {
55  namespace rat
56  {
58  {
62  bool lparen = false;
64  bool rparen = false;
66  {
67  exp = e;
68  return *this;
69  }
70  };
71 
72  using irange_type = std::tuple<int, int>;
73  }
74  }
75 
76 #line 77 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/rat/parse.hh" // lalr1.cc:372
77 
78 
79 # include <vector>
80 # include <iostream>
81 # include <stdexcept>
82 # include <string>
83 # include "stack.hh"
84 # include "location.hh"
85 
86 #ifndef YYASSERT
87 # include <cassert>
88 # define YYASSERT assert
89 #endif
90 
91 
92 #ifndef YY_ATTRIBUTE
93 # if (defined __GNUC__ \
94  && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
95  || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
96 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
97 # else
98 # define YY_ATTRIBUTE(Spec) /* empty */
99 # endif
100 #endif
101 
102 #ifndef YY_ATTRIBUTE_PURE
103 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
104 #endif
105 
106 #ifndef YY_ATTRIBUTE_UNUSED
107 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
108 #endif
109 
110 #if !defined _Noreturn \
111  && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
112 # if defined _MSC_VER && 1200 <= _MSC_VER
113 # define _Noreturn __declspec (noreturn)
114 # else
115 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
116 # endif
117 #endif
118 
119 /* Suppress unused-variable warnings by "using" E. */
120 #if ! defined lint || defined __GNUC__
121 # define YYUSE(E) ((void) (E))
122 #else
123 # define YYUSE(E) /* empty */
124 #endif
125 
126 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
127 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
128 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
129  _Pragma ("GCC diagnostic push") \
130  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
131  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
132 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
133  _Pragma ("GCC diagnostic pop")
134 #else
135 # define YY_INITIAL_VALUE(Value) Value
136 #endif
137 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
138 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
139 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
140 #endif
141 #ifndef YY_INITIAL_VALUE
142 # define YY_INITIAL_VALUE(Value) /* Nothing. */
143 #endif
144 
145 /* Debug traces. */
146 #ifndef YYDEBUG
147 # define YYDEBUG 1
148 #endif
149 
150 #line 11 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/rat/parse.yy" // lalr1.cc:372
151 namespace vcsn { namespace rat {
152 #line 153 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/rat/parse.hh" // lalr1.cc:372
153 
154 
155 
161  template <size_t S>
162  struct variant
163  {
166 
169  {}
170 
172  template <typename T>
173  variant (const T& t)
174  {
175  YYASSERT (sizeof (T) <= S);
176  new (yyas_<T> ()) T (t);
177  }
178 
181  {}
182 
184  template <typename T>
185  T&
186  build ()
187  {
188  return *new (yyas_<T> ()) T;
189  }
190 
192  template <typename T>
193  T&
194  build (const T& t)
195  {
196  return *new (yyas_<T> ()) T (t);
197  }
198 
200  template <typename T>
201  T&
202  as ()
203  {
204  return *yyas_<T> ();
205  }
206 
208  template <typename T>
209  const T&
210  as () const
211  {
212  return *yyas_<T> ();
213  }
214 
223  template <typename T>
224  void
225  swap (self_type& other)
226  {
227  std::swap (as<T> (), other.as<T> ());
228  }
229 
233  template <typename T>
234  void
235  move (self_type& other)
236  {
237  build<T> ();
238  swap<T> (other);
239  other.destroy<T> ();
240  }
241 
243  template <typename T>
244  void
245  copy (const self_type& other)
246  {
247  build<T> (other.as<T> ());
248  }
249 
251  template <typename T>
252  void
254  {
255  as<T> ().~T ();
256  }
257 
258  private:
260  self_type& operator=(const self_type&);
261  variant (const self_type&);
262 
264  template <typename T>
265  T*
266  yyas_ ()
267  {
268  void *yyp = yybuffer_.yyraw;
269  return static_cast<T*> (yyp);
270  }
271 
273  template <typename T>
274  const T*
275  yyas_ () const
276  {
277  const void *yyp = yybuffer_.yyraw;
278  return static_cast<const T*> (yyp);
279  }
280 
281  union
282  {
284  long double yyalign_me;
286  char yyraw[S];
287  } yybuffer_;
288  };
289 
290 
292  class parser
293  {
294  public:
295 #ifndef YYSTYPE
296  union union_type
298  {
299  // input
300  // exp
301  // weights
302  char dummy1[sizeof(braced_ratexp)];
303 
304  // "*"
305  char dummy2[sizeof(irange_type)];
306 
307  // class
308  char dummy3[sizeof(std::set<std::pair<std::string,std::string>>)];
309 
310  // "letter"
311  // "weight"
312  char dummy4[sizeof(std::string)];
313 };
314 
317 #else
318  typedef YYSTYPE semantic_type;
319 #endif
320  typedef location location_type;
322 
324  struct syntax_error : std::runtime_error
325  {
326  syntax_error (const location_type& l, const std::string& m);
328  };
329 
331  struct token
332  {
334  {
335  END = 0,
336  AMPERSAND = 258,
337  BACKSLASH = 259,
338  CARET = 260,
339  COLON = 261,
340  COMMA = 262,
341  COMPLEMENT = 263,
342  DASH = 264,
343  DOT = 265,
344  LBRACKET = 266,
345  LPAREN = 267,
346  ONE = 268,
347  PERCENT = 269,
348  PLUS = 270,
349  LT_PLUS = 271,
350  RBRACKET = 272,
351  RPAREN = 273,
353  SLASH = 275,
354  ZERO = 276,
355  STAR = 277,
356  LETTER = 278,
357  WEIGHT = 279,
358  CONCAT = 280,
359  RWEIGHT = 281,
360  LWEIGHT = 282
361  };
362  };
363 
366 
368  typedef int symbol_number_type;
369 
371  typedef unsigned char token_number_type;
372 
379  template <typename Base>
381  {
383  typedef Base super_type;
384 
386  basic_symbol ();
387 
389  basic_symbol (const basic_symbol& other);
390 
392 
393  basic_symbol (typename Base::kind_type t, const location_type& l);
394 
395  basic_symbol (typename Base::kind_type t, const braced_ratexp v, const location_type& l);
396 
397  basic_symbol (typename Base::kind_type t, const irange_type v, const location_type& l);
398 
399  basic_symbol (typename Base::kind_type t, const std::set<std::pair<std::string, std::string>> v, const location_type& l);
400 
401  basic_symbol (typename Base::kind_type t, const std::string v, const location_type& l);
402 
403 
405  basic_symbol (typename Base::kind_type t,
406  const semantic_type& v,
407  const location_type& l);
408 
409  ~basic_symbol ();
410 
412  void move (basic_symbol& s);
413 
416 
419 
420  private:
422  basic_symbol& operator= (const basic_symbol& other);
423  };
424 
426  struct by_type
427  {
429  by_type ();
430 
432  by_type (const by_type& other);
433 
436 
438  by_type (kind_type t);
439 
441  void move (by_type& that);
442 
445  symbol_number_type type_get () const;
446 
448  token_type token () const;
449 
450  enum { empty = 0 };
451 
455  };
456 
459 
460  // Symbol constructors declarations.
461  static inline
463  make_END (const location_type& l);
464 
465  static inline
467  make_AMPERSAND (const location_type& l);
468 
469  static inline
471  make_BACKSLASH (const location_type& l);
472 
473  static inline
475  make_CARET (const location_type& l);
476 
477  static inline
479  make_COLON (const location_type& l);
480 
481  static inline
483  make_COMMA (const location_type& l);
484 
485  static inline
487  make_COMPLEMENT (const location_type& l);
488 
489  static inline
491  make_DASH (const location_type& l);
492 
493  static inline
495  make_DOT (const location_type& l);
496 
497  static inline
499  make_LBRACKET (const location_type& l);
500 
501  static inline
503  make_LPAREN (const location_type& l);
504 
505  static inline
507  make_ONE (const location_type& l);
508 
509  static inline
511  make_PERCENT (const location_type& l);
512 
513  static inline
515  make_PLUS (const location_type& l);
516 
517  static inline
519  make_LT_PLUS (const location_type& l);
520 
521  static inline
523  make_RBRACKET (const location_type& l);
524 
525  static inline
527  make_RPAREN (const location_type& l);
528 
529  static inline
532 
533  static inline
535  make_SLASH (const location_type& l);
536 
537  static inline
539  make_ZERO (const location_type& l);
540 
541  static inline
543  make_STAR (const irange_type& v, const location_type& l);
544 
545  static inline
547  make_LETTER (const std::string& v, const location_type& l);
548 
549  static inline
551  make_WEIGHT (const std::string& v, const location_type& l);
552 
553  static inline
555  make_CONCAT (const location_type& l);
556 
557  static inline
559  make_RWEIGHT (const location_type& l);
560 
561  static inline
563  make_LWEIGHT (const location_type& l);
564 
565 
567  parser (driver& driver__yyarg);
568  virtual ~parser ();
569 
572  virtual int parse ();
573 
574 #if YYDEBUG
575  std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
578  void set_debug_stream (std::ostream &);
579 
581  typedef int debug_level_type;
583  debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
585  void set_debug_level (debug_level_type l);
586 #endif
587 
591  virtual void error (const location_type& loc, const std::string& msg);
592 
594  void error (const syntax_error& err);
595 
596  private:
598  parser (const parser&);
599  parser& operator= (const parser&);
600 
602  typedef int state_type;
603 
607  virtual std::string yysyntax_error_ (state_type yystate,
608  symbol_number_type yytoken) const;
609 
613  state_type yy_lr_goto_state_ (state_type yystate, int yysym);
614 
617  static bool yy_pact_value_is_default_ (int yyvalue);
618 
621  static bool yy_table_value_is_error_ (int yyvalue);
622 
623  static const signed char yypact_ninf_;
624  static const signed char yytable_ninf_;
625 
628 
629  // Tables.
630  // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
631  // STATE-NUM.
632  static const short int yypact_[];
633 
634  // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
635  // Performed when YYTABLE does not specify something else to do. Zero
636  // means the default is an error.
637  static const unsigned char yydefact_[];
638 
639  // YYPGOTO[NTERM-NUM].
640  static const signed char yypgoto_[];
641 
642  // YYDEFGOTO[NTERM-NUM].
643  static const signed char yydefgoto_[];
644 
645  // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
646  // positive, shift that token. If negative, reduce the rule whose
647  // number is the opposite. If YYTABLE_NINF, syntax error.
648  static const unsigned char yytable_[];
649 
650  static const signed char yycheck_[];
651 
652  // YYSTOS[STATE-NUM] -- The (internal number of the) accessing
653  // symbol of state STATE-NUM.
654  static const unsigned char yystos_[];
655 
656  // YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
657  static const unsigned char yyr1_[];
658 
659  // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
660  static const unsigned char yyr2_[];
661 
662 
664  static std::string yytnamerr_ (const char *n);
665 
666 
668  static const char* const yytname_[];
669 #if YYDEBUG
670  // YYRLINE[YYN] -- Source line where rule number YYN was defined.
671  static const unsigned char yyrline_[];
673  virtual void yy_reduce_print_ (int r);
675  virtual void yystack_print_ ();
676 
677  // Debugging.
678  int yydebug_;
679  std::ostream* yycdebug_;
680 
684  template <typename Base>
685  void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
686 #endif
687 
692  template <typename Base>
693  void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
694 
695  private:
697  struct by_state
698  {
700  by_state ();
701 
704 
706  by_state (kind_type s);
707 
709  by_state (const by_state& other);
710 
712  void move (by_state& that);
713 
716  symbol_number_type type_get () const;
717 
718  enum { empty = 0 };
719 
722  };
723 
725  struct stack_symbol_type : basic_symbol<by_state>
726  {
735  };
736 
739 
742 
748  void yypush_ (const char* m, stack_symbol_type& s);
749 
756  void yypush_ (const char* m, state_type s, symbol_type& sym);
757 
759  void yypop_ (unsigned int n = 1);
760 
761  // Constants.
762  enum
763  {
764  yyeof_ = 0,
765  yylast_ = 191,
766  yynnts_ = 6,
767  yyempty_ = -2,
768  yyfinal_ = 14,
770  yyerrcode_ = 256,
772  };
773 
774 
775  // User arguments.
777  };
778 
779  // Symbol number corresponding to token number t.
780  inline
783  {
784  static
785  const token_number_type
786  translate_table[] =
787  {
788  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
789  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
790  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
791  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
792  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
793  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
794  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
795  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
796  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
797  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
798  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
799  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
800  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
801  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
802  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
803  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
804  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
805  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
806  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
807  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
808  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
809  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
810  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
811  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
812  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
813  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
814  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
815  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
816  25, 26, 27
817  };
818  const unsigned int user_token_number_max_ = 282;
819  const token_number_type undef_token_ = 2;
820 
821  if (static_cast<int>(t) <= yyeof_)
822  return yyeof_;
823  else if (static_cast<unsigned int> (t) <= user_token_number_max_)
824  return translate_table[t];
825  else
826  return undef_token_;
827  }
828 
829  inline
830  parser::syntax_error::syntax_error (const location_type& l, const std::string& m)
831  : std::runtime_error (m)
832  , location (l)
833  {}
834 
835  // basic_symbol.
836  template <typename Base>
837  inline
839  : value ()
840  {}
841 
842  template <typename Base>
843  inline
845  : Base (other)
846  , value ()
847  , location (other.location)
848  {
849  switch (other.type_get ())
850  {
851  case 29: // input
852  case 31: // exp
853  case 32: // weights
854  value.copy< braced_ratexp > (other.value);
855  break;
856 
857  case 22: // "*"
858  value.copy< irange_type > (other.value);
859  break;
860 
861  case 33: // class
862  value.copy< std::set<std::pair<std::string,std::string>> > (other.value);
863  break;
864 
865  case 23: // "letter"
866  case 24: // "weight"
867  value.copy< std::string > (other.value);
868  break;
869 
870  default:
871  break;
872  }
873 
874  }
875 
876 
877  template <typename Base>
878  inline
879  parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const semantic_type& v, const location_type& l)
880  : Base (t)
881  , value ()
882  , location (l)
883  {
884  (void) v;
885  switch (this->type_get ())
886  {
887  case 29: // input
888  case 31: // exp
889  case 32: // weights
890  value.copy< braced_ratexp > (v);
891  break;
892 
893  case 22: // "*"
894  value.copy< irange_type > (v);
895  break;
896 
897  case 33: // class
898  value.copy< std::set<std::pair<std::string,std::string>> > (v);
899  break;
900 
901  case 23: // "letter"
902  case 24: // "weight"
903  value.copy< std::string > (v);
904  break;
905 
906  default:
907  break;
908  }
909 }
910 
911 
912  // Implementation of basic_symbol constructor for each type.
913 
914  template <typename Base>
915  parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const location_type& l)
916  : Base (t)
917  , value ()
918  , location (l)
919  {}
920 
921  template <typename Base>
922  parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const braced_ratexp v, const location_type& l)
923  : Base (t)
924  , value (v)
925  , location (l)
926  {}
927 
928  template <typename Base>
929  parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const irange_type v, const location_type& l)
930  : Base (t)
931  , value (v)
932  , location (l)
933  {}
934 
935  template <typename Base>
936  parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const std::set<std::pair<std::string, std::string>> v, const location_type& l)
937  : Base (t)
938  , value (v)
939  , location (l)
940  {}
941 
942  template <typename Base>
943  parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const std::string v, const location_type& l)
944  : Base (t)
945  , value (v)
946  , location (l)
947  {}
948 
949 
950  template <typename Base>
951  inline
953  {
954  // User destructor.
955  symbol_number_type yytype = this->type_get ();
956  semantic_type* yyvaluep = &value;
957  (void) yyvaluep;
958  switch (yytype)
959  {
960  default:
961  break;
962  }
963 
964  // Type destructor.
965  switch (yytype)
966  {
967  case 29: // input
968  case 31: // exp
969  case 32: // weights
970  value.template destroy< braced_ratexp > ();
971  break;
972 
973  case 22: // "*"
974  value.template destroy< irange_type > ();
975  break;
976 
977  case 33: // class
978  value.template destroy< std::set<std::pair<std::string,std::string>> > ();
979  break;
980 
981  case 23: // "letter"
982  case 24: // "weight"
983  value.template destroy< std::string > ();
984  break;
985 
986  default:
987  break;
988  }
989 
990  }
991 
992  template <typename Base>
993  inline
994  void
996  {
997  super_type::move(s);
998  switch (this->type_get ())
999  {
1000  case 29: // input
1001  case 31: // exp
1002  case 32: // weights
1003  value.move< braced_ratexp > (s.value);
1004  break;
1005 
1006  case 22: // "*"
1007  value.move< irange_type > (s.value);
1008  break;
1009 
1010  case 33: // class
1011  value.move< std::set<std::pair<std::string,std::string>> > (s.value);
1012  break;
1013 
1014  case 23: // "letter"
1015  case 24: // "weight"
1016  value.move< std::string > (s.value);
1017  break;
1018 
1019  default:
1020  break;
1021  }
1022 
1023  location = s.location;
1024  }
1025 
1026  // by_type.
1027  inline
1029  : type (empty)
1030  {}
1031 
1032  inline
1034  : type (other.type)
1035  {}
1036 
1037  inline
1039  : type (yytranslate_ (t))
1040  {}
1041 
1042  inline
1043  void
1045  {
1046  type = that.type;
1047  that.type = empty;
1048  }
1049 
1050  inline
1051  int
1053  {
1054  return type;
1055  }
1056 
1057  inline
1060  {
1061  // YYTOKNUM[NUM] -- (External) token number corresponding to the
1062  // (internal) symbol number NUM (which must be that of a token). */
1063  static
1064  const unsigned short int
1065  yytoken_number_[] =
1066  {
1067  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1068  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1069  275, 276, 277, 278, 279, 280, 281, 282
1070  };
1071  return static_cast<token_type> (yytoken_number_[type]);
1072  }
1073  // Implementation of make_symbol for each symbol type.
1076  {
1077  return symbol_type (token::END, l);
1078  }
1079 
1082  {
1083  return symbol_type (token::AMPERSAND, l);
1084  }
1085 
1088  {
1089  return symbol_type (token::BACKSLASH, l);
1090  }
1091 
1094  {
1095  return symbol_type (token::CARET, l);
1096  }
1097 
1100  {
1101  return symbol_type (token::COLON, l);
1102  }
1103 
1106  {
1107  return symbol_type (token::COMMA, l);
1108  }
1109 
1112  {
1113  return symbol_type (token::COMPLEMENT, l);
1114  }
1115 
1118  {
1119  return symbol_type (token::DASH, l);
1120  }
1121 
1124  {
1125  return symbol_type (token::DOT, l);
1126  }
1127 
1130  {
1131  return symbol_type (token::LBRACKET, l);
1132  }
1133 
1136  {
1137  return symbol_type (token::LPAREN, l);
1138  }
1139 
1142  {
1143  return symbol_type (token::ONE, l);
1144  }
1145 
1148  {
1149  return symbol_type (token::PERCENT, l);
1150  }
1151 
1154  {
1155  return symbol_type (token::PLUS, l);
1156  }
1157 
1160  {
1161  return symbol_type (token::LT_PLUS, l);
1162  }
1163 
1166  {
1167  return symbol_type (token::RBRACKET, l);
1168  }
1169 
1172  {
1173  return symbol_type (token::RPAREN, l);
1174  }
1175 
1178  {
1179  return symbol_type (token::TRANSPOSITION, l);
1180  }
1181 
1184  {
1185  return symbol_type (token::SLASH, l);
1186  }
1187 
1190  {
1191  return symbol_type (token::ZERO, l);
1192  }
1193 
1196  {
1197  return symbol_type (token::STAR, v, l);
1198  }
1199 
1201  parser::make_LETTER (const std::string& v, const location_type& l)
1202  {
1203  return symbol_type (token::LETTER, v, l);
1204  }
1205 
1207  parser::make_WEIGHT (const std::string& v, const location_type& l)
1208  {
1209  return symbol_type (token::WEIGHT, v, l);
1210  }
1211 
1214  {
1215  return symbol_type (token::CONCAT, l);
1216  }
1217 
1220  {
1221  return symbol_type (token::RWEIGHT, l);
1222  }
1223 
1226  {
1227  return symbol_type (token::LWEIGHT, l);
1228  }
1229 
1230 
1231 #line 11 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/rat/parse.yy" // lalr1.cc:372
1232 } } // vcsn::rat
1233 #line 1234 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/rat/parse.hh" // lalr1.cc:372
1234 
1235 
1236 // // "%code provides" blocks.
1237 #line 50 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/rat/parse.yy" // lalr1.cc:372
1238 
1239  #define YY_DECL_(Class) \
1240  parser::symbol_type Class lex(driver& driver_)
1241  #define YY_DECL YY_DECL_(yyFlexLexer::)
1242 
1243 #line 1244 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/rat/parse.hh" // lalr1.cc:372
1244 
1245 
1246 #endif // !YY_YY_USERS_AKIM_SRC_LRDE_VAUCANSON2_LIB_VCSN_RAT_PARSE_HH_INCLUDED
token_number_type type
The symbol type.
Definition: parse.hh:454
static symbol_type make_RBRACKET(const location_type &l)
Definition: parse.hh:1165
stack< stack_symbol_type > stack_type
Stack type.
Definition: parse.hh:738
virtual std::string yysyntax_error_(state_type yystate, symbol_number_type yytoken) const
Generate an error message.
Definition: parse.cc:1039
symbol_number_type type_get() const
The (internal) type number (corresponding to state).
Definition: parse.cc:275
void set_debug_level(debug_level_type l)
Set the current debugging level.
Definition: parse.cc:487
virtual void yystack_print_()
Print the state stack on the debug stream.
Definition: parse.cc:1274
char dummy4[sizeof(std::string)]
Definition: parse.hh:312
static symbol_type make_LETTER(const std::string &v, const location_type &l)
Definition: parse.hh:1201
static symbol_type make_ZERO(const location_type &l)
Definition: parse.hh:1189
Syntax errors thrown from user actions.
Definition: parse.hh:324
static symbol_type make_WEIGHT(const std::string &v, const location_type &l)
Definition: parse.hh:1207
Number of tokens.
Definition: parse.hh:771
long double yyalign_me
Strongest alignment constraints.
Definition: parse.hh:284
void copy(const self_type &other)
Copy the content of other to this.
Definition: parse.hh:245
"Internal" symbol: element of the stack.
Definition: parse.hh:725
static const unsigned char yyr2_[]
Definition: parse.hh:660
bool rparen
Whether there was a right-paren.
Definition: parse.hh:64
A Bison parser.
Definition: parse.hh:292
location_type location
The location.
Definition: parse.hh:418
char dummy1[sizeof(braced_ratexp)]
Definition: parse.hh:302
A char[S] buffer to store and retrieve objects.
Definition: parse.hh:162
by_state()
Default constructor.
Definition: parse.cc:251
static const signed char yytable_ninf_
Definition: parse.hh:624
token_type kind_type
The symbol type as needed by the constructor.
Definition: parse.hh:435
Termination state number.
Definition: parse.hh:768
token_type token() const
The token.
Definition: parse.hh:1059
location location_type
Symbol locations.
Definition: parse.hh:321
variant< S > self_type
Type of *this.
Definition: parse.hh:165
An auxiliary type to compute the largest semantic type.
Definition: parse.hh:297
state_type state
The state.
Definition: parse.hh:721
static const signed char yypact_ninf_
Definition: parse.hh:623
static symbol_type make_COMMA(const location_type &l)
Definition: parse.hh:1105
Type access provider for state based symbols.
Definition: parse.hh:697
char dummy2[sizeof(irange_type)]
Definition: parse.hh:305
int state_type
State numbers.
Definition: parse.hh:602
void yy_print_(std::ostream &yyo, const basic_symbol< Base > &yysym) const
Display a symbol type, value and location.
Definition: parse.cc:365
static symbol_type make_PERCENT(const location_type &l)
Definition: parse.hh:1147
variant(const T &t)
Construct and fill.
Definition: parse.hh:173
void destroy()
Destroy the stored T.
Definition: parse.hh:267
braced_ratexp & operator=(exp_t e)
Definition: parse.hh:65
static const signed char yypgoto_[]
Definition: parse.hh:640
#define YYASSERT
Definition: parse.hh:88
basic_symbol & operator=(const basic_symbol &other)
Assignment operator.
static symbol_type make_CONCAT(const location_type &l)
Definition: parse.hh:1213
variant< sizeof(union_type)> semantic_type
Symbol semantic values.
Definition: parse.hh:316
stack_type yystack_
The stack.
Definition: parse.hh:741
T & build(const T &t)
Instantiate a T in here from t.
Definition: parse.hh:194
void move(self_type &other)
Move the content of other to this.
Definition: parse.hh:235
static bool yy_table_value_is_error_(int yyvalue)
Whether the given yytable_ value indicates a syntax error.
Definition: parse.cc:510
driver & driver_
Definition: parse.hh:776
char yyraw[S]
A buffer large enough to store any of the semantic values.
Definition: parse.hh:286
A char[S] buffer to store and retrieve objects.
Definition: parse.hh:176
void yypop_(unsigned int n=1)
Pop n symbols the three stacks.
Definition: parse.cc:461
void move(basic_symbol &s)
Destructive move, s is emptied into this.
Definition: parse.hh:995
char dummy3[sizeof(std::set< std::pair< std::string, std::string >>)]
Definition: parse.hh:308
stack_symbol_type & operator=(const stack_symbol_type &that)
Assignment, needed by push_back.
Definition: parse.cc:320
static const signed char yycheck_[]
Definition: parse.hh:650
bool lparen
Whether there was a left-paren.
Definition: parse.hh:62
static const signed char yydefgoto_[]
Definition: parse.hh:643
parser & operator=(const parser &)
static symbol_type make_LBRACKET(const location_type &l)
Definition: parse.hh:1129
The abstract, non-parameterized, root for all rational expression node types.
Definition: ratexp.hh:20
syntax_error(const location_type &l, const std::string &m)
Definition: parse.hh:830
static symbol_type make_LWEIGHT(const location_type &l)
Definition: parse.hh:1225
State and public interface for rational expression parsing.
Definition: driver.hh:19
void swap(self_type &other)
Swap the content with other, of same type.
Definition: parse.hh:225
static symbol_type make_LT_PLUS(const location_type &l)
Definition: parse.hh:1159
Number of nonterminal symbols.
Definition: parse.hh:766
static const short int yypact_[]
Definition: parse.hh:632
static std::string yytnamerr_(const char *n)
Convert the symbol name n to a form suitable for a diagnostic.
Definition: parse.cc:197
static symbol_type make_AMPERSAND(const location_type &l)
Definition: parse.hh:1081
void yypush_(const char *m, stack_symbol_type &s)
Push a new state on the stack.
Definition: parse.cc:452
T & build()
Instantiate an empty T in here.
Definition: parse.hh:186
basic_symbol< by_state > super_type
Superclass.
Definition: parse.hh:728
debug_level_type debug_level() const
The current debugging level.
Definition: parse.cc:481
static symbol_type make_SLASH(const location_type &l)
Definition: parse.hh:1183
by_type()
Default constructor.
Definition: parse.hh:1028
int symbol_number_type
Internal symbol number.
Definition: parse.hh:368
semantic_type value
The semantic value.
Definition: parse.hh:415
parser(driver &driver__yyarg)
Build a parser object.
Definition: parse.cc:230
T & as()
Accessor to a built T.
Definition: parse.hh:216
static symbol_type make_RWEIGHT(const location_type &l)
Definition: parse.hh:1219
~variant()
Destruction, allowed only if empty.
Definition: parse.hh:180
static const unsigned char yyr1_[]
Definition: parse.hh:657
virtual int parse()
Parse.
Definition: parse.cc:516
static symbol_type make_RPAREN(const location_type &l)
Definition: parse.hh:1171
virtual void yy_reduce_print_(int r)
Report on the debug stream that the rule r is going to be reduced.
Definition: parse.cc:1287
static symbol_type make_BACKSLASH(const location_type &l)
Definition: parse.hh:1087
std::ostream * yycdebug_
Definition: parse.hh:679
Base super_type
Alias to Base.
Definition: parse.hh:383
Abstract a location.
Definition: location.hh:47
void set_debug_stream(std::ostream &)
Set the current debugging stream.
Definition: parse.cc:474
static const unsigned char yydefact_[]
Definition: parse.hh:637
stack_symbol_type()
Construct an empty symbol.
Definition: parse.cc:281
Define the vcsn::rat::location class.
unsigned char token_number_type
Internal symbol number for tokens (subsumed by symbol_number_type).
Definition: parse.hh:371
symbol_number_type type_get() const
The (internal) type number (corresponding to type).
Definition: parse.hh:1052
Type access provider for token (enum) based symbols.
Definition: parse.hh:426
static const unsigned char yystos_[]
Definition: parse.hh:654
Define the vcsn::rat::stack class.
static symbol_type make_CARET(const location_type &l)
Definition: parse.hh:1093
static symbol_type make_DOT(const location_type &l)
Definition: parse.hh:1123
variant()
Empty construction.
Definition: parse.hh:168
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
Definition: parse.cc:1361
static symbol_type make_ONE(const location_type &l)
Definition: parse.hh:1141
basic_symbol< by_type > symbol_type
"External" symbols: returned by the scanner.
Definition: parse.hh:458
void move(by_state &that)
Steal the symbol type from that.
Definition: parse.cc:262
static symbol_type make_STAR(const irange_type &v, const location_type &l)
Definition: parse.hh:1195
static token_number_type yytranslate_(token_type t)
Convert a scanner token number t to a symbol number.
Definition: parse.hh:782
Provide a variadic mul on top of a binary mul(), and one().
Definition: fwd.hh:36
std::shared_ptr< const exp > exp_t
Definition: fwd.hh:16
static const unsigned char yyrline_[]
Definition: parse.hh:671
static symbol_type make_DASH(const location_type &l)
Definition: parse.hh:1117
#define YY_ATTRIBUTE_PURE
Definition: parse.hh:103
void yy_destroy_(const char *yymsg, basic_symbol< Base > &yysym) const
Reclaim the memory associated to a symbol.
Definition: parse.cc:356
state_type yy_lr_goto_state_(state_type yystate, int yysym)
Compute post-reduction state.
Definition: parse.cc:494
static symbol_type make_END(const location_type &l)
Definition: parse.hh:1075
static symbol_type make_TRANSPOSITION(const location_type &l)
Definition: parse.hh:1177
static symbol_type make_COLON(const location_type &l)
Definition: parse.hh:1099
exp_t exp
The expression parsed so far.
Definition: parse.hh:60
static const char *const yytname_[]
For a symbol, its name in clear.
Definition: parse.hh:668
static const unsigned char yytable_[]
Definition: parse.hh:648
int debug_level_type
Type for debugging levels.
Definition: parse.hh:581
T & as()
Accessor to a built T.
Definition: parse.hh:202
union vcsn::rat::variant::@5 yybuffer_
const T & as() const
Const accessor to a built T (for printer).
Definition: parse.hh:210
static symbol_type make_LPAREN(const location_type &l)
Definition: parse.hh:1135
basic_symbol()
Default constructor.
Definition: parse.hh:838
self_type & operator=(const self_type &)
Prohibit blind copies.
std::tuple< int, int > irange_type
Definition: parse.hh:72
void move(by_type &that)
Steal the symbol type from that.
Definition: parse.hh:1044
const T * yyas_() const
Const accessor to raw memory as T.
Definition: parse.hh:275
T * yyas_()
Accessor to raw memory as T.
Definition: parse.hh:266
std::ostream & debug_stream() const
The current debugging stream.
Definition: parse.cc:468
static bool yy_pact_value_is_default_(int yyvalue)
Whether the given yypact_ value indicates a defaulted state.
Definition: parse.cc:504
state_type kind_type
The symbol type as needed by the constructor.
Definition: parse.hh:703
token::yytokentype token_type
(External) token type, as returned by yylex.
Definition: parse.hh:365
virtual ~parser()
Definition: parse.cc:239
void destroy()
Destroy the stored T.
Definition: parse.hh:253
static symbol_type make_PLUS(const location_type &l)
Definition: parse.hh:1153
Last index in yytable_.
Definition: parse.hh:765
A complete symbol.
Definition: parse.hh:380
static symbol_type make_COMPLEMENT(const location_type &l)
Definition: parse.hh:1111