Vcsn  2.3
Be Rational
parse.hh
Go to the documentation of this file.
1 // A Bison parser, made by GNU Bison 3.0.4.19-fbaf-dirty.
2 
3 // Skeleton interface for Bison LALR(1) parsers in C++
4 
5 // Copyright (C) 2002-2015 Free Software Foundation, Inc.
6 
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 
17 // You should have received a copy of the GNU General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 
20 // As a special exception, you may create a larger work that contains
21 // part or all of the Bison parser skeleton and distribute that work
22 // under terms of your choice, so long as that work isn't itself a
23 // parser generator using the skeleton or a modified version thereof
24 // as a parser skeleton. Alternatively, if you modify or redistribute
25 // the parser skeleton itself, you may (at your option) remove this
26 // special exception, which will cause the skeleton and the resulting
27 // Bison output files to be licensed under the GNU General Public
28 // License without this special exception.
29 
30 // This special exception was added by the Free Software Foundation in
31 // version 2.2 of Bison.
32 
38 // C++ LALR(1) parser skeleton written by Akim Demaille.
39 
40 #ifndef YY_YY_USERS_AKIM_SRC_LRDE_2_LIB_VCSN_DOT_PARSE_HH_INCLUDED
41 # define YY_YY_USERS_AKIM_SRC_LRDE_2_LIB_VCSN_DOT_PARSE_HH_INCLUDED
42 // // "%code requires" blocks.
43 #line 17 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:377
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 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.hh" // lalr1.cc:377
89 
90 
91 # include <cstdlib> // std::abort
92 # include <iostream>
93 # include <stdexcept>
94 # include <string>
95 # include <vector>
96 # include "stack.hh"
97 
98 
99 #ifndef YYASSERT
100 # include <cassert>
101 # define YYASSERT assert
102 #endif
103 
104 
105 #ifndef YY_ATTRIBUTE
106 # if (defined __GNUC__ \
107  && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
108  || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
109 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
110 # else
111 # define YY_ATTRIBUTE(Spec) /* empty */
112 # endif
113 #endif
114 
115 #ifndef YY_ATTRIBUTE_PURE
116 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
117 #endif
118 
119 #ifndef YY_ATTRIBUTE_UNUSED
120 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
121 #endif
122 
123 #if !defined _Noreturn \
124  && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
125 # if defined _MSC_VER && 1200 <= _MSC_VER
126 # define _Noreturn __declspec (noreturn)
127 # else
128 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
129 # endif
130 #endif
131 
132 /* Suppress unused-variable warnings by "using" E. */
133 #if ! defined lint || defined __GNUC__
134 # define YYUSE(E) ((void) (E))
135 #else
136 # define YYUSE(E) /* empty */
137 #endif
138 
139 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
140 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
141 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
142  _Pragma ("GCC diagnostic push") \
143  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
144  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
145 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
146  _Pragma ("GCC diagnostic pop")
147 #else
148 # define YY_INITIAL_VALUE(Value) Value
149 #endif
150 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
151 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
152 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
153 #endif
154 #ifndef YY_INITIAL_VALUE
155 # define YY_INITIAL_VALUE(Value) /* Nothing. */
156 #endif
157 
158 /* Debug traces. */
159 #ifndef YYDEBUG
160 # define YYDEBUG 1
161 #endif
162 
163 #line 11 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:377
164 namespace vcsn { namespace detail { namespace dot {
165 #line 166 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.hh" // lalr1.cc:377
166 
167 
168 
174  template <size_t S>
175  struct variant
176  {
179 
182  {}
183 
185  template <typename T>
186  variant (const T& t)
187  {
188  YYASSERT (sizeof (T) <= S);
189  new (yyas_<T> ()) T (t);
190  }
191 
194  {}
195 
197  template <typename T>
198  T&
199  build ()
200  {
201  return *new (yyas_<T> ()) T;
202  }
203 
205  template <typename T>
206  T&
207  build (const T& t)
208  {
209  return *new (yyas_<T> ()) T (t);
210  }
211 
213  template <typename T>
214  T&
215  as ()
216  {
217  return *yyas_<T> ();
218  }
219 
221  template <typename T>
222  const T&
223  as () const
224  {
225  return *yyas_<T> ();
226  }
227 
236  template <typename T>
237  void
238  swap (self_type& other)
239  {
240  std::swap (as<T> (), other.as<T> ());
241  }
242 
246  template <typename T>
247  void
248  move (self_type& other)
249  {
250  build<T> ();
251  swap<T> (other);
252  other.destroy<T> ();
253  }
254 
256  template <typename T>
257  void
258  copy (const self_type& other)
259  {
260  build<T> (other.as<T> ());
261  }
262 
264  template <typename T>
265  void
267  {
268  as<T> ().~T ();
269  }
270 
271  private:
273  self_type& operator=(const self_type&);
274  variant (const self_type&);
275 
277  template <typename T>
278  T*
279  yyas_ ()
280  {
281  void *yyp = yybuffer_.yyraw;
282  return static_cast<T*> (yyp);
283  }
284 
286  template <typename T>
287  const T*
288  yyas_ () const
289  {
290  const void *yyp = yybuffer_.yyraw;
291  return static_cast<const T*> (yyp);
292  }
293 
294  union
295  {
297  long double yyalign_me;
299  char yyraw[S];
300  } yybuffer_;
301  };
302 
303 
305  class parser
306  {
307  public:
308 #ifndef YYSTYPE
309  union union_type
311  {
312  // path
313  char dummy1[sizeof(paths_t)];
314 
315  // stmt_list
316  // stmt
317  // nodes
318  // edge_stmt
319  // subgraph
320  char dummy2[sizeof(states_t)];
321 
322  // ID
323  // attr_list
324  // attr_list.opt
325  // attr_assign
326  // a_list.1
327  // a_list.0
328  // node_stmt
329  // node_id
330  // id.opt
331  char dummy3[sizeof(string_t)];
332 };
333 
336 #else
337  typedef YYSTYPE semantic_type;
338 #endif
341 
343  struct syntax_error : std::runtime_error
344  {
345  syntax_error (const location_type& l, const std::string& m);
346  location_type location;
347  };
348 
350  struct token
351  {
353  {
354  END = 0,
355  DIGRAPH = 258,
356  EDGE = 259,
357  GRAPH = 260,
358  NODE = 261,
359  SUBGRAPH = 262,
360  LBRACE = 263,
361  RBRACE = 264,
362  LBRACKET = 265,
363  RBRACKET = 266,
364  EQ = 267,
365  ARROW = 268,
366  COLON = 269,
367  COMMA = 270,
368  SEMI = 271,
369  ID = 272
370  };
371  };
372 
375 
377  typedef int symbol_number_type;
378 
380  enum { empty_symbol = -2 };
381 
383  typedef unsigned char token_number_type;
384 
391  template <typename Base>
393  {
395  typedef Base super_type;
396 
398  basic_symbol ();
399 
401  basic_symbol (const basic_symbol& other);
402 
404 
405  basic_symbol (typename Base::kind_type t, const location_type& l);
406 
407  basic_symbol (typename Base::kind_type t, const paths_t v, const location_type& l);
408 
409  basic_symbol (typename Base::kind_type t, const states_t v, const location_type& l);
410 
411  basic_symbol (typename Base::kind_type t, const string_t v, const location_type& l);
412 
413 
415  basic_symbol (typename Base::kind_type t,
416  const semantic_type& v,
417  const location_type& l);
418 
420  ~basic_symbol ();
421 
423  void clear ();
424 
426  bool empty () const;
427 
429  void move (basic_symbol& s);
430 
432  semantic_type value;
433 
435  location_type location;
436 
437  private:
439  basic_symbol& operator= (const basic_symbol& other);
440  };
441 
443  struct by_type
444  {
446  by_type ();
447 
449  by_type (const by_type& other);
450 
452  typedef token_type kind_type;
453 
455  by_type (kind_type t);
456 
458  void clear ();
459 
461  void move (by_type& that);
462 
465  symbol_number_type type_get () const;
466 
468  token_type token () const;
469 
473  int type;
474  };
475 
478 
479  // Symbol constructors declarations.
480  static inline
481  symbol_type
482  make_END (const location_type& l);
483 
484  static inline
485  symbol_type
486  make_DIGRAPH (const location_type& l);
487 
488  static inline
489  symbol_type
490  make_EDGE (const location_type& l);
491 
492  static inline
493  symbol_type
494  make_GRAPH (const location_type& l);
495 
496  static inline
497  symbol_type
498  make_NODE (const location_type& l);
499 
500  static inline
501  symbol_type
502  make_SUBGRAPH (const location_type& l);
503 
504  static inline
505  symbol_type
506  make_LBRACE (const location_type& l);
507 
508  static inline
509  symbol_type
510  make_RBRACE (const location_type& l);
511 
512  static inline
513  symbol_type
514  make_LBRACKET (const location_type& l);
515 
516  static inline
517  symbol_type
518  make_RBRACKET (const location_type& l);
519 
520  static inline
521  symbol_type
522  make_EQ (const location_type& l);
523 
524  static inline
525  symbol_type
526  make_ARROW (const location_type& l);
527 
528  static inline
529  symbol_type
530  make_COLON (const location_type& l);
531 
532  static inline
533  symbol_type
534  make_COMMA (const location_type& l);
535 
536  static inline
537  symbol_type
538  make_SEMI (const location_type& l);
539 
540  static inline
541  symbol_type
542  make_ID (const string_t& v, const location_type& l);
543 
544 
546  parser (driver& driver__yyarg);
547  virtual ~parser ();
548 
551  virtual int parse ();
552 
553 #if YYDEBUG
554  std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
557  void set_debug_stream (std::ostream &);
558 
560  typedef int debug_level_type;
562  debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
564  void set_debug_level (debug_level_type l);
565 #endif
566 
570  virtual void error (const location_type& loc, const std::string& msg);
571 
573  void error (const syntax_error& err);
574 
575  private:
577  parser (const parser&);
578  parser& operator= (const parser&);
579 
581  typedef int state_type;
582 
586  virtual std::string yysyntax_error_ (state_type yystate,
587  const symbol_type& yyla) const;
588 
592  state_type yy_lr_goto_state_ (state_type yystate, int yysym);
593 
596  static bool yy_pact_value_is_default_ (int yyvalue);
597 
600  static bool yy_table_value_is_error_ (int yyvalue);
601 
602  static const signed char yypact_ninf_;
603  static const signed char yytable_ninf_;
604 
606  static token_number_type yytranslate_ (token_type t);
607 
608  // Tables.
609  // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
610  // STATE-NUM.
611  static const signed char yypact_[];
612 
613  // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
614  // Performed when YYTABLE does not specify something else to do. Zero
615  // means the default is an error.
616  static const unsigned char yydefact_[];
617 
618  // YYPGOTO[NTERM-NUM].
619  static const signed char yypgoto_[];
620 
621  // YYDEFGOTO[NTERM-NUM].
622  static const signed char yydefgoto_[];
623 
624  // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
625  // positive, shift that token. If negative, reduce the rule whose
626  // number is the opposite. If YYTABLE_NINF, syntax error.
627  static const signed char yytable_[];
628 
629  static const signed char yycheck_[];
630 
631  // YYSTOS[STATE-NUM] -- The (internal number of the) accessing
632  // symbol of state STATE-NUM.
633  static const unsigned char yystos_[];
634 
635  // YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
636  static const unsigned char yyr1_[];
637 
638  // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
639  static const unsigned char yyr2_[];
640 
641 
643  static std::string yytnamerr_ (const char *n);
644 
645 
647  static const char* const yytname_[];
648 #if YYDEBUG
649  // YYRLINE[YYN] -- Source line where rule number YYN was defined.
650  static const unsigned short int yyrline_[];
652  virtual void yy_reduce_print_ (int r);
654  virtual void yystack_print_ ();
655 
656  // Debugging.
657  int yydebug_;
658  std::ostream* yycdebug_;
659 
663  template <typename Base>
664  void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
665 #endif
666 
671  template <typename Base>
672  void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
673 
674  private:
676  struct by_state
677  {
679  by_state ();
680 
682  typedef state_type kind_type;
683 
685  by_state (kind_type s);
686 
688  by_state (const by_state& other);
689 
691  void clear ();
692 
694  void move (by_state& that);
695 
698  symbol_number_type type_get () const;
699 
701  enum { empty_state = -1 };
702 
705  state_type state;
706  };
707 
709  struct stack_symbol_type : basic_symbol<by_state>
710  {
716  stack_symbol_type (state_type s, symbol_type& sym);
719  };
720 
723 
725  stack_type yystack_;
726 
732  void yypush_ (const char* m, stack_symbol_type& s);
733 
740  void yypush_ (const char* m, state_type s, symbol_type& sym);
741 
743  void yypop_ (unsigned int n = 1);
744 
746  enum
747  {
748  yyeof_ = 0,
749  yylast_ = 70,
750  yynnts_ = 20,
751  yyfinal_ = 5,
753  yyerrcode_ = 256,
755  };
756 
757 
758  // User arguments.
760  };
761 
762  // Symbol number corresponding to token number t.
763  inline
765  parser::yytranslate_ (token_type t)
766  {
767  static
768  const token_number_type
769  translate_table[] =
770  {
771  0, 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, 2, 2, 2, 2,
780  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
781  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
782  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
783  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
784  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
785  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
786  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
787  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
788  2, 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, 1, 2, 3, 4,
797  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
798  15, 16, 17
799  };
800  const unsigned int user_token_number_max_ = 272;
801  const token_number_type undef_token_ = 2;
802 
803  if (static_cast<int>(t) <= yyeof_)
804  return yyeof_;
805  else if (static_cast<unsigned int> (t) <= user_token_number_max_)
806  return translate_table[t];
807  else
808  return undef_token_;
809  }
810 
811  inline
812  parser::syntax_error::syntax_error (const location_type& l, const std::string& m)
813  : std::runtime_error (m)
814  , location (l)
815  {}
816 
817  // basic_symbol.
818  template <typename Base>
819  inline
821  : value ()
822  {}
823 
824  template <typename Base>
825  inline
827  : Base (other)
828  , value ()
829  , location (other.location)
830  {
831  switch (other.type_get ())
832  {
833  case 31: // path
834  value.copy< paths_t > (other.value);
835  break;
836 
837  case 20: // stmt_list
838  case 21: // stmt
839  case 30: // nodes
840  case 32: // edge_stmt
841  case 36: // subgraph
842  value.copy< states_t > (other.value);
843  break;
844 
845  case 17: // ID
846  case 23: // attr_list
847  case 24: // attr_list.opt
848  case 25: // attr_assign
849  case 26: // a_list.1
850  case 29: // a_list.0
851  case 33: // node_stmt
852  case 34: // node_id
853  case 37: // id.opt
854  value.copy< string_t > (other.value);
855  break;
856 
857  default:
858  break;
859  }
860 
861  }
862 
863 
864  template <typename Base>
865  inline
866  parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const semantic_type& v, const location_type& l)
867  : Base (t)
868  , value ()
869  , location (l)
870  {
871  (void) v;
872  switch (this->type_get ())
873  {
874  case 31: // path
875  value.copy< paths_t > (v);
876  break;
877 
878  case 20: // stmt_list
879  case 21: // stmt
880  case 30: // nodes
881  case 32: // edge_stmt
882  case 36: // subgraph
883  value.copy< states_t > (v);
884  break;
885 
886  case 17: // ID
887  case 23: // attr_list
888  case 24: // attr_list.opt
889  case 25: // attr_assign
890  case 26: // a_list.1
891  case 29: // a_list.0
892  case 33: // node_stmt
893  case 34: // node_id
894  case 37: // id.opt
895  value.copy< string_t > (v);
896  break;
897 
898  default:
899  break;
900  }
901 }
902 
903 
904  // Implementation of basic_symbol constructor for each type.
905 
906  template <typename Base>
907  parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const location_type& l)
908  : Base (t)
909  , value ()
910  , location (l)
911  {}
912 
913  template <typename Base>
914  parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const paths_t v, const location_type& l)
915  : Base (t)
916  , value (v)
917  , location (l)
918  {}
919 
920  template <typename Base>
921  parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const states_t v, const location_type& l)
922  : Base (t)
923  , value (v)
924  , location (l)
925  {}
926 
927  template <typename Base>
928  parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const string_t v, const location_type& l)
929  : Base (t)
930  , value (v)
931  , location (l)
932  {}
933 
934 
935  template <typename Base>
936  inline
938  {
939  clear ();
940  }
941 
942  template <typename Base>
943  inline
944  void
946  {
947  // User destructor.
948  symbol_number_type yytype = this->type_get ();
949  basic_symbol<Base>& yysym = *this;
950  (void) yysym;
951  switch (yytype)
952  {
953  default:
954  break;
955  }
956 
957  // Type destructor.
958  switch (yytype)
959  {
960  case 31: // path
961  value.template destroy< paths_t > ();
962  break;
963 
964  case 20: // stmt_list
965  case 21: // stmt
966  case 30: // nodes
967  case 32: // edge_stmt
968  case 36: // subgraph
969  value.template destroy< states_t > ();
970  break;
971 
972  case 17: // ID
973  case 23: // attr_list
974  case 24: // attr_list.opt
975  case 25: // attr_assign
976  case 26: // a_list.1
977  case 29: // a_list.0
978  case 33: // node_stmt
979  case 34: // node_id
980  case 37: // id.opt
981  value.template destroy< string_t > ();
982  break;
983 
984  default:
985  break;
986  }
987 
988  Base::clear ();
989  }
990 
991  template <typename Base>
992  inline
993  bool
995  {
996  return Base::type_get () == empty_symbol;
997  }
998 
999  template <typename Base>
1000  inline
1001  void
1003  {
1004  super_type::move(s);
1005  switch (this->type_get ())
1006  {
1007  case 31: // path
1008  value.move< paths_t > (s.value);
1009  break;
1010 
1011  case 20: // stmt_list
1012  case 21: // stmt
1013  case 30: // nodes
1014  case 32: // edge_stmt
1015  case 36: // subgraph
1016  value.move< states_t > (s.value);
1017  break;
1018 
1019  case 17: // ID
1020  case 23: // attr_list
1021  case 24: // attr_list.opt
1022  case 25: // attr_assign
1023  case 26: // a_list.1
1024  case 29: // a_list.0
1025  case 33: // node_stmt
1026  case 34: // node_id
1027  case 37: // id.opt
1028  value.move< string_t > (s.value);
1029  break;
1030 
1031  default:
1032  break;
1033  }
1034 
1035  location = s.location;
1036  }
1037 
1038  // by_type.
1039  inline
1041  : type (empty_symbol)
1042  {}
1043 
1044  inline
1046  : type (other.type)
1047  {}
1048 
1049  inline
1051  : type (yytranslate_ (t))
1052  {}
1053 
1054  inline
1055  void
1057  {
1058  type = empty_symbol;
1059  }
1060 
1061  inline
1062  void
1064  {
1065  type = that.type;
1066  that.clear ();
1067  }
1068 
1069  inline
1070  int
1072  {
1073  return type;
1074  }
1075 
1076  inline
1079  {
1080  // YYTOKNUM[NUM] -- (External) token number corresponding to the
1081  // (internal) symbol number NUM (which must be that of a token). */
1082  static
1083  const unsigned short int
1084  yytoken_number_[] =
1085  {
1086  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1087  265, 266, 267, 268, 269, 270, 271, 272
1088  };
1089  return static_cast<token_type> (yytoken_number_[type]);
1090  }
1091  // Implementation of make_symbol for each symbol type.
1093  parser::make_END (const location_type& l)
1094  {
1095  return symbol_type (token::END, l);
1096  }
1097 
1099  parser::make_DIGRAPH (const location_type& l)
1100  {
1101  return symbol_type (token::DIGRAPH, l);
1102  }
1103 
1105  parser::make_EDGE (const location_type& l)
1106  {
1107  return symbol_type (token::EDGE, l);
1108  }
1109 
1111  parser::make_GRAPH (const location_type& l)
1112  {
1113  return symbol_type (token::GRAPH, l);
1114  }
1115 
1117  parser::make_NODE (const location_type& l)
1118  {
1119  return symbol_type (token::NODE, l);
1120  }
1121 
1123  parser::make_SUBGRAPH (const location_type& l)
1124  {
1125  return symbol_type (token::SUBGRAPH, l);
1126  }
1127 
1129  parser::make_LBRACE (const location_type& l)
1130  {
1131  return symbol_type (token::LBRACE, l);
1132  }
1133 
1135  parser::make_RBRACE (const location_type& l)
1136  {
1137  return symbol_type (token::RBRACE, l);
1138  }
1139 
1141  parser::make_LBRACKET (const location_type& l)
1142  {
1143  return symbol_type (token::LBRACKET, l);
1144  }
1145 
1147  parser::make_RBRACKET (const location_type& l)
1148  {
1149  return symbol_type (token::RBRACKET, l);
1150  }
1151 
1153  parser::make_EQ (const location_type& l)
1154  {
1155  return symbol_type (token::EQ, l);
1156  }
1157 
1159  parser::make_ARROW (const location_type& l)
1160  {
1161  return symbol_type (token::ARROW, l);
1162  }
1163 
1165  parser::make_COLON (const location_type& l)
1166  {
1167  return symbol_type (token::COLON, l);
1168  }
1169 
1171  parser::make_COMMA (const location_type& l)
1172  {
1173  return symbol_type (token::COMMA, l);
1174  }
1175 
1177  parser::make_SEMI (const location_type& l)
1178  {
1179  return symbol_type (token::SEMI, l);
1180  }
1181 
1183  parser::make_ID (const string_t& v, const location_type& l)
1184  {
1185  return symbol_type (token::ID, v, l);
1186  }
1187 
1188 
1189 #line 11 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:377
1190 } } } // vcsn::detail::dot
1191 #line 1192 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.hh" // lalr1.cc:377
1192 
1193 
1194 // // "%code provides" blocks.
1195 #line 63 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:377
1196 
1197  #define YY_DECL_(Class) \
1198  parser::symbol_type Class lex(driver& driver_)
1199  #define YY_DECL YY_DECL_(yyFlexLexer::)
1200 
1201 #line 1202 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.hh" // lalr1.cc:377
1202 
1203 
1204 #endif // !YY_YY_USERS_AKIM_SRC_LRDE_2_LIB_VCSN_DOT_PARSE_HH_INCLUDED
static const unsigned char yyr1_[]
Definition: parse.hh:636
static symbol_type make_SUBGRAPH(const location_type &l)
Definition: parse.hh:1123
static symbol_type make_ID(const string_t &v, const location_type &l)
Definition: parse.hh:1183
symbol_number_type type_get() const
The (internal) type number (corresponding to state).
Definition: parse.cc:303
int symbol_number_type
Symbol type: an internal symbol number.
Definition: parse.hh:377
void yypop_(unsigned int n=1)
Pop n symbols the three stacks.
Definition: parse.cc:553
Abstract a location.
Definition: location.hh:47
int debug_level_type
Type for debugging levels.
Definition: parse.hh:560
static const signed char yytable_[]
Definition: parse.hh:627
std::ostream & debug_stream() const
The current debugging stream.
Definition: parse.cc:560
std::string type(const automaton &a)
The implementation type of a.
Definition: others.cc:231
void swap(self_type &other)
Swap the content with other, of same type.
Definition: parse.hh:238
Define the vcsn::rat::location class.
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
Definition: symbol.hh:23
unsigned char token_number_type
Internal symbol number for tokens (subsumed by symbol_number_type).
Definition: parse.hh:383
stack_symbol_type & operator=(const stack_symbol_type &that)
Assignment, needed by push_back.
Definition: parse.cc:356
STL namespace.
std::ostream * yycdebug_
Definition: parse.hh:658
static symbol_type make_END(const location_type &l)
Definition: parse.hh:1093
const T * yyas_() const
Const accessor to raw memory as T.
Definition: parse.hh:288
debug_level_type debug_level() const
The current debugging level.
Definition: parse.cc:573
State and public interface for Dot parsing.
Definition: driver.hh:20
variant(const T &t)
Construct and fill.
Definition: parse.hh:186
basic_symbol< by_type > symbol_type
"External" symbols: returned by the scanner.
Definition: parse.hh:477
transitions_t transitions
Definition: parse.hh:77
basic_symbol()
Default constructor.
Definition: parse.hh:820
state_type state
The state.
Definition: parse.hh:705
static const unsigned short int yyrline_[]
Definition: parse.hh:650
self_type & operator=(const self_type &)
Prohibit blind copies.
by_state()
Default constructor.
Definition: parse.cc:272
variant< S > self_type
Type of *this.
Definition: parse.hh:178
static const signed char yycheck_[]
Definition: parse.hh:629
void yypush_(const char *m, stack_symbol_type &s)
Push a new state on the stack.
Definition: parse.cc:544
A Bison parser.
Definition: parse.hh:305
parser(driver &driver__yyarg)
Build a parser object.
Definition: parse.cc:251
static symbol_type make_DIGRAPH(const location_type &l)
Definition: parse.hh:1099
state_type yy_lr_goto_state_(state_type yystate, int yysym)
Compute post-reduction state.
Definition: parse.cc:586
void yy_print_(std::ostream &yyo, const basic_symbol< Base > &yysym) const
Display a symbol type, value and location.
Definition: parse.cc:406
static symbol_type make_LBRACKET(const location_type &l)
Definition: parse.hh:1141
An auxiliary type to compute the largest semantic type.
Definition: parse.hh:310
#define YY_ATTRIBUTE_PURE
Definition: parse.hh:116
"Internal" symbol: element of the stack.
Definition: parse.hh:709
static symbol_type make_EDGE(const location_type &l)
Definition: parse.hh:1105
static const signed char yytable_ninf_
Definition: parse.hh:603
static symbol_type make_SEMI(const location_type &l)
Definition: parse.hh:1177
int type
The symbol type.
Definition: parse.hh:473
basic_symbol & operator=(const basic_symbol &other)
Assignment operator.
~basic_symbol()
Destroy the symbol.
Definition: parse.hh:937
stack_type yystack_
The stack.
Definition: parse.hh:725
char dummy3[sizeof(string_t)]
Definition: parse.hh:331
Number of nonterminal symbols.
Definition: parse.hh:750
char yyraw[S]
A buffer large enough to store any of the semantic values.
Definition: parse.hh:299
variant< sizeof(union_type)> semantic_type
Symbol semantic values.
Definition: parse.hh:335
token::yytokentype token_type
(External) token type, as returned by yylex.
Definition: parse.hh:374
Type access provider for token (enum) based symbols.
Definition: parse.hh:443
static symbol_type make_LBRACE(const location_type &l)
Definition: parse.hh:1129
T & as()
Accessor to a built T.
Definition: parse.hh:215
void set_debug_level(debug_level_type l)
Set the current debugging level.
Definition: parse.cc:579
static symbol_type make_COLON(const location_type &l)
Definition: parse.hh:1165
vcsn::rat::location location_type
Symbol locations.
Definition: parse.hh:340
union vcsn::detail::dot::variant::@2 yybuffer_
long double yyalign_me
Strongest alignment constraints.
Definition: parse.hh:297
by_type()
Default constructor.
Definition: parse.hh:1040
token_type kind_type
The symbol type as needed by the constructor.
Definition: parse.hh:452
static token_number_type yytranslate_(token_type t)
Convert a scanner token number t to a symbol number.
Definition: parse.hh:765
static const unsigned char yydefact_[]
Definition: parse.hh:616
void set_debug_stream(std::ostream &)
Set the current debugging stream.
Definition: parse.cc:566
static bool yy_pact_value_is_default_(int yyvalue)
Whether the given yypact_ value indicates a defaulted state.
Definition: parse.cc:596
parser & operator=(const parser &)
syntax_error(const location_type &l, const std::string &m)
Definition: parse.hh:812
static const signed char yypact_[]
Definition: parse.hh:611
T & build(const T &t)
Instantiate a T in here from t.
Definition: parse.hh:207
Definition: a-star.hh:8
static const signed char yydefgoto_[]
Definition: parse.hh:622
static symbol_type make_EQ(const location_type &l)
Definition: parse.hh:1153
Define the vcsn::detail::dot::stack class.
static symbol_type make_RBRACKET(const location_type &l)
Definition: parse.hh:1147
Base super_type
Alias to Base.
Definition: parse.hh:395
static const unsigned char yystos_[]
Definition: parse.hh:633
stack< stack_symbol_type > stack_type
Stack type.
Definition: parse.hh:722
static symbol_type make_COMMA(const location_type &l)
Definition: parse.hh:1171
static symbol_type make_ARROW(const location_type &l)
Definition: parse.hh:1159
static symbol_type make_RBRACE(const location_type &l)
Definition: parse.hh:1135
state_type kind_type
The symbol type as needed by the constructor.
Definition: parse.hh:682
void move(basic_symbol &s)
Destructive move, s is emptied into this.
Definition: parse.hh:1002
const T & as() const
Const accessor to a built T (for printer).
Definition: parse.hh:223
location_type location
The location.
Definition: parse.hh:435
static const signed char yypact_ninf_
Definition: parse.hh:602
virtual int parse()
Parse.
Definition: parse.cc:608
void destroy()
Destroy the stored T.
Definition: parse.hh:266
void clear()
Destroy contents, and record that is empty.
Definition: parse.hh:945
static std::string yytnamerr_(const char *n)
Convert the symbol name n to a form suitable for a diagnostic.
Definition: parse.cc:218
void move(by_type &that)
Steal the symbol type from that.
Definition: parse.hh:1063
virtual void yy_reduce_print_(int r)
Report on the debug stream that the rule r is going to be reduced.
Definition: parse.cc:1406
int state_type
State numbers.
Definition: parse.hh:581
Syntax errors thrown from user actions.
Definition: parse.hh:343
void move(self_type &other)
Move the content of other to this.
Definition: parse.hh:248
std::vector< std::pair< string_t, string_t >> transitions_t
Definition: parse.hh:72
token_type token() const
The token.
Definition: parse.hh:1078
char dummy2[sizeof(states_t)]
Definition: parse.hh:320
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
Definition: parse.cc:1434
virtual std::string yysyntax_error_(state_type yystate, const symbol_type &yyla) const
Generate an error message.
Definition: parse.cc:1172
void move(by_state &that)
Steal the symbol type from that.
Definition: parse.cc:290
static const unsigned char yyr2_[]
Definition: parse.hh:639
virtual void yystack_print_()
Print the state stack on the debug stream.
Definition: parse.cc:1393
std::ostream & dot(const Aut &aut, std::ostream &out=std::cout, format fmt={})
Print an automaton in Graphviz's Dot format.
Definition: dot.hh:377
static symbol_type make_GRAPH(const location_type &l)
Definition: parse.hh:1111
symbol string_t
Definition: parse.hh:66
void clear()
Record that this symbol is empty.
Definition: parse.hh:1056
A char[S] buffer to store and retrieve objects.
Definition: parse.hh:175
std::vector< string_t > states_t
Definition: parse.hh:69
void clear()
Record that this symbol is empty.
Definition: parse.cc:283
T & build()
Instantiate an empty T in here.
Definition: parse.hh:199
semantic_type value
The semantic value.
Definition: parse.hh:432
stack_symbol_type()
Construct an empty symbol.
Definition: parse.cc:312
Provide a variadic mul on top of a binary mul(), and one().
Definition: fwd.hh:46
bool empty() const
Whether empty.
Definition: parse.hh:994
variant()
Empty construction.
Definition: parse.hh:181
basic_symbol< by_state > super_type
Superclass.
Definition: parse.hh:712
void yy_destroy_(const char *yymsg, basic_symbol< Base > &yysym) const
Reclaim the memory associated to a symbol.
Definition: parse.cc:397
void copy(const self_type &other)
Copy the content of other to this.
Definition: parse.hh:258
static bool yy_table_value_is_error_(int yyvalue)
Whether the given yytable_ value indicates a syntax error.
Definition: parse.cc:602
#define YYASSERT
Definition: parse.hh:101
~variant()
Destruction, allowed only if empty.
Definition: parse.hh:193
symbol_number_type type_get() const
The (internal) type number (corresponding to type).
Definition: parse.hh:1071
Termination state number.
Definition: parse.hh:751
T * yyas_()
Accessor to raw memory as T.
Definition: parse.hh:279
char dummy1[sizeof(paths_t)]
Definition: parse.hh:313
static const signed char yypgoto_[]
Definition: parse.hh:619
static const char *const yytname_[]
For a symbol, its name in clear.
Definition: parse.hh:647
Type access provider for state based symbols.
Definition: parse.hh:676
static symbol_type make_NODE(const location_type &l)
Definition: parse.hh:1117
Last index in yytable_.
Definition: parse.hh:749