r5921 - trunk/eda/fped
werner at docs.openmoko.org
werner at docs.openmoko.org
Tue Apr 20 00:57:51 CEST 2010
Author: werner
Date: 2010-04-20 00:57:51 +0200 (Tue, 20 Apr 2010)
New Revision: 5921
Modified:
trunk/eda/fped/fpd.y
Log:
%dump didn't dump the root frame because this frame was only appended to the
list of frames at the end of parsing. We now tentatively append it each time
a %dump is requested.
- fpd.y: append the root frame before calling "dump"
Modified: trunk/eda/fped/fpd.y
===================================================================
--- trunk/eda/fped/fpd.y 2010-04-19 21:14:32 UTC (rev 5920)
+++ trunk/eda/fped/fpd.y 2010-04-19 22:57:51 UTC (rev 5921)
@@ -249,6 +249,16 @@
}
+static void append_root_frame(void)
+{
+ root_frame->prev = last_frame;
+ if (last_frame)
+ last_frame->next = root_frame;
+ else
+ frames = root_frame;
+}
+
+
%}
@@ -311,11 +321,7 @@
}
fpd
{
- root_frame->prev = last_frame;
- if (last_frame)
- last_frame->next = root_frame;
- else
- frames = root_frame;
+ append_root_frame();
}
| START_EXPR expr
{
@@ -455,6 +461,13 @@
}
| TOK_DBG_DUMP
{
+ /*
+ * It's okay to do append the root frame multiple
+ * times. If more frames are added afterwards, they
+ * just replace the root frame until it gets appended a
+ * final time when parsing ends.
+ */
+ append_root_frame();
if (!dump(stdout)) {
perror("stdout");
exit(1);
More information about the commitlog
mailing list