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