xref: /titanic_52/usr/src/lib/libsqlite/tool/opcodeDoc.awk (revision b02e9a2d4d2071d770e5aa9ae8f83f2bbe1f2ced)
1
2#pragma ident	"%Z%%M%	%I%	%E% SMI"
3
4#
5# Extract opcode documentation for sqliteVdbe.c and generate HTML
6#
7BEGIN {
8  print "<html><body bgcolor=white>"
9  print "<h1>SQLite Virtual Database Engine Opcodes</h1>"
10  print "<table>"
11}
12/ Opcode: /,/\*\// {
13  if( $2=="Opcode:" ){
14    printf "<tr><td>%s&nbsp;%s&nbsp;%s&nbsp;%s</td>\n<td>\n", $3, $4, $5, $6
15  }else if( $1=="*/" ){
16    printf "</td></tr>\n"
17  }else if( NF>1 ){
18    sub(/^ *\*\* /,"")
19    gsub(/</,"&lt;")
20    gsub(/&/,"&amp;")
21    print
22  }
23}
24END {
25  print "</table></body></html>"
26}
27