summaryrefslogblamecommitdiffstats
path: root/chars.in
blob: ab8ad281de052f2880a599726f14846fcf73130f (plain) (tree)
1
2
3
4
5
6
7
8
               
  
                                                         

                                                                        

                                                                         
  






                                                                           


   



                                                                       
  




                                                                        

                                         

   

                                                                                  
                                                                                  






                                                                                  



                                                                                  
                                                                                  



                                                                                  
                                                                                  





                                                                                  
 















                                                                                  
 

                                                                                  
                                                                          
 










                                                                                  

                                                                                  
                                                                                  

                                                                                  

                                                                                  





                                                                                  
                                                                                  

                                                                                  



                                                                                  
                                                                                  
                                                                                  

                                                                                  

                                                                                  
                                                                                  

                                                                                  

                                                                                  





                                                                                  
                                                                                  

                                                                                  



                                                                                  
                                                                                  
                                                                                  

                                                                                  
                                                                                  
                                                                                  
                                                                                  



                                                                                  

                                                                                  




















































                                                                                  


















































































                                                                                  







                                                                          
                                                                          
                                                                          




                                                                          

                                                                                  
                                                                          
                                                                          
                                                                          
                                                                                  


                                                                          
                                                                                  
                                                                          


                                                                          




                                                                          
                                                                                  

                                                                                  
                                                                          




                                                                          
                                                                          
                                                                          

                                                                                  
                                                                                  
                                                                                  
                                                                          


                                                                          
                                                                                  




                                                                                  
                                                                                  
                                                                                  



                                                                          
                                                                          


                                                                          
/*	$Id$ */
/*
 * Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/*
 * The ASCII translation tables.  STRING corresponds to predefined
 * strings (cf. mdoc_samples.7 and tmac/mdoc/doc-nroff).  CHAR
 * corresponds to special characters (cf. groff_char.7).  BOTH contains
 * sequences that are equivalent in both STRING and CHAR.
 *
 * Either way, the left-hand side corresponds to the input sequence (\x,
 * \(xx, \*(xx and so on) whose length is listed second element.  The
 * right-hand side is what's produced by the front-end, with the fourth
 * element being its length.
 *
 * XXX - C-escape strings!
 * XXX - update LINES_MAX if adding more!
 */

STRING("Am",			2,	"&",		1,	"&amp;",	5)
STRING("Ba",			2,	"|",		1,	"|",		0)
STRING("Ge",			2,	">=",		2,	"&#8805;",	7)
STRING("Gt",			2,	">",		1,	"&gt;",		4)
STRING("If",			2,	"infinity",	8,	"infinity",	8)
STRING("Le",			2,	"<=",		2,	"&#8804;",	7)
STRING("Lq",			2,	"``",		2,	"&#8220;",	7)
STRING("Lt",			2,	"<",		1,	"&lt;",		4)
STRING("Na",			2,	"NaN",		3,	"NaN",		3)
STRING("Ne",			2,	"!=",		2,	"&#8800;",	7)
STRING("Pi",			2,	"pi",		2,	"&#960;",	6)
STRING("Pm",			2,	"+-",		2,	"&#177;",	6)
STRING("R",			1,	"(R)",		3,	"&#174;",	6)
STRING("Rq",			2,	"\'\'",		2,	"&#8221;",	7)
STRING("Tm",			2,	"tm",		2,	"&#8482;",	7)
STRING("left-bracket",		12,	"[",		1,	"[",		1)
STRING("left-parenthesis",	16,	"(",		1,	"(",		1)
STRING("left-singlequote",	16,	"`",		1,	"&#8216;",	7)
STRING("lp",			2,	"(",		1,	"(",		1)
STRING("q",			1,	"\"",		1,	"&quot;",	6)
STRING("quote-left",		10,	"`",		1,	"&#8216;",	7)
STRING("quote-right",		11,	"\'",		1,	"&#8217;",	7)
STRING("right-bracket",		13,	"]",		1,	"]",		1)
STRING("right-parenthesis",	17,	")",		1,	")",		1)
STRING("right-singlequote",	17,	"\'",		1,	"&#8217;",	7)
STRING("rp",			2,	")",		1,	")",		1)

/* Accents. */
CHAR("a\"",			2,	"\"",		1,	"&#779;",	6)
CHAR("a-",			2,	"-",		1,	"&#175;",	6)
CHAR("a.",			2,	".",		1,	"&#729;",	6)
CHAR("a^",			2,	"^",		1,	"&#770;",	6)
BOTH("aa",			2,	"\'",		1,	"&#769;",	6)
BOTH("ga",			2,	"`",		1,	"&#768;",	6)
CHAR("ab",			2,	"`",		1,	"&#774;",	6)
CHAR("ac",			2,	",",		1,	"&#807;",	6)
CHAR("ad",			2,	"\"",		1,	"&#776;",	6)
CHAR("ah",			2,	"v",		1,	"&#711;",	6)
CHAR("ao",			2,	"o",		1,	"&#730;",	6)
CHAR("a~",			2, 	"~",		1,	"&#771;",	6)
CHAR("ho",			2,	",",		1,	"&#808;",	6)
CHAR("ha",			2,	"^",		1,	"^",		1)
CHAR("ti",			2,	"~",		1,	"~",		1)

BOTH("lq",			2, 	"``",		2,	"&#8220;",	7)
BOTH("rq",			2, 	"\'\'",		2,	"&#8221;",	7)
BOTH("ua",			2,	"^",		1,	"",	0)

/* Punctuation. */
CHAR("-",			1,	"-",		1,	"-",		1)
CHAR(".",			1,	".",		1,	".",		1)

/* White-space. */
CHAR("0",			1,	" ",		1,	"&#160;",	6)
CHAR(" ",			1,	" ",		1,	"&#160;",	6)
CHAR("%",			1,	"",		0,	"",		0)
CHAR("&",			1,	"",		0,	"",		0)

/* Greek characters. */
CHAR("*A",			2,	"A",		1,	"&#913;",	6)
CHAR("*B",			2,	"B",		1,	"&#914;",	6)
CHAR("*G",			2,	"|",		1,	"&#915;",	6)
CHAR("*D",			2,	"/\\",		2,	"&#916;",	6)
CHAR("*E",			2,	"E",		1,	"&#917;",	6)
CHAR("*Z",			2,	"Z",		1,	"&#918;",	6)
CHAR("*Y",			2,	"H",		1,	"&#919;",	6)
CHAR("*H",			2,	"O",		1,	"&#920;",	6)
CHAR("*I",			2,	"I",		1,	"&#921;",	6)
CHAR("*K",			2,	"K",		1,	"&#922;",	6)
CHAR("*L",			2,	"/\\",		2,	"&#923;",	6)
CHAR("*M",			2,	"M",		1,	"&#924;",	6)
CHAR("*N",			2,	"N",		1,	"&#925;",	6)
CHAR("*C",			2,	"H",		1,	"&#926;",	6)
CHAR("*O",			2,	"O",		1,	"&#927;",	6)
CHAR("*P",			2,	"TT",		2,	"&#928;",	6)
CHAR("*R",			2,	"P",		1,	"&#929;",	6)
CHAR("*S",			2,	">",		1,	"&#931;",	6)
CHAR("*T",			2,	"T",		1,	"&#932;",	6)
CHAR("*U",			2,	"Y",		1,	"&#933;",	6)
CHAR("*F",			2,	"O_",		1,	"&#934;",	6)
CHAR("*X",			2,	"X",		1,	"&#935;",	6)
CHAR("*Q",			2,	"Y",		1,	"&#936;",	6)
CHAR("*W",			2,	"O",		1,	"&#937;",	6)
CHAR("*a",			2,	"a",		1,	"&#945;",	6)
CHAR("*b",			2,	"B",		1,	"&#946;",	6)
CHAR("*g",			2,	"y",		1,	"&#947;",	6)
CHAR("*d",			2,	"d",		1,	"&#948;",	6)
CHAR("*e",			2,	"e",		1,	"&#949;",	6)
CHAR("*z",			2,	"C",		1,	"&#950;",	6)
CHAR("*y",			2,	"n",		1,	"&#951;",	6)
CHAR("*h",			2,	"0",		1,	"&#952;",	6)
CHAR("*i",			2,	"i",		1,	"&#953;",	6)
CHAR("*k",			2,	"k",		1,	"&#954;",	6)
CHAR("*l",			2,	"\\",		1,	"&#955;",	6)
CHAR("*m",			2,	"u",		1,	"&#956;",	6)
CHAR("*n",			2,	"v",		1,	"&#957;",	6)
CHAR("*c",			2,	"E",		1,	"&#958;",	6)
CHAR("*o",			2,	"o",		1,	"&#959;",	6)
CHAR("*p",			2,	"n",		1,	"&#960;",	6)
CHAR("*r",			2,	"p",		1,	"&#961;",	6)
CHAR("*s",			2,	"o",		1,	"&#963;",	6)
CHAR("*t",			2,	"t",		1,	"&#964;",	6)
CHAR("*u",			2,	"u",		1,	"&#965;",	6)
CHAR("*f",			2,	"o",		1,	"&#981;",	6)
CHAR("*x",			2,	"x",		1,	"&#967;",	6)
CHAR("*q",			2,	"u",		1,	"&#968;",	6)
CHAR("*w",			2,	"w",		1,	"&#969;",	6)
CHAR("+h",			2,	"0",		1,	"&#977;",	6)
CHAR("+f",			2,	"o",		1,	"&#966;",	6)
CHAR("+p",			2,	"w",		1,	"&#982;",	6)
CHAR("+e",			2,	"e",		1,	"&#1013;",	7)
CHAR("ts",			2,	"s",		1,	"&#962;",	6)

/* Accented characters. */
CHAR(",C",			2,	"C",		1,	"&#199;",	6)
CHAR(",c",			2,	"c",		1,	"&#231;",	6)
CHAR("-D",			2,	"D",		1,	"&#208;",	6)
CHAR("/L",			2,	"L",		1,	"&#321;",	6)
CHAR("/O",			2,	"O",		1,	"&#216;",	6)
CHAR("/l",			2,	"l",		1,	"&#322;",	6)
CHAR("/o",			2,	"o",		1,	"&#248;",	6)
CHAR(":A",			2,	"A",		1,	"&#196;",	6)
CHAR(":E",			2,	"E",		1,	"&#203;",	6)
CHAR(":I",			2,	"I",		1,	"&#207;",	6)
CHAR(":O",			2,	"O",		1,	"&#214;",	6)
CHAR(":U",			2,	"U",		1,	"&#220;",	6)
CHAR(":a",			2,	"a",		1,	"&#228;",	6)
CHAR(":e",			2,	"e",		1,	"&#235;",	6)
CHAR(":i",			2,	"i",		1,	"&#239;",	6)
CHAR(":o",			2,	"o",		1,	"&#245;",	6)
CHAR(":u",			2,	"u",		1,	"&#252;",	6)
CHAR(":y",			2,	"y",		1,	"&#255;",	6)
CHAR("\'A",			2,	"A",		1,	"&#193;",	6)
CHAR("\'E",			2,	"E",		1,	"&#201;",	6)
CHAR("\'I",			2,	"I",		1,	"&#205;",	6)
CHAR("\'O",			2,	"O",		1,	"&#211;",	6)
CHAR("\'U",			2,	"U",		1,	"&#218;",	6)
CHAR("\'a",			2,	"a",		1,	"&#225;",	6)
CHAR("\'e",			2,	"e",		1,	"&#233;",	6)
CHAR("\'i",			2,	"i",		1,	"&#237;",	6)
CHAR("\'o",			2,	"o",		1,	"&#243;",	6)
CHAR("\'u",			2,	"u",		1,	"&#250;",	6)
CHAR("^A",			2,	"A",		1,	"&#194;",	6)
CHAR("^E",			2,	"E",		1,	"&#202;",	6)
CHAR("^I",			2,	"I",		1,	"&#206;",	6)
CHAR("^O",			2,	"O",		1,	"&#212;",	6)
CHAR("^U",			2,	"U",		1,	"&#219;",	6)
CHAR("^a",			2,	"a",		1,	"&#226;",	6)
CHAR("^e",			2,	"e",		1,	"&#234;",	6)
CHAR("^i",			2,	"i",		1,	"&#238;",	6)
CHAR("^o",			2,	"o",		1,	"&#244;",	6)
CHAR("^u",			2,	"u",		1,	"&#251;",	6)
CHAR("`A",			2,	"A",		1,	"&#192;",	6)
CHAR("`E",			2,	"E",		1,	"&#200;",	6)
CHAR("`I",			2,	"I",		1,	"&#204;",	6)
CHAR("`O",			2,	"O",		1,	"&#210;",	6)
CHAR("`U",			2,	"U",		1,	"&#217;",	6)
CHAR("`a",			2,	"a",		1,	"&#224;",	6)
CHAR("`e",			2,	"e",		1,	"&#232;",	6)
CHAR("`i",			2,	"i",		1,	"&#236;",	6)
CHAR("`o",			2,	"o",		1,	"&#242;",	6)
CHAR("`u",			2,	"u",		1,	"&#249;",	6)
CHAR("~A",			2,	"A",		1,	"&#195;",	6)
CHAR("~N",			2,	"N",		1,	"&#209;",	6)
CHAR("~O",			2,	"O",		1,	"&#213;",	6)
CHAR("~a",			2,	"a",		1,	"&#227;",	6)
CHAR("~n",			2,	"n",		1,	"&#241;",	6)
CHAR("~o",			2,	"o",		1,	"&#245;",	6)

CHAR("~",			1,	" ",		1,	"",	0)

/* Arrows. */
CHAR("->",			2, 	"->",		2,	"&#8594;",	7)
CHAR("<-",			2, 	"<-",		2,	"&#8592;",	7)
CHAR("<>",			2, 	"<>",		2,	"&#8596;",	7)

/* Logic. */
CHAR("AN",			2,	"^",		1,	"&#8743;",	7)
CHAR("OR",			2,	"v",		1,	"&#8744;",	7)
CHAR("no",			2,	"~",		1,	"&#172;",	6)
CHAR("tno",			3,	"~",		1,	"&#172;",	6)
CHAR("te",			2,	"3",		1,	"&#8707;",	7)
CHAR("fa",			2,	"V",		1,	"&#8704;",	7)
CHAR("st",			2,	"-)",		2,	"&#8715;",	7)
CHAR("tf",			2,	".:.",		3,	"&#8756;",	7)
CHAR("3d",			2,	".:.",		3,	"&#8756;",	7)
CHAR("or",			2,	"|",		1,	"|",		1)

/* Mathematicals. */
CHAR("pl",			2,	"+",		1,	"&#43;",	5)
CHAR("mi",			2,	"-",		1,	"&#8722;",	7)
CHAR("-+",			2,	"-+",		2,	"&#8723;",	7)
CHAR("+-",			2, 	"+-",		2,	"&#177;",	6)
CHAR("t+-",			3, 	"+-",		2,	"&#177;",	6)
CHAR("pc",			2, 	".",		1,	"&#183;",	6)
CHAR("md",			2, 	".",		1,	"&#8901;",	7)
CHAR("mu",			2,	"x",		1,	"&#215;",	6)
CHAR("tmu",			3,	"x",		1,	"&#215;",	6)
CHAR("c*",			2,	"x",		1,	"&#8855;",	7)
CHAR("c+",			2,	"+",		1,	"&#8853;",	7)
CHAR("di",			2,	"-:-",		3,	"&#247;",	6)
CHAR("tdi",			3,	"-:-",		3,	"&#247;",	6)
CHAR("f/",			2,	"/",		1,	"&#8260;",	7)
CHAR("**",			2, 	"*",		1,	"&#8727;",	7)
BOTH("<=",			2,	"<=",		2,	"&#8804;",	7)
BOTH(">=",			2,	">=",		2,	"&#8805;",	7)
CHAR("<<",			2, 	"<<",		2,	"&#8810;",	7)
CHAR(">>",			2, 	">>",		2,	"&#8811;",	7)
CHAR("eq",			2,	"=",		1,	"&#61;",	5)
CHAR("!=",			2, 	"!=",		2,	"&#8800;",	7)
CHAR("==",			2, 	"==",		2,	"&#8801;",	7)
CHAR("ne",			2, 	"!==",		3,	"&#8802;",	7)
CHAR("=~",			2,	"=~",		2,	"&#8773;",	7)
CHAR("-~",			2,	"-~",		2,	"&#8771;",	7)
CHAR("ap",			2,	"~",		1,	"&#8764;",	7)
CHAR("~~",			2,	"~~",		2,	"&#8776;",	7)
CHAR("~=",			2,	"~=",		2,	"&#8780;",	7)
CHAR("pt",			2,	"oc",		2,	"&#8733;",	7)
CHAR("es",			2,	"{}",		2,	"&#8709;",	7)
CHAR("mo",			2,	"E",		1,	"&#8712;",	7)
CHAR("nm",			2,	"!E",		2,	"&#8713;",	7)
CHAR("sb",			2,	"(=",		2,	"&#8834;",	7)
CHAR("nb",			2,	"(!=",		3,	"&#8836;",	7)
CHAR("sp",			2,	"=)",		2,	"&#8835;",	7)
CHAR("nc",			2,	"!=)",		3,	"&#8837;",	7)
CHAR("ib",			2,	"(=",		2,	"&#8838;",	7)
CHAR("ip",			2,	"=)",		2,	"&#8839;",	7)
CHAR("ca",			2,	"(^)",		3,	"&#8745;",	7)
CHAR("cu",			2,	"U",		1,	"&#8746;",	7)
CHAR("/_",			2,	"/_",		2,	"&#8736;",	7)
CHAR("pp",			2,	"_|_",		3,	"&#8869;",	7)
CHAR("is",			2,	"I",		1,	"&#8747;",	7)
CHAR("integral",		8,	"I",		1,	"&#8747;",	7)
CHAR("sum",			3,	"E",		1,	"&#8721;",	7)
CHAR("product",			7,	"TT",		2,	"&#8719;",	7)
CHAR("coproduct",		9,	"U",		1,	"&#8720;",	7)
CHAR("gr",			2,	"V",		1,	"&#8711;",	7)
CHAR("sr",			2,	"\\/",		2,	"&#8730;",	7)
CHAR("sqrt",			4,	"\\/",		2,	"&#8730;",	7)
CHAR("lc",			2,	"|~",		2,	"&#8968;",	7)
CHAR("rc",			2,	"~|",		2,	"&#8969;",	7)
CHAR("lf",			2,	"|_",		2,	"&#8970;",	7)
CHAR("rf",			2,	"_|",		2,	"&#8971;",	7)
CHAR("if",			2, 	"oo",		2,	"&#8734;",	7)
CHAR("Ah",			2,	"N",		1,	"&#8501;",	7)
CHAR("Im",			2,	"I",		1,	"&#8465;",	7)
CHAR("Re",			2,	"R",		1,	"&#8476;",	7)
CHAR("pd",			2,	"a",		1,	"&#8706;",	7)
CHAR("-h",			2,	"/h",		2,	"&#8463;",	7)

CHAR("AE",			2,	"AE",		2,	"&#198;",	6)
CHAR("Bq",			2, 	",,",		2,	"&#8222;",	7)
CHAR("Cs",			2,	"x",		1,	"",	0)
CHAR("Do",			2,	"$",		1,	"",	0)
CHAR("Eu",			2,	"EUR",		3,	"",	0)
CHAR("Fc",			2,	">>",		2,	"",	0)
CHAR("Fi",			2,	"ffi",		3,	"",	0)
CHAR("Fl",			2,	"ffl",		3,	"",	0)
CHAR("Fn",			2,	"f",		1,	"",	0)
CHAR("Fo",			2,	"<<",		2,	"",	0)
CHAR("OE",			2,	"OE",		2,	"",	0)
CHAR("Po",			2,	"L",		1,	"",	0)
CHAR("Sd",			2,	"o",		1,	"",	0)
CHAR("TP",			2,	"b",		1,	"",	0)
CHAR("Tp",			2,	"b",		1,	"",	0)
CHAR("Ye",			2,	"Y",		1,	"",	0)
CHAR("\'",			1,	"\'",		1,	"",	0)
CHAR("\\",			1,	"\\",		1,	"\\",		1)
CHAR("^",			1,	"",		0,	"",		0)
CHAR("`",			1,	"`",		1,	"",	0)
CHAR("aa",			2, 	"\'",		1,	"",	0)
CHAR("ae",			2,	"ae",		2,	"",	0)
CHAR("aq",			2, 	"\'",		1,	"&#8217;",	7)
CHAR("ba",			2, 	"|",		1,	"",	0)
CHAR("bb",			2, 	"|",		1,	"",	0)
CHAR("bq",			2, 	",",		1,	"",	0)
CHAR("bu",			2, 	"o",		1,	"&#8226;",	7)
CHAR("c",			1,	"",		0,	"",	0)
CHAR("ci",			2, 	"O",		1,	"",	0)
CHAR("co",			2, 	"(C)",		3,	"",	0)
CHAR("ct",			2,	"c",		1,	"",	0)
CHAR("dA",			2, 	"v",		1,	"",	0)
CHAR("da",			2, 	"v",		1,	"",	0)
CHAR("dd",			2,	"=",		1,	"",	0)
CHAR("de",			2,	"o",		1,	"",	0)
CHAR("dg",			2,	"-",		1,	"",	0)
CHAR("e",			1,	"\\",		1,	"\\",		1)
CHAR("em",			2, 	"--",		2,	"&#8212;",	7)
CHAR("en",			2, 	"-",		1,	"&#8211;",	7)
CHAR("eu",			2,	"EUR",		3,	"",	0)
CHAR("fc",			2,	">",		1,	"",	0)
CHAR("ff",			2,	"ff",		2,	"",	0)
CHAR("fi",			2,	"fi",		2,	"",	0)
CHAR("fl",			2,	"fl",		2,	"",	0)
CHAR("fo",			2,	"<",		1,	"",	0)
CHAR("hA",			2, 	"<=>",		3,	"",	0)
CHAR("hy",			2, 	"-",		1,	"",	0)
CHAR("lA",			2, 	"<=",		2,	"",	0)
CHAR("lB",			2, 	"[",		1,	"[",		1)
CHAR("lC",			2, 	"{",		1,	"{",		1)
CHAR("la",			2, 	"<",		1,	"&lt;",		4)
CHAR("lh",			2,	"<=",		2,	"",	0)
CHAR("oA",			2,	"A",		1,	"",	0)
CHAR("oa",			2,	"a",		1,	"",	0)
CHAR("oe",			2,	"oe",		2,	"",	0)
CHAR("oq",			2, 	"`",		1,	"&#8216;",	7)
CHAR("ps",			2,	"9|",		2,	"",	0)
CHAR("r!",			2,	"i",		1,	"",	0)
CHAR("r?",			2,	"c",		1,	"",	0)
CHAR("rA",			2, 	"=>",		2,	"",	0)
CHAR("rB",			2, 	"]",		1,	"]",		1)
CHAR("rC",			2, 	"}",		1,	"}",		1)
CHAR("ra",			2, 	">",		1,	"&gt;",		4)
CHAR("rg",			2, 	"(R)",		3,	"",	0)
CHAR("rh",			2,	"=>",		2,	"",	0)
CHAR("sc",			2,	"S",		1,	"",	0)
CHAR("ss",			2,	"ss",		2,	"",	0)
CHAR("tm",			2, 	"tm",		2,	"",	0)
CHAR("uA",			2, 	"^",		1,	"",	0)
CHAR("ua",			2, 	"^",		1,	"",	0)
CHAR("|",			1,	"",		0,	"",	0)