static void endgraph(void);
static void endnode(void);
static void endedge(void);
+static void freestack(void);
static char* concat(char*, char*);
static char* concatPort(char*, char*);
%%
graph : hdr body {endgraph();}
- | error {if (G) {agclose(G); G = Ag_G_global = NIL(Agraph_t*);}}
+ | error {freestack(); if (G) {endgraph(); agclose(G); G = Ag_G_global = NIL(Agraph_t*);}}
| /* empty */
;
assert(subg);
}
+static void freestack()
+{
+ while (S) {
+ deletelist(&(S->nodelist));
+ deletelist(&(S->attrlist));
+ deletelist(&(S->edgelist));
+ S = pop(S);
+ }
+}
+
extern FILE *yyin;
Agraph_t *agconcat(Agraph_t *g, void *chan, Agdisc_t *disc)
{