From f6e9cd0bd87bc95980b3fcdd71cc4af2f9184793 Mon Sep 17 00:00:00 2001 From: grammarware Date: Wed, 25 May 2011 16:03:13 +0000 Subject: [PATCH] making XBGF2HTML exporter fancier and up to date git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@1052 ab42f6e0-554d-0410-b580-99e487e6eeb2 --- shared/tools/xbgf2html | 27 +- topics/export/hypertext/bgf2xhtml.xslt | 453 +++++++--------- topics/export/hypertext/xbgf2xhtml.xslt | 679 ++++++++++++------------ 3 files changed, 561 insertions(+), 598 deletions(-) diff --git a/shared/tools/xbgf2html b/shared/tools/xbgf2html index 255eb795..34920834 100755 --- a/shared/tools/xbgf2html +++ b/shared/tools/xbgf2html @@ -1,24 +1,25 @@ #!/bin/sh +if [ ! -r $1 ]; then + echo "Oops: $1 not found or not readable." + exit 1 +fi + LOCAL=${PWD} cd `dirname $0` cd ../.. SLPS=${PWD} +cd `dirname ${LOCAL}/$1` +FULLPATH=${PWD} cd ${LOCAL} -if [ $# -eq 1 ]; then - OUTPUT=/dev/stdout -elif [ $# -ne 2 ]; then - echo "This tool transforms Transformational BGF documents to hypertext EBNF." - echo "Usage: xbgf2html []" - echo "When output file is not specified, stdout is used." - exit 1 +if [ $# -eq 2 ]; then + xsltproc --stringparam date `date +"%d/%m/%Y"` --stringparam fname `basename $1 .xbgf` --stringparam fullpath ${FULLPATH}/`basename $1` ${SLPS}/topics/export/hypertext/xbgf2xhtml.xslt $1 | grep -v 'DOCTYPE' > $2 +elif [ $# -eq 3 ]; then + xsltproc --stringparam date `date +"%d/%m/%Y"` --stringparam fname `basename $1 .xbgf` --stringparam fullpath ${FULLPATH}/`basename $1` --stringparam gname $3 ${SLPS}/topics/export/hypertext/xbgf2xhtml.xslt $1 | grep -v 'DOCTYPE' > $2 else - OUTPUT=$2 -fi -if [ ! -r $1 ]; then - echo "Oops: $1 not found or not readable." + echo "This tool transforms Transformational BGF documents to hypertext EBNF." + echo "Usage: xbgf2html []" + echo "When grammar is not specified, the local file is used." exit 1 fi - -xsltproc ${SLPS}/topics/export/hypertext/xbgf2xhtml.xslt $1 | grep -v 'DOCTYPE' > ${OUTPUT} diff --git a/topics/export/hypertext/bgf2xhtml.xslt b/topics/export/hypertext/bgf2xhtml.xslt index e7cc62eb..e6d613ea 100644 --- a/topics/export/hypertext/bgf2xhtml.xslt +++ b/topics/export/hypertext/bgf2xhtml.xslt @@ -1,20 +1,12 @@ - - - - - - - - Browsable Grammar - - - - -
-		      
-			
-
- - -
- - - - - - - - - - - : - - - - + + + +
+						
+					
+
+ + +
+ + + + + + + + + + : + + + + - - - - - + + + + + - - - + + + - - - - + + + + - - - - - - - - - - - - - ]]> - - - - - - - + - - - - - - - * - - - - - - - ? - - - - - - - - - - - - - - string - - - int - - - - - - - ε - - - - - empty - - - - - - any - - - - - - - any-uri - - - - - id - - - - - - - - - - - - - - - :: - - - ( - - ) - - - - - - - - - ( - - - - - - ) - - - - - ( - - - | - - - ) - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - " - - " - - - - - - [ - - - label - - - - - - - ] - - + + + + + + + + + + + ]]> + + + + + + + + + + + + + * + + + + + + ? + + + + + + + + + + + + string + + + int + + + + + + ε + + + + empty + + + + + any + + + + + + + any-uri + + + + + id + + + + + + + + + + + + + + :: + + + ( + + ) + + + + + + + + ( + + + + + + ) + + + + ( + + + | + + + ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + " + + " + + + + + [ + + + + ] +
diff --git a/topics/export/hypertext/xbgf2xhtml.xslt b/topics/export/hypertext/xbgf2xhtml.xslt index ebf69050..d5138842 100644 --- a/topics/export/hypertext/xbgf2xhtml.xslt +++ b/topics/export/hypertext/xbgf2xhtml.xslt @@ -1,352 +1,361 @@ - - - - - - - - - -
    - -
  • - -
  • -
    -
- - -
- - -
    - -
  • - -
  • -
    -
-
- - - - - - - - in - - - - - - - - in - - - - - - - - - - - - - - - + + + + + + + + + + + Browsable Grammar Transformation + + + +

+ +

+

Source: SLPS/

+
    + +
  • + +
  • +
    +
+
+
+ Maintained by Dr. Vadim Zaytsev a.k.a. @grammarware. + Last updated: . +
+ + +
+ +
    + +
  • + +
  • +
    +
+
+ + + + + + + in + + + + + + + + in + + + + + + + + + + + + + - - - - - - - - ); + + + + + + + + ); - - - - - - - - addV - - - addH - - - removeV - - - removeH - - - - - + + + + + + + addV + + + addH + + + removeV + + + removeH + + + + + - - ); + + ); - - - - - - - - - - ); + + + + + + + + + ); - - - - - - - - - - ); + + + + + + + + + + , + + + + + ); + + + + + + + + + + ); + + + + + + + + + + ); - - - - - - cmd - - - # - - - - ( - - - - ); + + + + + cmd + + + # + + + + + ( + + + + ); - - - - - - - + + + + + + - - , + + , - - - - + + + + - - - - - - ); + + + + + + ); - - - - - - - - - - - - - - - - - ); + + + + + + + + + + + + + + + + ); - - - - - - - - renameL - - - - - - , - - - - - - - - renameN - - - - - - , - - - - - - - - renameS - - - - - - , - - - - - - - - renameT - - - - - - , - - - - - - - - - - ( - - , - - - - ); + + + + + + + renameL + + + + + + , + + + + + + + + renameN + + + + + + , + + + + + + + + renameS + + + + + + , + + + + + + + + renameT + + + + + + , + + + + + + + - + + ( + + , + + + + ); - - - - - - - - - - - , - - - - - ); + + + + + + + + + + , + + + + + ); - - - - - - - - - [ - - ] - - - - :: - - - - , " - - " - - - - - - ); + + + + + + + + [ + + ] + + + + :: + + + + , " + + " + + + + + + ); - - - - - - - - - - , - - - - ); + + + + + + + + + , + + + + ); - - - - - - - cmd - - - # - - - - - ( - - - - - [ - - - label - - - # - - - - - ] - - +
+ + + + + + ( + + + + [ + + + + ] +