1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22 #include <precomp.h>
23 #include <s2_dsapi/cx_dsapi.hxx>
24
25
26 // NOT FULLY DEFINED SERVICES
27 #include <x_parse2.hxx>
28 #include <tools/tkpchars.hxx>
29 #include <s2_dsapi/tk_atag2.hxx>
30 #include <s2_dsapi/tk_docw2.hxx>
31 #include <s2_dsapi/tk_xml.hxx>
32 #include <s2_dsapi/cx_docu2.hxx>
33 #include <s2_dsapi/tokrecv.hxx>
34
35
36 namespace csi
37 {
38 namespace dsapi
39 {
40
41
42 const intt C_nStatusSize = 128;
43 const intt C_nCppInitialNrOfStati = 400;
44
45
46 const uintt nF_fin_Error = 1;
47 const uintt nF_fin_Ignore = 2;
48 const uintt nF_fin_Eof = 3;
49 const uintt nF_fin_AnyWord = 4;
50 const uintt nF_fin_AtTag = 5;
51 const uintt nF_fin_EndSign = 6;
52 const uintt nF_goto_EoHtml = 7;
53 const uintt nF_goto_EoXmlConst = 8;
54 const uintt nF_goto_EoXmlLink_BeginTag = 9;
55 const uintt nF_goto_EoXmlLink_EndTag = 10;
56 const uintt nF_goto_EoXmlFormat_BeginTag = 11;
57 const uintt nF_goto_EoXmlFormat_EndTag = 12;
58 const uintt nF_goto_CheckStar = 13;
59 const uintt nF_fin_Comma = 14;
60 const uintt nF_fin_White = 15;
61
62 const UINT16 nTok_at_author = 100 + Tok_AtTag::author;
63 const UINT16 nTok_at_see = 100 + Tok_AtTag::see;
64 const UINT16 nTok_at_param = 100 + Tok_AtTag::param;
65 const UINT16 nTok_at_return = 100 + Tok_AtTag::e_return;
66 const UINT16 nTok_at_throws = 100 + Tok_AtTag::e_throw;
67 const UINT16 nTok_at_example = 100 + Tok_AtTag::example;
68 const UINT16 nTok_at_deprecated = 100 + Tok_AtTag::deprecated;
69 const UINT16 nTok_at_suspicious = 100 + Tok_AtTag::suspicious;
70 const UINT16 nTok_at_missing = 100 + Tok_AtTag::missing;
71 const UINT16 nTok_at_incomplete = 100 + Tok_AtTag::incomplete;
72 const UINT16 nTok_at_version = 100 + Tok_AtTag::version;
73 const UINT16 nTok_at_guarantees = 100 + Tok_AtTag::guarantees;
74 const UINT16 nTok_at_exception = 100 + Tok_AtTag::exception;
75 const UINT16 nTok_at_since = 100 + Tok_AtTag::since;
76
77 const UINT16 nTok_const_TRUE = 200 + Tok_XmlConst::e_true;
78 const UINT16 nTok_const_FALSE = 200 + Tok_XmlConst::e_false;
79 const UINT16 nTok_const_NULL = 200 + Tok_XmlConst::e_null;
80 const UINT16 nTok_const_void = 200 + Tok_XmlConst::e_void;
81
82 const UINT16 nTok_link_typeB = 300 + Tok_XmlLink_BeginTag::type;
83 const UINT16 nTok_link_typeE = 325 + Tok_XmlLink_EndTag::type;
84 const UINT16 nTok_link_memberB = 300 + Tok_XmlLink_BeginTag::member;
85 const UINT16 nTok_link_membeE = 325 + Tok_XmlLink_EndTag::member;
86 const UINT16 nTok_link_constB = 300 + Tok_XmlLink_BeginTag::e_const;
87 const UINT16 nTok_link_constE = 325 + Tok_XmlLink_EndTag::e_const;
88
89 const UINT16 nTok_format_listingB = 350 + Tok_XmlFormat_BeginTag::listing;
90 const UINT16 nTok_format_listingE = 375 + Tok_XmlFormat_EndTag::listing;
91 const UINT16 nTok_format_codeB = 350 + Tok_XmlFormat_BeginTag::code;
92 const UINT16 nTok_format_codeE = 375 + Tok_XmlFormat_EndTag::code;
93 const UINT16 nTok_format_atomB = 350 + Tok_XmlFormat_BeginTag::atom;
94 const UINT16 nTok_format_atomE = 375 + Tok_XmlFormat_EndTag::atom;
95
96
97 const UINT16 nTok_html_parastart = 400;
98
99 const UINT16 nTok_MLDocuEnd = 501;
100 const UINT16 nTok_EOL = 502;
101
102
Context_Docu(Token_Receiver & o_rReceiver)103 Context_Docu::Context_Docu( Token_Receiver & o_rReceiver )
104 : aStateMachine(C_nStatusSize, C_nCppInitialNrOfStati),
105 pReceiver(&o_rReceiver),
106 pParentContext(0),
107 pCx_EoHtml(0),
108 pCx_EoXmlConst(0),
109 pCx_EoXmlLink_BeginTag(0),
110 pCx_EoXmlLink_EndTag(0),
111 pCx_EoXmlFormat_BeginTag(0),
112 pCx_EoXmlFormat_EndTag(0),
113 pCx_CheckStar(0),
114 pNewToken(0),
115 pFollowUpContext(0),
116 bIsMultiline(false)
117 {
118 pCx_EoHtml = new Cx_EoHtml(o_rReceiver, *this);
119 pCx_EoXmlConst = new Cx_EoXmlConst(o_rReceiver, *this);
120 pCx_EoXmlLink_BeginTag = new Cx_EoXmlLink_BeginTag(o_rReceiver, *this);
121 pCx_EoXmlLink_EndTag = new Cx_EoXmlLink_EndTag(o_rReceiver, *this);
122 pCx_EoXmlFormat_BeginTag = new Cx_EoXmlFormat_BeginTag(o_rReceiver, *this);
123 pCx_EoXmlFormat_EndTag = new Cx_EoXmlFormat_EndTag(o_rReceiver, *this);
124 pCx_CheckStar = new Cx_CheckStar(*pReceiver,*this);
125
126 SetupStateMachine();
127 }
128
129 void
SetParentContext(TkpContext & io_rParentContext,const char *)130 Context_Docu::SetParentContext( TkpContext & io_rParentContext,
131 const char * )
132 {
133 pFollowUpContext = pParentContext = &io_rParentContext;
134 pCx_CheckStar->Set_End_FolloUpContext(io_rParentContext);
135 }
136
~Context_Docu()137 Context_Docu::~Context_Docu()
138 {
139 }
140
141 void
ReadCharChain(CharacterSource & io_rText)142 Context_Docu::ReadCharChain( CharacterSource & io_rText )
143 {
144 csv_assert(pParentContext != 0);
145
146 pNewToken = 0;
147
148 UINT16 nTokenId = 0;
149 StmBoundsStatu2 & rBound = aStateMachine.GetCharChain(nTokenId, io_rText);
150
151 // !!!
152 // The order of the next two lines is essential, because
153 // pFollowUpContext may be changed by PerformStatusFunction() also,
154 // which then MUST override the previous assignment.
155 pFollowUpContext = rBound.FollowUpContext();
156 PerformStatusFunction(rBound.StatusFunctionNr(), nTokenId, io_rText);
157 }
158
159 bool
PassNewToken()160 Context_Docu::PassNewToken()
161 {
162 if (pNewToken)
163 {
164 pReceiver->Receive(*pNewToken.Release());
165 return true;
166 }
167 return false;
168 }
169
170 TkpContext &
FollowUpContext()171 Context_Docu::FollowUpContext()
172 {
173 csv_assert(pFollowUpContext != 0);
174 return *pFollowUpContext;
175 }
176
177 void
PerformStatusFunction(uintt i_nStatusSignal,UINT16 i_nTokenId,CharacterSource & io_rText)178 Context_Docu::PerformStatusFunction( uintt i_nStatusSignal,
179 UINT16 i_nTokenId,
180 CharacterSource & io_rText )
181 {
182 switch (i_nStatusSignal)
183 {
184 case nF_fin_White:
185 io_rText.CutToken();
186 pNewToken = new Tok_White;
187 break;
188 case nF_fin_Error:
189 throw X_AutodocParser(X_AutodocParser::x_InvalidChar);
190 // no break because of throw
191 case nF_fin_Ignore:
192 pNewToken = 0;
193 io_rText.CutToken();
194 break;
195 case nF_fin_Eof:
196 if (bIsMultiline)
197 throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF);
198 else
199 io_rText.CutToken();
200 pNewToken = new Tok_EOF;
201 break;
202 case nF_fin_AnyWord:
203 pNewToken = new Tok_Word(io_rText.CutToken());
204 break;
205 case nF_fin_AtTag:
206 io_rText.CutToken();
207 pNewToken = new Tok_AtTag( i_nTokenId - 100 );
208 break;
209 case nF_fin_Comma:
210 io_rText.CutToken();
211 pNewToken = new Tok_Comma;
212 break;
213 case nF_fin_EndSign:
214 io_rText.CutToken();
215 switch (i_nTokenId)
216 {
217 case nTok_MLDocuEnd:
218 if (bIsMultiline)
219 {
220 pNewToken = new Tok_DocuEnd;
221 pFollowUpContext = pParentContext;
222 }
223 else
224 {
225 pNewToken = new Tok_Word(io_rText.CutToken());
226 pFollowUpContext = this;
227 }
228 break;
229 case nTok_EOL:
230 if (bIsMultiline)
231 {
232 pNewToken = new Tok_EOL;
233 pFollowUpContext = this;
234 }
235 else
236 {
237 pNewToken = new Tok_DocuEnd;
238 pFollowUpContext = pParentContext;
239 }
240 pReceiver->Increment_CurLine();
241 break;
242 default:
243 csv_assert(false);
244 }
245 break;
246 case nF_goto_EoHtml:
247 pCx_EoHtml->SetIfIsStartOfParagraph(i_nTokenId == nTok_html_parastart);
248 break;
249 case nF_goto_EoXmlConst:
250 pCx_EoXmlConst->SetTokenId(i_nTokenId - 200);
251 break;
252 case nF_goto_EoXmlLink_BeginTag:
253 pCx_EoXmlLink_BeginTag->SetTokenId(i_nTokenId - 300);
254 break;
255 case nF_goto_EoXmlLink_EndTag:
256 pCx_EoXmlLink_EndTag->SetTokenId(i_nTokenId - 325);
257 break;
258 case nF_goto_EoXmlFormat_BeginTag:
259 pCx_EoXmlFormat_BeginTag->SetTokenId(i_nTokenId - 350);
260 break;
261 case nF_goto_EoXmlFormat_EndTag:
262 pCx_EoXmlFormat_EndTag->SetTokenId(i_nTokenId - 375);
263 break;
264 case nF_goto_CheckStar:
265 pCx_CheckStar->SetIsEnd( bIsMultiline );
266 break;
267 default:
268 csv_assert(false);
269 } // end switch (i_nStatusSignal)
270 }
271
272 void
SetupStateMachine()273 Context_Docu::SetupStateMachine()
274 {
275 // Besondere Array-Stati (kein Tokenabschluss oder Kontextwechsel):
276 // const INT16 bas = 0; // Base-Status
277 const INT16 wht = 1; // Whitespace-overlook-Status
278 const INT16 awd = 2; // Any-Word-Read-Status
279
280 // Kontextwechsel-Stati:
281 const INT16 goto_EoHtml = 3;
282 const INT16 goto_EoXmlConst = 4;
283 const INT16 goto_EoXmlLink_BeginTag = 5;
284 const INT16 goto_EoXmlLink_EndTag = 6;
285 const INT16 goto_EoXmlFormat_BeginTag = 7;
286 const INT16 goto_EoXmlFormat_EndTag = 8;
287 const INT16 goto_CheckStar = 9;
288
289 // Tokenfinish-Stati:
290 const INT16 finError = 10;
291 // const INT16 finIgnore = 11;
292 const INT16 finEof = 12;
293 const INT16 finAnyWord = 13;
294 const INT16 finAtTag = 14;
295 const INT16 finEndSign = 15;
296 // const INT16 finComma = 16;
297 const INT16 finWhite = 17;
298
299 // Konstanten zur Benutzung in der Tabelle:
300 const INT16 ght = goto_EoHtml;
301 /*
302 const INT16 gxc = goto_EoXmlConst;
303 const INT16 glb = goto_EoXmlLink_TagBegin;
304 const INT16 gle = goto_EoXmlLink_TagEnd;
305 const INT16 gfb = goto_EoXmlFormat_TagBegin;
306 const INT16 gfe = goto_EoXmlFormat_TagEnd;
307 */
308 const INT16 err = finError;
309 const INT16 faw = finAnyWord;
310 // const INT16 fig = finIgnore;
311 // const INT16 fes = finEndSign;
312 const INT16 fof = finEof;
313 // const INT16 fat = finAtTag;
314 const INT16 fwh = finWhite;
315
316 /// The '0's will be replaced by calls of AddToken().
317
318 const INT16 A_nTopStatus[C_nStatusSize] =
319 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
320 {fof,err,err,err,err,err,err,err,err,wht, 0,wht,wht, 0,err,err,
321 err,err,err,err,err,err,err,err,err,err,fof,err,err,err,err,err, // ... 31
322 wht,awd,awd,awd,awd,awd,awd,awd,awd,awd, 0,awd,awd,awd,awd,awd,
323 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, 0,awd,awd,awd, // ... 63
324 0,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,
325 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, // ... 95
326 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,
327 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd // ... 127
328 };
329
330 const INT16 A_nWhitespaceStatus[C_nStatusSize] =
331 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
332 {fof,err,err,err,err,err,err,err,err,wht,fwh,wht,wht,fwh,err,err,
333 err,err,err,err,err,err,err,err,err,err,fof,err,err,err,err,err, // ... 31
334 wht,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,
335 fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh, // ... 63
336 fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,
337 fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh, // ... 95
338 fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,
339 fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh // ... 127
340 };
341
342 const INT16 A_nWordStatus[C_nStatusSize] =
343 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
344 {faw,err,err,err,err,err,err,err,err,faw,faw,faw,faw,faw,err,err,
345 err,err,err,err,err,err,err,err,err,err,faw,err,err,err,err,err, // ... 31
346 faw,awd,awd,awd,awd,awd,awd,awd,awd,awd,faw,awd,awd,awd,awd,awd,
347 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,faw,awd,awd,awd, // ... 63
348 faw,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,
349 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, // ... 95
350 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,
351 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd // ... 127
352 };
353
354 const INT16 A_nAtTagDefStatus[C_nStatusSize] =
355 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
356 {faw,err,err,err,err,err,err,err,err,faw,faw,faw,faw,faw,err,err,
357 err,err,err,err,err,err,err,err,err,err,faw,err,err,err,err,err, // ... 31
358 faw,awd,awd,awd,awd,awd,awd,awd,awd,awd,faw,awd,awd,awd,awd,awd,
359 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,faw,awd,faw,awd,awd,awd, // ... 63
360 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,
361 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, // ... 95
362 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,
363 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd // ... 127
364 };
365
366 const INT16 A_nHtmlDefStatus[C_nStatusSize] =
367 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
368 {ght,err,err,err,err,err,err,err,err,ght,ght,ght,ght,ght,err,err,
369 err,err,err,err,err,err,err,err,err,err,ght,err,err,err,err,err, // ... 31
370 ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,
371 ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght, // ... 63
372 ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,
373 ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght, // ... 95
374 ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,
375 ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght // ... 127
376 };
377
378 const INT16 A_nPunctDefStatus[C_nStatusSize] =
379 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
380 {err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,
381 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, // 16 ...
382 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,
383 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, // 48 ...
384 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,
385 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, // 80 ...
386 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,
387 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err // 112 ...
388 };
389
390 DYN StmArrayStatu2 * dpStatusTop
391 = new StmArrayStatu2( C_nStatusSize, A_nTopStatus, 0, true);
392 DYN StmArrayStatu2 * dpStatusWhite
393 = new StmArrayStatu2( C_nStatusSize, A_nWhitespaceStatus, 0, true);
394 DYN StmArrayStatu2 * dpStatusWord
395 = new StmArrayStatu2( C_nStatusSize, A_nWordStatus, 0, true);
396
397 DYN StmBoundsStatu2 * dpBst_goto_EoHtml
398 = new StmBoundsStatu2( *this, *pCx_EoHtml, nF_goto_EoHtml, true );
399 DYN StmBoundsStatu2 * dpBst_goto_EoXmlConst
400 = new StmBoundsStatu2( *this, *pCx_EoXmlConst, nF_goto_EoXmlConst, true );
401 DYN StmBoundsStatu2 * dpBst_goto_EoXmlLink_BeginTag
402 = new StmBoundsStatu2( *this, *pCx_EoXmlLink_BeginTag, nF_goto_EoXmlLink_BeginTag, true );
403 DYN StmBoundsStatu2 * dpBst_goto_EoXmlLink_EndTag
404 = new StmBoundsStatu2( *this, *pCx_EoXmlLink_EndTag, nF_goto_EoXmlLink_EndTag, true );
405 DYN StmBoundsStatu2 * dpBst_goto_EoXmlFormat_BeginTag
406 = new StmBoundsStatu2( *this, *pCx_EoXmlFormat_BeginTag, nF_goto_EoXmlFormat_BeginTag, true );
407 DYN StmBoundsStatu2 * dpBst_goto_EoXmlFormat_EndTag
408 = new StmBoundsStatu2( *this, *pCx_EoXmlFormat_EndTag, nF_goto_EoXmlFormat_EndTag, true );
409 DYN StmBoundsStatu2 * dpBst_goto_CheckStar
410 = new StmBoundsStatu2( *this, *pCx_CheckStar, nF_goto_CheckStar, true );
411
412
413 DYN StmBoundsStatu2 * dpBst_finError
414 = new StmBoundsStatu2( *this, TkpContext_Null2_(), nF_fin_Error, true );
415 DYN StmBoundsStatu2 * dpBst_finIgnore
416 = new StmBoundsStatu2( *this, *this, nF_fin_Ignore, true);
417 DYN StmBoundsStatu2 * dpBst_finEof
418 = new StmBoundsStatu2( *this, TkpContext_Null2_(), nF_fin_Eof, false);
419 DYN StmBoundsStatu2 * dpBst_finAnyWord
420 = new StmBoundsStatu2( *this, *this, nF_fin_AnyWord, true);
421 DYN StmBoundsStatu2 * dpBst_finAtTag
422 = new StmBoundsStatu2( *this, *this, nF_fin_AtTag, false);
423 DYN StmBoundsStatu2 * dpBst_finEndSign
424 = new StmBoundsStatu2( *this, *pParentContext, nF_fin_EndSign, false);
425 DYN StmBoundsStatu2 * dpBst_fin_Comma
426 = new StmBoundsStatu2( *this, *this, nF_fin_Comma, false );
427 DYN StmBoundsStatu2 * dpBst_finWhite
428 = new StmBoundsStatu2( *this, *this, nF_fin_White, false);
429
430
431 // dpMain aufbauen:
432 aStateMachine.AddStatus(dpStatusTop);
433 aStateMachine.AddStatus(dpStatusWhite);
434 aStateMachine.AddStatus(dpStatusWord);
435
436 aStateMachine.AddStatus(dpBst_goto_EoHtml);
437 aStateMachine.AddStatus(dpBst_goto_EoXmlConst);
438 aStateMachine.AddStatus(dpBst_goto_EoXmlLink_BeginTag);
439 aStateMachine.AddStatus(dpBst_goto_EoXmlLink_EndTag);
440 aStateMachine.AddStatus(dpBst_goto_EoXmlFormat_BeginTag);
441 aStateMachine.AddStatus(dpBst_goto_EoXmlFormat_EndTag);
442 aStateMachine.AddStatus(dpBst_goto_CheckStar);
443
444 aStateMachine.AddStatus(dpBst_finError);
445 aStateMachine.AddStatus(dpBst_finIgnore);
446 aStateMachine.AddStatus(dpBst_finEof);
447 aStateMachine.AddStatus(dpBst_finAnyWord);
448 aStateMachine.AddStatus(dpBst_finAtTag);
449 aStateMachine.AddStatus(dpBst_finEndSign);
450 aStateMachine.AddStatus(dpBst_fin_Comma);
451 aStateMachine.AddStatus(dpBst_finWhite);
452
453
454 aStateMachine.AddToken( "@author", nTok_at_author, A_nAtTagDefStatus, finAtTag );
455 aStateMachine.AddToken( "@param", nTok_at_param, A_nAtTagDefStatus, finAtTag );
456 aStateMachine.AddToken( "@throws", nTok_at_throws, A_nAtTagDefStatus, finAtTag );
457 aStateMachine.AddToken( "@see", nTok_at_see, A_nAtTagDefStatus, finAtTag );
458 aStateMachine.AddToken( "@since", nTok_at_since, A_nAtTagDefStatus, finAtTag );
459 aStateMachine.AddToken( "@example", nTok_at_example, A_nAtTagDefStatus, finAtTag );
460 aStateMachine.AddToken( "@return", nTok_at_return, A_nAtTagDefStatus, finAtTag );
461 aStateMachine.AddToken( "@returns", nTok_at_return, A_nAtTagDefStatus, finAtTag );
462 aStateMachine.AddToken( "@deprecated",
463 nTok_at_deprecated, A_nAtTagDefStatus, finAtTag );
464 aStateMachine.AddToken( "@suspicious",
465 nTok_at_suspicious, A_nAtTagDefStatus, finAtTag );
466 aStateMachine.AddToken( "@missing", nTok_at_missing, A_nAtTagDefStatus, finAtTag );
467 aStateMachine.AddToken( "@incomplete",
468 nTok_at_incomplete, A_nAtTagDefStatus, finAtTag );
469 aStateMachine.AddToken( "@version", nTok_at_version, A_nAtTagDefStatus, finAtTag );
470 aStateMachine.AddToken( "@guarantees",
471 nTok_at_guarantees, A_nAtTagDefStatus, finAtTag );
472 aStateMachine.AddToken( "@exception",
473 nTok_at_exception, A_nAtTagDefStatus, finAtTag );
474
475 aStateMachine.AddToken( "<", 0, A_nHtmlDefStatus, goto_EoHtml );
476 aStateMachine.AddToken( "*", 0, A_nPunctDefStatus, goto_CheckStar );
477 // aStateMachine.AddToken( ",", 0, A_nPunctDefStatus, finComma );
478
479 aStateMachine.AddToken( "<type", nTok_link_typeB, A_nHtmlDefStatus, goto_EoXmlLink_BeginTag );
480 aStateMachine.AddToken( "</type", nTok_link_typeE, A_nHtmlDefStatus, goto_EoXmlLink_EndTag );
481 aStateMachine.AddToken( "<member", nTok_link_memberB, A_nHtmlDefStatus, goto_EoXmlLink_BeginTag );
482 aStateMachine.AddToken( "</member", nTok_link_membeE, A_nHtmlDefStatus, goto_EoXmlLink_EndTag );
483 aStateMachine.AddToken( "<const", nTok_link_constB, A_nHtmlDefStatus, goto_EoXmlLink_BeginTag );
484 aStateMachine.AddToken( "</const", nTok_link_constE, A_nHtmlDefStatus, goto_EoXmlLink_EndTag );
485
486 aStateMachine.AddToken( "<listing", nTok_format_listingB,A_nHtmlDefStatus, goto_EoXmlFormat_BeginTag );
487 aStateMachine.AddToken( "</listing",nTok_format_listingE,A_nHtmlDefStatus, goto_EoXmlFormat_EndTag );
488 aStateMachine.AddToken( "<code", nTok_format_codeB, A_nHtmlDefStatus, goto_EoXmlFormat_BeginTag );
489 aStateMachine.AddToken( "</code", nTok_format_codeE, A_nHtmlDefStatus, goto_EoXmlFormat_EndTag );
490 aStateMachine.AddToken( "<atom", nTok_format_atomB, A_nHtmlDefStatus, goto_EoXmlFormat_BeginTag );
491 aStateMachine.AddToken( "</atom", nTok_format_atomE, A_nHtmlDefStatus, goto_EoXmlFormat_EndTag );
492
493 aStateMachine.AddToken( "<TRUE/", nTok_const_TRUE, A_nHtmlDefStatus, goto_EoXmlConst );
494 aStateMachine.AddToken( "<true/", nTok_const_TRUE, A_nHtmlDefStatus, goto_EoXmlConst );
495 aStateMachine.AddToken( "<FALSE/", nTok_const_FALSE, A_nHtmlDefStatus, goto_EoXmlConst );
496 aStateMachine.AddToken( "<false/", nTok_const_FALSE, A_nHtmlDefStatus, goto_EoXmlConst );
497 aStateMachine.AddToken( "<NULL/", nTok_const_NULL, A_nHtmlDefStatus, goto_EoXmlConst );
498 aStateMachine.AddToken( "<void/", nTok_const_void, A_nHtmlDefStatus, goto_EoXmlConst );
499
500 aStateMachine.AddToken( "<p", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml );
501 aStateMachine.AddToken( "<pre", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml );
502 aStateMachine.AddToken( "<dl", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml );
503 aStateMachine.AddToken( "<ul", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml );
504 aStateMachine.AddToken( "<ol", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml );
505 aStateMachine.AddToken( "<table", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml );
506 aStateMachine.AddToken( "<P", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml );
507 aStateMachine.AddToken( "<PRE", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml );
508 aStateMachine.AddToken( "<DL", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml );
509 aStateMachine.AddToken( "<UL", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml );
510 aStateMachine.AddToken( "<OL", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml );
511 aStateMachine.AddToken( "<TABLE", nTok_html_parastart, A_nHtmlDefStatus, goto_EoHtml );
512
513 aStateMachine.AddToken( "\r\n", nTok_EOL, A_nPunctDefStatus, finEndSign );
514 aStateMachine.AddToken( "\n", nTok_EOL, A_nPunctDefStatus, finEndSign );
515 aStateMachine.AddToken( "\r", nTok_EOL, A_nPunctDefStatus, finEndSign );
516 };
517
518 void
SetMode_IsMultiLine(bool i_bTrue)519 Context_Docu::SetMode_IsMultiLine( bool i_bTrue )
520 {
521 bIsMultiline = i_bTrue;
522 }
523
524
525 } // namespace dsapi
526 } // namespace csi
527
528