2
0
mirror of https://github.com/boostorg/graph.git synced 2026-01-30 07:52:10 +00:00

replace tabs by proper number of spaces

[SVN r12323]
This commit is contained in:
Lie-Quan Lee
2002-01-15 03:43:22 +00:00
parent 256fe97529
commit 9c82870ba5
41 changed files with 2109 additions and 2109 deletions

View File

@@ -11,13 +11,13 @@
#define bgl_undir_char bgl_undir_char
#define bgl_undir_debug bgl_undir_debug
#define bgl_undir_nerrs bgl_undir_nerrs
#define GRAPH_T 257
#define NODE_T 258
#define EDGE_T 259
#define DIGRAPH_T 260
#define EDGEOP_T 261
#define SUBGRAPH_T 262
#define ID_T 263
#define GRAPH_T 257
#define NODE_T 258
#define EDGE_T 259
#define DIGRAPH_T 260
#define EDGEOP_T 261
#define SUBGRAPH_T 262
#define ID_T 263
#line 1 "graphviz_parser.y"
@@ -100,7 +100,7 @@
static const std::string& get_graph_name(const Subgraph& g) {
const boost::graph_property<Subgraph, boost::graph_name_t>::type&
name = boost::get_property(g, boost::graph_name);
name = boost::get_property(g, boost::graph_name);
return name;
}
@@ -117,7 +117,7 @@
//set the label of vertex, it could be overwritten later.
boost::property_map<GRAPHVIZ_GRAPH, boost::vertex_attribute_t>::type
va = boost::get(boost::vertex_attribute, g);
va = boost::get(boost::vertex_attribute, g);
va[v]["label"] = name;
//add v into the map so next time we will find it.
@@ -141,85 +141,85 @@
static void set_attribute(GraphvizAttrList& p,
const GraphvizAttrList& attr) {
const GraphvizAttrList& attr) {
GraphvizAttrList::const_iterator i, end;
for ( i=attr.begin(), end=attr.end(); i!=end; ++i)
p[i->first]=i->second;
p[i->first]=i->second;
}
static void set_attribute(Subgraph& g,
AttrState s, bool clear_attribute = true) {
AttrState s, bool clear_attribute = true) {
typedef Subgraph Graph;
switch ( s ) {
case GRAPH_GRAPH_A:
{
boost::graph_property<Graph, boost::graph_graph_attribute_t>::type&
gga = boost::get_property(g, boost::graph_graph_attribute);
set_attribute(gga, attributes);
}
break;
{
boost::graph_property<Graph, boost::graph_graph_attribute_t>::type&
gga = boost::get_property(g, boost::graph_graph_attribute);
set_attribute(gga, attributes);
}
break;
case GRAPH_NODE_A:
{
boost::graph_property<Graph, boost::graph_vertex_attribute_t>::type&
gna = boost::get_property(g, boost::graph_vertex_attribute);
set_attribute(gna, attributes);
}
break;
{
boost::graph_property<Graph, boost::graph_vertex_attribute_t>::type&
gna = boost::get_property(g, boost::graph_vertex_attribute);
set_attribute(gna, attributes);
}
break;
case GRAPH_EDGE_A:
{
boost::graph_property<Graph, boost::graph_edge_attribute_t>::type&
gea = boost::get_property(g, boost::graph_edge_attribute);
set_attribute(gea, attributes);
}
break;
{
boost::graph_property<Graph, boost::graph_edge_attribute_t>::type&
gea = boost::get_property(g, boost::graph_edge_attribute);
set_attribute(gea, attributes);
}
break;
case NODE_A:
{
boost::property_map<Graph, boost::vertex_attribute_t>::type
va = boost::get(boost::vertex_attribute, g); //va[v]
set_attribute(va[current_vertex], attributes);
}
break;
{
boost::property_map<Graph, boost::vertex_attribute_t>::type
va = boost::get(boost::vertex_attribute, g); //va[v]
set_attribute(va[current_vertex], attributes);
}
break;
case EDGE_A:
{
boost::property_map<Graph, boost::edge_attribute_t>::type
ea = boost::get(boost::edge_attribute, g); //ea[e]
set_attribute(ea[current_edge], attributes);
}
break;
{
boost::property_map<Graph, boost::edge_attribute_t>::type
ea = boost::get(boost::edge_attribute, g); //ea[e]
set_attribute(ea[current_edge], attributes);
}
break;
}
if ( clear_attribute )
attributes.clear();
attributes.clear();
}
static void add_edges(const Vertex& u,
const Vertex& v, GRAPHVIZ_GRAPH& g) {
const Vertex& v, GRAPHVIZ_GRAPH& g) {
graphviz::current_edge = boost::add_edge(u, v, g).first;
graphviz::set_attribute(g, EDGE_A, false);
}
static void add_edges(Subgraph* G1, Subgraph* G2,
GRAPHVIZ_GRAPH& g) {
GRAPHVIZ_GRAPH& g) {
boost::graph_traits<Subgraph>::vertex_iterator i, j, m, n;
for ( boost::tie(i, j) = boost::vertices(*G1); i != j; ++i) {
for ( boost::tie(m, n) = boost::vertices(*G2); m != n; ++m) {
graphviz::add_edges(G1->local_to_global(*i),
G2->local_to_global(*m), g);
}
for ( boost::tie(m, n) = boost::vertices(*G2); m != n; ++m) {
graphviz::add_edges(G1->local_to_global(*i),
G2->local_to_global(*m), g);
}
}
}
static void add_edges(Subgraph* G, const Vertex& v, GRAPHVIZ_GRAPH& g) {
boost::graph_traits<Subgraph>::vertex_iterator i, j;
for ( boost::tie(i, j) = boost::vertices(*G); i != j; ++i) {
graphviz::add_edges(G->local_to_global(*i), v, g);
graphviz::add_edges(G->local_to_global(*i), v, g);
}
}
static void add_edges(const Vertex& u, Subgraph* G, GRAPHVIZ_GRAPH& g) {
boost::graph_traits<Subgraph>::vertex_iterator i, j;
for ( boost::tie(i, j) = boost::vertices(*G); i != j; ++i) {
graphviz::add_edges(u, G->local_to_global(*i), g);
graphviz::add_edges(u, G->local_to_global(*i), g);
}
}
@@ -242,7 +242,7 @@
static void set_graph_name(const std::string& name) {
boost::graph_property<Subgraph, boost::graph_name_t>::type&
gea = boost::get_property(*current_graph, boost::graph_name);
gea = boost::get_property(*current_graph, boost::graph_name);
gea = name;
}
@@ -258,9 +258,9 @@
#define YYFINAL 66
#define YYFLAG -32768
#define YYNTBASE 18
#define YYFINAL 66
#define YYFLAG -32768
#define YYNTBASE 18
#define YYTRANSLATE(x) ((unsigned)(x) <= 263 ? yytranslate[x] : 45)
@@ -392,7 +392,7 @@ static const short yypgoto[] = {-32768,
};
#define YYLAST 56
#define YYLAST 56
static const short yytable[] = { 50,
@@ -463,7 +463,7 @@ static const short yycheck[] = { 36,
since that symbol is in the user namespace. */
#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
#if 0 /* No need for malloc.h, which pollutes the namespace;
instead, just don't use alloca. */
instead, just don't use alloca. */
#include <malloc.h>
#endif
#else /* not MSDOS, or __TURBOC__ */
@@ -476,7 +476,7 @@ static const short yycheck[] = { 36,
#else /* not MSDOS, or __TURBOC__, or _AIX */
#if 0
#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
and on HPUX 10. Eventually we can turn this on. */
and on HPUX 10. Eventually we can turn this on. */
#define YYSTACK_USE_ALLOCA
#define alloca __builtin_alloca
#endif /* __hpux */
@@ -498,50 +498,50 @@ static const short yycheck[] = { 36,
It is replaced by the list of actions, each action
as one case of the switch. */
#define yyerrok (yyerrstatus = 0)
#define yyclearin (bgl_undir_char = YYEMPTY)
#define YYEMPTY -2
#define YYEOF 0
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
#define YYERROR goto yyerrlab1
#define yyerrok (yyerrstatus = 0)
#define yyclearin (bgl_undir_char = YYEMPTY)
#define YYEMPTY -2
#define YYEOF 0
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
#define YYERROR goto yyerrlab1
/* Like YYERROR except do call bgl_undir_error.
This remains here temporarily to ease the
transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
#define YYFAIL goto yyerrlab
#define YYFAIL goto yyerrlab
#define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(token, value) \
do \
if (bgl_undir_char == YYEMPTY && yylen == 1) \
{ bgl_undir_char = (token), bgl_undir_lval = (value); \
bgl_undir_char1 = YYTRANSLATE (bgl_undir_char); \
YYPOPSTACK; \
goto yybackup; \
} \
else \
{ bgl_undir_error ("syntax error: cannot back up"); YYERROR; } \
do \
if (bgl_undir_char == YYEMPTY && yylen == 1) \
{ bgl_undir_char = (token), bgl_undir_lval = (value); \
bgl_undir_char1 = YYTRANSLATE (bgl_undir_char); \
YYPOPSTACK; \
goto yybackup; \
} \
else \
{ bgl_undir_error ("syntax error: cannot back up"); YYERROR; } \
while (0)
#define YYTERROR 1
#define YYERRCODE 256
#define YYTERROR 1
#define YYERRCODE 256
#ifndef YYPURE
#define YYLEX bgl_undir_lex()
#define YYLEX bgl_undir_lex()
#endif
#ifdef YYPURE
#ifdef YYLSP_NEEDED
#ifdef YYLEX_PARAM
#define YYLEX bgl_undir_lex(&bgl_undir_lval, &yylloc, YYLEX_PARAM)
#define YYLEX bgl_undir_lex(&bgl_undir_lval, &yylloc, YYLEX_PARAM)
#else
#define YYLEX bgl_undir_lex(&bgl_undir_lval, &yylloc)
#define YYLEX bgl_undir_lex(&bgl_undir_lval, &yylloc)
#endif
#else /* not YYLSP_NEEDED */
#ifdef YYLEX_PARAM
#define YYLEX bgl_undir_lex(&bgl_undir_lval, YYLEX_PARAM)
#define YYLEX bgl_undir_lex(&bgl_undir_lval, YYLEX_PARAM)
#else
#define YYLEX bgl_undir_lex(&bgl_undir_lval)
#define YYLEX bgl_undir_lex(&bgl_undir_lval)
#endif
#endif /* not YYLSP_NEEDED */
#endif
@@ -550,27 +550,27 @@ while (0)
#ifndef YYPURE
int bgl_undir_char; /* the lookahead symbol */
YYSTYPE bgl_undir_lval; /* the semantic value of the */
/* lookahead symbol */
int bgl_undir_char; /* the lookahead symbol */
YYSTYPE bgl_undir_lval; /* the semantic value of the */
/* lookahead symbol */
#ifdef YYLSP_NEEDED
YYLTYPE yylloc; /* location data for the lookahead */
/* symbol */
YYLTYPE yylloc; /* location data for the lookahead */
/* symbol */
#endif
int bgl_undir_nerrs; /* number of parse errors so far */
int bgl_undir_nerrs; /* number of parse errors so far */
#endif /* not YYPURE */
#if YYDEBUG != 0
int bgl_undir_debug; /* nonzero means print parse trace */
int bgl_undir_debug; /* nonzero means print parse trace */
/* Since this is uninitialized, it does not stop multiple parsers
from coexisting. */
#endif
/* YYINITDEPTH indicates the initial size of the parser's stacks */
/* YYINITDEPTH indicates the initial size of the parser's stacks */
#ifndef YYINITDEPTH
#ifndef YYINITDEPTH
#define YYINITDEPTH 200
#endif
@@ -590,9 +590,9 @@ int bgl_undir_debug; /* nonzero means print parse trace */
definitions require. With GCC, __builtin_memcpy takes an arg
of type size_t, but it can handle unsigned int. */
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
#else /* not GNU C or C++ */
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
#else /* not GNU C or C++ */
#ifndef __cplusplus
/* This is the most reliable way to avoid incompatibilities
@@ -667,17 +667,17 @@ yyparse(YYPARSE_PARAM_ARG)
register int yyn;
register short *yyssp;
register YYSTYPE *yyvsp;
int yyerrstatus; /* number of tokens to shift before error messages enabled */
int bgl_undir_char1 = 0; /* lookahead token as an internal (translated) token number */
int yyerrstatus; /* number of tokens to shift before error messages enabled */
int bgl_undir_char1 = 0; /* lookahead token as an internal (translated) token number */
short yyssa[YYINITDEPTH]; /* the state stack */
YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
short yyssa[YYINITDEPTH]; /* the state stack */
YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
short *yyss = yyssa; /* refer to the stacks thru separate pointers */
YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
short *yyss = yyssa; /* refer to the stacks thru separate pointers */
YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
#ifdef YYLSP_NEEDED
YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
YYLTYPE *yyls = yylsa;
YYLTYPE *yylsp;
@@ -698,9 +698,9 @@ yyparse(YYPARSE_PARAM_ARG)
#endif
#endif
YYSTYPE yyval; /* the variable used to return */
/* semantic values from the action */
/* routines */
YYSTYPE yyval; /* the variable used to return */
/* semantic values from the action */
/* routines */
int yylen;
@@ -712,7 +712,7 @@ yyparse(YYPARSE_PARAM_ARG)
yystate = 0;
yyerrstatus = 0;
bgl_undir_nerrs = 0;
bgl_undir_char = YYEMPTY; /* Cause a token to be read. */
bgl_undir_char = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
@@ -747,20 +747,20 @@ yynewstate:
#ifdef yyoverflow
/* Each stack pointer address is followed by the size of
the data in use in that stack, in bytes. */
the data in use in that stack, in bytes. */
#ifdef YYLSP_NEEDED
/* This used to be a conditional around just the two extra args,
but that might be undefined if yyoverflow is a macro. */
but that might be undefined if yyoverflow is a macro. */
yyoverflow("parser stack overflow",
&yyss1, size * sizeof (*yyssp),
&yyvs1, size * sizeof (*yyvsp),
&yyls1, size * sizeof (*yylsp),
&yystacksize);
&yyss1, size * sizeof (*yyssp),
&yyvs1, size * sizeof (*yyvsp),
&yyls1, size * sizeof (*yylsp),
&yystacksize);
#else
yyoverflow("parser stack overflow",
&yyss1, size * sizeof (*yyssp),
&yyvs1, size * sizeof (*yyvsp),
&yystacksize);
&yyss1, size * sizeof (*yyssp),
&yyvs1, size * sizeof (*yyvsp),
&yystacksize);
#endif
yyss = yyss1; yyvs = yyvs1;
@@ -770,34 +770,34 @@ yynewstate:
#else /* no yyoverflow */
/* Extend the stack our own way. */
if (yystacksize >= YYMAXDEPTH)
{
bgl_undir_error("parser stack overflow");
if (yyfree_stacks)
{
free (yyss);
free (yyvs);
{
bgl_undir_error("parser stack overflow");
if (yyfree_stacks)
{
free (yyss);
free (yyvs);
#ifdef YYLSP_NEEDED
free (yyls);
free (yyls);
#endif
}
return 2;
}
}
return 2;
}
yystacksize *= 2;
if (yystacksize > YYMAXDEPTH)
yystacksize = YYMAXDEPTH;
yystacksize = YYMAXDEPTH;
#ifndef YYSTACK_USE_ALLOCA
yyfree_stacks = 1;
#endif
yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
__yy_memcpy ((char *)yyss, (char *)yyss1,
size * (unsigned int) sizeof (*yyssp));
size * (unsigned int) sizeof (*yyssp));
yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
__yy_memcpy ((char *)yyvs, (char *)yyvs1,
size * (unsigned int) sizeof (*yyvsp));
size * (unsigned int) sizeof (*yyvsp));
#ifdef YYLSP_NEEDED
yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
__yy_memcpy ((char *)yyls, (char *)yyls1,
size * (unsigned int) sizeof (*yylsp));
size * (unsigned int) sizeof (*yylsp));
#endif
#endif /* no yyoverflow */
@@ -809,11 +809,11 @@ yynewstate:
#if YYDEBUG != 0
if (bgl_undir_debug)
fprintf(stderr, "Stack size increased to %d\n", yystacksize);
fprintf(stderr, "Stack size increased to %d\n", yystacksize);
#endif
if (yyssp >= yyss + yystacksize - 1)
YYABORT;
YYABORT;
}
#if YYDEBUG != 0
@@ -843,21 +843,21 @@ yynewstate:
{
#if YYDEBUG != 0
if (bgl_undir_debug)
fprintf(stderr, "Reading a token: ");
fprintf(stderr, "Reading a token: ");
#endif
bgl_undir_char = YYLEX;
}
/* Convert token to internal form (in bgl_undir_char1) for indexing tables with */
if (bgl_undir_char <= 0) /* This means end of input. */
if (bgl_undir_char <= 0) /* This means end of input. */
{
bgl_undir_char1 = 0;
bgl_undir_char = YYEOF; /* Don't call YYLEX any more */
bgl_undir_char = YYEOF; /* Don't call YYLEX any more */
#if YYDEBUG != 0
if (bgl_undir_debug)
fprintf(stderr, "Now at end of input.\n");
fprintf(stderr, "Now at end of input.\n");
#endif
}
else
@@ -866,15 +866,15 @@ yynewstate:
#if YYDEBUG != 0
if (bgl_undir_debug)
{
fprintf (stderr, "Next token is %d (%s", bgl_undir_char, yytname[bgl_undir_char1]);
/* Give the individual parser a way to print the precise meaning
of a token, for further debugging info. */
{
fprintf (stderr, "Next token is %d (%s", bgl_undir_char, yytname[bgl_undir_char1]);
/* Give the individual parser a way to print the precise meaning
of a token, for further debugging info. */
#ifdef YYPRINT
YYPRINT (stderr, bgl_undir_char, bgl_undir_lval);
YYPRINT (stderr, bgl_undir_char, bgl_undir_lval);
#endif
fprintf (stderr, ")\n");
}
fprintf (stderr, ")\n");
}
#endif
}
@@ -894,7 +894,7 @@ yynewstate:
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrlab;
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
@@ -945,11 +945,11 @@ yyreduce:
int i;
fprintf (stderr, "Reducing via rule %d (line %d), ",
yyn, yyrline[yyn]);
yyn, yyrline[yyn]);
/* Print the symbols being reduced, and their result. */
for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
fprintf (stderr, "%s ", yytname[yyrhs[i]]);
fprintf (stderr, "%s ", yytname[yyrhs[i]]);
fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
}
#endif
@@ -983,7 +983,7 @@ case 14:
#line 279 "graphviz_parser.y"
{
graphviz::set_attribute(*graphviz::current_graph,
graphviz::attribute_state);
graphviz::attribute_state);
;
break;}
case 15:
@@ -1017,7 +1017,7 @@ case 28:
{
graphviz::set_attribute(
*static_cast<graphviz::Subgraph*>(graphviz::current_graph),
GRAPH_GRAPH_A);
GRAPH_GRAPH_A);
;
break;}
case 29:
@@ -1026,7 +1026,7 @@ case 29:
graphviz::Vertex* temp = static_cast<graphviz::Vertex*>(yyvsp[-1].ptr);
graphviz::current_vertex = *temp;
graphviz::set_attribute(*static_cast<GRAPHVIZ_GRAPH*>(YYPARSE_PARAM),
NODE_A);
NODE_A);
delete temp;
yyval.i = 0;
;
@@ -1047,7 +1047,7 @@ case 32:
if (result.second) {
graphviz::current_vertex = result.first->second;
if (! graphviz::current_graph->is_root())
boost::add_vertex(graphviz::current_vertex, *graphviz::current_graph);
boost::add_vertex(graphviz::current_vertex, *graphviz::current_graph);
} else
graphviz::current_vertex = graphviz::add_name(*name, *static_cast<GRAPHVIZ_GRAPH*>(YYPARSE_PARAM)) ;
graphviz::Vertex* temp = new graphviz::Vertex(graphviz::current_vertex);
@@ -1087,27 +1087,27 @@ case 35:
Ptr source = static_cast<Ptr>(yyvsp[-2].ptr);
for (std::vector<Ptr>::iterator it=graphviz::vlist.begin();
it !=graphviz::vlist.end(); ++it) {
it !=graphviz::vlist.end(); ++it) {
if ( source->second ) {
if ( (*it)->second )
graphviz::add_edges(static_cast<graphviz::Subgraph*>(source->first),
static_cast<graphviz::Subgraph*>((*it)->first),
*static_cast<GRAPHVIZ_GRAPH*>(YYPARSE_PARAM));
else
graphviz::add_edges(static_cast<graphviz::Subgraph*>(source->first),
*static_cast<graphviz::Vertex*>((*it)->first),
*static_cast<GRAPHVIZ_GRAPH*>(YYPARSE_PARAM));
if ( (*it)->second )
graphviz::add_edges(static_cast<graphviz::Subgraph*>(source->first),
static_cast<graphviz::Subgraph*>((*it)->first),
*static_cast<GRAPHVIZ_GRAPH*>(YYPARSE_PARAM));
else
graphviz::add_edges(static_cast<graphviz::Subgraph*>(source->first),
*static_cast<graphviz::Vertex*>((*it)->first),
*static_cast<GRAPHVIZ_GRAPH*>(YYPARSE_PARAM));
} else {
graphviz::Vertex* temp = static_cast<graphviz::Vertex*>(source->first);
if ( (*it)->second )
graphviz::add_edges(*temp,
static_cast<graphviz::Subgraph*>((*it)->first),
*static_cast<GRAPHVIZ_GRAPH*>(YYPARSE_PARAM));
else
graphviz::add_edges(*temp,
*static_cast<graphviz::Vertex*>((*it)->first),
*static_cast<GRAPHVIZ_GRAPH*>(YYPARSE_PARAM));
delete temp;
graphviz::Vertex* temp = static_cast<graphviz::Vertex*>(source->first);
if ( (*it)->second )
graphviz::add_edges(*temp,
static_cast<graphviz::Subgraph*>((*it)->first),
*static_cast<GRAPHVIZ_GRAPH*>(YYPARSE_PARAM));
else
graphviz::add_edges(*temp,
*static_cast<graphviz::Vertex*>((*it)->first),
*static_cast<GRAPHVIZ_GRAPH*>(YYPARSE_PARAM));
delete temp;
}
delete source;
@@ -1222,7 +1222,7 @@ case 46:
short *ssp1 = yyss - 1;
fprintf (stderr, "state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
#endif
@@ -1272,44 +1272,44 @@ yyerrlab: /* here on detecting error */
yyn = yypact[yystate];
if (yyn > YYFLAG && yyn < YYLAST)
{
int size = 0;
char *msg;
int x, count;
{
int size = 0;
char *msg;
int x, count;
count = 0;
/* Start X at -yyn if nec to avoid negative indexes in yycheck. */
for (x = (yyn < 0 ? -yyn : 0);
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
size += strlen(yytname[x]) + 15, count++;
msg = (char *) malloc(size + 15);
if (msg != 0)
{
strcpy(msg, "parse error");
count = 0;
/* Start X at -yyn if nec to avoid negative indexes in yycheck. */
for (x = (yyn < 0 ? -yyn : 0);
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
size += strlen(yytname[x]) + 15, count++;
msg = (char *) malloc(size + 15);
if (msg != 0)
{
strcpy(msg, "parse error");
if (count < 5)
{
count = 0;
for (x = (yyn < 0 ? -yyn : 0);
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
{
strcat(msg, count == 0 ? ", expecting `" : " or `");
strcat(msg, yytname[x]);
strcat(msg, "'");
count++;
}
}
bgl_undir_error(msg);
free(msg);
}
else
bgl_undir_error ("parse error; also virtual memory exceeded");
}
if (count < 5)
{
count = 0;
for (x = (yyn < 0 ? -yyn : 0);
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
{
strcat(msg, count == 0 ? ", expecting `" : " or `");
strcat(msg, yytname[x]);
strcat(msg, "'");
count++;
}
}
bgl_undir_error(msg);
free(msg);
}
else
bgl_undir_error ("parse error; also virtual memory exceeded");
}
else
#endif /* YYERROR_VERBOSE */
bgl_undir_error("parse error");
bgl_undir_error("parse error");
}
goto yyerrlab1;
@@ -1321,11 +1321,11 @@ yyerrlab1: /* here on error raised explicitly by an action */
/* return failure if at end of input */
if (bgl_undir_char == YYEOF)
YYABORT;
YYABORT;
#if YYDEBUG != 0
if (bgl_undir_debug)
fprintf(stderr, "Discarding token %d (%s).\n", bgl_undir_char, yytname[bgl_undir_char1]);
fprintf(stderr, "Discarding token %d (%s).\n", bgl_undir_char, yytname[bgl_undir_char1]);
#endif
bgl_undir_char = YYEMPTY;
@@ -1334,7 +1334,7 @@ yyerrlab1: /* here on error raised explicitly by an action */
/* Else will try to reuse lookahead token
after shifting the error token. */
yyerrstatus = 3; /* Each real token shifted decrements this */
yyerrstatus = 3; /* Each real token shifted decrements this */
goto yyerrhandle;
@@ -1362,7 +1362,7 @@ yyerrpop: /* pop the current state because it cannot handle the error token */
short *ssp1 = yyss - 1;
fprintf (stderr, "Error: state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
#endif
@@ -1381,7 +1381,7 @@ yyerrhandle:
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrpop;
goto yyerrpop;
yyn = -yyn;
goto yyreduce;
}