summary refs log tree commit diff stats
path: root/compiler/docgen2.nim
blob: d76be8e3cb9c3d49c746243e92f4981a49700e97 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#
#
#           The Nimrod Compiler
#        (c) Copyright 2012 Andreas Rumpf
#
#    See the file "copying.txt", included in this
#    distribution, for details about the copyright.
#

# This module implements a new documentation generator that runs after
# semantic checking.

import 
  os, options, ast, astalgo, msgs, ropes, idents, passes, docgen

type 
  TGen = object of TPassContext
    doc: PDoc
    module: PSym
  PGen = ref TGen

proc close(p: PPassContext, n: PNode): PNode =
  var g = PGen(p)
  let useWarning = sfMainModule notin g.module.flags
  if gWholeProject or sfMainModule in g.module.flags:
    writeOutput(g.doc, g.module.filename, HtmlExt, useWarning)
    try:
      generateIndex(g.doc)
    except EIO:
      discard

proc processNode(c: PPassContext, n: PNode): PNode = 
  result = n
  var g = PGen(c)
  generateDoc(g.doc, n)

proc myOpen(module: PSym): PPassContext = 
  var g: PGen
  new(g)
  g.module = module
  var d = newDocumentor(module.filename, options.gConfigVars)
  d.hasToc = true
  g.doc = d
  result = g

const docgen2Pass* = makePass(open = myOpen, process = processNode, close = close)

proc finishDoc2Pass*(project: string) = 
  discard
">> capital L, stroke <IMG SRC=X ALT=" � &amp;#321; --> &#321; &amp;Lstrok; --> &Lstrok;"> general currency sign <IMG SRC=X ALT=" � &amp;#164; --> &#164; &amp;curren; --> &curren;"> capital L, caron <IMG SRC=X ALT=" � &amp;#317; --> &#317; &amp;Lcaron; --> &Lcaron;"> capital S, acute accent <IMG SRC=X ALT=" � &amp;#346; --> &#346; &amp;Sacute; --> &Sacute;"> section sign <IMG SRC=X ALT=" � &amp;#167; --> &#167; &amp;sect; --> &sect;"> umlaut (dieresis) <IMG SRC=X ALT=" � &amp;#168; --> &#168; &amp;uml; --> &uml;"> <IMG SRC=X ALT=" &amp;die; --> &die;"> capital S, caron <IMG SRC=X ALT=" � &amp;#352; --> &#352; &amp;Scaron; --> &Scaron;"> capital S, cedilla <IMG SRC=X ALT=" � &amp;#350; --> &#350; &amp;Scedil; --> &Scedil;"> capital T, caron <IMG SRC=X ALT=" � &amp;#356; --> &#356; &amp;Tcaron; --> &Tcaron;"> capital Z, acute accent <IMG SRC=X ALT=" � &amp;#377; --> &#377; &amp;Zacute; --> &Zacute;"> soft hyphen <IMG SRC=X ALT=" [�] [&amp;#173;]-->[&#173;] [&amp;shy;] -->[&shy;]"> capital Z, caron <IMG SRC=X ALT=" � &amp;#381; --> &#381; &amp;Zcaron; --> &Zcaron;"> capital Z, dot above <IMG SRC=X ALT=" � &amp;#379; --> &#379; &amp;Zdot; --> &Zdot;"> degree sign <IMG SRC=X ALT=" � &amp;#176; --> &#176; &amp;deg; --> &deg;"> small a, ogonek <IMG SRC=X ALT=" � &amp;#261; --> &#261; &amp;aogon; --> &aogon;"> ogonek <IMG SRC=X ALT=" {�} {&amp;#731;}-->{&#731;} {&amp;ogon;} -->{&ogon;}"> small l, stroke <IMG SRC=X ALT=" � &amp;#322; --> &#322; &amp;lstrok; --> &lstrok;"> acute accent <IMG SRC=X ALT=" � &amp;#180; --> &#180; &amp;acute; --> &acute;"> small l, caron <IMG SRC=X ALT=" � &amp;#318; --> &#318; &amp;lcaron; --> &lcaron;"> small s, acute accent <IMG SRC=X ALT=" � &amp;#347; --> &#347; &amp;sacute; --> &sacute;"> caron <IMG SRC=X ALT=" {�} {&amp;#711;}-->{&#711;} {&amp;caron;} -->{&caron;}"> cedilla <IMG SRC=X ALT=" � &amp;#184; --> &#184; &amp;cedil; --> &cedil;"> small s, caron <IMG SRC=X ALT=" � &amp;#353; --> &#353; &amp;scaron; --> &scaron;"> small s, cedilla <IMG SRC=X ALT=" � &amp;#351; --> &#351; &amp;scedil; --> &scedil;"> small t, caron <IMG SRC=X ALT=" � &amp;#357; --> &#357; &amp;tcaron; --> &tcaron;"> small z, acute accent <IMG SRC=X ALT=" � &amp;#378; --> &#378; &amp;zacute; --> &zacute;"> double acute accent <IMG SRC=X ALT=" {�} {&amp;#733;}-->{&#733;} {&amp;dblac;} -->{&dblac;}"> small z, caron <IMG SRC=X ALT=" � &amp;#382; --> &#382; &amp;zcaron; --> &zcaron;"> small z, dot above <IMG SRC=X ALT=" � &amp;#380; --> &#380; &amp;zdot; --> &zdot; "> capital R, acute accent <IMG SRC=X ALT=" � &amp;#340; --> &#340; &amp;Racute; --> &Racute;"> capital A, acute accent <IMG SRC=X ALT=" � &amp;#193; --> &#193; &amp;Aacute; --> &Aacute;"> capital A, circumflex accent <IMG SRC=X ALT=" � &amp;#194; --> &#194; &amp;Acirc; --> &Acirc;"> capital A, breve <IMG SRC=X ALT=" � &amp;#258; --> &#258; &amp;Abreve; --> &Abreve;"> capital A, dieresis or umlaut mark <IMG SRC=X ALT=" � &amp;#196; --> &#196; &amp;Auml; --> &Auml;"> capital L, acute accent <IMG SRC=X ALT=" � &amp;#313; --> &#313; &amp;Lacute; --> &Lacute;"> capital C, acute accent <IMG SRC=X ALT=" � &amp;#262; --> &#262; &amp;Cacute; --> &Cacute;"> capital C, cedilla <IMG SRC=X ALT=" � &amp;#199; --> &#199; &amp;Ccedil; --> &Ccedil;"> capital C, caron <IMG SRC=X ALT=" � &amp;#268; --> &#268; &amp;Ccaron; --> &Ccaron;"> capital E, acute accent <IMG SRC=X ALT=" � &amp;#201; --> &#201; &amp;Eacute; --> &Eacute;"> capital E, ogonek <IMG SRC=X ALT=" � &amp;#280; --> &#280; &amp;Eogon; --> &Eogon;"> capital E, dieresis or umlaut mark <IMG SRC=X ALT=" � &amp;#203; --> &#203; &amp;Euml; --> &Euml;"> capital E, caron <IMG SRC=X ALT=" � &amp;#282; --> &#282; &amp;Ecaron; --> &Ecaron;"> capital I, acute accent <IMG SRC=X ALT=" � &amp;#205; --> &#205; &amp;Iacute; --> &Iacute;"> capital I, circumflex accent <IMG SRC=X ALT=" � &amp;#206; --> &#206; &amp;Icirc; --> &Icirc;"> capital D, caron <IMG SRC=X ALT=" � &amp;#270; --> &#270; &amp;Dcaron; --> &Dcaron;"> capital D, stroke <IMG SRC=X ALT=" � &amp;#272; --> &#272; &amp;Dstrok; --> &Dstrok;"> capital Eth, Icelandic <IMG SRC=X ALT=" N/A &amp;#208; --> &#208; &amp;ETH; --> &ETH;"> capital N, acute accent <IMG SRC=X ALT=" � &amp;#323; --> &#323; &amp;Nacute; --> &Nacute;"> capital N, caron <IMG SRC=X ALT=" � &amp;#327; --> &#327; &amp;Ncaron; --> &Ncaron;"> capital O, acute accent <IMG SRC=X ALT=" � &amp;#211; --> &#211; &amp;Oacute; --> &Oacute;"> capital O, circumflex accent <IMG SRC=X ALT=" � &amp;#212; --> &#212; &amp;Ocirc; --> &Ocirc;"> capital O, double acute accent <IMG SRC=X ALT=" � &amp;#368; --> &#368; &amp;Odblac; --> &Odblac;"> capital O, dieresis or umlaut mark <IMG SRC=X ALT=" � &amp;#214; --> &#214; &amp;Ouml; --> &Ouml;"> multiply sign <IMG SRC=X ALT=" � &amp;#215; --> &#215; &amp;times; --> &times;"> capital R, caron <IMG SRC=X ALT=" � &amp;#344; --> &#344; &amp;Rcaron; --> &Rcaron;"> capital U, ring <IMG SRC=X ALT=" � &amp;#366; --> &#366; &amp;Uring; --> &Uring;"> capital U, acute accent <IMG SRC=X ALT=" � &amp;#218; --> &#218; &amp;Uacute; --> &Uacute;"> capital U, double acute accent <IMG SRC=X ALT=" � &amp;#368; --> &#368; &amp;Udblac; --> &Udblac;"> capital U, dieresis or umlaut mark <IMG SRC=X ALT=" � &amp;#220; --> &#220; &amp;Uuml; --> &Uuml;"> capital Y, acute accent <IMG SRC=X ALT=" � &amp;#221; --> &#221; &amp;Yacute; --> &Yacute;"> capital T, cedilla <IMG SRC=X ALT=" � &amp;#354; --> &#354; &amp;Tcedil; --> &Tcedil;"> small sharp s, German (sz ligature) <IMG SRC=X ALT=" � &amp;#223; --> &#223; &amp;szlig; --> &szlig;"> small r, acute accent <IMG SRC=X ALT=" � &amp;#341; --> &#341; &amp;racute; --> &racute;"> small a, acute accent <IMG SRC=X ALT=" � &amp;#225; --> &#225; &amp;aacute; --> &aacute;"> small a, circumflex accent <IMG SRC=X ALT=" � &amp;#226; --> &#226; &amp;acirc; --> &acirc;"> small a, breve <IMG SRC=X ALT=" � &amp;#259; --> &#259; &amp;abreve; --> &abreve;"> small a, dieresis or umlaut mark <IMG SRC=X ALT=" � &amp;#228; --> &#228; &amp;auml; --> &auml;"> small l, acute accent <IMG SRC=X ALT=" � &amp;#314; --> &#314; &amp;lacute; --> &lacute;"> small c, acute accent <IMG SRC=X ALT=" � &amp;#263; --> &#263; &amp;cacute; --> &cacute;"> small c, cedilla <IMG SRC=X ALT=" � &amp;#231; --> &#231; &amp;ccedil; --> &ccedil;"> small c, caron <IMG SRC=X ALT=" � &amp;#269; --> &#269; &amp;ccaron; --> &ccaron;"> small e, acute accent <IMG SRC=X ALT=" � &amp;#233; --> &#233; &amp;eacute; --> &eacute;"> small e, ogonek <IMG SRC=X ALT=" � &amp;#281; --> &#281; &amp;eogon; --> &eogon;"> small e, dieresis or umlaut mark <IMG SRC=X ALT=" � &amp;#235; --> &#235; &amp;euml; --> &euml;"> small e, caron <IMG SRC=X ALT=" � &amp;#283; --> &#283; &amp;ecaron; --> &ecaron;"> small i, acute accent <IMG SRC=X ALT=" � &amp;#237; --> &#237; &amp;iacute; --> &iacute;"> small i, circumflex accent <IMG SRC=X ALT=" � &amp;#238; --> &#238; &amp;icirc; --> &icirc;"> small d, caron <IMG SRC=X ALT=" � &amp;#271; --> &#271; &amp;dcaron; --> &dcaron;"> small d, stroke <IMG SRC=X ALT=" � &amp;#273; --> &#273; &amp;dstrok; --> &dstrok;"> small eth, Icelandic <IMG SRC=X ALT=" N/A &amp;#240; --> &#240; &amp;eth; --> &eth;"> small n, acute accent <IMG SRC=X ALT=" � &amp;#324; --> &#324; &amp;nacute; --> &nacute;"> small n, caron <IMG SRC=X ALT=" � &amp;#328; --> &#328; &amp;ncaron; --> &ncaron;"> small o, acute accent <IMG SRC=X ALT=" � &amp;#243; --> &#243; &amp;oacute; --> &oacute;"> small o, circumflex accent <IMG SRC=X ALT=" � &amp;#244; --> &#244; &amp;ocirc; --> &ocirc;"> small o, double acute accent <IMG SRC=X ALT=" � &amp;#369; --> &#369; &amp;odblac; --> &odblac;"> small o, dieresis or umlaut mark <IMG SRC=X ALT=" � &amp;#246; --> &#246; &amp;ouml; --> &ouml;"> division sign <IMG SRC=X ALT=" � &amp;#247; --> &#247; &amp;divide; --> &divide;"> small r, caron <IMG SRC=X ALT=" � &amp;#345; --> &#345; &amp;rcaron; --> &rcaron;"> small u, ring <IMG SRC=X ALT=" � &amp;#367; --> &#367; &amp;uring; --> &uring;"> small u, acute accent <IMG SRC=X ALT=" � &amp;#250; --> &#250; &amp;uacute; --> &uacute;"> small u, double acute accent <IMG SRC=X ALT=" � &amp;#369; --> &#369; &amp;udblac; --> &udblac;"> small u, dieresis or umlaut mark <IMG SRC=X ALT=" � &amp;#252; --> &#252; &amp;uuml; --> &uuml;"> small y, acute accent <IMG SRC=X ALT=" � &amp;#253; --> &#253; &amp;yacute; --> &yacute;"> small t, cedilla <IMG SRC=X ALT=" � &amp;#355; --> &#355; &amp;tcedil; --> &tcedil;"> dot above <IMG SRC=X ALT=" {�} {&amp;#729;}-->{&#729;} {&amp;dot;} -->{&dot;}"> Some other characters of interest Char Code Entity name =================================== ==== ============ ============== capital AE diphthong (ligature) <IMG SRC=X ALT=" N/A &amp;#198; --> &#198; &amp;AElig; --> &AElig;"> small ae diphthong (ligature) <IMG SRC=X ALT=" N/A &amp;#230; --> &#230; &amp;aelig; --> &aelig;"> capital OE ligature <IMG SRC=X ALT=" N/A {&amp;#338;}-->{&#338;} {&amp;OElig;} -->{&OElig;}"> small oe ligature <IMG SRC=X ALT=" N/A {&amp;#339;}-->{&#339;} {&amp;oelig;} -->{&oelig;}"> copyright <IMG SRC=X ALT=" N/A &amp;#169; --> &#169; &amp;copy; --> &copy;"> registered trademark <IMG SRC=X ALT=" N/A &amp;#174; --> &#174; &amp;reg; --> &reg;"> trademark sign <IMG SRC=X ALT=" N/A &amp;#8482;--> &#8482; &amp;trade; --> &trade;"> em space <IMG SRC=X ALT=" N/A [&amp;#8195;]->[&#8195;] [&amp;emsp;] -->[&emsp;]"> en space <IMG SRC=X ALT=" N/A [&amp;#8194;]->[&#8194;] [&amp;ensp;] -->[&ensp;]"> 1/3-em space <IMG SRC=X ALT=" N/A [&amp;#8196;]->[&#8196;] [&amp;emsp13;] -->[&emsp13;]"> 1/4-em space <IMG SRC=X ALT=" N/A [&amp;#8197;]->[&#8197;] [&amp;emsp14;] -->[&emsp14;]"> thin space <IMG SRC=X ALT=" N/A [&amp;#8201;]->[&#8201;] [&amp;thinsp;]-->[&thinsp;]"> hair space <IMG SRC=X ALT=" N/A [&amp;#8202;]->[&#8202;] [&amp;hairsp;]-->[&hairsp;]"> em dash <IMG SRC=X ALT=" N/A [&amp;#8212;]->[&#8212;] [&amp;mdash;] -->[&mdash;]"> en dash <IMG SRC=X ALT=" N/A [&amp;#8211;]->[&#8211;] [&amp;ndash;] -->[&ndash;]"> </PRE><!-- </PRE> no HotJava preBeta hackx - kw --> <!-- second /PRE is a hack for HotJava 1.0 preBeta 1 --> <HR> <P> Characters not found in ISO-8859-2 have "N/A" in the <TT>Char</TT> column. Some characters for which I could not find entity names in either <A HREF="http://www.internic.net/rfc/rfc2070.txt">RFC 2070</A> or the <A HREF="ftp://www.ucc.ie/pub/sgml/">ISOlat1, ISOlat2, ISOnum, ISOpub and ISOtech</A> sets (the ones included by Peter Flynn's <A HREF="http://www.ucc.ie/doc/www/html/dtds/htmlpro.html">HTML Pro DTD</A>) are shown enclosed in <TT>{</TT>braces<TT>}</TT>. </P> <P> See Martin Ramsch's original <A CHARSET="iso-8859-1" HREF="http://www.uni-passau.de/~ramsch/iso8859-1.html">ISO-8859-1 Table</A> for related info and links, and for some notes on entity names. This file is mostly just an adaptation of his table to the ISO-8859-2 character set. <HR> <ADDRESS>kweide@tezcat.com 1997-03-09</ADDRESS> </BODY> </HTML>