Documentation Source Text

Check-in [56374346ea]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Updates to text based bubble diagrams to fix minor issues and add linking.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 56374346eadb3945ed0adbdac66fc3372e727df9
User & Date: shaneh 2010-03-25 21:31:55
Context
2010-03-25
21:32
Corrected typo. check-in: da61246532 user: shaneh tags: trunk
21:31
Updates to text based bubble diagrams to fix minor issues and add linking. check-in: 56374346ea user: shaneh tags: trunk
21:30
Added psuedo-BNF generator for syntax diagrams. check-in: 678b7b774c user: shaneh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to art/syntax/all-text.html.

cannot compute difference between binary files

Changes to art/syntax/bubble-generator-text.tcl.

200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
...
411
412
413
414
415
416
417

418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
...
470
471
472
473
474
475
476

477
478
479
480
481
482
483
484
485
486
487
488
489
...
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
    stack
       {line CREATE {or {} TEMP TEMPORARY} VIEW {opt IF NOT EXISTS}}
       {line {optx /database-name .} /view-name AS select-stmt}
  }
  create-virtual-table-stmt {
    stack
       {line CREATE VIRTUAL TABLE {optx /database-name .} /table-name}
       {line USING /module-name {optx ( {loop module-argument ,} )}}
  }
  delete-stmt {
    line DELETE FROM qualified-table-name {optx WHERE expr}
  }
  delete-stmt-limited {
    stack
        {line DELETE FROM qualified-table-name {optx WHERE expr}}
................................................................................
      {line /* {loop nil /anything-except-*/}
           {or */ /end-of-input}}
  }
}

# used for curves
set rad "4px"

# used for bubble text
set font1 "9px"
# used for arrows
set font2 "12px"
# used for 
set font3 "14px"

# |
set c9474 "<table class=\"draw\"><tr><td class=\"rside\"></td><td class=\"empty\"></td></tr><tr><td class=\"rside\"></td><td class=\"empty\"></td></tr></table>"
# -|
set c9488 "<table class=\"draw\"><tr><td class=\"bottom\"></td><td class=\"empty\"></td></tr><tr><td class=\"empty\"></td><td class=\"lside\"></td></tr></table>"
# |-
set c9484 "<table class=\"draw\"><tr><td class=\"empty\"></td><td class=\"empty\"></td></tr><tr><td class=\"rside\"></td><td class=\"top\"></td></tr></table>"
# |_
set c9492 "<table class=\"draw\"><tr><td class=\"rside\"></td><td class=\"bottom\"></td></tr><tr><td class=\"empty\"></td><td class=\"empty\"></td></tr></table>"
# _|
set c9496 "<table class=\"draw\"><tr><td class=\"bottom\"></td><td class=\"lside\"></td></tr><tr><td class=\"empty\"></td><td class=\"empty\"></td></tr></table>"
#-(- top left
set c9581 "<table class=\"draw\"><tr><td class=\"bottom\"></td><td class=\"bottom\"></td></tr><tr><td class=\"empty\"></td><td class=\"empty\" style=\"border-top-style:solid; border-left-style:solid; border-width:1px; border-top-left-radius:$rad; -moz-border-radius-topleft:$rad; -webkit-border-top-left-radius:$rad;\"></td></tr></table>"
#-)- top right
set c9582 "<table class=\"draw\"><tr><td class=\"bottom\"></td><td class=\"bottom\"></td></tr><tr><td class=\"empty\" style=\"border-top-style:solid; border-right-style:solid; border-width:1px; border-top-right-radius:$rad; -moz-border-radius-topright:$rad; -webkit-border-top-right-radius:$rad;\"></td><td class=\"empty\"></td></tr></table>"
#-|-
set c9516 "<table class=\"draw\"><tr><td class=\"empty\"></td><td class=\"empty\"></td></tr><tr><td class=\"top rside\"></td><td class=\"top\"></td></tr></table>"
#( bot left
set c9584 "<table class=\"draw\"><tr><td class=\"empty\"></td><td class=\"empty\" style=\"border-bottom-style:solid; border-left-style:solid; border-width:1px; border-bottom-left-radius:$rad; -moz-border-radius-bottomleft:$rad; -webkit-border-bottom-left-radius:$rad;\"></td></tr><tr><td class=\"empty\"></td><td class=\"empty\"></td></tr></table>"
# ) bot right
set c9583 "<table class=\"draw\"><tr><td class=\"empty\" style=\"border-bottom-style:solid; border-right-style:solid; border-width:1px; border-bottom-right-radius:$rad; -moz-border-radius-bottomright:$rad; -webkit-border-bottom-right-radius:$rad;\"></td><td class=\"empty\"></td></tr><tr><td class=\"empty\"></td><td class=\"empty\"></td></tr></table>"
# |-
set c9500 "<table class=\"draw\"><tr><td class=\"rside\"></td><td class=\"bottom\"></td></tr><tr><td class=\"rside\"></td><td class=\"empty\"></td></tr></table>"
# -|
set c9508 "<table class=\"draw\"><tr><td class=\"bottom\"></td><td class=\"lside\"></td></tr><tr><td class=\"empty\"></td><td class=\"lside\"></td></tr></table>"
#->
set rarr  "<table class=\"draw\"><tr><td class=\"bottom\"></td><td rowspan=2 style=\"vertical-align:middle; font-size:$font2;\">&gt;</td></tr><tr><td class=\"empty\"></td></tr></table>"
# <-
set larr  "<table class=\"draw\"><tr><td rowspan=2 style=\"vertical-align:middle; font-size:$font2;\">&lt;</td><td class=\"bottom\"></td></tr><tr><td class=\"empty\"></td></tr></table>"
# ---
set hr  "<table class=\"draw\" width=100%><tr><td width=100% class=\"bottom\"></td></tr><tr><td width=100% class=\"empty\"></td></tr></table>"


# Draw a bubble containing $txt. 
#
proc draw_bubble {txt} {
  global c9474 c9488 c9484 c9492 c9496 c9581 c9582 c9516 c9584 c9583 c9500 c9508 rarr larr hr

................................................................................
    set istoken 1
  } elseif {[regexp {^[a-z]} $txt]} {
    set istoken 0
  } else {
    set istoken 1
  }


  set txt "&nbsp;$txt&nbsp;"

  if {$istoken} {
    return [list 1 "<table><tr><td class=\"round\">$txt</td></tr></table>"]
  } else {
    return [list 1 "<table><tr><td class=\"square\">$txt</td></tr></table>"]
  }

  return [list 0 ""]
}

# Draw a sequence of terms from left to write.  Each element of $lx
# descripts a single term.
................................................................................

set f [open all-text.html w]
puts $f "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"
puts $f "<html>"
puts $f "<head>"
puts $f "<style type='text/css'>"
puts $f "h3 { font-family:helvetica; font-size:$font3; }"
puts $f "table, td { border-collapse:separate; border-style:none; margin:0px; padding:0px; border-spacing:0px; }"
puts $f "td { vertical-align:top; white-space:nowrap; font-family:helvetica; font-size:$font3; }"
puts $f "hr { height:1px; }"
puts $f ".round { border-collapse:separate; font-size:$font1; border-style:solid; border-width:1px; margin:0px; padding:1px; border-spacing:0px; border-radius:$font1; -moz-border-radius:$font1; -webkit-border-radius:$font1; }"
puts $f ".square { font-size:$font1; border-style:solid; border-width:1px; margin:0px; padding:1px; border-spacing:0px; }"
puts $f ".side { border-style:solid; border-width:1px; }"
puts $f ".draw { border-collapse:separate; empty-cells:show; }"
puts $f ".top { padding:$rad; border-top-style:solid; border-width:1px; }"
puts $f ".bottom { padding:$rad; border-bottom-style:solid; border-width:1px; }"
puts $f ".rside { padding:$rad; border-right-style:solid; border-width:1px; }"
puts $f ".lside { padding:$rad; border-left-style:solid; border-width:1px; }"
puts $f ".empty { padding:$rad; }"
puts $f "</style>"
puts $f "</head>"
puts $f "<body>"
foreach {name graph} $all_graphs {
  if {$name == "sql-stmt-list" || 1} {
    puts $f "<h3>$name:</h3>"
    set rc [draw_graph $name $graph]
    set h [lindex $rc 0]
    set content [lindex $rc 1]
    puts $f "$content"
  }
}
puts $f "</body>"
puts $f "</html>"
close $f








|







 







>
|

|

|



|

|

|

|

|

|

|

|

|

|

|

|

|

|

|







 







>





|







 







|

<
<
|
|
<


|
|






|










200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
...
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
...
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
...
768
769
770
771
772
773
774
775
776


777
778

779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
    stack
       {line CREATE {or {} TEMP TEMPORARY} VIEW {opt IF NOT EXISTS}}
       {line {optx /database-name .} /view-name AS select-stmt}
  }
  create-virtual-table-stmt {
    stack
       {line CREATE VIRTUAL TABLE {optx /database-name .} /table-name}
       {line USING /module-name {optx ( {loop /module-argument ,} )}}
  }
  delete-stmt {
    line DELETE FROM qualified-table-name {optx WHERE expr}
  }
  delete-stmt-limited {
    stack
        {line DELETE FROM qualified-table-name {optx WHERE expr}}
................................................................................
      {line /* {loop nil /anything-except-*/}
           {or */ /end-of-input}}
  }
}

# used for curves
set rad "4px"
set rad1 "5px"
# used for bubble text (<= (2 x rad)+2)
set font1 "9px"
# used for arrows (~ 3 x rad)
set font2 "12px"
# used for everything else (~ font1+5)
set font3 "14px"

# |
set c9474 "<table><tr><td class=\"rside\"></td><td class=\"empty\"></td></tr><tr><td class=\"rside\"></td><td class=\"empty\"></td></tr></table>"
# -|
set c9488 "<table><tr><td class=\"bottom\"></td><td class=\"empty\"></td></tr><tr><td class=\"empty\"></td><td class=\"lside\"></td></tr></table>"
# |-
set c9484 "<table><tr><td class=\"empty\"></td><td class=\"empty\"></td></tr><tr><td class=\"rside\" style=\"padding-bottom:$rad1;\"></td><td class=\"top\"></td></tr></table>"
# |_
set c9492 "<table><tr><td class=\"rside\"></td><td class=\"bottom\"></td></tr><tr><td class=\"empty\"></td><td class=\"empty\"></td></tr></table>"
# _|
set c9496 "<table><tr><td class=\"bottom\"></td><td class=\"lside\"></td></tr><tr><td class=\"empty\"></td><td class=\"empty\"></td></tr></table>"
#-(- top left
set c9581 "<table><tr><td class=\"bottom\"></td><td class=\"bottom\"></td></tr><tr><td class=\"empty\"></td><td class=\"empty\" style=\"border-top-style:solid; border-left-style:solid; border-width:1px; border-top-left-radius:$rad; -moz-border-radius-topleft:$rad; -webkit-border-top-left-radius:$rad;\"></td></tr></table>"
#-)- top right
set c9582 "<table><tr><td class=\"bottom\"></td><td class=\"bottom\"></td></tr><tr><td class=\"empty\" style=\"border-top-style:solid; border-right-style:solid; border-width:1px; border-top-right-radius:$rad; -moz-border-radius-topright:$rad; -webkit-border-top-right-radius:$rad;\"></td><td class=\"empty\"></td></tr></table>"
#-|-
set c9516 "<table><tr><td class=\"bottom\"></td><td class=\"empty\"></td></tr><tr><td class=\"rside\"></td><td class=\"top\"></td></tr></table>"
#( bot left
set c9584 "<table><tr><td class=\"empty\"></td><td class=\"empty\" style=\"border-bottom-style:solid; border-left-style:solid; border-width:1px; border-bottom-left-radius:$rad; -moz-border-radius-bottomleft:$rad; -webkit-border-bottom-left-radius:$rad;\"></td></tr><tr><td class=\"empty\"></td><td class=\"empty\"></td></tr></table>"
# ) bot right
set c9583 "<table><tr><td class=\"empty\" style=\"border-bottom-style:solid; border-right-style:solid; border-width:1px; border-bottom-right-radius:$rad; -moz-border-radius-bottomright:$rad; -webkit-border-bottom-right-radius:$rad;\"></td><td class=\"empty\"></td></tr><tr><td class=\"empty\"></td><td class=\"empty\"></td></tr></table>"
# |-
set c9500 "<table><tr><td class=\"rside\"></td><td class=\"bottom\"></td></tr><tr><td class=\"rside\"></td><td class=\"empty\"></td></tr></table>"
# -|
set c9508 "<table><tr><td class=\"bottom\"></td><td class=\"lside\"></td></tr><tr><td class=\"empty\"></td><td class=\"lside\"></td></tr></table>"
#->
set rarr  "<table><tr><td class=\"bottom\"></td><td rowspan=2 style=\"vertical-align:middle; font-size:$font2;\">&gt;</td></tr><tr><td class=\"empty\"></td></tr></table>"
# <-
set larr  "<table><tr><td rowspan=2 style=\"vertical-align:middle; font-size:$font2;\">&lt;</td><td class=\"bottom\"></td></tr><tr><td class=\"empty\"></td></tr></table>"
# ---
set hr  "<table width=100%><tr><td width=100% class=\"bottom\"></td></tr><tr><td width=100% class=\"empty\"></td></tr></table>"


# Draw a bubble containing $txt. 
#
proc draw_bubble {txt} {
  global c9474 c9488 c9484 c9492 c9496 c9581 c9582 c9516 c9584 c9583 c9500 c9508 rarr larr hr

................................................................................
    set istoken 1
  } elseif {[regexp {^[a-z]} $txt]} {
    set istoken 0
  } else {
    set istoken 1
  }

  set href "&nbsp;<a href=\"#$txt\">$txt</a>&nbsp;"
  set txt "&nbsp;$txt&nbsp;"

  if {$istoken} {
    return [list 1 "<table><tr><td class=\"round\">$txt</td></tr></table>"]
  } else {
    return [list 1 "<table><tr><td class=\"square\">$href</td></tr></table>"]
  }

  return [list 0 ""]
}

# Draw a sequence of terms from left to write.  Each element of $lx
# descripts a single term.
................................................................................

set f [open all-text.html w]
puts $f "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"
puts $f "<html>"
puts $f "<head>"
puts $f "<style type='text/css'>"
puts $f "h3 { font-family:helvetica; font-size:$font3; }"
puts $f "table, td { empty-cells:show; border-collapse:separate; border-style:none; margin:0px; padding:0px; border-spacing:0px; }"
puts $f "td { vertical-align:top; white-space:nowrap; font-family:helvetica; font-size:$font3; }"


puts $f ".round { font-size:$font1; border-style:solid; border-width:1px; padding:1px; border-radius:$font1; -moz-border-radius:$font1; -webkit-border-radius:$font1; }"
puts $f ".square { font-size:$font1; border-style:solid; border-width:1px; padding:1px; }"

puts $f ".top { padding:$rad; border-top-style:solid; border-width:1px; }"
puts $f ".bottom { padding:$rad; border-bottom-style:solid; border-width:1px; }"
puts $f ".rside { padding:$rad; border-right-style:solid; border-width:1px; padding-top:$rad1; }"
puts $f ".lside { padding:$rad; border-left-style:solid; border-width:1px; padding-top:$rad1; }"
puts $f ".empty { padding:$rad; }"
puts $f "</style>"
puts $f "</head>"
puts $f "<body>"
foreach {name graph} $all_graphs {
  if {$name == "sql-stmt-list" || 1} {
    puts $f "<h3><a name=\"$name\">$name</a>:</h3>"
    set rc [draw_graph $name $graph]
    set h [lindex $rc 0]
    set content [lindex $rc 1]
    puts $f "$content"
  }
}
puts $f "</body>"
puts $f "</html>"
close $f