aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2022-10-01 12:46:30 -0700
committerJohn MacFarlane <[email protected]>2022-10-01 12:46:30 -0700
commit89e7e9b636d2364ef766b97c533dc3f685a794d6 (patch)
tree1ffb7b4c1dba8803ee335cbbb5e0d702a4b8bb0f /tools
parent20f82b0a8b47cdcdead0939a2c8fd2d459774fc7 (diff)
Makefile: add moduledeps target.
make moduledeps ROOTNODE=T.P.Parsing
Diffstat (limited to 'tools')
-rw-r--r--tools/depthfirst.gvpr18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/depthfirst.gvpr b/tools/depthfirst.gvpr
new file mode 100644
index 000000000..5539be22e
--- /dev/null
+++ b/tools/depthfirst.gvpr
@@ -0,0 +1,18 @@
+BEGIN {
+ int i, indent;
+ int seen[string];
+ void prInd (int cnt) {
+ for (i = 0; i < cnt; i++) printf (" "); }
+}
+BEG_G {
+ $tvtype = TV_prepostfwd; $tvroot = node($,ARGV[0]);
+} N{
+ if (seen[$.name]) {
+ indent--;
+ if (indent == 0) exit(0);
+ } else {
+ prInd(indent); print ($.name);
+ seen[$.name] = 1;
+ indent++;
+ }
+}