summaryrefslogtreecommitdiffstats
path: root/Parser/grammar.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-12-30 15:46:02 (GMT)
committerGuido van Rossum <guido@python.org>1994-12-30 15:46:02 (GMT)
commit588633daa2fe7276ae4b0c99723094add0d965ff (patch)
tree531b98a64c67825f81af62a682cacc29707b4b6a /Parser/grammar.c
parent66cb311fba7e824f11964090bce8b6b91f00d2e4 (diff)
downloadcpython-588633daa2fe7276ae4b0c99723094add0d965ff.zip
cpython-588633daa2fe7276ae4b0c99723094add0d965ff.tar.gz
cpython-588633daa2fe7276ae4b0c99723094add0d965ff.tar.bz2
Parser/tokenizer.c (tok_nextc): zap tok->buf after freeing;
rest: abort() -> fatal(); small things
Diffstat (limited to 'Parser/grammar.c')
-rw-r--r--Parser/grammar.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/Parser/grammar.c b/Parser/grammar.c
index 1285fb3..b422cf5 100644
--- a/Parser/grammar.c
+++ b/Parser/grammar.c
@@ -48,6 +48,7 @@ newgrammar(start)
g->g_start = start;
g->g_ll.ll_nlabels = 0;
g->g_ll.ll_label = NULL;
+ g->g_accel = 0;
return g;
}
@@ -84,6 +85,10 @@ addstate(d)
s = &d->d_state[d->d_nstates++];
s->s_narcs = 0;
s->s_arc = NULL;
+ s->s_lower = 0;
+ s->s_upper = 0;
+ s->s_accel = NULL;
+ s->s_accept = 0;
return s - d->d_state;
}
@@ -139,7 +144,6 @@ findlabel(ll, type, str)
char *str;
{
int i;
- label *lb;
for (i = 0; i < ll->ll_nlabels; i++) {
if (ll->ll_label[i].lb_type == type /*&&
@@ -147,7 +151,8 @@ findlabel(ll, type, str)
return i;
}
fprintf(stderr, "Label %d/'%s' not found\n", type, str);
- abort();
+ fatal("grammar.c:findlabel()");
+ /*NOTREACHED*/
}
/* Forward */
@@ -158,8 +163,10 @@ translatelabels(g)
grammar *g;
{
int i;
-
+
+#ifdef DEBUG
printf("Translating labels ...\n");
+#endif
/* Don't translate EMPTY */
for (i = EMPTY+1; i < g->g_ll.ll_nlabels; i++)
translabel(g, &g->g_ll.ll_label[i]);