# This file contains TCL procedures used to generate standard parts of # web pages. # proc header {txt} { puts "$txt" puts \ {
} } proc footer {{rcsid {}}} { puts {
} set date [lrange $rcsid 3 4] if {$date!=""} { puts "This page last modified on $date" } puts {} } # The following two procs, Syntax and Section, are used to ensure # consistent formatting in the "lang.html" and "pragma.html" pages. # proc Syntax {args} { puts {} foreach {rule body} $args { puts "" regsub -all < $body {%LT} body regsub -all > $body {%GT} body regsub -all %LT $body {} body regsub -all %GT $body {} body regsub -all {[]|[*?]} $body {&} body regsub -all "\n" [string trim $body] "
\n" body regsub -all "\n *" $body "\n\\ \\ \\ \\ " body regsub -all {[|,.*()]} $body {&} body regsub -all { = } $body { = } body regsub -all {STAR} $body {*} body ## These metacharacters must be handled to undo being ## treated as SQL punctuation characters above. regsub -all {RPPLUS} $body {
)+} body regsub -all {LP} $body {(} body regsub -all {RP} $body {)} body ## Place the left-hand side of the rule in the 2nd table column. puts "" } puts {
" puts "$rule ::=$body
} } proc Section {name {label {}}} { puts "\n
" if {$label!=""} { puts "" } puts "

$name

\n" }