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