33 #line 128 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:397
36 #define TRY(Loc, Stm) \
42 catch (std::exception& e) \
44 error(Loc, e.what()); \
49 #line 50 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:397
54 #line 55 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:404
57 # if defined __cplusplus && 201103L <= __cplusplus
58 # define YY_NULLPTR nullptr
68 #line 69 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:412
70 #line 71 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:413
106 o << t.first <<
"->" << t.second;
118 return driver_.
scanner_->lex(driver_);
124 #line 125 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:413
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 (yyla.clear ())
203 #define YYACCEPT goto yyacceptlab
204 #define YYABORT goto yyabortlab
205 #define YYERROR goto yyerrorlab
206 #define YYRECOVERING() (!!yyerrstatus_)
208 #line 11 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:479
209 namespace vcsn {
namespace detail {
namespace dot {
210 #line 211 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:479
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)
273 : state (empty_state)
278 : state (other.state)
305 if (state == empty_state)
320 switch (that.type_get ())
394 template <
typename Base>
404 template <
typename Base>
409 std::ostream& yyoutput = yyo;
416 yyo << (yytype <
yyntokens_ ?
"token" :
"nterm")
423 #line 171 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:636
425 #line 426 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:636
437 #line 175 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:636
439 #line 440 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:636
472 #line 171 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:636
474 #line 475 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:636
479 #line 175 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:636
481 #line 482 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:636
486 #line 279 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:636
488 #line 489 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:636
493 #line 175 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:636
495 #line 496 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:636
507 #line 171 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:636
509 #line 510 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:636
514 #line 175 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:636
516 #line 517 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:636
521 #line 171 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:636
523 #line 524 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:636
617 int yyerrstatus_ = 0;
632 YYCDEBUG <<
"Starting parse" << std::endl;
636 #line 145 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:741
641 #line 642 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:741
675 yyla.
move (yylookahead);
687 yyn += yyla.type_get ();
706 yypush_ (
"Shifting", yyn, yyla);
779 #line 186 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
781 #line 782 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
785 #line 188 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
789 for (
auto s: yystack_[1].value.as<
states_t > ())
792 #line 793 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
796 #line 197 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
798 #line 799 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
802 #line 198 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
804 #line 805 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
814 #line 200 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
816 #line 817 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
820 #line 201 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
822 #line 823 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
838 #line 207 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
840 #line 841 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
844 #line 212 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
848 #line 849 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
852 #line 220 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
854 #line 855 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
858 #line 221 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
860 #line 861 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
864 #line 226 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
867 static const string_t vcsn_context{
"vcsn_context"};
870 else if (yystack_[2].value.as<
string_t > () == vcsn_context)
876 #line 877 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
880 #line 241 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
884 #line 885 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
888 #line 257 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
890 #line 891 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
894 #line 258 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
896 #line 897 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
900 #line 262 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
902 #line 903 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
906 #line 263 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
908 #line 909 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
912 #line 282 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
914 for (
auto s1: yystack_[2].value.as<
states_t > ())
915 for (
auto s2: yystack_[0].value.as<
states_t > ())
919 #line 920 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
923 #line 289 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
926 for (
auto s1: yystack_[2].value.as<
paths_t > ().
ends)
927 for (
auto s2: yystack_[0].value.as<
states_t > ())
931 #line 932 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
935 #line 300 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
940 #line 941 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
944 #line 308 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
948 #line 949 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
952 #line 315 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
966 #line 967 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
982 #line 337 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
984 #line 985 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
994 #line 342 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
996 #line 997 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
1000 #line 346 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
1002 #line 1003 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
1006 #line 347 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859
1008 #line 1009 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
1012 #line 1013 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859
1045 if (yyerrstatus_ == 3)
1051 if (yyla.type_get () ==
yyeof_)
1053 else if (!yyla.
empty ())
1090 yyn =
yypact_[yystack_[0].state];
1103 if (yystack_.size () == 1)
1116 error_token.
state = yyn;
1117 yypush_ (
"Shifting", error_token);
1133 yy_destroy_ (
"Cleanup: discarding lookahead", yyla);
1138 while (1 < yystack_.size ())
1148 YYCDEBUG <<
"Exception caught: cleaning lookahead and stack"
1178 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1180 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1209 int yytoken = yyla.type_get ();
1210 yyarg[yycount++] =
yytname_[yytoken];
1217 int yyxbegin = yyn < 0 ? -yyn : 0;
1219 int yychecklim =
yylast_ - yyn + 1;
1221 for (
int yyx = yyxbegin; yyx < yyxend; ++yyx)
1225 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1239 #define YYCASE_(N, S) \
1244 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
1245 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
1246 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1247 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1248 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1255 for (
char const* yyp = yyformat; *yyp; ++yyp)
1256 if (yyp[0] ==
'%' && yyp[1] ==
's' && yyi < yycount)
1274 45, 8, 49, -23, 43, -23, -23, -1, 42, 42,
1275 42, -23, -23, 19, 8, 37, -23, -23, 41, 5,
1276 -23, -23, 22, 44, 38, -23, -23, -23, 4, 39,
1277 46, -23, 50, -23, -23, 6, 6, -23, -23, -23,
1278 47, 28, -23, 51, -23, -23, 52, -23, 53, -23,
1279 -23, -23, -23, -23, -23, 38, 42, 48, 21, -23,
1286 0, 37, 0, 38, 0, 1, 3, 0, 0, 0,
1287 0, 3, 2, 32, 37, 21, 7, 8, 0, 14,
1288 6, 5, 14, 9, 23, 12, 10, 11, 0, 0,
1289 0, 31, 0, 22, 4, 0, 0, 15, 29, 30,
1290 0, 18, 24, 0, 36, 16, 33, 3, 32, 27,
1291 25, 26, 28, 19, 20, 23, 14, 0, 0, 17,
1298 -23, -23, -11, -23, -23, 31, -21, -22, -23, -23,
1299 -23, 12, -17, -23, -23, -23, 9, -23, 11, 54
1305 -1, 2, 7, 15, 16, 37, 38, 17, 42, 55,
1306 34, 43, 18, 19, 20, 21, 22, 31, 23, 4
1312 28, 39, 41, 8, 9, 10, 11, 12, 8, 9,
1313 10, 11, 44, 11, 24, 13, 14, 36, 49, 52,
1314 13, 14, 48, 14, 3, 8, 9, 10, 11, 62,
1315 29, 24, 30, 41, -25, 60, 58, 13, 14, 25,
1316 26, 27, 53, 54, 50, 50, 51, 51, 1, 5,
1317 6, 24, 33, 35, 40, 45, -26, 47, 29, 0,
1318 0, 56, 46, 0, 61, 57, 30, 59, 32
1324 11, 22, 24, 4, 5, 6, 7, 8, 4, 5,
1325 6, 7, 8, 7, 9, 16, 17, 12, 35, 36,
1326 16, 17, 16, 17, 16, 4, 5, 6, 7, 8,
1327 11, 9, 13, 55, 12, 56, 47, 16, 17, 8,
1328 9, 10, 14, 15, 35, 36, 35, 36, 3, 0,
1329 7, 9, 15, 12, 16, 16, 12, 7, 11, -1,
1330 -1, 10, 16, -1, 16, 13, 13, 55, 14
1336 0, 3, 19, 16, 37, 0, 7, 20, 4, 5,
1337 6, 7, 8, 16, 17, 21, 22, 25, 30, 31,
1338 32, 33, 34, 36, 9, 23, 23, 23, 20, 11,
1339 13, 35, 37, 15, 28, 12, 12, 23, 24, 24,
1340 16, 25, 26, 29, 8, 16, 16, 7, 16, 30,
1341 34, 36, 30, 14, 15, 27, 10, 13, 20, 29,
1348 0, 18, 19, 20, 20, 21, 21, 21, 21, 21,
1349 22, 22, 22, 23, 24, 24, 25, 26, 27, 27,
1350 27, 28, 28, 29, 29, 30, 30, 31, 31, 32,
1351 33, 34, 35, 35, 35, 36, 36, 37, 37
1357 0, 2, 5, 0, 3, 1, 1, 1, 1, 1,
1358 2, 2, 2, 4, 0, 1, 3, 3, 0, 1,
1359 1, 0, 1, 0, 1, 1, 1, 3, 3, 2,
1360 2, 2, 0, 2, 4, 5, 3, 0, 1
1370 "END",
"error",
"$undefined",
"\"digraph\"",
"\"edge\"",
"\"graph\"",
1371 "\"node\"",
"\"{\"",
"\"}\"",
"\"[\"",
"\"]\"",
"\"=\"",
"\"->\"",
1372 "\":\"",
"\",\"",
"\";\"",
"ID",
"\"subgraph\"",
"$accept",
"graph",
1373 "stmt_list",
"stmt",
"attr_stmt",
"attr_list",
"attr_list.opt",
1374 "attr_assign",
"a_list.1",
"comma.opt",
"semi.opt",
"a_list.0",
"nodes",
1375 "path",
"edge_stmt",
"node_stmt",
"node_id",
"port.opt",
"subgraph",
1380 const unsigned short int
1383 0, 182, 182, 186, 187, 197, 198, 199, 200, 201,
1384 205, 206, 207, 211, 220, 221, 225, 240, 247, 247,
1385 247, 251, 252, 257, 258, 262, 263, 281, 288, 299,
1386 307, 314, 335, 336, 337, 341, 342, 346, 347
1406 unsigned int yylno =
yyrline_[yyrule];
1407 int yynrhs =
yyr2_[yyrule];
1409 *
yycdebug_ <<
"Reducing stack by rule " << yyrule - 1
1410 <<
" (line " << yylno <<
"):" << std::endl;
1412 for (
int yyi = 0; yyi < yynrhs; yyi++)
1419 #line 11 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:1167
1421 #line 1422 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:1167
1422 #line 349 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:1168
static const unsigned short int yyrline_[]
static std::ostream & operator<<(std::ostream &o, const states_t ss)
static const unsigned char yyr2_[]
void yypush_(const char *m, stack_symbol_type &s)
Push a new state on the stack.
std::ostream & debug_stream() const
The current debugging stream.
#define YYLLOC_DEFAULT(Current, Rhs, N)
void move(self_type &other)
Move the content of other to this.
std::shared_ptr< const detail::label_base > label
void set_debug_stream(std::ostream &)
Set the current debugging stream.
void move(basic_symbol &s)
Destructive move, s is emptied into this.
stack_type yystack_
The stack.
T & build()
Instantiate an empty T in here.
debug_level_type debug_level() const
The current debugging level.
std::shared_ptr< vcsn::automaton_editor > edit_
An automaton editor that stores the one being built.
Termination state number.
static const signed char yydefgoto_[]
virtual void yy_reduce_print_(int r)
Report on the debug stream that the rule r is going to be reduced.
stack_symbol_type()
Construct an empty symbol.
location_t location_
The inital location.
std::vector< string_t > states_t
void set_debug_level(debug_level_type l)
Set the current debugging level.
static const signed char yycheck_[]
static parser::symbol_type yylex(driver &driver_)
Use our local scanner object.
void yypop_(unsigned int n=1)
Pop n symbols the three stacks.
void move(by_state &that)
Steal the symbol type from that.
const_iterator begin() const
static const signed char yypact_ninf_
parser(driver &driver__yyarg)
Build a parser object.
void yy_print_(std::ostream &yyo, const basic_symbol< Base > &yysym) const
Display a symbol type, value and location.
Syntax errors thrown from user actions.
int symbol_number_type
Symbol type: an internal symbol number.
void clear()
Destroy contents, and record that is empty.
bool empty() const
Whether empty.
virtual std::string yysyntax_error_(state_type yystate, const symbol_type &yyla) const
Generate an error message.
std::vector< stack_symbol_type >::const_reverse_iterator const_iterator
by_state()
Default constructor.
T & as()
Accessor to a built T.
"Internal" symbol: element of the stack.
virtual void yystack_print_()
Print the state stack on the debug stream.
transitions_t transitions
virtual int parse()
Parse.
static const signed char yytable_ninf_
const_iterator end() const
Define the vcsn::detail::dot::parser class.
static bool yy_pact_value_is_default_(int yyvalue)
Whether the given yypact_ value indicates a defaulted state.
void clear()
Record that this symbol is empty.
#define YY_SYMBOL_PRINT(Title, Symbol)
static const signed char yypact_[]
void require(bool b, Args &&...args)
If b is not verified, raise an error with args as message.
static const unsigned char yyr1_[]
location(const position &b, const position &e)
Construct a location from b to e.
int debug_level_type
Type for debugging levels.
static const signed char yytable_[]
#define TRY(Loc, Stm)
Run Stm, and bounces exceptions into parse errors at Loc.
void pop(unsigned int n=1)
#define YY_REDUCE_PRINT(Rule)
void yy_destroy_(const char *yymsg, basic_symbol< Base > &yysym) const
Reclaim the memory associated to a symbol.
Present a slice of the top of a stack.
std::unique_ptr< yyFlexLexer > scanner_
The scanner.
static bool yy_table_value_is_error_(int yyvalue)
Whether the given yytable_ value indicates a syntax error.
static std::string yytnamerr_(const char *n)
Convert the symbol name n to a form suitable for a diagnostic.
static const signed char yypgoto_[]
State and public interface for Dot parsing.
state_type state
The state.
basic_symbol< by_type > symbol_type
"External" symbols: returned by the scanner.
location_type location
The location.
static const char *const yytname_[]
For a symbol, its name in clear.
stack_symbol_type & operator=(const stack_symbol_type &that)
Assignment, needed by push_back.
static const unsigned char yystos_[]
std::ostream & dot(const Aut &aut, std::ostream &out, bool dot2tex=false)
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
void error(const location_t &l, const std::string &m)
Report an error m at l.
void push(T &t)
Steal the contents of t.
void setup_(const location_t &l, const std::string &ctx)
From context_, build edit_.
Type access provider for state based symbols.
state_type yy_lr_goto_state_(state_type yystate, int yysym)
Compute post-reduction state.
S::size_type size() const
static const unsigned char yydefact_[]
semantic_type value
The semantic value.
int state_type
State numbers.
symbol_number_type type_get() const
The (internal) type number (corresponding to state).