summaryrefslogtreecommitdiff
path: root/tools/dfagen/examples
diff options
context:
space:
mode:
authorNicolas Schodet2010-03-15 23:20:36 +0100
committerNicolas Schodet2010-03-15 23:20:36 +0100
commit603900db2e1f893de5a10d8da7d7e1d2552f991a (patch)
treeffbb4b2e493147f0cb5f1e62cf9b59513f08a2fd /tools/dfagen/examples
parentc40ac55789ef7da23bc7baaf77e47944de0faccb (diff)
tools/dfagen: limit c output using origin, closes #102
Diffstat (limited to 'tools/dfagen/examples')
-rw-r--r--tools/dfagen/examples/Makefile6
-rw-r--r--tools/dfagen/examples/import.conf5
-rw-r--r--tools/dfagen/examples/tpl/template_cb.txt3
-rw-r--r--tools/dfagen/examples/tpl/template_imported12.txt6
4 files changed, 19 insertions, 1 deletions
diff --git a/tools/dfagen/examples/Makefile b/tools/dfagen/examples/Makefile
index ad97b8a4..35c3e3cd 100644
--- a/tools/dfagen/examples/Makefile
+++ b/tools/dfagen/examples/Makefile
@@ -1,6 +1,6 @@
CFLAGS = -O2 -Wall
-all: ex1 ex2 ex1.png ex2.png ex2_tpl import.dump.check
+all: ex1 ex2 ex1.png ex2.png ex2_tpl import.dump.check import_imported12.txt
ex1: ex1.o ex1_cb.o
@@ -32,6 +32,9 @@ ex2_cb.c: ex2_cb_skel.c ex2_cb.c.patch
ex2_tpl: ex2.fsm ex2_tpl.conf
python ../dfagen.py -o c -d $(filter %.fsm, $^) -c $(filter %.conf, $^) -p $@
+import_imported12.txt: import.fsm imported1.fsm imported2.fsm imported3.fsm import.conf
+ python ../dfagen.py -o c -d import.fsm -c import.conf -p import
+
%.dot: %.fsm
python ../dfagen.py -o dot -d $< -p $(@:%.dot=%)
@@ -53,3 +56,4 @@ clean:
rm -f ex2.dot ex2.png
rm -f ex2_tpl_defs.h ex2_tpl_table.h
rm -f import.dump
+ rm -f import_imported12.txt
diff --git a/tools/dfagen/examples/import.conf b/tools/dfagen/examples/import.conf
new file mode 100644
index 00000000..60e2ef0f
--- /dev/null
+++ b/tools/dfagen/examples/import.conf
@@ -0,0 +1,5 @@
+[user]
+template-dir = tpl
+
+[templates]
+template_imported12.txt = %_imported12.txt
diff --git a/tools/dfagen/examples/tpl/template_cb.txt b/tools/dfagen/examples/tpl/template_cb.txt
new file mode 100644
index 00000000..7495502e
--- /dev/null
+++ b/tools/dfagen/examples/tpl/template_cb.txt
@@ -0,0 +1,3 @@
+%(state)s =%(event)s=>
+%(branches_to)s
+
diff --git a/tools/dfagen/examples/tpl/template_imported12.txt b/tools/dfagen/examples/tpl/template_imported12.txt
new file mode 100644
index 00000000..64c8e745
--- /dev/null
+++ b/tools/dfagen/examples/tpl/template_imported12.txt
@@ -0,0 +1,6 @@
+
+Example for template origin limitation.
+
+Only states from Imported1 and Imported2 will be listed.
+
+%(states_template,template_cb.txt,origin=Imported1|Imported2)s