33 #line 128 "lib/vcsn/dot/parse.yy" // lalr1.cc:392
36 #define TRY(Loc, Stm) \
42 catch (std::exception& e) \
44 error(Loc, e.what()); \
49 #line 50 "./lib/vcsn/dot/parse.cc" // lalr1.cc:392
54 #line 55 "./lib/vcsn/dot/parse.cc" // lalr1.cc:399
57 # if defined __cplusplus && 201103L <= __cplusplus
58 # define YY_NULLPTR nullptr
68 #line 69 "./lib/vcsn/dot/parse.cc" // lalr1.cc:407
70 #line 71 "lib/vcsn/dot/parse.yy" // lalr1.cc:408
106 o << t.first <<
"->" << t.second;
118 return driver_.
scanner_->lex(driver_);
124 #line 125 "./lib/vcsn/dot/parse.cc" // lalr1.cc:408
128 # if defined YYENABLE_NLS && YYENABLE_NLS
130 # include <libintl.h>
131 # define YY_(msgid) dgettext ("bison-runtime", msgid)
135 # define YY_(msgid) msgid
139 #define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
144 # ifndef YYLLOC_DEFAULT
145 # define YYLLOC_DEFAULT(Current, Rhs, N) \
149 (Current).begin = YYRHSLOC (Rhs, 1).begin; \
150 (Current).end = YYRHSLOC (Rhs, N).end; \
154 (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
161 #define YYUSE(E) ((void) (E))
167 # define YYCDEBUG if (yydebug_) (*yycdebug_)
169 # define YY_SYMBOL_PRINT(Title, Symbol) \
173 *yycdebug_ << Title << ' '; \
174 yy_print_ (*yycdebug_, Symbol); \
175 *yycdebug_ << std::endl; \
179 # define YY_REDUCE_PRINT(Rule) \
182 yy_reduce_print_ (Rule); \
185 # define YY_STACK_PRINT() \
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)
200 #define yyerrok (yyerrstatus_ = 0)
201 #define yyclearin (yyempty = true)
203 #define YYACCEPT goto yyacceptlab
204 #define YYABORT goto yyabortlab
205 #define YYERROR goto yyerrorlab
206 #define YYRECOVERING() (!!yyerrstatus_)
208 #line 11 "lib/vcsn/dot/parse.yy" // lalr1.cc:474
209 namespace vcsn {
namespace detail {
namespace dot {
210 #line 211 "./lib/vcsn/dot/parse.cc" // lalr1.cc:474
222 std::string yyr =
"";
223 char const *yyp = yystr;
230 goto do_not_strip_quotes;
234 goto do_not_strip_quotes;
243 do_not_strip_quotes: ;
255 yycdebug_ (&
std::cerr),
257 driver_ (driver__yyarg)
278 : state (other.state)
298 return state == empty ? 0 :
yystos_[state];
310 switch (that.type_get ())
384 template <
typename Base>
394 template <
typename Base>
397 const basic_symbol<Base>& yysym)
const
399 std::ostream& yyoutput = yyo;
402 yyo << (yytype <
yyntokens_ ?
"token" :
"nterm")
404 << yysym.location <<
": ";
409 #line 172 "lib/vcsn/dot/parse.yy" // lalr1.cc:617
410 {
debug_stream() << yysym.value.template as< string_t > (); }
411 #line 412 "./lib/vcsn/dot/parse.cc" // lalr1.cc:617
423 #line 176 "lib/vcsn/dot/parse.yy" // lalr1.cc:617
424 {
debug_stream() << yysym.value.template as< states_t > (); }
425 #line 426 "./lib/vcsn/dot/parse.cc" // lalr1.cc:617
458 #line 172 "lib/vcsn/dot/parse.yy" // lalr1.cc:617
459 {
debug_stream() << yysym.value.template as< string_t > (); }
460 #line 461 "./lib/vcsn/dot/parse.cc" // lalr1.cc:617
465 #line 176 "lib/vcsn/dot/parse.yy" // lalr1.cc:617
466 {
debug_stream() << yysym.value.template as< states_t > (); }
467 #line 468 "./lib/vcsn/dot/parse.cc" // lalr1.cc:617
472 #line 280 "lib/vcsn/dot/parse.yy" // lalr1.cc:617
473 {
debug_stream() << yysym.value.template as< paths_t > (); }
474 #line 475 "./lib/vcsn/dot/parse.cc" // lalr1.cc:617
479 #line 176 "lib/vcsn/dot/parse.yy" // lalr1.cc:617
480 {
debug_stream() << yysym.value.template as< states_t > (); }
481 #line 482 "./lib/vcsn/dot/parse.cc" // lalr1.cc:617
493 #line 172 "lib/vcsn/dot/parse.yy" // lalr1.cc:617
494 {
debug_stream() << yysym.value.template as< string_t > (); }
495 #line 496 "./lib/vcsn/dot/parse.cc" // lalr1.cc:617
500 #line 176 "lib/vcsn/dot/parse.yy" // lalr1.cc:617
501 {
debug_stream() << yysym.value.template as< states_t > (); }
502 #line 503 "./lib/vcsn/dot/parse.cc" // lalr1.cc:617
507 #line 172 "lib/vcsn/dot/parse.yy" // lalr1.cc:617
508 {
debug_stream() << yysym.value.template as< string_t > (); }
509 #line 510 "./lib/vcsn/dot/parse.cc" // lalr1.cc:617
606 int yyerrstatus_ = 0;
621 YYCDEBUG <<
"Starting parse" << std::endl;
625 #line 145 "lib/vcsn/dot/parse.yy" // lalr1.cc:725
630 #line 631 "./lib/vcsn/dot/parse.cc" // lalr1.cc:725
664 yyla.
move (yylookahead);
677 yyn += yyla.type_get ();
699 yypush_ (
"Shifting", yyn, yyla);
772 #line 187 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
774 #line 775 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
778 #line 189 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
782 for (
auto s: yystack_[1].value.as<
states_t > ())
785 #line 786 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
789 #line 198 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
791 #line 792 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
795 #line 199 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
797 #line 798 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
807 #line 201 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
809 #line 810 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
813 #line 202 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
815 #line 816 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
831 #line 208 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
833 #line 834 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
837 #line 213 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
841 #line 842 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
845 #line 221 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
847 #line 848 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
851 #line 222 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
853 #line 854 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
857 #line 227 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
860 static const string_t vcsn_context{
"vcsn_context"};
863 else if (yystack_[2].value.as<
string_t > () == vcsn_context)
869 #line 870 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
873 #line 242 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
877 #line 878 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
881 #line 258 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
883 #line 884 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
887 #line 259 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
889 #line 890 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
893 #line 263 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
895 #line 896 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
899 #line 264 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
901 #line 902 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
905 #line 283 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
907 for (
auto s1: yystack_[2].value.as<
states_t > ())
908 for (
auto s2: yystack_[0].value.as<
states_t > ())
912 #line 913 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
916 #line 290 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
919 for (
auto s1: yystack_[2].value.as<
paths_t > ().
ends)
920 for (
auto s2: yystack_[0].value.as<
states_t > ())
924 #line 925 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
928 #line 301 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
933 #line 934 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
937 #line 309 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
941 #line 942 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
945 #line 316 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
959 #line 960 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
975 #line 338 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
977 #line 978 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
987 #line 343 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
989 #line 990 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
993 #line 347 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
995 #line 996 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
999 #line 348 "lib/vcsn/dot/parse.yy" // lalr1.cc:847
1001 #line 1002 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
1005 #line 1006 "./lib/vcsn/dot/parse.cc" // lalr1.cc:847
1034 yyempty ?
yyempty_ : yyla.type_get ()));
1039 if (yyerrstatus_ == 3)
1045 if (yyla.type_get () ==
yyeof_)
1084 yyn =
yypact_[yystack_[0].state];
1097 if (yystack_.size () == 1)
1110 error_token.
state = yyn;
1111 yypush_ (
"Shifting", error_token);
1127 yy_destroy_ (
"Cleanup: discarding lookahead", yyla);
1132 while (1 < yystack_.size ())
1142 YYCDEBUG <<
"Exception caught: cleaning lookahead and stack"
1173 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1175 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1204 yyarg[yycount++] =
yytname_[yytoken];
1211 int yyxbegin = yyn < 0 ? -yyn : 0;
1213 int yychecklim =
yylast_ - yyn + 1;
1215 for (
int yyx = yyxbegin; yyx < yyxend; ++yyx)
1219 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1233 #define YYCASE_(N, S) \
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"));
1248 for (
char const* yyp = yyformat; *yyp; ++yyp)
1249 if (yyp[0] ==
'%' && yyp[1] ==
's' && yyi < yycount)
1267 29, 20, 45, -23, 42, -23, -23, 1, 41, 41,
1268 41, 20, -23, -23, 5, 36, -23, -23, 40, 10,
1269 -23, -23, 26, 43, 37, -23, -23, -23, 47, 7,
1270 44, 46, -23, -23, -23, 14, 14, -23, -23, -23,
1271 48, -13, -23, 51, -23, -23, -23, 50, 52, -23,
1272 -23, -23, -23, -23, -23, 37, 41, 21, 53, -23,
1279 0, 37, 0, 38, 0, 1, 3, 0, 0, 0,
1280 0, 37, 3, 2, 32, 21, 7, 8, 0, 14,
1281 6, 5, 14, 9, 23, 12, 10, 11, 0, 0,
1282 0, 0, 31, 22, 4, 0, 0, 15, 29, 30,
1283 0, 18, 24, 0, 3, 36, 16, 33, 32, 27,
1284 25, 26, 28, 19, 20, 23, 14, 0, 0, 17,
1291 -23, -23, -11, -23, -23, 32, -22, -20, -23, -23,
1292 -23, 2, 8, -23, -23, -23, 11, -23, 13, 54
1298 -1, 2, 7, 15, 16, 37, 38, 17, 42, 55,
1299 34, 43, 18, 19, 20, 21, 22, 32, 23, 4
1305 39, 29, 53, 54, 41, 8, 9, 10, 11, 12,
1306 13, 8, 9, 10, 11, 12, 45, 30, 14, 31,
1307 24, 11, 12, 36, 14, 8, 9, 10, 11, 12,
1308 61, 48, 1, 57, 60, 41, 24, 3, 14, -25,
1309 25, 26, 27, 49, 52, 5, 50, 50, 51, 51,
1310 6, 24, 33, 35, 40, 44, -26, 59, 0, 0,
1311 30, 46, 56, 47, 58, 28, 31, 0, 0, 0,
1318 22, 12, 15, 16, 24, 4, 5, 6, 7, 8,
1319 9, 4, 5, 6, 7, 8, 9, 12, 17, 14,
1320 10, 7, 8, 13, 17, 4, 5, 6, 7, 8,
1321 9, 17, 3, 44, 56, 55, 10, 17, 17, 13,
1322 8, 9, 10, 35, 36, 0, 35, 36, 35, 36,
1323 8, 10, 16, 13, 17, 8, 13, 55, -1, -1,
1324 12, 17, 11, 17, 14, 11, 14, -1, -1, -1,
1331 0, 3, 19, 17, 37, 0, 8, 20, 4, 5,
1332 6, 7, 8, 9, 17, 21, 22, 25, 30, 31,
1333 32, 33, 34, 36, 10, 23, 23, 23, 37, 20,
1334 12, 14, 35, 16, 28, 13, 13, 23, 24, 24,
1335 17, 25, 26, 29, 8, 9, 17, 17, 17, 30,
1336 34, 36, 30, 15, 16, 27, 11, 20, 14, 29,
1343 0, 18, 19, 20, 20, 21, 21, 21, 21, 21,
1344 22, 22, 22, 23, 24, 24, 25, 26, 27, 27,
1345 27, 28, 28, 29, 29, 30, 30, 31, 31, 32,
1346 33, 34, 35, 35, 35, 36, 36, 37, 37
1352 0, 2, 5, 0, 3, 1, 1, 1, 1, 1,
1353 2, 2, 2, 4, 0, 1, 3, 3, 0, 1,
1354 1, 0, 1, 0, 1, 1, 1, 3, 3, 2,
1355 2, 2, 0, 2, 4, 5, 3, 0, 1
1365 "END",
"error",
"$undefined",
"\"digraph\"",
"\"edge\"",
"\"graph\"",
1366 "\"node\"",
"\"subgraph\"",
"\"{\"",
"\"}\"",
"\"[\"",
"\"]\"",
"\"=\"",
1367 "\"->\"",
"\":\"",
"\",\"",
"\";\"",
"ID",
"$accept",
"graph",
1368 "stmt_list",
"stmt",
"attr_stmt",
"attr_list",
"attr_list.opt",
1369 "attr_assign",
"a_list.1",
"comma.opt",
"semi.opt",
"a_list.0",
"nodes",
1370 "path",
"edge_stmt",
"node_stmt",
"node_id",
"port.opt",
"subgraph",
1375 const unsigned short int
1378 0, 183, 183, 187, 188, 198, 199, 200, 201, 202,
1379 206, 207, 208, 212, 221, 222, 226, 241, 248, 248,
1380 248, 252, 253, 258, 259, 263, 264, 282, 289, 300,
1381 308, 315, 336, 337, 338, 342, 343, 347, 348
1401 unsigned int yylno =
yyrline_[yyrule];
1402 int yynrhs =
yyr2_[yyrule];
1404 *
yycdebug_ <<
"Reducing stack by rule " << yyrule - 1
1405 <<
" (line " << yylno <<
"):" << std::endl;
1407 for (
int yyi = 0; yyi < yynrhs; yyi++)
1414 #line 11 "lib/vcsn/dot/parse.yy" // lalr1.cc:1155
1416 #line 1417 "./lib/vcsn/dot/parse.cc" // lalr1.cc:1155
1417 #line 350 "lib/vcsn/dot/parse.yy" // lalr1.cc:1156
Syntax errors thrown from user actions.
int debug_level_type
Type for debugging levels.
void set_debug_level(debug_level_type l)
Set the current debugging level.
#define YYLLOC_DEFAULT(Current, Rhs, N)
void yy_print_(std::ostream &yyo, const basic_symbol< Base > &yysym) const
Display a symbol type, value and location.
Type access provider for state based symbols.
static const signed char yydefgoto_[]
Termination state number.
void require(Bool b, Args &&...args)
If b is not verified, raise an error with args as message.
debug_level_type debug_level() const
The current debugging level.
location_type location
The location.
auto transitions(const Aut &aut) -> decltype(all_transitions(aut, is_special_t< Aut >
All the transition indexes between visible states.
int state_type
State numbers.
static const unsigned char yyr2_[]
state_type state
The state.
void yy_destroy_(const char *yymsg, basic_symbol< Base > &yysym) const
Reclaim the memory associated to a symbol.
static const signed char yytable_ninf_
by_state()
Default constructor.
static std::ostream & operator<<(std::ostream &o, const states_t ss)
std::unique_ptr< yyFlexLexer > scanner_
The scanner.
location(const position &b, const position &e)
Construct a location from b to e.
semantic_type value
The semantic value.
"Internal" symbol: element of the stack.
#define YY_REDUCE_PRINT(Rule)
std::ostream & dot(const Aut &aut, std::ostream &out, format fmt={})
Print an automaton in Graphviz's Dot format.
virtual void yy_reduce_print_(int r)
Report on the debug stream that the rule r is going to be reduced.
void error(const location_t &l, const std::string &m)
Report an error m at l.
const_iterator begin() const
void setup_(const location_t &l, const std::string &ctx)
From context_, build edit_.
static const unsigned char yyr1_[]
std::vector< string_t > states_t
stack_symbol_type & operator=(const stack_symbol_type &that)
Assignment, needed by push_back.
static bool yy_table_value_is_error_(int yyvalue)
Whether the given yytable_ value indicates a syntax error.
virtual std::string yysyntax_error_(state_type yystate, symbol_number_type yytoken) const
Generate an error message.
static const unsigned short int yyrline_[]
location_t location_
The inital location.
virtual int parse()
Parse.
std::shared_ptr< const detail::label_base > label
std::ostream & debug_stream() const
The current debugging stream.
static const signed char yypgoto_[]
T & build()
Instantiate an empty T in here.
virtual void yystack_print_()
Print the state stack on the debug stream.
static const signed char yycheck_[]
Present a slice of the top of a stack.
void move(self_type &other)
Move the content of other to this.
static const char *const yytname_[]
For a symbol, its name in clear.
static bool yy_pact_value_is_default_(int yyvalue)
Whether the given yypact_ value indicates a defaulted state.
static const signed char yytable_[]
void pop(unsigned int n=1)
state_type yy_lr_goto_state_(state_type yystate, int yysym)
Compute post-reduction state.
static const signed char yypact_ninf_
static const unsigned char yystos_[]
const_iterator end() const
std::shared_ptr< vcsn::automaton_editor > edit_
An automaton editor that stores the one being built.
basic_symbol< by_type > symbol_type
"External" symbols: returned by the scanner.
S::const_reverse_iterator const_iterator
S::size_type size() const
void move(basic_symbol &s)
Destructive move, s is emptied into this.
void yypop_(unsigned int n=1)
Pop n symbols the three stacks.
transitions_t transitions
parser(driver &driver__yyarg)
Build a parser object.
void push(T &t)
Steal the contents of t.
State and public interface for Dot parsing.
void move(by_state &that)
Steal the symbol type from that.
#define YY_SYMBOL_PRINT(Title, Symbol)
static const unsigned char yydefact_[]
stack_symbol_type()
Construct an empty symbol.
#define TRY(Loc, Stm)
Run Stm, and bounces exceptions into parse errors at Loc.
void yypush_(const char *m, stack_symbol_type &s)
Push a new state on the stack.
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.
static parser::symbol_type yylex(driver &driver_)
Use our local scanner object.
int symbol_number_type
Internal symbol number.
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
T & as()
Accessor to a built T.
stack_type yystack_
The stack.
symbol_number_type type_get() const
The (internal) type number (corresponding to state).
static const signed char yypact_[]
Define the vcsn::detail::dot::parser class.