Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
parse.cc
Go to the documentation of this file.
1 // A Bison parser, made by GNU Bison 3.0.2.13-aa0e.
2 
3 // Skeleton implementation 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 // // "%code top" blocks.
33 #line 130 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:392
34 
36 #define TRY(Loc, Stm) \
37  do { \
38  try \
39  { \
40  Stm; \
41  } \
42  catch (std::exception& e) \
43  { \
44  error(Loc, e.what()); \
45  YYERROR; \
46  } \
47  } while (false)
48 
49 #line 50 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:392
50 
51 
52 // First part of user declarations.
53 
54 #line 55 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:399
55 
56 # ifndef YY_NULLPTR
57 # if defined __cplusplus && 201103L <= __cplusplus
58 # define YY_NULLPTR nullptr
59 # else
60 # define YY_NULLPTR 0
61 # endif
62 # endif
63 
64 #include "parse.hh"
65 
66 // User implementation prologue.
67 
68 #line 69 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:407
69 // Unqualified %code blocks.
70 #line 73 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:408
71 
72  #include <cassert>
74  #include <lib/vcsn/dot/scan.hh>
75 
76  namespace vcsn
77  {
78  namespace detail
79  {
80  namespace dot
81  {
82  static std::ostream&
83  operator<<(std::ostream& o, const states_t ss)
84  {
85  bool first = true;
86  o << '{';
87  for (auto s: ss)
88  {
89  if (!first)
90  o << ", ";
91  o << s;
92  first = false;
93  }
94  return o << '}';
95  }
96 
97  static std::ostream&
98  operator<<(std::ostream& o, const paths_t ps)
99  {
100  bool first = true;
101  o << '{';
102  for (auto t: ps.transitions)
103  {
104  if (!first)
105  o << ", ";
106  o << t.first << "->" << t.second;
107  first = false;
108  }
109  return o << '}';
110  }
111 
113  static
114  inline
116  yylex(driver& driver_)
117  {
118  return driver_.scanner_->lex(driver_);
119  }
120  }
121  }
122  }
123 
124 #line 125 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:408
125 
126 
127 #ifndef YY_
128 # if defined YYENABLE_NLS && YYENABLE_NLS
129 # if ENABLE_NLS
130 # include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE.
131 # define YY_(msgid) dgettext ("bison-runtime", msgid)
132 # endif
133 # endif
134 # ifndef YY_
135 # define YY_(msgid) msgid
136 # endif
137 #endif
138 
139 #define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
140 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
141  If N is 0, then set CURRENT to the empty location which ends
142  the previous symbol: RHS[0] (always defined). */
143 
144 # ifndef YYLLOC_DEFAULT
145 # define YYLLOC_DEFAULT(Current, Rhs, N) \
146  do \
147  if (N) \
148  { \
149  (Current).begin = YYRHSLOC (Rhs, 1).begin; \
150  (Current).end = YYRHSLOC (Rhs, N).end; \
151  } \
152  else \
153  { \
154  (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
155  } \
156  while (/*CONSTCOND*/ false)
157 # endif
158 
159 
160 // Suppress unused-variable warnings by "using" E.
161 #define YYUSE(E) ((void) (E))
162 
163 // Enable debugging if requested.
164 #if YYDEBUG
165 
166 // A pseudo ostream that takes yydebug_ into account.
167 # define YYCDEBUG if (yydebug_) (*yycdebug_)
168 
169 # define YY_SYMBOL_PRINT(Title, Symbol) \
170  do { \
171  if (yydebug_) \
172  { \
173  *yycdebug_ << Title << ' '; \
174  yy_print_ (*yycdebug_, Symbol); \
175  *yycdebug_ << std::endl; \
176  } \
177  } while (false)
178 
179 # define YY_REDUCE_PRINT(Rule) \
180  do { \
181  if (yydebug_) \
182  yy_reduce_print_ (Rule); \
183  } while (false)
184 
185 # define YY_STACK_PRINT() \
186  do { \
187  if (yydebug_) \
188  yystack_print_ (); \
189  } while (false)
190 
191 #else // !YYDEBUG
192 
193 # define YYCDEBUG if (false) std::cerr
194 # define YY_SYMBOL_PRINT(Title, Symbol) YYUSE(Symbol)
195 # define YY_REDUCE_PRINT(Rule) static_cast<void>(0)
196 # define YY_STACK_PRINT() static_cast<void>(0)
197 
198 #endif // !YYDEBUG
199 
200 #define yyerrok (yyerrstatus_ = 0)
201 #define yyclearin (yyempty = true)
202 
203 #define YYACCEPT goto yyacceptlab
204 #define YYABORT goto yyabortlab
205 #define YYERROR goto yyerrorlab
206 #define YYRECOVERING() (!!yyerrstatus_)
207 
208 #line 11 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:474
209 namespace vcsn { namespace detail { namespace dot {
210 #line 211 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:474
211 
212  /* Return YYSTR after stripping away unnecessary quotes and
213  backslashes, so that it's suitable for yyerror. The heuristic is
214  that double-quoting is unnecessary unless the string contains an
215  apostrophe, a comma, or backslash (other than backslash-backslash).
216  YYSTR is taken from yytname. */
217  std::string
218  parser::yytnamerr_ (const char *yystr)
219  {
220  if (*yystr == '"')
221  {
222  std::string yyr = "";
223  char const *yyp = yystr;
224 
225  for (;;)
226  switch (*++yyp)
227  {
228  case '\'':
229  case ',':
230  goto do_not_strip_quotes;
231 
232  case '\\':
233  if (*++yyp != '\\')
234  goto do_not_strip_quotes;
235  // Fall through.
236  default:
237  yyr += *yyp;
238  break;
239 
240  case '"':
241  return yyr;
242  }
243  do_not_strip_quotes: ;
244  }
245 
246  return yystr;
247  }
248 
249 
251  parser::parser (driver& driver__yyarg)
252  :
253 #if YYDEBUG
254  yydebug_ (false),
255  yycdebug_ (&std::cerr),
256 #endif
257  driver_ (driver__yyarg)
258  {}
259 
261  {}
262 
263 
264  /*---------------.
265  | Symbol types. |
266  `---------------*/
267 
268 
269 
270  // by_state.
271  inline
273  : state (empty)
274  {}
275 
276  inline
278  : state (other.state)
279  {}
280 
281  inline
282  void
284  {
285  state = that.state;
286  that.state = empty;
287  }
288 
289  inline
291  : state (s)
292  {}
293 
294  inline
297  {
298  return state == empty ? 0 : yystos_[state];
299  }
300 
301  inline
303  {}
304 
305 
306  inline
308  : super_type (s, that.location)
309  {
310  switch (that.type_get ())
311  {
312  case 31: // path
313  value.move< paths_t > (that.value);
314  break;
315 
316  case 20: // stmt_list
317  case 21: // stmt
318  case 30: // nodes
319  case 32: // edge_stmt
320  case 36: // subgraph
321  value.move< states_t > (that.value);
322  break;
323 
324  case 16: // ID
325  case 23: // attr_list
326  case 24: // attr_list.opt
327  case 25: // attr_assign
328  case 26: // a_list.1
329  case 29: // a_list.0
330  case 33: // node_stmt
331  case 34: // node_id
332  case 37: // id.opt
333  value.move< string_t > (that.value);
334  break;
335 
336  default:
337  break;
338  }
339 
340  // that is emptied.
341  that.type = empty;
342  }
343 
344  inline
347  {
348  state = that.state;
349  switch (that.type_get ())
350  {
351  case 31: // path
352  value.copy< paths_t > (that.value);
353  break;
354 
355  case 20: // stmt_list
356  case 21: // stmt
357  case 30: // nodes
358  case 32: // edge_stmt
359  case 36: // subgraph
360  value.copy< states_t > (that.value);
361  break;
362 
363  case 16: // ID
364  case 23: // attr_list
365  case 24: // attr_list.opt
366  case 25: // attr_assign
367  case 26: // a_list.1
368  case 29: // a_list.0
369  case 33: // node_stmt
370  case 34: // node_id
371  case 37: // id.opt
372  value.copy< string_t > (that.value);
373  break;
374 
375  default:
376  break;
377  }
378 
379  location = that.location;
380  return *this;
381  }
382 
383 
384  template <typename Base>
385  inline
386  void
387  parser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
388  {
389  if (yymsg)
390  YY_SYMBOL_PRINT (yymsg, yysym);
391  }
392 
393 #if YYDEBUG
394  template <typename Base>
395  void
396  parser::yy_print_ (std::ostream& yyo,
397  const basic_symbol<Base>& yysym) const
398  {
399  std::ostream& yyoutput = yyo;
400  YYUSE (yyoutput);
401  symbol_number_type yytype = yysym.type_get ();
402  yyo << (yytype < yyntokens_ ? "token" : "nterm")
403  << ' ' << yytname_[yytype] << " ("
404  << yysym.location << ": ";
405  switch (yytype)
406  {
407  case 16: // ID
408 
409 #line 173 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:617
410  { debug_stream() << yysym.value.template as< string_t > (); }
411 #line 412 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:617
412  break;
413 
414  case 20: // stmt_list
415 //-
416 //-#line 177 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:617
417 //- { debug_stream() << yysym.value.template as< states_t > (); }
418 //-#line 419 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:617
419 //- break;
420 
421  case 21: // stmt
422 
423 #line 177 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:617
424  { debug_stream() << yysym.value.template as< states_t > (); }
425 #line 426 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:617
426  break;
427 
428  case 23: // attr_list
429 //-
430 //-#line 173 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:617
431 //- { debug_stream() << yysym.value.template as< string_t > (); }
432 //-#line 433 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:617
433 //- break;
434 
435  case 24: // attr_list.opt
436 //-
437 //-#line 173 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:617
438 //- { debug_stream() << yysym.value.template as< string_t > (); }
439 //-#line 440 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:617
440 //- break;
441 
442  case 25: // attr_assign
443 //-
444 //-#line 173 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:617
445 //- { debug_stream() << yysym.value.template as< string_t > (); }
446 //-#line 447 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:617
447 //- break;
448 
449  case 26: // a_list.1
450 //-
451 //-#line 173 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:617
452 //- { debug_stream() << yysym.value.template as< string_t > (); }
453 //-#line 454 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:617
454 //- break;
455 
456  case 29: // a_list.0
457 
458 #line 173 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:617
459  { debug_stream() << yysym.value.template as< string_t > (); }
460 #line 461 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:617
461  break;
462 
463  case 30: // nodes
464 
465 #line 177 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:617
466  { debug_stream() << yysym.value.template as< states_t > (); }
467 #line 468 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:617
468  break;
469 
470  case 31: // path
471 
472 #line 281 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:617
473  { debug_stream() << yysym.value.template as< paths_t > (); }
474 #line 475 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:617
475  break;
476 
477  case 32: // edge_stmt
478 
479 #line 177 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:617
480  { debug_stream() << yysym.value.template as< states_t > (); }
481 #line 482 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:617
482  break;
483 
484  case 33: // node_stmt
485 //-
486 //-#line 173 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:617
487 //- { debug_stream() << yysym.value.template as< string_t > (); }
488 //-#line 489 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:617
489 //- break;
490 
491  case 34: // node_id
492 
493 #line 173 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:617
494  { debug_stream() << yysym.value.template as< string_t > (); }
495 #line 496 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:617
496  break;
497 
498  case 36: // subgraph
499 
500 #line 177 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:617
501  { debug_stream() << yysym.value.template as< states_t > (); }
502 #line 503 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:617
503  break;
504 
505  case 37: // id.opt
506 
507 #line 173 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:617
508  { debug_stream() << yysym.value.template as< string_t > (); }
509 #line 510 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:617
510  break;
511 
512 
513  default:
514  break;
515  }
516  yyo << ')';
517  }
518 #endif
519 
520  inline
521  void
522  parser::yypush_ (const char* m, state_type s, symbol_type& sym)
523  {
524  stack_symbol_type t (s, sym);
525  yypush_ (m, t);
526  }
527 
528  inline
529  void
530  parser::yypush_ (const char* m, stack_symbol_type& s)
531  {
532  if (m)
533  YY_SYMBOL_PRINT (m, s);
534  yystack_.push (s);
535  }
536 
537  inline
538  void
539  parser::yypop_ (unsigned int n)
540  {
541  yystack_.pop (n);
542  }
543 
544 #if YYDEBUG
545  std::ostream&
547  {
548  return *yycdebug_;
549  }
550 
551  void
552  parser::set_debug_stream (std::ostream& o)
553  {
554  yycdebug_ = &o;
555  }
556 
557 
560  {
561  return yydebug_;
562  }
563 
564  void
566  {
567  yydebug_ = l;
568  }
569 #endif // YYDEBUG
570 
571  inline parser::state_type
573  {
574  int yyr = yypgoto_[yysym - yyntokens_] + yystate;
575  if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
576  return yytable_[yyr];
577  else
578  return yydefgoto_[yysym - yyntokens_];
579  }
580 
581  inline bool
583  {
584  return yyvalue == yypact_ninf_;
585  }
586 
587  inline bool
589  {
590  return yyvalue == yytable_ninf_;
591  }
592 
593  int
595  {
597  bool yyempty = true;
598 
599  // State.
600  int yyn;
602  int yylen = 0;
603 
604  // Error handling.
605  int yynerrs_ = 0;
606  int yyerrstatus_ = 0;
607 
609  symbol_type yyla;
610 
612  stack_symbol_type yyerror_range[3];
613 
615  int yyresult;
616 
617  // FIXME: This shoud be completely indented. It is not yet to
618  // avoid gratuitous conflicts when merging into the master branch.
619  try
620  {
621  YYCDEBUG << "Starting parse" << std::endl;
622 
623 
624  // User initialization code.
625  #line 147 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:725
626 {
627  yyla.location = driver_.location_;
628 }
629 
630 #line 631 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:725
631 
632  /* Initialize the stack. The initial state will be set in
633  yynewstate, since the latter expects the semantical and the
634  location values to have been already stored, initialize these
635  stacks with a primary value. */
636  yystack_.clear ();
637  yypush_ (YY_NULLPTR, 0, yyla);
638 
639  // A new symbol was pushed on the stack.
640  yynewstate:
641  YYCDEBUG << "Entering state " << yystack_[0].state << std::endl;
642 
643  // Accept?
644  if (yystack_[0].state == yyfinal_)
645  goto yyacceptlab;
646 
647  goto yybackup;
648 
649  // Backup.
650  yybackup:
651 
652  // Try to take a decision without lookahead.
653  yyn = yypact_[yystack_[0].state];
654  if (yy_pact_value_is_default_ (yyn))
655  goto yydefault;
656 
657  // Read a lookahead token.
658  if (yyempty)
659  {
660  YYCDEBUG << "Reading a token: ";
661  try
662  {
663  symbol_type yylookahead (yylex (driver_));
664  yyla.move (yylookahead);
665  }
666  catch (const syntax_error& yyexc)
667  {
668  error (yyexc);
669  goto yyerrlab1;
670  }
671  yyempty = false;
672  }
673  YY_SYMBOL_PRINT ("Next token is", yyla);
674 
675  /* If the proper action on seeing token YYLA.TYPE is to reduce or
676  to detect an error, take that action. */
677  yyn += yyla.type_get ();
678  if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type_get ())
679  goto yydefault;
680 
681  // Reduce or error.
682  yyn = yytable_[yyn];
683  if (yyn <= 0)
684  {
685  if (yy_table_value_is_error_ (yyn))
686  goto yyerrlab;
687  yyn = -yyn;
688  goto yyreduce;
689  }
690 
691  // Discard the token being shifted.
692  yyempty = true;
693 
694  // Count tokens shifted since error; after three, turn off error status.
695  if (yyerrstatus_)
696  --yyerrstatus_;
697 
698  // Shift the lookahead token.
699  yypush_ ("Shifting", yyn, yyla);
700  goto yynewstate;
701 
702  /*-----------------------------------------------------------.
703  | yydefault -- do the default action for the current state. |
704  `-----------------------------------------------------------*/
705  yydefault:
706  yyn = yydefact_[yystack_[0].state];
707  if (yyn == 0)
708  goto yyerrlab;
709  goto yyreduce;
710 
711  /*-----------------------------.
712  | yyreduce -- Do a reduction. |
713  `-----------------------------*/
714  yyreduce:
715  yylen = yyr2_[yyn];
716  {
717  stack_symbol_type yylhs;
718  yylhs.state = yy_lr_goto_state_(yystack_[yylen].state, yyr1_[yyn]);
719  /* Variants are always initialized to an empty instance of the
720  correct type. The default '$$ = $1' action is NOT applied
721  when using variants. */
722  switch (yyr1_[yyn])
723  {
724  case 31: // path
725  yylhs.value.build< paths_t > ();
726  break;
727 
728  case 20: // stmt_list
729  case 21: // stmt
730  case 30: // nodes
731  case 32: // edge_stmt
732  case 36: // subgraph
733  yylhs.value.build< states_t > ();
734  break;
735 
736  case 16: // ID
737  case 23: // attr_list
738  case 24: // attr_list.opt
739  case 25: // attr_assign
740  case 26: // a_list.1
741  case 29: // a_list.0
742  case 33: // node_stmt
743  case 34: // node_id
744  case 37: // id.opt
745  yylhs.value.build< string_t > ();
746  break;
747 
748  default:
749  break;
750  }
751 
752 
753  // Compute the default @$.
754  {
756  YYLLOC_DEFAULT (yylhs.location, slice, yylen);
757  }
758 
759  // Perform the reduction.
760  YY_REDUCE_PRINT (yyn);
761  try
762  {
763  switch (yyn)
764  {
765  case 2:
766 //-#line 184 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
767 //- {}
768 //-#line 769 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
769 //- break;
770 
771  case 3:
772 #line 188 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
773  {}
774 #line 775 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
775  break;
776 
777  case 4:
778 #line 190 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
779  {
780  // Preserve the set of states.
781  std::swap(yylhs.value.as< states_t > (), yystack_[2].value.as< states_t > ());
782  for (auto s: yystack_[1].value.as< states_t > ())
783  yylhs.value.as< states_t > ().emplace_back(std::move(s));
784  }
785 #line 786 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
786  break;
787 
788  case 5:
789 #line 199 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
790  { yylhs.value.as< states_t > ().emplace_back(std::move(yystack_[0].value.as< string_t > ())); }
791 #line 792 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
792  break;
793 
794  case 6:
795 #line 200 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
796  { std::swap(yylhs.value.as< states_t > (), yystack_[0].value.as< states_t > ()); }
797 #line 798 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
798  break;
799 
800  case 7:
801 //-#line 201 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
802 //- {}
803 //-#line 804 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
804 //- break;
805 
806  case 8:
807 #line 202 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
808  {}
809 #line 810 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
810  break;
811 
812  case 9:
813 #line 203 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
814  { std::swap(yylhs.value.as< states_t > (), yystack_[0].value.as< states_t > ()); }
815 #line 816 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
816  break;
817 
818  case 10:
819 //-#line 207 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
820 //- {}
821 //-#line 822 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
822 //- break;
823 
824  case 11:
825 //-#line 208 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
826 //- {}
827 //-#line 828 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
828 //- break;
829 
830  case 12:
831 #line 209 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
832  {}
833 #line 834 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
834  break;
835 
836  case 13:
837 #line 214 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
838  {
839  std::swap(yylhs.value.as< string_t > (), yystack_[2].value.as< string_t > ().get().empty() ? yystack_[0].value.as< string_t > () : yystack_[2].value.as< string_t > ());
840  }
841 #line 842 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
842  break;
843 
844  case 14:
845 #line 222 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
846  { yylhs.value.as< string_t > () = ""; }
847 #line 848 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
848  break;
849 
850  case 15:
851 #line 223 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
852  { std::swap(yylhs.value.as< string_t > (), yystack_[0].value.as< string_t > ()); }
853 #line 854 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
854  break;
855 
856  case 16:
857 #line 228 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
858  {
859  static const string_t label{"label"};
860  static const string_t vcsn_context{"vcsn_context"};
861  if (yystack_[2].value.as< string_t > () == label)
862  std::swap(yylhs.value.as< string_t > (), yystack_[0].value.as< string_t > ());
863  else if (yystack_[2].value.as< string_t > () == vcsn_context)
864  driver_.setup_(yystack_[0].location, yystack_[0].value.as< string_t > ());
865  else
866  // Beware of the default "$$ = $1;" action.
867  yylhs.value.as< string_t > () = "";
868  }
869 #line 870 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
870  break;
871 
872  case 17:
873 #line 243 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
874  {
875  std::swap(yylhs.value.as< string_t > (), yystack_[2].value.as< string_t > ().get().empty() ? yystack_[0].value.as< string_t > () : yystack_[2].value.as< string_t > ());
876  }
877 #line 878 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
878  break;
879 
880  case 23:
881 #line 259 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
882  {}
883 #line 884 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
884  break;
885 
886  case 24:
887 #line 260 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
888  { std::swap(yylhs.value.as< string_t > (), yystack_[0].value.as< string_t > ()); }
889 #line 890 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
890  break;
891 
892  case 25:
893 #line 264 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
894  { yylhs.value.as< states_t > ().emplace_back(std::move(yystack_[0].value.as< string_t > ())); }
895 #line 896 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
896  break;
897 
898  case 26:
899 #line 265 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
900  { yylhs.value.as< states_t > () = yystack_[0].value.as< states_t > (); }
901 #line 902 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
902  break;
903 
904  case 27:
905 #line 284 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
906  {
907  for (auto s1: yystack_[2].value.as< states_t > ())
908  for (auto s2: yystack_[0].value.as< states_t > ())
909  yylhs.value.as< paths_t > ().transitions.emplace_back(s1, s2);
910  yylhs.value.as< paths_t > ().ends = yystack_[0].value.as< states_t > ();
911  }
912 #line 913 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
913  break;
914 
915  case 28:
916 #line 291 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
917  {
918  std::swap(yylhs.value.as< paths_t > ().transitions, yystack_[2].value.as< paths_t > ().transitions);
919  for (auto s1: yystack_[2].value.as< paths_t > ().ends)
920  for (auto s2: yystack_[0].value.as< states_t > ())
921  yylhs.value.as< paths_t > ().transitions.emplace_back(s1, s2);
922  yylhs.value.as< paths_t > ().ends = yystack_[0].value.as< states_t > ();
923  }
924 #line 925 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
925  break;
926 
927  case 29:
928 #line 302 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
929  {
930  for (auto t: yystack_[1].value.as< paths_t > ().transitions)
931  TRY(yystack_[0].location, driver_.edit_->add_entry(t.first, t.second, yystack_[0].value.as< string_t > ()));
932  }
933 #line 934 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
934  break;
935 
936  case 30:
937 #line 310 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
938  {
939  std::swap(yylhs.value.as< string_t > (), yystack_[1].value.as< string_t > ());
940  }
941 #line 942 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
942  break;
943 
944  case 31:
945 #line 317 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
946  {
947  // We need the editor to exist.
948  require(bool(driver_.edit_), yylhs.location, ": no vcsn_context");
949  std::swap(yylhs.value.as< string_t > (), yystack_[1].value.as< string_t > ());
950  if (yylhs.value.as< string_t > ().get()[0] == 'I')
951  TRY(yystack_[1].location, driver_.edit_->add_pre(yylhs.value.as< string_t > ()));
952  else if (yylhs.value.as< string_t > ().get()[0] == 'F')
953  TRY(yystack_[1].location, driver_.edit_->add_post(yylhs.value.as< string_t > ()));
954  else
955  // This is not needed, but it ensures that the states will be
956  // numbered by their order of appearance in the file.
957  TRY(yystack_[1].location, driver_.edit_->add_state(yylhs.value.as< string_t > ()));
958  }
959 #line 960 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
960  break;
961 
962  case 32:
963 //-#line 337 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
964 //- {}
965 //-#line 966 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
966 //- break;
967 
968  case 33:
969 //-#line 338 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
970 //- {}
971 //-#line 972 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
972 //- break;
973 
974  case 34:
975 #line 339 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
976  {}
977 #line 978 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
978  break;
979 
980  case 35:
981 //-#line 343 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
982 //- { std::swap(yylhs.value.as< states_t > (), yystack_[1].value.as< states_t > ()); }
983 //-#line 984 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
984 //- break;
985 
986  case 36:
987 #line 344 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
988  { std::swap(yylhs.value.as< states_t > (), yystack_[1].value.as< states_t > ()); }
989 #line 990 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
990  break;
991 
992  case 37:
993 #line 348 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
994  {}
995 #line 996 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
996  break;
997 
998  case 38:
999 #line 349 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:847
1000  { std::swap(yylhs.value.as< string_t > (), yystack_[0].value.as< string_t > ()); }
1001 #line 1002 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
1002  break;
1003 
1004 
1005 #line 1006 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:847
1006  default:
1007  break;
1008  }
1009  }
1010  catch (const syntax_error& yyexc)
1011  {
1012  error (yyexc);
1013  YYERROR;
1014  }
1015  YY_SYMBOL_PRINT ("-> $$ =", yylhs);
1016  yypop_ (yylen);
1017  yylen = 0;
1018  YY_STACK_PRINT ();
1019 
1020  // Shift the result of the reduction.
1021  yypush_ (YY_NULLPTR, yylhs);
1022  }
1023  goto yynewstate;
1024 
1025  /*--------------------------------------.
1026  | yyerrlab -- here on detecting error. |
1027  `--------------------------------------*/
1028  yyerrlab:
1029  // If not already recovering from an error, report this error.
1030  if (!yyerrstatus_)
1031  {
1032  ++yynerrs_;
1033  error (yyla.location, yysyntax_error_ (yystack_[0].state,
1034  yyempty ? yyempty_ : yyla.type_get ()));
1035  }
1036 
1037 
1038  yyerror_range[1].location = yyla.location;
1039  if (yyerrstatus_ == 3)
1040  {
1041  /* If just tried and failed to reuse lookahead token after an
1042  error, discard it. */
1043 
1044  // Return failure if at end of input.
1045  if (yyla.type_get () == yyeof_)
1046  YYABORT;
1047  else if (!yyempty)
1048  {
1049  yy_destroy_ ("Error: discarding", yyla);
1050  yyempty = true;
1051  }
1052  }
1053 
1054  // Else will try to reuse lookahead token after shifting the error token.
1055  goto yyerrlab1;
1056 
1057 
1058  /*---------------------------------------------------.
1059  | yyerrorlab -- error raised explicitly by YYERROR. |
1060  `---------------------------------------------------*/
1061  yyerrorlab:
1062 
1063  /* Pacify compilers like GCC when the user code never invokes
1064  YYERROR and the label yyerrorlab therefore never appears in user
1065  code. */
1066  if (false)
1067  goto yyerrorlab;
1068  yyerror_range[1].location = yystack_[yylen - 1].location;
1069  /* Do not reclaim the symbols of the rule whose action triggered
1070  this YYERROR. */
1071  yypop_ (yylen);
1072  yylen = 0;
1073  goto yyerrlab1;
1074 
1075  /*-------------------------------------------------------------.
1076  | yyerrlab1 -- common code for both syntax error and YYERROR. |
1077  `-------------------------------------------------------------*/
1078  yyerrlab1:
1079  yyerrstatus_ = 3; // Each real token shifted decrements this.
1080  {
1081  stack_symbol_type error_token;
1082  for (;;)
1083  {
1084  yyn = yypact_[yystack_[0].state];
1085  if (!yy_pact_value_is_default_ (yyn))
1086  {
1087  yyn += yyterror_;
1088  if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
1089  {
1090  yyn = yytable_[yyn];
1091  if (0 < yyn)
1092  break;
1093  }
1094  }
1095 
1096  // Pop the current state because it cannot handle the error token.
1097  if (yystack_.size () == 1)
1098  YYABORT;
1099 
1100  yyerror_range[1].location = yystack_[0].location;
1101  yy_destroy_ ("Error: popping", yystack_[0]);
1102  yypop_ ();
1103  YY_STACK_PRINT ();
1104  }
1105 
1106  yyerror_range[2].location = yyla.location;
1107  YYLLOC_DEFAULT (error_token.location, yyerror_range, 2);
1108 
1109  // Shift the error token.
1110  error_token.state = yyn;
1111  yypush_ ("Shifting", error_token);
1112  }
1113  goto yynewstate;
1114 
1115  // Accept.
1116  yyacceptlab:
1117  yyresult = 0;
1118  goto yyreturn;
1119 
1120  // Abort.
1121  yyabortlab:
1122  yyresult = 1;
1123  goto yyreturn;
1124 
1125  yyreturn:
1126  if (!yyempty)
1127  yy_destroy_ ("Cleanup: discarding lookahead", yyla);
1128 
1129  /* Do not reclaim the symbols of the rule whose action triggered
1130  this YYABORT or YYACCEPT. */
1131  yypop_ (yylen);
1132  while (1 < yystack_.size ())
1133  {
1134  yy_destroy_ ("Cleanup: popping", yystack_[0]);
1135  yypop_ ();
1136  }
1137 
1138  return yyresult;
1139  }
1140  catch (...)
1141  {
1142  YYCDEBUG << "Exception caught: cleaning lookahead and stack"
1143  << std::endl;
1144  // Do not try to display the values of the reclaimed symbols,
1145  // as their printer might throw an exception.
1146  if (!yyempty)
1147  yy_destroy_ (YY_NULLPTR, yyla);
1148 
1149  while (1 < yystack_.size ())
1150  {
1152  yypop_ ();
1153  }
1154  throw;
1155  }
1156  }
1157 
1158  void
1160  {
1161  error (yyexc.location, yyexc.what());
1162  }
1163 
1164  // Generate an error message.
1165  std::string
1167  {
1168  std::string yyres;
1169  // Number of reported tokens (one for the "unexpected", one per
1170  // "expected").
1171  size_t yycount = 0;
1172  // Its maximum.
1173  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1174  // Arguments of yyformat.
1175  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1176 
1177  /* There are many possibilities here to consider:
1178  - If this state is a consistent state with a default action, then
1179  the only way this function was invoked is if the default action
1180  is an error action. In that case, don't check for expected
1181  tokens because there are none.
1182  - The only way there can be no lookahead present (in yytoken) is
1183  if this state is a consistent state with a default action.
1184  Thus, detecting the absence of a lookahead is sufficient to
1185  determine that there is no unexpected or expected token to
1186  report. In that case, just report a simple "syntax error".
1187  - Don't assume there isn't a lookahead just because this state is
1188  a consistent state with a default action. There might have
1189  been a previous inconsistent state, consistent state with a
1190  non-default action, or user semantic action that manipulated
1191  yyla. (However, yyla is currently not documented for users.)
1192  - Of course, the expected token list depends on states to have
1193  correct lookahead information, and it depends on the parser not
1194  to perform extra reductions after fetching a lookahead from the
1195  scanner and before detecting a syntax error. Thus, state
1196  merging (from LALR or IELR) and default reductions corrupt the
1197  expected token list. However, the list is correct for
1198  canonical LR with one exception: it will still contain any
1199  token that will not be accepted due to an error action in a
1200  later state.
1201  */
1202  if (yytoken != yyempty_)
1203  {
1204  yyarg[yycount++] = yytname_[yytoken];
1205  int yyn = yypact_[yystate];
1206  if (!yy_pact_value_is_default_ (yyn))
1207  {
1208  /* Start YYX at -YYN if negative to avoid negative indexes in
1209  YYCHECK. In other words, skip the first -YYN actions for
1210  this state because they are default actions. */
1211  int yyxbegin = yyn < 0 ? -yyn : 0;
1212  // Stay within bounds of both yycheck and yytname.
1213  int yychecklim = yylast_ - yyn + 1;
1214  int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
1215  for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
1216  if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
1217  && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
1218  {
1219  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1220  {
1221  yycount = 1;
1222  break;
1223  }
1224  else
1225  yyarg[yycount++] = yytname_[yyx];
1226  }
1227  }
1228  }
1229 
1230  char const* yyformat = YY_NULLPTR;
1231  switch (yycount)
1232  {
1233 #define YYCASE_(N, S) \
1234  case N: \
1235  yyformat = S; \
1236  break
1237  YYCASE_(0, YY_("syntax error"));
1238  YYCASE_(1, YY_("syntax error, unexpected %s"));
1239  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1240  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1241  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1242  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1243 #undef YYCASE_
1244  }
1245 
1246  // Argument number.
1247  size_t yyi = 0;
1248  for (char const* yyp = yyformat; *yyp; ++yyp)
1249  if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
1250  {
1251  yyres += yytnamerr_ (yyarg[yyi++]);
1252  ++yyp;
1253  }
1254  else
1255  yyres += *yyp;
1256  return yyres;
1257  }
1258 
1259 
1260  const signed char parser::yypact_ninf_ = -23;
1261 
1262  const signed char parser::yytable_ninf_ = -27;
1263 
1264  const signed char
1265  parser::yypact_[] =
1266  {
1267  45, 8, 49, -23, 43, -23, -23, -1, 42, 42,
1268  42, -23, -23, 19, 8, 37, -23, -23, 41, 5,
1269  -23, -23, 22, 44, 38, -23, -23, -23, 4, 39,
1270  46, -23, 50, -23, -23, 6, 6, -23, -23, -23,
1271  47, 28, -23, 51, -23, -23, 52, -23, 53, -23,
1272  -23, -23, -23, -23, -23, 38, 42, 48, 21, -23,
1273  -23, -23, -23
1274  };
1275 
1276  const unsigned char
1277  parser::yydefact_[] =
1278  {
1279  0, 37, 0, 38, 0, 1, 3, 0, 0, 0,
1280  0, 3, 2, 32, 37, 21, 7, 8, 0, 14,
1281  6, 5, 14, 9, 23, 12, 10, 11, 0, 0,
1282  0, 31, 0, 22, 4, 0, 0, 15, 29, 30,
1283  0, 18, 24, 0, 36, 16, 33, 3, 32, 27,
1284  25, 26, 28, 19, 20, 23, 14, 0, 0, 17,
1285  13, 34, 35
1286  };
1287 
1288  const signed char
1289  parser::yypgoto_[] =
1290  {
1291  -23, -23, -11, -23, -23, 31, -21, -22, -23, -23,
1292  -23, 12, -17, -23, -23, -23, 9, -23, 11, 54
1293  };
1294 
1295  const signed char
1296  parser::yydefgoto_[] =
1297  {
1298  -1, 2, 7, 15, 16, 37, 38, 17, 42, 55,
1299  34, 43, 18, 19, 20, 21, 22, 31, 23, 4
1300  };
1301 
1302  const signed char
1303  parser::yytable_[] =
1304  {
1305  28, 39, 41, 8, 9, 10, 11, 12, 8, 9,
1306  10, 11, 44, 11, 24, 13, 14, 36, 49, 52,
1307  13, 14, 48, 14, 3, 8, 9, 10, 11, 62,
1308  29, 24, 30, 41, -25, 60, 58, 13, 14, 25,
1309  26, 27, 53, 54, 50, 50, 51, 51, 1, 5,
1310  6, 24, 33, 35, 40, 45, -26, 47, 29, 0,
1311  0, 56, 46, 0, 61, 57, 30, 59, 32
1312  };
1313 
1314  const signed char
1315  parser::yycheck_[] =
1316  {
1317  11, 22, 24, 4, 5, 6, 7, 8, 4, 5,
1318  6, 7, 8, 7, 9, 16, 17, 12, 35, 36,
1319  16, 17, 16, 17, 16, 4, 5, 6, 7, 8,
1320  11, 9, 13, 55, 12, 56, 47, 16, 17, 8,
1321  9, 10, 14, 15, 35, 36, 35, 36, 3, 0,
1322  7, 9, 15, 12, 16, 16, 12, 7, 11, -1,
1323  -1, 10, 16, -1, 16, 13, 13, 55, 14
1324  };
1325 
1326  const unsigned char
1327  parser::yystos_[] =
1328  {
1329  0, 3, 19, 16, 37, 0, 7, 20, 4, 5,
1330  6, 7, 8, 16, 17, 21, 22, 25, 30, 31,
1331  32, 33, 34, 36, 9, 23, 23, 23, 20, 11,
1332  13, 35, 37, 15, 28, 12, 12, 23, 24, 24,
1333  16, 25, 26, 29, 8, 16, 16, 7, 16, 30,
1334  34, 36, 30, 14, 15, 27, 10, 13, 20, 29,
1335  24, 16, 8
1336  };
1337 
1338  const unsigned char
1339  parser::yyr1_[] =
1340  {
1341  0, 18, 19, 20, 20, 21, 21, 21, 21, 21,
1342  22, 22, 22, 23, 24, 24, 25, 26, 27, 27,
1343  27, 28, 28, 29, 29, 30, 30, 31, 31, 32,
1344  33, 34, 35, 35, 35, 36, 36, 37, 37
1345  };
1346 
1347  const unsigned char
1348  parser::yyr2_[] =
1349  {
1350  0, 2, 5, 0, 3, 1, 1, 1, 1, 1,
1351  2, 2, 2, 4, 0, 1, 3, 3, 0, 1,
1352  1, 0, 1, 0, 1, 1, 1, 3, 3, 2,
1353  2, 2, 0, 2, 4, 5, 3, 0, 1
1354  };
1355 
1356 
1357 
1358  // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1359  // First, the terminals, then, starting at \a yyntokens_, nonterminals.
1360  const char*
1361  const parser::yytname_[] =
1362  {
1363  "END", "error", "$undefined", "\"digraph\"", "\"edge\"", "\"graph\"",
1364  "\"node\"", "\"{\"", "\"}\"", "\"[\"", "\"]\"", "\"=\"", "\"->\"",
1365  "\":\"", "\",\"", "\";\"", "ID", "\"subgraph\"", "$accept", "graph",
1366  "stmt_list", "stmt", "attr_stmt", "attr_list", "attr_list.opt",
1367  "attr_assign", "a_list.1", "comma.opt", "semi.opt", "a_list.0", "nodes",
1368  "path", "edge_stmt", "node_stmt", "node_id", "port.opt", "subgraph",
1369  "id.opt", YY_NULLPTR
1370  };
1371 
1372 #if YYDEBUG
1373  const unsigned short int
1374  parser::yyrline_[] =
1375  {
1376  0, 184, 184, 188, 189, 199, 200, 201, 202, 203,
1377  207, 208, 209, 213, 222, 223, 227, 242, 249, 249,
1378  249, 253, 254, 259, 260, 264, 265, 283, 290, 301,
1379  309, 316, 337, 338, 339, 343, 344, 348, 349
1380  };
1381 
1382  // Print the state stack on the debug stream.
1383  void
1385  {
1386  *yycdebug_ << "Stack now";
1388  i = yystack_.begin (),
1389  i_end = yystack_.end ();
1390  i != i_end; ++i)
1391  *yycdebug_ << ' ' << i->state;
1392  *yycdebug_ << std::endl;
1393  }
1394 
1395  // Report on the debug stream that the rule \a yyrule is going to be reduced.
1396  void
1398  {
1399  unsigned int yylno = yyrline_[yyrule];
1400  int yynrhs = yyr2_[yyrule];
1401  // Print the symbols being reduced, and their result.
1402  *yycdebug_ << "Reducing stack by rule " << yyrule - 1
1403  << " (line " << yylno << "):" << std::endl;
1404  // The symbols being reduced.
1405  for (int yyi = 0; yyi < yynrhs; yyi++)
1406  YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
1407  yystack_[(yynrhs) - (yyi + 1)]);
1408  }
1409 #endif // YYDEBUG
1410 
1411 
1412 #line 11 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:1155
1413 } } } // vcsn::detail::dot
1414 #line 1415 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.cc" // lalr1.cc:1155
1415 #line 351 "/Users/akim/src/lrde/vaucanson2/lib/vcsn/dot/parse.yy" // lalr1.cc:1156
1416 
1417 
1418 namespace vcsn
1419 {
1420  namespace detail
1421  {
1422  namespace dot
1423  {
1424  void
1425  parser::error(const location_type& l, const std::string& m)
1426  {
1427  driver_.error(l, m);
1428  }
1429  }
1430  }
1431 }
virtual void yystack_print_()
Print the state stack on the debug stream.
Definition: parse.cc:1384
Type access provider for state based symbols.
Definition: parse.hh:660
#define TRY(Loc, Stm)
Run Stm, and bounces exceptions into parse errors at Loc.
Definition: parse.cc:36
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
#define YY_REDUCE_PRINT(Rule)
Definition: parse.cc:179
location_type location
The location.
Definition: parse.hh:425
static const signed char yytable_ninf_
Definition: parse.hh:587
#define YY_(msgid)
Definition: parse.cc:135
static bool yy_pact_value_is_default_(int yyvalue)
Whether the given yypact_ value indicates a defaulted state.
Definition: parse.cc:582
#define YY_SYMBOL_PRINT(Title, Symbol)
Definition: parse.cc:169
symbol_number_type type_get() const
The (internal) type number (corresponding to state).
Definition: parse.cc:296
S::const_reverse_iterator const_iterator
Definition: stack.hh:52
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 const unsigned char yyr1_[]
Definition: parse.hh:620
#define YYABORT
Definition: parse.cc:204
State and public interface for Dot parsing.
Definition: driver.hh:21
#define YYERROR
Definition: parse.cc:205
#define YYLLOC_DEFAULT(Current, Rhs, N)
Definition: parse.cc:145
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
location_t location_
The inital location.
Definition: driver.hh:47
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
#define YY_NULLPTR
Definition: parse.cc:60
static bool yy_table_value_is_error_(int yyvalue)
Whether the given yytable_ value indicates a syntax error.
Definition: parse.cc:588
Termination state number.
Definition: parse.hh:731
location(const position &b, const position &e)
Construct a location from b to e.
Definition: location.hh:52
static std::string yytnamerr_(const char *n)
Convert the symbol name n to a form suitable for a diagnostic.
Definition: parse.cc:218
void push(T &t)
Steal the contents of t.
Definition: stack.hh:83
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
basic_symbol< by_type > symbol_type
"External" symbols: returned by the scanner.
Definition: parse.hh:465
static const unsigned short int yyrline_[]
Definition: parse.hh:634
static const unsigned char yystos_[]
Definition: parse.hh:617
static parser::symbol_type yylex(driver &driver_)
Use our local scanner object.
Definition: parse.cc:116
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
Definition: parse.cc:1425
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
#define YYCDEBUG
Definition: parse.cc:167
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
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
const_iterator begin() const
Definition: stack.hh:112
std::ostream * yycdebug_
Definition: parse.hh:642
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
int state_type
State numbers.
Definition: parse.hh:565
void error(const location_t &l, const std::string &m)
Report an error m at l.
Definition: driver.cc:69
semantic_type value
The semantic value.
Definition: parse.hh:422
static const signed char yycheck_[]
Definition: parse.hh:613
std::unique_ptr< yyFlexLexer > scanner_
The scanner.
Definition: driver.hh:39
Define the vcsn::detail::dot::parser class.
Abstract a location.
Definition: location.hh:47
#define YY_STACK_PRINT()
Definition: parse.cc:185
std::vector< string_t > states_t
Definition: parse.hh:71
#define YYCASE_(N, S)
void yy_print_(std::ostream &yyo, const basic_symbol< Base > &yysym) const
Display a symbol type, value and location.
Definition: parse.cc:396
std::shared_ptr< const detail::label_base > label
Definition: fwd.hh:46
int symbol_number_type
Internal symbol number.
Definition: parse.hh:377
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
static std::ostream & operator<<(std::ostream &o, const states_t ss)
Definition: parse.cc:83
stack_type yystack_
The stack.
Definition: parse.hh:704
static const signed char yydefgoto_[]
Definition: parse.hh:606
void setup_(const location_t &l, const std::string &ctx)
From context_, build edit_.
Definition: driver.cc:54
Present a slice of the top of a stack.
Definition: stack.hh:133
void set_debug_level(debug_level_type l)
Set the current debugging level.
Definition: parse.cc:565
transitions_t transitions
Definition: parse.hh:79
state_type state
The state.
Definition: parse.hh:684
#define YYUSE(E)
Definition: parse.cc:161
std::shared_ptr< vcsn::automaton_editor > edit_
An automaton editor that stores the one being built.
Definition: driver.hh:49
void yypop_(unsigned int n=1)
Pop n symbols the three stacks.
Definition: parse.cc:539
const_iterator end() const
Definition: stack.hh:119
static const signed char yypact_ninf_
Definition: parse.hh:586
"Internal" symbol: element of the stack.
Definition: parse.hh:688
parser(driver &driver__yyarg)
Build a parser object.
Definition: parse.cc:251
#define YYDEBUG
Definition: parse.hh:161
virtual int parse()
Parse.
Definition: parse.cc:594
void pop(unsigned int n=1)
Definition: stack.hh:91
S::size_type size() const
Definition: stack.hh:105
std::ostream & dot(const Aut &aut, std::ostream &out, bool dot2tex=false)
Definition: dot.hh:344
void require(bool b, Args &&...args)
If b is not verified, raise an error with args as message.
Definition: raise.hh:39