bdd0a41aed
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68
27 lines
1.1 KiB
Sed
27 lines
1.1 KiB
Sed
#
|
|
# 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\//
|
|
|