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)
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 172 "/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 176 "/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 172 "/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 176 "/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 282 "/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 176 "/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 172 "/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 176 "/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 172 "/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 187 "/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 189 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859 792 #line 793 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859 796 #line 198 "/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 199 "/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 201 "/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 202 "/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 844 #line 209 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859 846 #line 847 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859 850 #line 214 "/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 222 "/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 223 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859 866 #line 867 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859 870 #line 228 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859 882 #line 883 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859 886 #line 243 "/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 900 #line 260 "/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 261 "/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 265 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859 914 #line 915 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859 918 #line 266 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859 920 #line 921 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859 924 #line 285 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859 931 #line 932 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859 935 #line 292 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859 943 #line 944 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859 947 #line 303 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859 953 #line 954 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859 957 #line 312 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859 961 #line 962 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859 965 #line 319 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859 980 #line 981 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859 996 #line 342 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859 998 #line 999 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859 1008 #line 347 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859 1010 #line 1011 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859 1014 #line 351 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859 1016 #line 1017 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859 1020 #line 352 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:859 1022 #line 1023 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859 1026 #line 1027 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:859 1059 if (yyerrstatus_ == 3)
1065 if (yyla.type_get () ==
yyeof_)
1067 else if (!yyla.
empty ())
1104 yyn =
yypact_[yystack_[0].state];
1117 if (yystack_.size () == 1)
1130 error_token.
state = yyn;
1131 yypush_ (
"Shifting", error_token);
1147 yy_destroy_ (
"Cleanup: discarding lookahead", yyla);
1152 while (1 < yystack_.size ())
1162 YYCDEBUG <<
"Exception caught: cleaning lookahead and stack" 1192 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1194 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1223 int yytoken = yyla.type_get ();
1224 yyarg[yycount++] =
yytname_[yytoken];
1231 int yyxbegin = yyn < 0 ? -yyn : 0;
1233 int yychecklim =
yylast_ - yyn + 1;
1235 for (
int yyx = yyxbegin; yyx < yyxend; ++yyx)
1239 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1253 #define YYCASE_(N, S) \ 1258 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
1259 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
1260 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
1261 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
1262 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1269 for (
char const* yyp = yyformat; *yyp; ++yyp)
1270 if (yyp[0] ==
'%' && yyp[1] ==
's' && yyi < yycount)
1288 0, 9, 33, -24, 31, -24, -24, 1, -24, 37,
1289 37, 37, 9, -24, -24, 34, 44, -24, -24, 39,
1290 4, -24, -24, 17, 48, 14, -24, -24, -24, 41,
1291 15, 45, 46, -24, -24, -24, 21, 21, -24, -24,
1292 -24, -24, 52, 35, -24, 54, -24, -24, -24, 53,
1293 55, -24, -24, -24, -24, -24, -24, 14, 37, 36,
1294 49, -24, -24, -24, -24
1300 0, 39, 0, 40, 0, 1, 3, 0, 10, 0,
1301 0, 0, 39, 3, 2, 34, 22, 7, 8, 0,
1302 15, 6, 5, 15, 9, 0, 13, 11, 12, 0,
1303 0, 0, 0, 33, 23, 4, 0, 0, 16, 31,
1304 32, 25, 0, 19, 26, 0, 3, 38, 17, 35,
1305 34, 29, 27, 28, 30, 20, 21, 0, 15, 0,
1312 -24, -24, -12, -24, -24, 2, -23, -21, -24, -24,
1313 -24, 11, 18, -24, -24, -24, 20, -24, 22, 58
1319 -1, 2, 7, 16, 17, 38, 39, 18, 44, 57,
1320 35, 45, 19, 20, 21, 22, 23, 33, 24, 4
1326 40, 30, 8, 1, 43, 9, 10, 11, 12, 13,
1327 14, 26, 27, 28, 25, 41, 8, 37, 15, 9,
1328 10, 11, 12, 13, 47, -24, 3, 25, 12, 13,
1329 -27, 42, 15, 5, 59, 62, 43, 8, 50, 6,
1330 9, 10, 11, 12, 13, 63, 31, 25, 32, 46,
1331 55, 56, 36, 15, 51, 54, 52, 52, 53, 53,
1332 34, -28, 48, 49, 31, 58, 64, 60, 61, 32,
1339 23, 13, 1, 3, 25, 4, 5, 6, 7, 8,
1340 9, 9, 10, 11, 10, 1, 1, 13, 17, 4,
1341 5, 6, 7, 8, 9, 11, 17, 10, 7, 8,
1342 13, 17, 17, 0, 46, 58, 57, 1, 17, 8,
1343 4, 5, 6, 7, 8, 9, 12, 10, 14, 8,
1344 15, 16, 13, 17, 36, 37, 36, 37, 36, 37,
1345 16, 13, 17, 17, 12, 11, 17, 14, 57, 14,
1352 0, 3, 19, 17, 37, 0, 8, 20, 1, 4,
1353 5, 6, 7, 8, 9, 17, 21, 22, 25, 30,
1354 31, 32, 33, 34, 36, 10, 23, 23, 23, 37,
1355 20, 12, 14, 35, 16, 28, 13, 13, 23, 24,
1356 24, 1, 17, 25, 26, 29, 8, 9, 17, 17,
1357 17, 30, 34, 36, 30, 15, 16, 27, 11, 20,
1364 0, 18, 19, 20, 20, 21, 21, 21, 21, 21,
1365 21, 22, 22, 22, 23, 24, 24, 25, 26, 27,
1366 27, 27, 28, 28, 29, 29, 29, 30, 30, 31,
1367 31, 32, 33, 34, 35, 35, 35, 36, 36, 37,
1374 0, 2, 5, 0, 3, 1, 1, 1, 1, 1,
1375 1, 2, 2, 2, 4, 0, 1, 3, 3, 0,
1376 1, 1, 0, 1, 0, 1, 1, 1, 1, 3,
1377 3, 2, 2, 2, 0, 2, 4, 5, 3, 0,
1388 "\"end\"",
"error",
"$undefined",
"\"digraph\"",
"\"edge\"",
1389 "\"graph\"",
"\"node\"",
"\"subgraph\"",
"\"{\"",
"\"}\"",
"\"[\"",
1390 "\"]\"",
"\"=\"",
"\"->\"",
"\":\"",
"\",\"",
"\";\"",
"\"identifier\"",
1391 "$accept",
"graph",
"stmt_list",
"stmt",
"attr_stmt",
"attr_list",
1392 "attr_list.opt",
"attr_assign",
"a_list.1",
"comma.opt",
"semi.opt",
1393 "a_list.0",
"nodes",
"path",
"edge_stmt",
"node_stmt",
"node_id",
1398 const unsigned short int 1401 0, 183, 183, 187, 188, 198, 199, 200, 201, 202,
1402 203, 207, 208, 209, 213, 222, 223, 227, 242, 249,
1403 249, 249, 253, 254, 259, 260, 261, 265, 266, 284,
1404 291, 302, 311, 318, 340, 341, 342, 346, 347, 351,
1425 unsigned int yylno =
yyrline_[yyrule];
1426 int yynrhs =
yyr2_[yyrule];
1428 *
yycdebug_ <<
"Reducing stack by rule " << yyrule - 1
1429 <<
" (line " << yylno <<
"):" << std::endl;
1431 for (
int yyi = 0; yyi < yynrhs; yyi++)
1438 #line 11 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:1167 1440 #line 1441 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.cc" // lalr1.cc:1167 1441 #line 354 "/Users/akim/src/lrde/2/lib/vcsn/dot/parse.yy" // lalr1.cc:1168 debug_level_type debug_level() const
The current debugging level.
#define YY_SYMBOL_PRINT(Title, Symbol)
std::ostream & dot(const Aut &aut, std::ostream &out=std::cout, format fmt={}, bool mathjax=false)
Print an automaton in Graphviz's Dot format.
void move(self_type &other)
Move the content of other to this.
stack_symbol_type()
Construct an empty symbol.
void set_debug_stream(std::ostream &)
Set the current debugging stream.
transitions_t transitions
void move(basic_symbol &s)
Destructive move, s is emptied into this.
T & build()
Instantiate an empty T in here.
static const unsigned char yystos_[]
#define YYLLOC_DEFAULT(Current, Rhs, N)
void push(T &t)
Steal the contents of t.
location_t location_
The inital location.
static const char *const yytname_[]
For a symbol, its name in clear.
void swap(config::config_value &first, config::config_value &second)
static std::string yytnamerr_(const char *n)
Convert the symbol name n to a form suitable for a diagnostic.
stack_type yystack_
The stack.
bool empty() const
Whether empty.
Define the vcsn::detail::dot::parser class.
virtual void yystack_print_()
Print the state stack on the debug stream.
#define YY_REDUCE_PRINT(Rule)
Type access provider for state based symbols.
void clear()
Record that this symbol is empty.
std::unique_ptr< yyFlexLexer > scanner_
The scanner.
void pop(unsigned int n=1)
auto transitions(const Aut &aut) -> decltype(all_transitions(aut, is_special_t< Aut >
All the transition indexes between visible states.
Termination state number.
const_iterator end() const
void yy_destroy_(const char *yymsg, basic_symbol< Base > &yysym) const
Reclaim the memory associated to a symbol.
semantic_type value
The semantic value.
stack_symbol_type & operator=(const stack_symbol_type &that)
Assignment, needed by push_back.
Present a slice of the top of a stack.
virtual int parse()
Parse.
static const signed char yypact_ninf_
static const signed char yypgoto_[]
static parser::symbol_type yylex(driver &driver_)
Use our local scanner object.
std::vector< string_t > states_t
static const unsigned char yycheck_[]
location(const position &b, const position &e)
Construct a location from b to e.
parser(driver &driver__yyarg)
Build a parser object.
int symbol_number_type
Symbol type: an internal symbol number.
static const signed char yypact_[]
static const unsigned short int yyrline_[]
void clear()
Destroy contents, and record that is empty.
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
State and public interface for Dot parsing.
T & as()
Accessor to a built T.
static const unsigned char yydefact_[]
static const unsigned char yyr2_[]
Syntax errors thrown from user actions.
virtual void yy_reduce_print_(int r)
Report on the debug stream that the rule r is going to be reduced.
static bool yy_pact_value_is_default_(int yyvalue)
Whether the given yypact_ value indicates a defaulted state.
void setup_(const location_t &l, const std::string &ctx)
From context_, build edit_.
static const signed char yytable_[]
void yy_print_(std::ostream &yyo, const basic_symbol< Base > &yysym) const
Display a symbol type, value and location.
void move(by_state &that)
Steal the symbol type from that.
static const signed char yytable_ninf_
state_type yy_lr_goto_state_(state_type yystate, int yysym)
Compute post-reduction state.
"Internal" symbol: element of the stack.
void yypop_(unsigned int n=1)
Pop n symbols the three stacks.
value_impl< detail::label_tag > label
virtual std::string yysyntax_error_(state_type yystate, const symbol_type &yyla) const
Generate an error message.
void set_debug_level(debug_level_type l)
Set the current debugging level.
static std::ostream & operator<<(std::ostream &o, const states_t ss)
void error(const location_t &l, const std::string &m)
Report an error m at l.
symbol_number_type type_get() const
The (internal) type number (corresponding to state).
void copy(const self_type &other)
Copy the content of other to this.
int debug_level_type
Type for debugging levels.
std::shared_ptr< vcsn::automaton_editor > edit_
An automaton editor that stores the one being built.
int state_type
State numbers.
state_type state
The state.
const_iterator begin() const
static const signed char yydefgoto_[]
S::size_type size() const
#define TRY(Loc, Stm)
Run Stm, and bounces exceptions into parse errors at Loc.
by_state()
Default constructor.
std::vector< stack_symbol_type > ::const_reverse_iterator const_iterator
static bool yy_table_value_is_error_(int yyvalue)
Whether the given yytable_ value indicates a syntax error.
void yypush_(const char *m, stack_symbol_type &s)
Push a new state on the stack.
location_type location
The location.
bool has_edit_(const location_t &l)
Require that vcsn_context was defined.
static const unsigned char yyr1_[]
std::ostream & debug_stream() const
The current debugging stream.