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_DOT_PARSE_HH_INCLUDED
41 # define YY_YY_USERS_AKIM_SRC_LRDE_VAUCANSON2_LIB_VCSN_DOT_PARSE_HH_INCLUDED
42 // // "%code requires" blocks.
43 #line 17 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:372
44 
45  #include <iostream>
46  #include <string>
47 
48  #include <boost/flyweight.hpp>
49  #include <boost/flyweight/no_tracking.hpp>
50  #include <lib/vcsn/rat/location.hh>
51  #include <lib/vcsn/dot/driver.hh>
52 
53  namespace vcsn
54  {
55  namespace detail
56  {
57  namespace dot
58  {
59  // Identifiers (attributes and node names).
60  //
61  // With ref_counting I have a 20% penalty compared to using
62  // std::string. With no_tracking, I get a 10x speed up (e.g.,
63  // vcsn-cat of a determinized ladybird). But then we leak.
64  // We should try to have an arena in which the flyweight
65  // performs its allocation, and flush the whole arena once
66  // we're done parsing.
67  using string_t =
68  boost::flyweight<std::string, boost::flyweights::no_tracking>;
69 
70  // A set of states.
71  using states_t = std::vector<string_t>;
72 
73  // (Unlabeled) transitions.
74  using transitions_t = std::vector<std::pair<string_t, string_t>>;
75 
76  // A set of paths.
77  struct paths_t
78  {
80  // The current ends of paths. Not the same as the
81  // destinations of all the transitions, e.g., in the case of
82  // "0 -> 1 -> 2", transitions = { 0 -> 1, 1 -> 2 }, ends = {
83  // 2 }.
85  };
86  }
87  }
88  }
89 
90 #line 91 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.hh" // lalr1.cc:372
91 
92 
93 # include <vector>
94 # include <iostream>
95 # include <stdexcept>
96 # include <string>
97 # include "stack.hh"
98 
99 
100 #ifndef YYASSERT
101 # include <cassert>
102 # define YYASSERT assert
103 #endif
104 
105 
106 #ifndef YY_ATTRIBUTE
107 # if (defined __GNUC__ \
108  && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
109  || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
110 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
111 # else
112 # define YY_ATTRIBUTE(Spec) /* empty */
113 # endif
114 #endif
115 
116 #ifndef YY_ATTRIBUTE_PURE
117 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
118 #endif
119 
120 #ifndef YY_ATTRIBUTE_UNUSED
121 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
122 #endif
123 
124 #if !defined _Noreturn \
125  && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
126 # if defined _MSC_VER && 1200 <= _MSC_VER
127 # define _Noreturn __declspec (noreturn)
128 # else
129 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
130 # endif
131 #endif
132 
133 /* Suppress unused-variable warnings by "using" E. */
134 #if ! defined lint || defined __GNUC__
135 # define YYUSE(E) ((void) (E))
136 #else
137 # define YYUSE(E) /* empty */
138 #endif
139 
140 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
141 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
142 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
143  _Pragma ("GCC diagnostic push") \
144  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
145  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
146 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
147  _Pragma ("GCC diagnostic pop")
148 #else
149 # define YY_INITIAL_VALUE(Value) Value
150 #endif
151 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
152 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
153 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
154 #endif
155 #ifndef YY_INITIAL_VALUE
156 # define YY_INITIAL_VALUE(Value) /* Nothing. */
157 #endif
158 
159 /* Debug traces. */
160 #ifndef YYDEBUG
161 # define YYDEBUG 1
162 #endif
163 
164 #line 11 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:372
165 namespace vcsn { namespace detail { namespace dot {
166 #line 167 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.hh" // lalr1.cc:372
167 
168 
169 
175  template <size_t S>
176  struct variant
177  {
180 
183  {}
184 
186  template <typename T>
187  variant (const T& t)
188  {
189  YYASSERT (sizeof (T) <= S);
190  new (yyas_<T> ()) T (t);
191  }
192 
195  {}
196 
198  template <typename T>
199  T&
200  build ()
201  {
202  return *new (yyas_<T> ()) T;
203  }
204 
206  template <typename T>
207  T&
208  build (const T& t)
209  {
210  return *new (yyas_<T> ()) T (t);
211  }
212 
214  template <typename T>
215  T&
216  as ()
217  {
218  return *yyas_<T> ();
219  }
220 
222  template <typename T>
223  const T&
224  as () const
225  {
226  return *yyas_<T> ();
227  }
228 
237  template <typename T>
238  void
239  swap (self_type& other)
240  {
241  std::swap (as<T> (), other.as<T> ());
242  }
243 
247  template <typename T>
248  void
249  move (self_type& other)
250  {
251  build<T> ();
252  swap<T> (other);
253  other.destroy<T> ();
254  }
255 
257  template <typename T>
258  void
259  copy (const self_type& other)
260  {
261  build<T> (other.as<T> ());
262  }
263 
265  template <typename T>
266  void
268  {
269  as<T> ().~T ();
270  }
271 
272  private:
274  self_type& operator=(const self_type&);
275  variant (const self_type&);
276 
278  template <typename T>
279  T*
280  yyas_ ()
281  {
282  void *yyp = yybuffer_.yyraw;
283  return static_cast<T*> (yyp);
284  }
285 
287  template <typename T>
288  const T*
289  yyas_ () const
290  {
291  const void *yyp = yybuffer_.yyraw;
292  return static_cast<const T*> (yyp);
293  }
294 
295  union
296  {
298  long double yyalign_me;
300  char yyraw[S];
301  } yybuffer_;
302  };
303 
304 
306  class parser
307  {
308  public:
309 #ifndef YYSTYPE
310  union union_type
312  {
313  // path
314  char dummy1[sizeof(paths_t)];
315 
316  // stmt_list
317  // stmt
318  // nodes
319  // edge_stmt
320  // subgraph
321  char dummy2[sizeof(states_t)];
322 
323  // ID
324  // attr_list
325  // attr_list.opt
326  // attr_assign
327  // a_list.1
328  // a_list.0
329  // node_stmt
330  // node_id
331  // id.opt
332  char dummy3[sizeof(string_t)];
333 };
334 
337 #else
338  typedef YYSTYPE semantic_type;
339 #endif
342 
344  struct syntax_error : std::runtime_error
345  {
346  syntax_error (const location_type& l, const std::string& m);
348  };
349 
351  struct token
352  {
354  {
355  END = 0,
356  DIGRAPH = 258,
357  EDGE = 259,
358  GRAPH = 260,
359  NODE = 261,
360  LBRACE = 262,
361  RBRACE = 263,
362  LBRACKET = 264,
363  RBRACKET = 265,
364  EQ = 266,
365  ARROW = 267,
366  COLON = 268,
367  COMMA = 269,
368  SEMI = 270,
369  ID = 271
370  };
371  };
372 
375 
377  typedef int symbol_number_type;
378 
380  typedef unsigned char token_number_type;
381 
388  template <typename Base>
390  {
392  typedef Base super_type;
393 
395  basic_symbol ();
396 
398  basic_symbol (const basic_symbol& other);
399 
401 
402  basic_symbol (typename Base::kind_type t, const location_type& l);
403 
404  basic_symbol (typename Base::kind_type t, const paths_t v, const location_type& l);
405 
406  basic_symbol (typename Base::kind_type t, const states_t v, const location_type& l);
407 
408  basic_symbol (typename Base::kind_type t, const string_t v, const location_type& l);
409 
410 
412  basic_symbol (typename Base::kind_type t,
413  const semantic_type& v,
414  const location_type& l);
415 
416  ~basic_symbol ();
417 
419  void move (basic_symbol& s);
420 
423 
426 
427  private:
429  basic_symbol& operator= (const basic_symbol& other);
430  };
431 
433  struct by_type
434  {
436  by_type ();
437 
439  by_type (const by_type& other);
440 
443 
445  by_type (kind_type t);
446 
448  void move (by_type& that);
449 
452  symbol_number_type type_get () const;
453 
455  token_type token () const;
456 
457  enum { empty = 0 };
458 
462  };
463 
466 
467  // Symbol constructors declarations.
468  static inline
470  make_END (const location_type& l);
471 
472  static inline
474  make_DIGRAPH (const location_type& l);
475 
476  static inline
478  make_EDGE (const location_type& l);
479 
480  static inline
482  make_GRAPH (const location_type& l);
483 
484  static inline
486  make_NODE (const location_type& l);
487 
488  static inline
490  make_LBRACE (const location_type& l);
491 
492  static inline
494  make_RBRACE (const location_type& l);
495 
496  static inline
498  make_LBRACKET (const location_type& l);
499 
500  static inline
502  make_RBRACKET (const location_type& l);
503 
504  static inline
506  make_EQ (const location_type& l);
507 
508  static inline
510  make_ARROW (const location_type& l);
511 
512  static inline
514  make_COLON (const location_type& l);
515 
516  static inline
518  make_COMMA (const location_type& l);
519 
520  static inline
522  make_SEMI (const location_type& l);
523 
524  static inline
526  make_ID (const string_t& v, const location_type& l);
527 
528 
530  parser (driver& driver__yyarg);
531  virtual ~parser ();
532 
535  virtual int parse ();
536 
537 #if YYDEBUG
538  std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
541  void set_debug_stream (std::ostream &);
542 
544  typedef int debug_level_type;
546  debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
548  void set_debug_level (debug_level_type l);
549 #endif
550 
554  virtual void error (const location_type& loc, const std::string& msg);
555 
557  void error (const syntax_error& err);
558 
559  private:
561  parser (const parser&);
562  parser& operator= (const parser&);
563 
565  typedef int state_type;
566 
570  virtual std::string yysyntax_error_ (state_type yystate,
571  symbol_number_type yytoken) const;
572 
576  state_type yy_lr_goto_state_ (state_type yystate, int yysym);
577 
580  static bool yy_pact_value_is_default_ (int yyvalue);
581 
584  static bool yy_table_value_is_error_ (int yyvalue);
585 
586  static const signed char yypact_ninf_;
587  static const signed char yytable_ninf_;
588 
591 
592  // Tables.
593  // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
594  // STATE-NUM.
595  static const signed char yypact_[];
596 
597  // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
598  // Performed when YYTABLE does not specify something else to do. Zero
599  // means the default is an error.
600  static const unsigned char yydefact_[];
601 
602  // YYPGOTO[NTERM-NUM].
603  static const signed char yypgoto_[];
604 
605  // YYDEFGOTO[NTERM-NUM].
606  static const signed char yydefgoto_[];
607 
608  // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
609  // positive, shift that token. If negative, reduce the rule whose
610  // number is the opposite. If YYTABLE_NINF, syntax error.
611  static const signed char yytable_[];
612 
613  static const signed char yycheck_[];
614 
615  // YYSTOS[STATE-NUM] -- The (internal number of the) accessing
616  // symbol of state STATE-NUM.
617  static const unsigned char yystos_[];
618 
619  // YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
620  static const unsigned char yyr1_[];
621 
622  // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
623  static const unsigned char yyr2_[];
624 
625 
627  static std::string yytnamerr_ (const char *n);
628 
629 
631  static const char* const yytname_[];
632 #if YYDEBUG
633  // YYRLINE[YYN] -- Source line where rule number YYN was defined.
634  static const unsigned short int yyrline_[];
636  virtual void yy_reduce_print_ (int r);
638  virtual void yystack_print_ ();
639 
640  // Debugging.
641  int yydebug_;
642  std::ostream* yycdebug_;
643 
647  template <typename Base>
648  void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
649 #endif
650 
655  template <typename Base>
656  void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
657 
658  private:
660  struct by_state
661  {
663  by_state ();
664 
667 
669  by_state (kind_type s);
670 
672  by_state (const by_state& other);
673 
675  void move (by_state& that);
676 
679  symbol_number_type type_get () const;
680 
681  enum { empty = 0 };
682 
685  };
686 
688  struct stack_symbol_type : basic_symbol<by_state>
689  {
698  };
699 
702 
705 
711  void yypush_ (const char* m, stack_symbol_type& s);
712 
719  void yypush_ (const char* m, state_type s, symbol_type& sym);
720 
722  void yypop_ (unsigned int n = 1);
723 
724  // Constants.
725  enum
726  {
727  yyeof_ = 0,
728  yylast_ = 68,
729  yynnts_ = 20,
730  yyempty_ = -2,
731  yyfinal_ = 5,
733  yyerrcode_ = 256,
735  };
736 
737 
738  // User arguments.
740  };
741 
742  // Symbol number corresponding to token number t.
743  inline
746  {
747  static
748  const token_number_type
749  translate_table[] =
750  {
751  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
752  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
753  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
754  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
755  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
756  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
757  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
758  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
759  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
760  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
761  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
762  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
763  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
764  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
765  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
766  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
767  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
768  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
769  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
770  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
771  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
772  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
773  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
774  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
775  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
776  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
777  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
778  15, 16, 17
779  };
780  const unsigned int user_token_number_max_ = 272;
781  const token_number_type undef_token_ = 2;
782 
783  if (static_cast<int>(t) <= yyeof_)
784  return yyeof_;
785  else if (static_cast<unsigned int> (t) <= user_token_number_max_)
786  return translate_table[t];
787  else
788  return undef_token_;
789  }
790 
791  inline
792  parser::syntax_error::syntax_error (const location_type& l, const std::string& m)
793  : std::runtime_error (m)
794  , location (l)
795  {}
796 
797  // basic_symbol.
798  template <typename Base>
799  inline
801  : value ()
802  {}
803 
804  template <typename Base>
805  inline
807  : Base (other)
808  , value ()
809  , location (other.location)
810  {
811  switch (other.type_get ())
812  {
813  case 31: // path
814  value.copy< paths_t > (other.value);
815  break;
816 
817  case 20: // stmt_list
818  case 21: // stmt
819  case 30: // nodes
820  case 32: // edge_stmt
821  case 36: // subgraph
822  value.copy< states_t > (other.value);
823  break;
824 
825  case 16: // ID
826  case 23: // attr_list
827  case 24: // attr_list.opt
828  case 25: // attr_assign
829  case 26: // a_list.1
830  case 29: // a_list.0
831  case 33: // node_stmt
832  case 34: // node_id
833  case 37: // id.opt
834  value.copy< string_t > (other.value);
835  break;
836 
837  default:
838  break;
839  }
840 
841  }
842 
843 
844  template <typename Base>
845  inline
846  parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const semantic_type& v, const location_type& l)
847  : Base (t)
848  , value ()
849  , location (l)
850  {
851  (void) v;
852  switch (this->type_get ())
853  {
854  case 31: // path
855  value.copy< paths_t > (v);
856  break;
857 
858  case 20: // stmt_list
859  case 21: // stmt
860  case 30: // nodes
861  case 32: // edge_stmt
862  case 36: // subgraph
863  value.copy< states_t > (v);
864  break;
865 
866  case 16: // ID
867  case 23: // attr_list
868  case 24: // attr_list.opt
869  case 25: // attr_assign
870  case 26: // a_list.1
871  case 29: // a_list.0
872  case 33: // node_stmt
873  case 34: // node_id
874  case 37: // id.opt
875  value.copy< string_t > (v);
876  break;
877 
878  default:
879  break;
880  }
881 }
882 
883 
884  // Implementation of basic_symbol constructor for each type.
885 
886  template <typename Base>
887  parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const location_type& l)
888  : Base (t)
889  , value ()
890  , location (l)
891  {}
892 
893  template <typename Base>
894  parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const paths_t v, const location_type& l)
895  : Base (t)
896  , value (v)
897  , location (l)
898  {}
899 
900  template <typename Base>
901  parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const states_t v, const location_type& l)
902  : Base (t)
903  , value (v)
904  , location (l)
905  {}
906 
907  template <typename Base>
908  parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const string_t v, const location_type& l)
909  : Base (t)
910  , value (v)
911  , location (l)
912  {}
913 
914 
915  template <typename Base>
916  inline
918  {
919  // User destructor.
920  symbol_number_type yytype = this->type_get ();
921  semantic_type* yyvaluep = &value;
922  (void) yyvaluep;
923  switch (yytype)
924  {
925  default:
926  break;
927  }
928 
929  // Type destructor.
930  switch (yytype)
931  {
932  case 31: // path
933  value.template destroy< paths_t > ();
934  break;
935 
936  case 20: // stmt_list
937  case 21: // stmt
938  case 30: // nodes
939  case 32: // edge_stmt
940  case 36: // subgraph
941  value.template destroy< states_t > ();
942  break;
943 
944  case 16: // ID
945  case 23: // attr_list
946  case 24: // attr_list.opt
947  case 25: // attr_assign
948  case 26: // a_list.1
949  case 29: // a_list.0
950  case 33: // node_stmt
951  case 34: // node_id
952  case 37: // id.opt
953  value.template destroy< string_t > ();
954  break;
955 
956  default:
957  break;
958  }
959 
960  }
961 
962  template <typename Base>
963  inline
964  void
966  {
967  super_type::move(s);
968  switch (this->type_get ())
969  {
970  case 31: // path
971  value.move< paths_t > (s.value);
972  break;
973 
974  case 20: // stmt_list
975  case 21: // stmt
976  case 30: // nodes
977  case 32: // edge_stmt
978  case 36: // subgraph
979  value.move< states_t > (s.value);
980  break;
981 
982  case 16: // ID
983  case 23: // attr_list
984  case 24: // attr_list.opt
985  case 25: // attr_assign
986  case 26: // a_list.1
987  case 29: // a_list.0
988  case 33: // node_stmt
989  case 34: // node_id
990  case 37: // id.opt
991  value.move< string_t > (s.value);
992  break;
993 
994  default:
995  break;
996  }
997 
998  location = s.location;
999  }
1000 
1001  // by_type.
1002  inline
1004  : type (empty)
1005  {}
1006 
1007  inline
1009  : type (other.type)
1010  {}
1011 
1012  inline
1014  : type (yytranslate_ (t))
1015  {}
1016 
1017  inline
1018  void
1020  {
1021  type = that.type;
1022  that.type = empty;
1023  }
1024 
1025  inline
1026  int
1028  {
1029  return type;
1030  }
1031 
1032  inline
1035  {
1036  // YYTOKNUM[NUM] -- (External) token number corresponding to the
1037  // (internal) symbol number NUM (which must be that of a token). */
1038  static
1039  const unsigned short int
1040  yytoken_number_[] =
1041  {
1042  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1043  265, 266, 267, 268, 269, 270, 271, 272
1044  };
1045  return static_cast<token_type> (yytoken_number_[type]);
1046  }
1047  // Implementation of make_symbol for each symbol type.
1050  {
1051  return symbol_type (token::END, l);
1052  }
1053 
1056  {
1057  return symbol_type (token::DIGRAPH, l);
1058  }
1059 
1062  {
1063  return symbol_type (token::EDGE, l);
1064  }
1065 
1068  {
1069  return symbol_type (token::GRAPH, l);
1070  }
1071 
1074  {
1075  return symbol_type (token::NODE, l);
1076  }
1077 
1080  {
1081  return symbol_type (token::LBRACE, l);
1082  }
1083 
1086  {
1087  return symbol_type (token::RBRACE, l);
1088  }
1089 
1092  {
1093  return symbol_type (token::LBRACKET, l);
1094  }
1095 
1098  {
1099  return symbol_type (token::RBRACKET, l);
1100  }
1101 
1104  {
1105  return symbol_type (token::EQ, l);
1106  }
1107 
1110  {
1111  return symbol_type (token::ARROW, l);
1112  }
1113 
1116  {
1117  return symbol_type (token::COLON, l);
1118  }
1119 
1122  {
1123  return symbol_type (token::COMMA, l);
1124  }
1125 
1128  {
1129  return symbol_type (token::SEMI, l);
1130  }
1131 
1134  {
1135  return symbol_type (token::ID, v, l);
1136  }
1137 
1138 
1139 #line 11 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:372
1140 } } } // vcsn::detail::dot
1141 #line 1142 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.hh" // lalr1.cc:372
1142 
1143 
1144 // // "%code provides" blocks.
1145 #line 65 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:372
1146 
1147  #define YY_DECL_(Class) \
1148  parser::symbol_type Class lex(driver& driver_)
1149  #define YY_DECL YY_DECL_(yyFlexLexer::)
1150 
1151 #line 1152 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.hh" // lalr1.cc:372
1152 
1153 
1154 #endif // !YY_YY_USERS_AKIM_SRC_LRDE_VAUCANSON2_LIB_VCSN_DOT_PARSE_HH_INCLUDED
Type access provider for token (enum) based symbols.
Definition: parse.hh:433
virtual void yystack_print_()
Print the state stack on the debug stream.
Definition: parse.cc:1384
char yyraw[S]
A buffer large enough to store any of the semantic values.
Definition: parse.hh:300
Type access provider for state based symbols.
Definition: parse.hh:660
static symbol_type make_DIGRAPH(const location_type &l)
Definition: parse.hh:1055
union vcsn::detail::dot::variant::@1 yybuffer_
void move(by_state &that)
Steal the symbol type from that.
Definition: parse.cc:283
void move(self_type &other)
Move the content of other to this.
Definition: parse.hh:249
location_type location
The location.
Definition: parse.hh:425
variant(const T &t)
Construct and fill.
Definition: parse.hh:187
static symbol_type make_EDGE(const location_type &l)
Definition: parse.hh:1061
static const signed char yytable_ninf_
Definition: parse.hh:587
token_type token() const
The token.
Definition: parse.hh:1034
static bool yy_pact_value_is_default_(int yyvalue)
Whether the given yypact_ value indicates a defaulted state.
Definition: parse.cc:582
symbol_number_type type_get() const
The (internal) type number (corresponding to state).
Definition: parse.cc:296
stack_symbol_type()
Construct an empty symbol.
Definition: parse.cc:302
stack_symbol_type & operator=(const stack_symbol_type &that)
Assignment, needed by push_back.
Definition: parse.cc:346
static const char *const yytname_[]
For a symbol, its name in clear.
Definition: parse.hh:631
static const signed char yypact_[]
Definition: parse.hh:595
static symbol_type make_NODE(const location_type &l)
Definition: parse.hh:1073
char dummy2[sizeof(states_t)]
Definition: parse.hh:321
static symbol_type make_GRAPH(const location_type &l)
Definition: parse.hh:1067
static const unsigned char yyr1_[]
Definition: parse.hh:620
T * yyas_()
Accessor to raw memory as T.
Definition: parse.hh:280
State and public interface for Dot parsing.
Definition: driver.hh:21
syntax_error(const location_type &l, const std::string &m)
Definition: parse.hh:792
static symbol_type make_COLON(const location_type &l)
Definition: parse.hh:1115
vcsn::rat::location location_type
Symbol locations.
Definition: parse.hh:341
static symbol_type make_RBRACE(const location_type &l)
Definition: parse.hh:1085
void move(basic_symbol &s)
Destructive move, s is emptied into this.
Definition: parse.hh:965
int debug_level_type
Type for debugging levels.
Definition: parse.hh:544
static const signed char yytable_[]
Definition: parse.hh:611
void destroy()
Destroy the stored T.
Definition: parse.hh:267
void yy_destroy_(const char *yymsg, basic_symbol< Base > &yysym) const
Reclaim the memory associated to a symbol.
Definition: parse.cc:387
static const unsigned char yydefact_[]
Definition: parse.hh:600
static bool yy_table_value_is_error_(int yyvalue)
Whether the given yytable_ value indicates a syntax error.
Definition: parse.cc:588
long double yyalign_me
Strongest alignment constraints.
Definition: parse.hh:298
Termination state number.
Definition: parse.hh:731
static std::string yytnamerr_(const char *n)
Convert the symbol name n to a form suitable for a diagnostic.
Definition: parse.cc:218
A char[S] buffer to store and retrieve objects.
Definition: parse.hh:176
void swap(self_type &other)
Swap the content with other, of same type.
Definition: parse.hh:239
static const signed char yypgoto_[]
Definition: parse.hh:603
Last index in yytable_.
Definition: parse.hh:728
T & build()
Instantiate an empty T in here.
Definition: parse.hh:200
state_type kind_type
The symbol type as needed by the constructor.
Definition: parse.hh:666
basic_symbol< by_type > symbol_type
"External" symbols: returned by the scanner.
Definition: parse.hh:465
variant()
Empty construction.
Definition: parse.hh:182
token_type kind_type
The symbol type as needed by the constructor.
Definition: parse.hh:442
static symbol_type make_EQ(const location_type &l)
Definition: parse.hh:1103
static const unsigned short int yyrline_[]
Definition: parse.hh:634
static const unsigned char yystos_[]
Definition: parse.hh:617
stack< stack_symbol_type > stack_type
Stack type.
Definition: parse.hh:701
static symbol_type make_COMMA(const location_type &l)
Definition: parse.hh:1121
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
Definition: parse.cc:1425
char dummy3[sizeof(string_t)]
Definition: parse.hh:332
static const unsigned char yyr2_[]
Definition: parse.hh:623
void yypush_(const char *m, stack_symbol_type &s)
Push a new state on the stack.
Definition: parse.cc:530
boost::flyweight< std::string, boost::flyweights::no_tracking > string_t
Definition: parse.hh:68
std::ostream & debug_stream() const
The current debugging stream.
Definition: parse.cc:546
void copy(const self_type &other)
Copy the content of other to this.
Definition: parse.hh:259
A Bison parser.
Definition: parse.hh:306
state_type yy_lr_goto_state_(state_type yystate, int yysym)
Compute post-reduction state.
Definition: parse.cc:572
by_state()
Default constructor.
Definition: parse.cc:272
#define YY_ATTRIBUTE_PURE
Definition: parse.hh:117
self_type & operator=(const self_type &)
Prohibit blind copies.
~variant()
Destruction, allowed only if empty.
Definition: parse.hh:194
static symbol_type make_LBRACKET(const location_type &l)
Definition: parse.hh:1091
basic_symbol()
Default constructor.
Definition: parse.hh:800
std::ostream * yycdebug_
Definition: parse.hh:642
static symbol_type make_END(const location_type &l)
Definition: parse.hh:1049
Number of nonterminal symbols.
Definition: parse.hh:729
virtual std::string yysyntax_error_(state_type yystate, symbol_number_type yytoken) const
Generate an error message.
Definition: parse.cc:1166
debug_level_type debug_level() const
The current debugging level.
Definition: parse.cc:559
T & as()
Accessor to a built T.
Definition: parse.hh:216
virtual void yy_reduce_print_(int r)
Report on the debug stream that the rule r is going to be reduced.
Definition: parse.cc:1397
const T & as() const
Const accessor to a built T (for printer).
Definition: parse.hh:224
int state_type
State numbers.
Definition: parse.hh:565
by_type()
Default constructor.
Definition: parse.hh:1003
#define YYASSERT
Definition: parse.hh:102
An auxiliary type to compute the largest semantic type.
Definition: parse.hh:311
variant< sizeof(union_type)> semantic_type
Symbol semantic values.
Definition: parse.hh:336
basic_symbol & operator=(const basic_symbol &other)
Assignment operator.
semantic_type value
The semantic value.
Definition: parse.hh:422
symbol_number_type type_get() const
The (internal) type number (corresponding to type).
Definition: parse.hh:1027
const T * yyas_() const
Const accessor to raw memory as T.
Definition: parse.hh:289
static const signed char yycheck_[]
Definition: parse.hh:613
static symbol_type make_LBRACE(const location_type &l)
Definition: parse.hh:1079
Abstract a location.
Definition: location.hh:47
Define the vcsn::rat::location class.
std::vector< string_t > states_t
Definition: parse.hh:71
basic_symbol< by_state > super_type
Superclass.
Definition: parse.hh:691
static symbol_type make_ID(const string_t &v, const location_type &l)
Definition: parse.hh:1133
void yy_print_(std::ostream &yyo, const basic_symbol< Base > &yysym) const
Display a symbol type, value and location.
Definition: parse.cc:396
int symbol_number_type
Internal symbol number.
Definition: parse.hh:377
Provide a variadic mul on top of a binary mul(), and one().
Definition: fwd.hh:36
Syntax errors thrown from user actions.
Definition: parse.hh:344
void set_debug_stream(std::ostream &)
Set the current debugging stream.
Definition: parse.cc:552
std::vector< std::pair< string_t, string_t >> transitions_t
Definition: parse.hh:74
stack_type yystack_
The stack.
Definition: parse.hh:704
unsigned char token_number_type
Internal symbol number for tokens (subsumed by symbol_number_type).
Definition: parse.hh:380
variant< S > self_type
Type of *this.
Definition: parse.hh:179
static const signed char yydefgoto_[]
Definition: parse.hh:606
token_number_type type
The symbol type.
Definition: parse.hh:461
char dummy1[sizeof(paths_t)]
Definition: parse.hh:314
void set_debug_level(debug_level_type l)
Set the current debugging level.
Definition: parse.cc:565
T & build(const T &t)
Instantiate a T in here from t.
Definition: parse.hh:208
void move(by_type &that)
Steal the symbol type from that.
Definition: parse.hh:1019
transitions_t transitions
Definition: parse.hh:79
static token_number_type yytranslate_(token_type t)
Convert a scanner token number t to a symbol number.
Definition: parse.hh:745
state_type state
The state.
Definition: parse.hh:684
void yypop_(unsigned int n=1)
Pop n symbols the three stacks.
Definition: parse.cc:539
"Internal" symbol: element of the stack.
Definition: parse.hh:688
static const signed char yypact_ninf_
Definition: parse.hh:586
Define the vcsn::detail::dot::stack class.
parser(driver &driver__yyarg)
Build a parser object.
Definition: parse.cc:251
virtual int parse()
Parse.
Definition: parse.cc:594
parser & operator=(const parser &)
Base super_type
Alias to Base.
Definition: parse.hh:392
std::ostream & dot(const Aut &aut, std::ostream &out, bool dot2tex=false)
Definition: dot.hh:344
static symbol_type make_RBRACKET(const location_type &l)
Definition: parse.hh:1097
static symbol_type make_SEMI(const location_type &l)
Definition: parse.hh:1127
A complete symbol.
Definition: parse.hh:380
static symbol_type make_ARROW(const location_type &l)
Definition: parse.hh:1109
token::yytokentype token_type
(External) token type, as returned by yylex.
Definition: parse.hh:374