www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D CHM (HTML Help) update (1.011)

------------sZDT2ooyerO0WrUrbEQ4EV
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: Quoted-Printable

Greetings,

Some time ago I released a program which would automatically create an H=
TML Help project from D's HTML help files.
The original release is here: http://www.digitalmars.com/webnews/newsgro=
ups.php?article_id=3D51175
I've made some improvements, and here's the next version.

Most importantly, the program now inserts anchors for Phobos DDOC keywor=
ds - thus, when looking up Phobos identifiers from the help index, the p=
age will automatically scroll down to the identifier's documentation. Th=
is could make looking up Phobos functions from IDEs much more comfortabl=
e.

As suggested by Jussi Jumppanen, I've changed the title to "D Programmin=
g Language". The program also uses the current version of Kirk McDonald'=
s keyword index ( http://www.prowiki.org/wiki4d/wiki.cgi?LanguageSpecifi=
cation/KeywordIndex ).

I've attached the program; to make the CHM yourself, place it to dmd/htm=
l/, compile and run it. It will generate a Microsoft HTML Help Workshop =
project, along with the required files. After it's done, open the projec=
t file (d.hhp) with Microsoft's CHM compiler, and compile it.

I have also updated my pre-built version of the CHM, located here:
http://thecybershadow.net/d/docs/d.chm
This one is built from 1.011's HTML help files.

-- =

Best regards,
  Vladimir                          mailto:thecybershadow gmail.com
------------sZDT2ooyerO0WrUrbEQ4EV
Content-Disposition: attachment; filename=chmgen.d
Content-Type: text/x-dsrc; name=chmgen.d
Content-Transfer-Encoding: Quoted-Printable

import std.stdio;
import std.file;
import std.string;
import std.regexp;

// ********************************************************************

int min(int a, int b)
{
	return a < b ? a : b;
}

void backSlash(char[] s)   // replace path delimiters in-place
{
	//s=3Ds.dup;
	foreach(inout c;s)
		if(c=3D=3D'/')
			c=3D'\\';
}

bool match(char[] line, char[] pattern)
{
	return std.regexp.find(line, pattern)>=3D0;
}

char[] getAnchor(char[] s)
{
	int i =3D std.string.find(s, '#');
	if(i<0)
		return "";
	else
		return s[i..$];
}

char[] removeAnchor(char[] s)
{
	int i =3D std.string.find(s, '#');
	if(i<0)
		return s;
	else
		return s[0..i];
}

char[] absoluteUrl(char[] base, char[] url)
{
	backSlash(base);
	backSlash(url);
	=

	if (url[0]=3D=3D'#')
		return base ~ url;

	while(base[$-1]!=3D'\\')
		base =3D base[0..$-1];
	=

	while(url[0..3]=3D=3D"..\\")
	{
		url =3D url[3..$];
		do {
			base =3D base[0..$-1];
			if(base.length=3D=3D0)
				return "";
		} while(base[$-1]!=3D'\\');
	}
	return base ~ url;
}

char[] movePath(char[] s)
{
	if(s.length>1 && s[0..2]=3D=3D"d\\")
		s =3D "chm" ~ s[1..$];
	return s;
}

char[] normalize(char[] s)
{
	s =3D tolower(s);
	char[] t;
	foreach(c;s)
		if(!iswhite(c))
			t ~=3D c;
	return t;
}

// ********************************************************************

struct Link
{
	char[] url, title, text;

	static Link opCall(char[] url, char[] title, char[] text)
	{
		backSlash(url);
		Link my;
		my.url =3D strip(url);
		my.title =3D strip(title);
		my.text =3D strip(text);
		return my;
	}
}

struct LinkBlock
{
	Link caption;
	Link[] links;

	static LinkBlock opCall(char[] url, char[] title, char[] text)
	{
		backSlash(url);
		LinkBlock my;
		my.caption.url =3D strip(url);
		my.caption.title =3D strip(title);
		my.caption.text =3D strip(text);
		return my;
	}
}

class Page
{
	char[] newFileName;
	char[] title;
	char[] src;
	Link[] toctop;
	LinkBlock[] linkBlocks;
	bool[char[]] anchors;
}

struct KeyLink
{
	char[] anchor;
	char[] title;

	static KeyLink opCall(char[] anchor, char[] title)
	{
		KeyLink my;
		my.anchor =3D strip(anchor);
		my.title =3D strip(title);
		return my;
	}
}

// ********************************************************************

char[][] listdirrec(char[] pathname)
{
	char[][] files =3D null;	=


	bool listing(char[] filename)
	{
		char[] file =3D std.path.join(pathname, filename);
		if(isdir(file))
		{
			char[] oldpath =3D pathname;
			pathname =3D file;
			listdir(pathname, &listing);
			pathname =3D oldpath;
		}
		else
		{
			files ~=3D std.path.join(pathname, filename);
		}
		return true; // continue
	}
	=

	listdir(pathname, &listing);

	return files;
}

Page[char[]] pages;
KeyLink[char[]][char[]] keywords;   // keywords[normalize(keyword)][orig=
inal url w/o anchor] =3D anchor/title
char[][char[]] keyTable;

void addKeyword(char[] keyword, char[] link, char[] title =3D null)
{
	keyword =3D strip(keyword);
	char[] norm =3D normalize(keyword);
	char[] file =3D removeAnchor(link);
	backSlash(file);
	char[] anchor =3D getAnchor(link);
	if(title=3D=3Dnull && norm in keywords && file in keywords[norm])   // =
when title is present, it overrides any existing anchors/etc.
	{
		if(keywords[norm][file].anchor>anchor) // "less" is better
			keywords[norm][file] =3D KeyLink(anchor, title);
	}
	else
		keywords[norm][file] =3D KeyLink(anchor, title);
	if(title=3D=3Dnull && norm in keyTable)
	{
		if(keyTable[norm]>keyword) // "less" is better
			keyTable[norm] =3D keyword;
	}
	else
		keyTable[norm] =3D keyword;
}

void main()
{
	// clean up
	if(exists("chm"))
		foreach(file;listdirrec("chm\\"))
			std.file.remove(file);
	else
		mkdir("chm");
	=

	char[][] files =3D listdirrec("d\\");
	=

	foreach(i,file;files)
		pages[file] =3D new Page;

	RegExp re_title =3D new RegExp(`<title>(Digital Mars - The )?D Programm=
ing Language - (.*)</title>`);
	RegExp re_title2 =3D new RegExp(`<h1>(.*)</h1>`);
	RegExp re_heading =3D new RegExp(`<h2>(.*)</h2>`);
	RegExp re_heading_link =3D new RegExp(`<h2><a href=3D"([^"]*)"( title=3D=
"([^"]*)")?>(.*)</a></h2>`);
	RegExp re_nav_link =3D new RegExp(`<li><a href=3D"([^"]*)"( title=3D"(.=
*)")?>(.*)</a></li>`);
	RegExp re_anchor =3D new RegExp(`<a name=3D"([^"]*)">(<.{1,2}>)*([^<]+)=
<`);
	RegExp re_anchor_2 =3D new RegExp(`<a name=3D([^>]*)>(<.{1,2}>)*([^<]+)=
<`);
	RegExp re_link   =3D new RegExp(`<a href=3D"([^"]*)">(<.{1,2}>)*([^<]+)=
<`);
	RegExp re_def =3D new RegExp(`<dt><big>(.*)<u>([^<]+)<`);

	foreach(fileName,page;pages)
		with(page)
		{
			char[] destdir =3D movePath(std.path.getDirName(fileName));
			if(!exists(destdir))
				mkdir(destdir);

			newFileName =3D movePath(fileName);

			if(match(fileName, `\.html$`))
			{
				writefln("Processing "~fileName);
				src =3D cast(char[])read(fileName);
				char[][] lines =3D splitlines(src);
				char[][] newlines =3D null;
				bool skip =3D false, intoctop =3D false, innavblock =3D false, innav=
block2 =3D false;
				int dl =3D 0;
				char[] anchor =3D null;
				anchors[""] =3D true;
				foreach(line;lines)
				{
					bool nextSkip =3D skip;
					=

					if (re_title.test(line))
					{
						title =3D strip(re_title.match(2));
						line =3D re_title.replace(`<title>` ~ title ~ `</title>`);
					}
					if (re_title2.test(line))
						if(title=3D=3D"")
							title =3D strip(re_title2.match(1));
					=

					if (re_anchor.test(line))
					{
						anchor =3D '#' ~ re_anchor.match(1);
						anchors[anchor] =3D true;
					}
					else
					if (re_anchor_2.test(line))
					{
						anchor =3D '#' ~ re_anchor_2.match(1);
						anchors[anchor] =3D true;
					}

					if(match(line, `<div id=3D"toctop">`))
						intoctop =3D true;
					if(match(line, `<div class=3D"navblock">`))
						if(innavblock)
						{
							innavblock2 =3D true;
							linkBlocks ~=3D LinkBlock("", "", "");
						}
						else
							innavblock =3D true;
					if(match(line, `</div>`))
						intoctop =3D innavblock2 =3D false;

					if(std.string.find(line, `<dl>`)>=3D0)
						dl++;
					if(dl=3D=3D1)
					{
						if(re_def.test(line))
						{
							anchor =3D re_def.match(2);
							while("#"~anchor in anchors) anchor ~=3D '_';
							anchors["#"~anchor] =3D true;
							line =3D re_def.pre ~ re_def.replace(`<dt><big>$1<u><a name=3D"` =
~ anchor ~ `">$2</a><`) ~ re_def.post;
							//writefln("new line: ", line);
							addKeyword(re_def.match(2), fileName ~ "#" ~ anchor);
						}
					}
					if(std.string.find(line, `</dl>`)>=3D0)
						dl--;

					if(re_heading_link.test(line))
					{
						if(innavblock2)
							linkBlocks ~=3D LinkBlock(re_heading_link.match(1), re_heading_li=
nk.match(3), re_heading_link.match(4));
					}
					else
					if(re_heading.test(line))
					{
						if(innavblock2)
							linkBlocks ~=3D LinkBlock("", "", re_heading.match(1));
					}

					if(re_nav_link.test(line))
						if(intoctop)
							toctop   ~=3D Link(re_nav_link.match(1), re_nav_link.match(3), re=
_nav_link.match(4));
						else
						if(innavblock2)
							if(re_nav_link.match(1)[0..7]!=3D"http://" && exists(absoluteUrl(=
fileName, re_nav_link.match(1))))
								linkBlocks[$-1].links ~=3D Link(re_nav_link.match(1), re_nav_lin=
k.match(3), re_nav_link.match(4));
						//else
						//	writefln("Displaced link: ", line);
					=

					if(re_anchor.test(line))
						addKeyword(re_anchor.match(3), fileName ~ "#" ~ re_anchor.match(1)=
);
					else
					if(re_anchor_2.test(line))
						addKeyword(re_anchor_2.match(3), fileName ~ "#" ~ re_anchor_2.matc=
h(1));
					=

					if(re_link.test(line))
						if(re_link.match(1)[0..min($,7)]!=3D"http://")
							addKeyword(re_link.match(3), absoluteUrl(fileName, re_link.match(=
1)));
					=

					// skip Google ads
					if(match(line, `^<!-- Google ad -->$`))
						skip =3D nextSkip =3D true;
					if(match(line, `^</script>$`))
						nextSkip =3D false;

					// skip navigation bar
					if(match(line, `^<div id=3D"navigation">$`))
						skip =3D nextSkip =3D true;
					if(match(line, `^<div id=3D"content">$`))
						skip =3D nextSkip =3D false;

					if(!skip)
						newlines ~=3D line;
					skip =3D nextSkip;
				}
				src =3D join(newlines, newline);
				write(newFileName, src);
			}
			else
			if(match(fileName, `\.css$`))
			{
				writefln("Processing "~fileName);
				src =3D cast(char[])read(fileName);
				char[][] lines =3D splitlines(src);
				char[][] newlines =3D null;
				foreach(line;lines)
				{
					// skip #div.content positioning
					if(!match(line, `margin-left:13em;`))
						newlines ~=3D line;
				}
				src =3D join(newlines, newline);
				write(newFileName, src);
			}
			else
			{
				copy(fileName, newFileName);
			}
		} =


	// ************************************************************

	Link[] topLinks;
	bool[char[]] gotLink;

	foreach(fileName,page;pages)
		foreach(link;page.toctop)
		{
			char[] url =3D absoluteUrl(fileName, link.url);
			if(!(url in gotLink))
			{
				topLinks ~=3D Link(url, link.title, link.text);
				gotLink[url] =3D true;
			}
		}

	// retreive keyword link titles
	foreach(keyNorm,urls;keywords)
		foreach(url,inout link;urls)
			if(url in pages)
				link.title =3D pages[url].title;

	// ************************************************************

	RegExp re_key_new =3D new RegExp(`<tt>(.*)</tt>`);
	RegExp re_key_link =3D new RegExp(`^\* (.*)\[http://www\.digitalmars\.c=
om/([^ ]*) (.*)\]`);

	char[][] keywordLines =3D splitlines(keywordIndex);
	char[] keyword;
	foreach(line;keywordLines)
	{
		if(re_key_new.test(line))
			keyword =3D re_key_new.match(1);
		if(re_key_link.test(line))
		{
			char[] url =3D re_key_link.match(2);
			char[] file =3D removeAnchor(url);
			char[] anchor =3D getAnchor(url);
			backSlash(url);
			=

			if(file in pages)
			{
				if(!(anchor in pages[file].anchors))
				{
					//char[] anchors; foreach(anch,b;pages[file].anchors) anchors~=3Dan=
ch~",";
					//writefln("Invalid URL: " ~ url ~ " out of: " ~ anchors);

					char[] cmp1 =3D normalize(anchor);
					foreach(realAnchor,b;pages[file].anchors)
					{
						char[] cmp2 =3D normalize(realAnchor);
						int n =3D min(cmp1.length, cmp2.length);
						if(n>=3D3 && cmp1[0..n] =3D=3D cmp2[0..n])
						{
							//writefln("Fixing broken anchor " ~ anchor ~ " to " ~ realAnchor=
);
							anchor =3D realAnchor;
							break;
						}	=

					}
				}

				if(anchor in pages[file].anchors)
				{
					addKeyword(keyword, file ~ anchor, re_key_link.match(1) ~ re_key_li=
nk.match(3));
				//	writefln("Adding keyword " ~ keyword ~ " to " ~ file ~ anchor ~ "=
 as " ~ re_key_link.match(1) ~ re_key_link.match(3));
				}
				//else
				//	writefln("Broken anchor link to keyword "~ keyword ~ " to " ~ re_=
key_link.match(2) ~ " as " ~ re_key_link.match(1) ~ re_key_link.match(3)=
);
			}
			//else
			//	writefln("Unfound URL: " ~ url);
		}
	}

	// ************************************************************

	FILE* f =3D fopen("d.hhp", "wt");
	fwritefln(f, =

`[OPTIONS]
Binary Index=3DNo
Compatibility=3D1.1 or later
Compiled file=3Dd.chm
Contents file=3Dd.hhc
Default Window=3Dmain
Default topic=3D` ~ movePath(topLinks[0].url) ~ `
Display compile progress=3DNo
Full-text search=3DYes
Index file=3Dd.hhk
Language=3D0x409 English (United States)
Title=3DD

[WINDOWS]
main=3D"D Programming Language","d.hhc","d.hhk","` ~ movePath(topLinks[0=
].url) ~ `","` ~ movePath(topLinks[0].url) ~ `",,,,,0x63520,,0x380e,[0,0=
,800,570],0x918f0000,,,,,,0

[FILES]`);
	char[][] htmlList;
	foreach(page;pages)
		if(match(page.newFileName, `\.html$`))
			htmlList ~=3D page.newFileName;
	htmlList.sort;
	foreach(s;htmlList)
		fwritefln(f, s);
	fwritefln(f, `
[INFOTYPES]`);
	fclose(f);

	// ************************************************************

	f =3D fopen("d.hhc", "wt");
	fwritefln(f, =

`<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML><BODY>
<OBJECT type=3D"text/site properties"><param name=3D"Window Styles" valu=
e=3D"0x800025"></OBJECT>
<UL>`);
	foreach(toplink;topLinks)
	{
		fwritefln(f, =

`	<LI><OBJECT type=3D"text/sitemap">
		<param name=3D"Name" value=3D"` ~ toplink.title ~ `">
		<param name=3D"Local" value=3D"` ~ movePath(toplink.url) ~ `">
		</OBJECT>
	<UL>`);
		Page topPage =3D pages[toplink.url];
		foreach(link;topPage.linkBlocks[0].links)
			fwritefln(f, =

`		<LI> <OBJECT type=3D"text/sitemap">
			<param name=3D"Name" value=3D"` ~ link.text ~ `">
			<param name=3D"Local" value=3D"` ~ movePath(absoluteUrl(toplink.url, =
link.url)) ~ `">
			</OBJECT>`);
		foreach(linkBlock;topPage.linkBlocks[1..$])
		{
			fwritefln(f, =

`		<LI> <OBJECT type=3D"text/sitemap">
			<param name=3D"Name" value=3D"` ~ linkBlock.caption.text ~ `">`);
			if(linkBlock.caption.url!=3D"")
				fwritefln(f, =

`			<param name=3D"Local" value=3D"` ~ movePath(absoluteUrl(toplink.url,=
 linkBlock.caption.url)) ~ `">`);
			fwritefln(f, =

`			</OBJECT>
		<UL>`);
			foreach(link;linkBlock.links)
				fwritefln(f, =

`			<LI> <OBJECT type=3D"text/sitemap">
				<param name=3D"Name" value=3D"` ~ link.text ~ `">
				<param name=3D"Local" value=3D"` ~ movePath(absoluteUrl(toplink.url,=
 link.url)) ~ `">
				</OBJECT>`);
			fwritefln(f, =

`		</UL>`);
		}
		fwritefln(f, =

`	</UL>`);
	}
	fwritefln(f, `</UL>
</BODY></HTML>`);
	fclose(f);

	// ************************************************************

	char[][] keywordList;
	foreach(keyNorm,urlList;keywords)
		keywordList ~=3D keyNorm;
	keywordList.sort;

	f =3D fopen("d.hhk", "wt");
	fwritefln(f, =

`<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML><BODY>
<UL>`);
	foreach(keyNorm;keywordList)
	{
		auto urlList =3D keywords[keyNorm];
		fwritefln(f, =

`	<LI> <OBJECT type=3D"text/sitemap">
		<param name=3D"Name" value=3D"` ~ keyTable[keyNorm] ~ `">`);
		foreach(url,link;urlList)
			if(url in pages)
			{
				fwritefln(f, =

`		<param name=3D"Name" value=3D"` ~ link.title ~ `">
		<param name=3D"Local" value=3D"` ~ movePath(url) ~ link.anchor ~ `">`)=
;
			}
		fwritefln(f, =

`		</OBJECT>`);
	}
	fwritefln(f, =

`</UL>
</BODY></HTML>`);
	fclose(f);
}

// ********************************************************************

// retreived on 2007.04.12 from http://www.prowiki.org/wiki4d/wiki.cgi?L=
anguageSpecification/KeywordIndex
const keywordIndex =3D `
<tt>abstract</tt>
* [http://www.digitalmars.com/d/attribute.html#abstract Attributes]
<tt>alias</tt>
* [http://www.digitalmars.com/d/declaration.html#alias Declarations]
* template parameters: [http://www.digitalmars.com/d/template.html#alias=
parameters Templates]
<tt>align</tt>
* [http://www.digitalmars.com/d/attribute.html#align Attributes]
<tt>asm</tt>
* [http://www.digitalmars.com/d/statement.html#asm Statements]
* x86 inline assembler:  [http://www.digitalmars.com/d/iasm.html Inline =
Assembler]
<tt>assert</tt>
* [http://www.digitalmars.com/d/expression.html#AssertExpression Express=
ions]
* static assert:  [http://www.digitalmars.com/d/version.html#staticasser=
t Conditional Compilation]

<tt>auto</tt>
* class attribute:  [http://www.digitalmars.com/d/class.html#auto Classe=
s]
* RAII attribute:  [http://www.digitalmars.com/d/attribute.html#auto Att=
ributes]
* type inference:  [http://www.digitalmars.com/d/declaration.html#AutoDe=
claration Declarations]

----

<tt>body</tt>
* in function contract:  [http://www.digitalmars.com/d/dbc.html Contract=
s]

<tt>bool</tt>
* [http://www.digitalmars.com/d/type.html Types]

<tt>break</tt>
* in switch:  [http://www.digitalmars.com/d/statement.html#SwitchStateme=
nt Statements]
* statement:  [http://www.digitalmars.com/d/statement.html#BreakStatemen=
t Statements]

<tt>byte</tt>
* [http://www.digitalmars.com/d/type.html Types]

----

<tt>case</tt>
* in switch:  [http://www.digitalmars.com/d/statement.html#SwitchStateme=
nt Statements]

<tt>cast</tt>
* [http://www.digitalmars.com/d/expression.html#CastExpression Expressio=
ns]

<tt>catch</tt>
* [http://www.digitalmars.com/d/statement.html#TryStatement Statements]

<tt>cdouble</tt>
* [http://www.digitalmars.com/d/type.html Types]
* complex types:  [http://www.digitalmars.com/d/float.html Floating Poin=
t]

<tt>cent</tt>
* [http://www.digitalmars.com/d/type.html Types]

<tt>cfloat</tt>
* [http://www.digitalmars.com/d/type.html Types]
* complex types:  [http://www.digitalmars.com/d/float.html Floating Poin=
t]

<tt>char</tt>
* [http://www.digitalmars.com/d/type.html Types]

<tt>class</tt>
* [http://www.digitalmars.com/d/class.html Classes]
* properties of:  [http://www.digitalmars.com/d/property.html#classprope=
rties Properties]

<tt>const</tt>
* [http://www.digitalmars.com/d/attribute.html#const Attributes]

<tt>continue</tt>
* [http://www.digitalmars.com/d/statement.html#ContinueStatement Stateme=
nts]

<tt>creal</tt>
* [http://www.digitalmars.com/d/type.html Types]
* complex types:  [http://www.digitalmars.com/d/float.html Floating Poin=
t]

----

<tt>dchar</tt>
* [http://www.digitalmars.com/d/type.html Types]

<tt>debug</tt>
* [http://www.digitalmars.com/d/version.html#debug Conditional Compilati=
on]

<tt>default</tt>
* in switch:  [http://www.digitalmars.com/d/statement.html#SwitchStateme=
nt Statements]

<tt>delegate</tt>
* as datatype and replacement for pointer-to-member-function:  [http://w=
ww.digitalmars.com/d/type.html#delegates Types]
* as dynamic closure:  [http://www.digitalmars.com/d/function.html#closu=
res Functions]
* in function literal:  [http://www.digitalmars.com/d/expression.html#Fu=
nctionLiteral Expressions]

<tt>delete</tt>
* expression:  [http://www.digitalmars.com/d/expression.html#DeleteExpre=
ssion Expressions]
* overloading:  [http://www.digitalmars.com/d/class.html#deallocators Cl=
asses]

<tt>deprecated</tt>
* [http://www.digitalmars.com/d/attribute.html#deprecated Attributes]

<tt>do</tt>
* [http://www.digitalmars.com/d/statement.html#DoStatement Statements]

<tt>double</tt>
* [http://www.digitalmars.com/d/type.html Types]
* floating point types:  [http://www.digitalmars.com/d/float.html Floati=
ng Point]

----

<tt>else</tt>
* [http://www.digitalmars.com/d/statement.html#IfStatement Statements]

<tt>enum</tt>
* [http://www.digitalmars.com/d/enum.html Enums]

<tt>export</tt>
* protection attribute:  [http://www.digitalmars.com/d/attribute.html At=
tributes]

<tt>extern</tt>
* linkage attribute:  [http://www.digitalmars.com/d/attribute.html#linka=
ge Attributes]
* interfacing to C:  [http://www.digitalmars.com/d/interfaceToC.html Int=
erfacing to C]
* in variable declaration:  [http://www.digitalmars.com/d/declaration.ht=
ml#extern Declarations]

----

<tt>false</tt>
* [http://www.digitalmars.com/d/expression.html#PrimaryExpression Expres=
sions]

<tt>final</tt>
* [http://www.digitalmars.com/d/function.html Functions]

<tt>finally</tt>
* [http://www.digitalmars.com/d/statement.html#TryStatement Statements]

<tt>float</tt>
* [http://www.digitalmars.com/d/type.html Types]
* floating point types:  [http://www.digitalmars.com/d/float.html Floati=
ng Point]

<tt>for</tt>
* [http://www.digitalmars.com/d/statement.html#ForStatement Statements]

<tt>foreach</tt>
* [http://www.digitalmars.com/d/statement.html#ForeachStatement Statemen=
ts]

<tt>foreach_reverse</tt>
* [http://www.digitalmars.com/d/statement.html#ForeachStatement Statemen=
ts]

<tt>function</tt>
* as datatype:  [http://www.digitalmars.com/d/type.html Types]
* in function literal:  [http://www.digitalmars.com/d/expression.html#Fu=
nctionLiteral Expressions]
* function pointers:  [http://www.digitalmars.com/d/function.html#closur=
es Functions]


----


<tt>goto</tt>
* [http://www.digitalmars.com/d/statement.html#GotoStatement Statements]=



----


<tt>idouble</tt>
* [http://www.digitalmars.com/d/type.html Types]
* imaginary types:  [http://www.digitalmars.com/d/float.html Floating Po=
int]

<tt>if</tt>
* [http://www.digitalmars.com/d/statement.html#IfStatement Statements]
* static if:  [http://www.digitalmars.com/d/version.html#staticif Condit=
ional Compilation]

<tt>ifloat</tt>
* [http://www.digitalmars.com/d/type.html Types]
* imaginary types:  [http://www.digitalmars.com/d/float.html Floating Po=
int]

<tt>import</tt>
* [http://www.digitalmars.com/d/module.html#ImportDeclaration Modules]
* import expression:  [http://digitalmars.com/d/expression.html#ImportEx=
pression Expressions]

<tt>in</tt>
* in pre contract:  [http://www.digitalmars.com/d/dbc.html Contracts]
* containment test:  [http://www.digitalmars.com/d/expression.html#InExp=
ression Expressions]
* function parameter:  [http://www.digitalmars.com/d/function.html#param=
eters Functions]

<tt>inout</tt> ''(deprecated, use <tt>ref</tt> instead)''
* in foreach statement:  [http://www.digitalmars.com/d/statement.html#Fo=
reachStatement Statements]
* function parameter:  [http://www.digitalmars.com/d/function.html#param=
eters Functions]

<tt>int</tt>
* [http://www.digitalmars.com/d/type.html Types]

<tt>interface</tt>
* [http://www.digitalmars.com/d/interface.html Interfaces]

<tt>invariant</tt>
* [http://www.digitalmars.com/d/class.html#invariants Classes]

<tt>ireal</tt>
* [http://www.digitalmars.com/d/type.html Types]
* imaginary types:  [http://www.digitalmars.com/d/float.html Floating Po=
int]

<tt>is</tt>
* identity comparison:  [http://www.digitalmars.com/d/expression.html#Eq=
ualExpression Expressions]
* type comparison:  [http://www.digitalmars.com/d/expression.html#IsExpr=
ession Expressions]


----


<tt>lazy</tt>
* function parameter:  [http://www.digitalmars.com/d/function.html#param=
eters Functions]

<tt>long</tt>
* [http://www.digitalmars.com/d/type.html Types]


----

<tt>macro</tt>
* ''Unused''

<tt>mixin</tt>
* [http://www.digitalmars.com/d/template-mixin.html Template Mixins]
* Mixin declarations:  [http://digitalmars.com/d/module.html#MixinDeclar=
ation Modules]
* Mixin expressions:  [http://digitalmars.com/d/expression.html#MixinExp=
ression Expressions]
* Mixin statements:  [http://digitalmars.com/d/statement.html#MixinState=
ment Statements]

<tt>module</tt>
* [http://www.digitalmars.com/d/module.html Modules]


----


<tt>new</tt>
* anonymous nested classes and:  [http://www.digitalmars.com/d/class.htm=
l#anonymous Classes]
* expression:  [http://www.digitalmars.com/d/expression.html#NewExpressi=
on Expressions]
* overloading:  [http://www.digitalmars.com/d/class.html#allocators Clas=
ses]

<tt>null</tt>
* [http://www.digitalmars.com/d/expression.html#PrimaryExpression Expres=
sions]


----


<tt>out</tt>
* in post contract:  [http://www.digitalmars.com/d/dbc.html Contracts]
* function parameter:  [http://www.digitalmars.com/d/function.html#param=
eters Functions]

<tt>override</tt>
* [http://www.digitalmars.com/d/attribute.html#override Attributes]


----


<tt>package</tt>
* [http://www.digitalmars.com/d/attribute.html Attributes]

<tt>pragma</tt>
* [http://www.digitalmars.com/d/pragma.html Pragmas]

<tt>private</tt>
* and import:  [http://www.digitalmars.com/d/module.html Modules]
* protection attribute:  [http://www.digitalmars.com/d/attribute.html At=
tributes]

<tt>protected</tt>
* [http://www.digitalmars.com/d/attribute.html Attributes]

<tt>public</tt>
* [http://www.digitalmars.com/d/attribute.html Attributes]


----


<tt>real</tt>
* [http://www.digitalmars.com/d/type.html Types]
* floating point types:  [http://www.digitalmars.com/d/float.html Floati=
ng Point]

<tt>ref</tt>
* in foreach statement:  [http://www.digitalmars.com/d/statement.html#Fo=
reachStatement Statements]
* function parameter:  [http://www.digitalmars.com/d/function.html#param=
eters Functions]

<tt>return</tt>
* [http://www.digitalmars.com/d/statement.html#ReturnStatement Statement=
s]


----


<tt>scope</tt>
* statement: [http://www.digitalmars.com/d/statement.html#ScopeGuardStat=
ement Statements]
* RAII attribute:  [http://www.digitalmars.com/d/attribute.html#scope At=
tributes]

<tt>short</tt>
* [http://www.digitalmars.com/d/type.html Types]

<tt>static</tt>
* attribute:  [http://www.digitalmars.com/d/attribute.html Attributes]
* constructors:  [http://www.digitalmars.com/d/class.html#staticconstruc=
tor Classes]
* destructors:  [http://www.digitalmars.com/d/class.html#staticdestructo=
r Classes]
* order of static constructors and destructors:  [http://www.digitalmars=
.com/d/module.html#staticorder Modules]
* static assert:  [http://www.digitalmars.com/d/version.html#staticasser=
t Conditional Compilation]
* static if:  [http://www.digitalmars.com/d/version.html#staticif Condit=
ional Compilation]
* static import:  [http://www.digitalmars.com/d/module.html#ImportDeclar=
ation Modules]

<tt>struct</tt>
* [http://www.digitalmars.com/d/struct.html Structs & Unions]
* properties of:  [http://www.digitalmars.com/d/property.html#classprope=
rties Properties]

<tt>super</tt>
* [http://www.digitalmars.com/d/expression.html#PrimaryExpression Expres=
sions]
* as name of superclass constructor:  [http://www.digitalmars.com/d/clas=
s.html#constructors Classes]

<tt>switch</tt>
* [http://www.digitalmars.com/d/statement.html#SwitchStatement Statement=
s]

<tt>synchronized</tt>
* [http://www.digitalmars.com/d/statement.html#SynchronizedStatement Sta=
tements]


----


<tt>template</tt>
* [http://www.digitalmars.com/d/template.html Templates]

<tt>this</tt>
* [http://www.digitalmars.com/d/expression.html#PrimaryExpression Expres=
sions]
* as constructor name:  [http://www.digitalmars.com/d/class.html#constru=
ctors Classes]
* with ~, as destructor name:  [http://www.digitalmars.com/d/class.html#=
destructors Classes]

<tt>throw</tt>
* [http://www.digitalmars.com/d/statement.html#ThrowStatement Statements=
]

<tt>true</tt>
* [http://www.digitalmars.com/d/expression.html#PrimaryExpression Expres=
sions]

<tt>try</tt>
* [http://www.digitalmars.com/d/statement.html#TryStatement Statements]

<tt>typedef</tt>
* [http://www.digitalmars.com/d/declaration.html#typedef Declarations]

<tt>typeid</tt>
* [http://www.digitalmars.com/d/expression.html#typeidexpression Express=
ions]

<tt>typeof</tt>
* [http://www.digitalmars.com/d/declaration.html#typeof Declarations]


----


<tt>ubyte</tt>
* [http://www.digitalmars.com/d/type.html Types]

<tt>ucent</tt>
* [http://www.digitalmars.com/d/type.html Types]

<tt>uint</tt>
* [http://www.digitalmars.com/d/type.html Types]

<tt>ulong</tt>
* [http://www.digitalmars.com/d/type.html Types]

<tt>union</tt>
* [http://www.digitalmars.com/d/struct.html Structs & Unions]

<tt>unittest</tt>
* in classes:  [http://www.digitalmars.com/d/class.html#unittest Classes=
]

<tt>ushort</tt>
* [http://www.digitalmars.com/d/type.html Types]


----


<tt>version</tt>
* [http://www.digitalmars.com/d/version.html#version Conditional Compila=
tion]

<tt>void</tt>
* as initializer:  [http://www.digitalmars.com/d/declaration.html Declar=
ations]
* as type:  [http://www.digitalmars.com/d/type.html Types]

<tt>volatile</tt>
* [http://www.digitalmars.com/d/statement.html#VolatileStatement Stateme=
nts]


----


<tt>wchar</tt>
* [http://www.digitalmars.com/d/type.html Types]

<tt>while</tt>
* [http://www.digitalmars.com/d/statement.html#WhileStatement Statements=
]

<tt>with</tt>
* [http://www.digitalmars.com/d/statement.html#WithStatement Statements]=




----

Source: Kirk <n>McDonald</n>, http://216.190.88.10:8087/media/d_index.ht=
ml (NG:digitalmars.D/38550)
`;
------------sZDT2ooyerO0WrUrbEQ4EV--
Apr 12 2007