summaryrefslogtreecommitdiffstats
path: root/java/etc/make_javajet_sed.sed
diff options
context:
space:
mode:
authordims <dims@13f79535-47bb-0310-9956-ffa450edef68>2008-06-17 00:23:01 +0000
committerdims <dims@13f79535-47bb-0310-9956-ffa450edef68>2008-06-17 00:23:01 +0000
commitbdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a (patch)
tree38a92061c0793434c4be189f1d70c3458b6bc41d /java/etc/make_javajet_sed.sed
Move Tuscany from Incubator to top level.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/etc/make_javajet_sed.sed')
-rw-r--r--java/etc/make_javajet_sed.sed27
1 files changed, 27 insertions, 0 deletions
diff --git a/java/etc/make_javajet_sed.sed b/java/etc/make_javajet_sed.sed
new file mode 100644
index 0000000000..a55afe547d
--- /dev/null
+++ b/java/etc/make_javajet_sed.sed
@@ -0,0 +1,27 @@
+#
+# sed script to be run on the output of the javajet builder to make the generated java
+# more comprehensible for development/debugging purposes
+# the script generates a sed script which can be run on the original input in order
+# to substitute all the TEXT_ constant references to their values
+#
+# e.g.
+# 1) cat SDOClass.java | grep "protected final String TEXT_" | sed -f <thisfile> > SDOClass.sed
+# 2) cat SDOClass.java | sed -f SDOClass.sed > SDOClassSed.java
+# then the file can be formatted in eclipse say, and fix up the class name to SDOClassSed
+# and you should be able to see what's going on better
+#
+#
+# add to the output script a line which removes the constant declarations
+1i\
+/protected final String TEXT_/d
+# arrange the var name/value pairs regularly
+/protected final String TEXT_/ s/[ \t]*protected final String TEXT_\([0-9][0-9]*\) = \(.*\);[ \t]*$/TEXT_\1 \2/
+# escape special characters in the value
+s/\\/\\\\/g
+s/\//\\\//g
+s/\'/\\\'/g
+# build the substitution pattern for line 2 of the output script
+s/ /\\\(\[\^0-9\]\\\)\//
+s/$/\\1\//
+s/^/\/generate(Object argument)\/,$s\//
+