Index: Makefile
===================================================================
--- Makefile (revision 34670)
+++ Makefile (revision 34671)
@@ -19,6 +19,7 @@
$(SCCBOX) $(HOW) build_ps.sh "$(LIBDIR)/build_ps.sh"
$(SCCBOX) $(HOW) keylist.sh "$(LIBDIR)/keylist.sh"
$(SCCBOX) $(HOW) menu2svg.sh "$(LIBDIR)/menu2svg.sh"
+ $(SCCBOX) $(HOW) action_compiler.sh "$(LIBDIR)/action_compiler.sh"
install:
$(MAKE) install_all HOW="install -f"
Index: action_compiler.sh
===================================================================
--- action_compiler.sh (nonexistent)
+++ action_compiler.sh (revision 34671)
@@ -0,0 +1,180 @@
+#!/bin/sh
+
+SEP="<@@@@>"
+SEPH="<@@H@@>"
+
+compile()
+{
+ awk -v "SEP=$SEP" -v "SEPH=$SEPH" '
+ BEGIN {
+ q="\""
+ SEP="^" SEP
+ SEPH="^" SEPH
+ }
+
+ function strip(s) {
+ sub("^[ \t]*", "", s)
+ sub("[ \t]*$", "", s)
+ return s
+ }
+
+ function read_tag(tag, tmp1,tmp2) {
+ getline tmp1
+ getline tmp2
+ if (tmp2 ~ "" tag)
+ return tmp1
+ print "Error: expected closing tag " tag " in line " NR " of " current > "/dev/stderr"
+ exit(1)
+ }
+
+ function notav(s) {
+ if (s == "") return "n/a"
+ return s
+ }
+
+ function end_act()
+ {
+ if (current != "")
+ print ""
+ currrent = ""
+ }
+
+ ($0 ~ SEP) {
+ end_act()
+ action = ""
+ $1=""
+ current=tolower(strip($0))
+ sub("^.*/", "", current)
+ sub(".html$", "", current)
+
+ if (current in ANAME)
+ aname = ANAME[current]
+ else
+ aname = current
+
+ print ""
+ print "
" aname "
"
+ print "- "
+ print "
"
+ print "
"
+ print "Syntax summary: | " notav(SYNTAX[current])
+ print " |
---|
Help text: | " notav(HELP[current])
+ print " |
---|
Registered by: | " notav(COOKIE[current])
+ print " |
---|
"
+ print ""
+ next
+ }
+
+
+ ($0 ~ SEPH) {
+ end_act()
+ action = ""
+ $1=""
+ print "
" $0 "
"
+ aname=""
+ next
+ }
+
+ (current == "") && (/^A/) {
+ # reading the action list: new action
+ action=strip($0)
+ sub("^A", "", action)
+ aname= action
+ action = tolower(action)
+# avoid saving duplicates at the main action node
+ if (action in SEEN)
+ action = action "_dup"
+ else
+ ANAME[action] = aname
+ SEEN[action] = 1
+ next
+ }
+
+
+ (current == "") && (/^D/) {
+ # reading the action list: help line
+ tmp = $0
+ sub("^D", "", tmp)
+ HELP[action]=HELP[action] "\n" tmp
+ next
+ }
+
+ (current == "") && (/^S/) {
+ # reading the action list: syntax line
+ tmp = $0
+ sub("^S", "", tmp)
+ SYNTAX[action]=SYNTAX[action] "\n" tmp
+ next
+ }
+
+ (current == "") && (/^C/) {
+ # reading the action list: cookie line
+ tmp = $0
+ sub("^C", "", tmp)
+ COOKIE[action]=COOKIE[action] "\n" tmp
+ next
+ }
+
+ /^/ {
+ arg = read_tag("arg")
+ print "" arg ""
+ next
+ }
+
+ /^/ {
+ ex = read_tag("example")
+ print "Example:", ex, "
"
+ next
+ }
+
+ /^/ {
+ act = tolower(read_tag("act"))
+ print "" act ""
+ next
+ }
+
+ {
+ print
+ }
+
+ END {
+ end_act()
+ }
+ '
+}
+
+echo '
+
+
+
+ pcb-rnd user manual - action details
+
+
+
+
+ pcb-rnd actions (details)
+'
+
+(
+ (
+ cd ../../../../src
+ ./pcb-rnd --dump-actions 2>/dev/null
+ )
+ for fn in "$@"
+ do
+ if test "$fn" = "LIBRND"
+ then
+ echo ""
+ echo "$SEPH librnd actions (common to Ringdove)"
+ else
+ echo ""
+ echo "$SEP $fn"
+ tr "\n\r\t" " " < $fn | sed "s@<@\n<@g;s@>@>\n@g;"
+ fi
+ done
+) | compile
+
+echo '
+
+
+'
Property changes on: action_compiler.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property