00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <iostream>
00024 #include <string>
00025 #include <set>
00026 #include <map>
00027 #include <cstdlib>
00028
00029 #include "doc_autodoc.hh"
00030 #include "tlib.hh"
00031 #include "boxes.hh"
00032 #include "doc.hh"
00033
00034
00035 extern SourceReader gReader;
00036
00037 map<string, string> gDocAutodocStringMap;
00038 set<string> gDocAutodocKeySet;
00039
00040 static void initDocAutodocKeySet();
00041
00042
00043
00044
00045
00046
00047
00048
00049
00058 void declareAutoDoc()
00059 {
00060 Tree autodoc = nil;
00061 Tree process = boxIdent("process");
00062
00063 string autoEquationTxt = "\n" + gDocAutodocStringMap["autoeqntitle"] + "\n\n";
00064 autoEquationTxt += gDocAutodocStringMap["autoeqntext"] + "\n";
00065 autodoc = cons(docTxt(autoEquationTxt.c_str()), autodoc);
00066 autodoc = cons(docEqn(process), autodoc);
00067
00068 string autoDiagramTxt = "\n" + gDocAutodocStringMap["autodgmtitle"] + "\n\n";
00069 autoDiagramTxt += gDocAutodocStringMap["autodgmtext"] + "\n";
00070 autodoc = cons(docTxt(autoDiagramTxt.c_str()), autodoc);
00071 autodoc = cons(docDgm(process), autodoc);
00072
00073 string autoNoticeTxt = "\n" + gDocAutodocStringMap["autontctitle"] + "\n\n";
00074 autoNoticeTxt += gDocAutodocStringMap["autontctext"] + "\n";
00075 autodoc = cons(docTxt(autoNoticeTxt.c_str()), autodoc);
00076 autodoc = cons(docNtc(), autodoc);
00077
00078 string autoListingTxt;
00079 vector<string> pathnames = gReader.listSrcFiles();
00080 if(pathnames.size() > 1) {
00081 autoListingTxt = "\n" + gDocAutodocStringMap["autolsttitle2"] + "\n\n";
00082 autoListingTxt += gDocAutodocStringMap["autolsttext2"] + "\n";
00083 } else {
00084 autoListingTxt = "\n" + gDocAutodocStringMap["autolsttitle1"] + "\n\n";
00085 autoListingTxt += gDocAutodocStringMap["autolsttext1"] + "\n";
00086 }
00087 autodoc = cons(docTxt(autoListingTxt.c_str()), autodoc);
00088 autodoc = cons(docLst(), autodoc);
00089
00090 declareDoc(autodoc);
00091 }
00092
00093
00097 void initDocAutodoc()
00098 {
00099 initDocAutodocKeySet();
00100 }
00101
00102
00103
00104
00105
00106
00107
00108
00112 static void initDocAutodocKeySet() {
00113
00114 gDocAutodocKeySet.insert("autoeqntitle");
00115 gDocAutodocKeySet.insert("autoeqntext");
00116
00117 gDocAutodocKeySet.insert("autodgmtitle");
00118 gDocAutodocKeySet.insert("autodgmtext");
00119
00120 gDocAutodocKeySet.insert("autontctitle");
00121 gDocAutodocKeySet.insert("autontctext");
00122
00123 gDocAutodocKeySet.insert("autolsttitle1");
00124 gDocAutodocKeySet.insert("autolsttext1");
00125
00126 gDocAutodocKeySet.insert("autolsttitle2");
00127 gDocAutodocKeySet.insert("autolsttext2");
00128 }
00129
00130
00134 static void printDocAutodocStringMapContent() {
00135 bool trace = false;
00136 if(trace) {
00137 cout << "gDocAutodocStringMap.size() = " << gDocAutodocStringMap.size() << endl;
00138 map<string,string>::iterator it;
00139 int i = 1;
00140 for(it = gDocAutodocStringMap.begin(); it!=gDocAutodocStringMap.end(); ++it)
00141 cout << i++ << ".\tgDocNoticeStringMap[" << it->first << "] \t= '" << it->second << "'" << endl;
00142 }
00143 }
00144