summaryrefslogtreecommitdiff
path: root/autodoc/source/parser_i/idoc/cx_dsapi.cxx
blob: 9c43d5febf549214fa61d075bb5354e349db5c9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#include <precomp.h>
#include <s2_dsapi/cx_dsapi.hxx>


// NOT FULLY DEFINED SERVICES
#include <x_parse2.hxx>
#include <tools/tkpchars.hxx>
#include <s2_dsapi/tk_atag2.hxx>
#include <s2_dsapi/tk_docw2.hxx>
#include <s2_dsapi/tk_xml.hxx>
#include <s2_dsapi/cx_docu2.hxx>
#include <s2_dsapi/tokrecv.hxx>


namespace csi
{
namespace dsapi
{


const intt C_nStatusSize = 128;
const intt C_nCppInitialNrOfStati = 400;


const uintt nF_fin_Error = 1;
const uintt nF_fin_Ignore = 2;
const uintt nF_fin_Eof = 3;
const uintt nF_fin_AnyWord = 4;
const uintt nF_fin_AtTag = 5;
const uintt nF_fin_EndSign = 6;
const uintt nF_goto_EoHtml = 7;
const uintt nF_goto_EoXmlConst = 8;
const uintt nF_goto_EoXmlLink_BeginTag = 9;
const uintt nF_goto_EoXmlLink_EndTag = 10;
const uintt nF_goto_EoXmlFormat_BeginTag = 11;
const uintt nF_goto_EoXmlFormat_EndTag = 12;
const uintt nF_goto_CheckStar = 13;
const uintt nF_fin_Comma = 14;
const uintt nF_fin_White = 15;

const UINT16 nTok_at_author = 100 + Tok_AtTag::author;
const UINT16 nTok_at_see = 100 + Tok_AtTag::see;
const UINT16 nTok_at_param = 100 + Tok_AtTag::param;
const UINT16 nTok_at_return = 100 + Tok_AtTag::e_return;
const UINT16 nTok_at_throws = 100 + Tok_AtTag::e_throw;
const UINT16 nTok_at_example = 100 + Tok_AtTag::example;
const UINT16 nTok_at_deprecated = 100 + Tok_AtTag::deprecated;
const UINT16 nTok_at_suspicious = 100 + Tok_AtTag::suspicious;
const UINT16 nTok_at_missing = 100 + Tok_AtTag::missing;
const UINT16 nTok_at_incomplete = 100 + Tok_AtTag::incomplete;
const UINT16 nTok_at_version = 100 + Tok_AtTag::version;
const UINT16 nTok_at_guarantees = 100 + Tok_AtTag::guarantees;
const UINT16 nTok_at_exception = 100 + Tok_AtTag::exception;
const UINT16 nTok_at_since = 100 + Tok_AtTag::since;

const UINT16 nTok_const_TRUE = 200 + Tok_XmlConst::e_true;
const UINT16 nTok_const_FALSE = 200 + Tok_XmlConst::e_false;
const UINT16 nTok_const_NULL = 200 + Tok_XmlConst::e_null;
const UINT16 nTok_const_void = 200 + Tok_XmlConst::e_void;

const UINT16 nTok_link_typeB = 300 + Tok_XmlLink_BeginTag::type;
const UINT16 nTok_link_typeE = 325 + Tok_XmlLink_EndTag::type;
const UINT16 nTok_link_memberB = 300 + Tok_XmlLink_BeginTag::member;
const UINT16 nTok_link_membeE = 325 + Tok_XmlLink_EndTag::member;
const UINT16 nTok_link_constB = 300 + Tok_XmlLink_BeginTag::e_const;
const UINT16 nTok_link_constE = 325 + Tok_XmlLink_EndTag::e_const;

const UINT16 nTok_format_listingB = 350 + Tok_XmlFormat_BeginTag::listing;
const UINT16 nTok_format_listingE = 375 + Tok_XmlFormat_EndTag::listing;
const UINT16 nTok_format_codeB = 350 + Tok_XmlFormat_BeginTag::code;
const UINT16 nTok_format_codeE = 375 + Tok_XmlFormat_EndTag::code;
const UINT16 nTok_format_atomB = 350 + Tok_XmlFormat_BeginTag::atom;
const UINT16 nTok_format_atomE = 375 + Tok_XmlFormat_EndTag::atom;


const UINT16 nTok_html_parastart = 400;

const UINT16 nTok_MLDocuEnd = 501;
const UINT16 nTok_EOL = 502;


Context_Docu::Context_Docu( Token_Receiver & o_rReceiver )
    :   aStateMachine(C_nStatusSize, C_nCppInitialNrOfStati),
        pReceiver(&o_rReceiver),
        pParentContext(0),
        pCx_EoHtml(0),
        pCx_EoXmlConst(0),
        pCx_EoXmlLink_BeginTag(0),
        pCx_EoXmlLink_EndTag(0),
        pCx_EoXmlFormat_BeginTag(0),
        pCx_EoXmlFormat_EndTag(0),
        pCx_CheckStar(0),
        pNewToken(0),
        pFollowUpContext(0),
        bIsMultiline(false)
{
    pCx_EoHtml = new Cx_EoHtml(o_rReceiver, *this);
    pCx_EoXmlConst = new Cx_EoXmlConst(o_rReceiver, *this);
    pCx_EoXmlLink_BeginTag = new Cx_EoXmlLink_BeginTag(o_rReceiver, *this);
    pCx_EoXmlLink_EndTag = new Cx_EoXmlLink_EndTag(o_rReceiver, *this);
    pCx_EoXmlFormat_BeginTag = new Cx_EoXmlFormat_BeginTag(o_rReceiver, *this);
    pCx_EoXmlFormat_EndTag = new Cx_EoXmlFormat_EndTag(o_rReceiver, *this);
    pCx_CheckStar = new Cx_CheckStar(*pReceiver,*this);

    SetupStateMachine();
}

void
Context_Docu::SetParentContext( TkpContext & io_rParentContext,
                                const char * )
{
    pFollowUpContext = pParentContext = &io_rParentContext;
    pCx_CheckStar->Set_End_FolloUpContext(io_rParentContext);
}

Context_Docu::~Context_Docu()
{
}

void
Context_Docu::ReadCharChain( CharacterSource & io_rText )
{
    csv_assert(pParentContext != 0);

    pNewToken = 0;

    UINT16 nTokenId = 0;
    StmBoundsStatu2 & rBound = aStateMachine.GetCharChain(nTokenId, io_rText);

    // !!!
    //   The order of the next two lines is essential, because
    //   pFollowUpContext may be changed by PerformStatusFunction() also,
    //   which then MUST override the previous assignment.
    pFollowUpContext = rBound.FollowUpContext();
    PerformStatusFunction(rBound.StatusFunctionNr(), nTokenId, io_rText);
}

bool
Context_Docu::PassNewToken()
{
    if (pNewToken)
    {
        pReceiver->Receive(*pNewToken.Release());
        return true;
    }
    return false;
}

TkpContext &
Context_Docu::FollowUpContext()
{
    csv_assert(pFollowUpContext != 0);
    return *pFollowUpContext;
}

void
Context_Docu::PerformStatusFunction( uintt              i_nStatusSignal,
                                     UINT16             i_nTokenId,
                                     CharacterSource &  io_rText )
{
    switch (i_nStatusSignal)
    {
        case nF_fin_White:
            io_rText.CutToken();
            pNewToken = new Tok_White;
            break;
        case nF_fin_Error:
            throw X_AutodocParser(X_AutodocParser::x_InvalidChar);
            // no break because of throw
        case nF_fin_Ignore:
            pNewToken = 0;
            io_rText.CutToken();
            break;
        case nF_fin_Eof:
            if (bIsMultiline)
                throw X_AutodocParser(X_AutodocParser::x_UnexpectedEOF);
            else
                io_rText.CutToken();
                pNewToken = new Tok_EOF;
            break;
        case nF_fin_AnyWord:
            pNewToken = new Tok_Word(io_rText.CutToken());
            break;
        case nF_fin_AtTag:
            io_rText.CutToken();
            pNewToken = new Tok_AtTag( i_nTokenId - 100 );
            break;
        case nF_fin_Comma:
            io_rText.CutToken();
            pNewToken = new Tok_Comma;
            break;
        case nF_fin_EndSign:
            io_rText.CutToken();
            switch (i_nTokenId)
            {
                case nTok_MLDocuEnd:
                    if (bIsMultiline)
                    {
                        pNewToken = new Tok_DocuEnd;
                        pFollowUpContext = pParentContext;
                    }
                    else
                    {
                        pNewToken = new Tok_Word(io_rText.CutToken());
                        pFollowUpContext = this;
                    }
                    break;
                case nTok_EOL:
                    if (bIsMultiline)
                    {
                        pNewToken = new Tok_EOL;
                        pFollowUpContext = this;
                    }
                    else
                    {
                        pNewToken = new Tok_DocuEnd;
                        pFollowUpContext = pParentContext;
                    }
                    pReceiver->Increment_CurLine();
                    break;
                default:
                    csv_assert(false);
            }
            break;
        case nF_goto_EoHtml:
            pCx_EoHtml->SetIfIsStartOfParagraph(i_nTokenId == nTok_html_parastart);
            break;
        case nF_goto_EoXmlConst:
            pCx_EoXmlConst->SetTokenId(i_nTokenId - 200);
            break;
        case nF_goto_EoXmlLink_BeginTag:
            pCx_EoXmlLink_BeginTag->SetTokenId(i_nTokenId - 300);
            break;
        case nF_goto_EoXmlLink_EndTag:
            pCx_EoXmlLink_EndTag->SetTokenId(i_nTokenId - 325);
            break;
        case nF_goto_EoXmlFormat_BeginTag:
            pCx_EoXmlFormat_BeginTag->SetTokenId(i_nTokenId - 350);
            break;
        case nF_goto_EoXmlFormat_EndTag:
            pCx_EoXmlFormat_EndTag->SetTokenId(i_nTokenId - 375);
            break;
        case nF_goto_CheckStar:
            pCx_CheckStar->SetIsEnd( bIsMultiline );
            break;
        default:
            csv_assert(false);
    }   // end switch (i_nStatusSignal)
}

void
Context_Docu::SetupStateMachine()
{
    // special array statuses (no tokenfinish or change of context):
//  const INT16 bas = 0;        // base status
    const INT16 wht = 1;        // skip whitespace status
    const INT16 awd = 2;        // any word read status

    // change of context statuses:
    const INT16 goto_EoHtml = 3;
    const INT16 goto_EoXmlConst = 4;
    const INT16 goto_EoXmlLink_BeginTag = 5;
    const INT16 goto_EoXmlLink_EndTag = 6;
    const INT16 goto_EoXmlFormat_BeginTag = 7;
    const INT16 goto_EoXmlFormat_EndTag = 8;
    const INT16 goto_CheckStar = 9;

    // tokenfinish statuses:
    const INT16 finError = 10;
//  const INT16 finIgnore = 11;
    const INT16 finEof = 12;
    const INT16 finAnyWord = 13;
    const INT16 finAtTag = 14;
    const INT16 finEndSign = 15;
//  const INT16 finComma = 16;
    const INT16 finWhite = 17;

    // constants for use in the table:
    const INT16 ght = goto_EoHtml;
    const INT16 err = finError;
    const INT16 faw = finAnyWord;
//  const INT16 fig = finIgnore;
//  const INT16 fes = finEndSign;
    const INT16 fof = finEof;
//  const INT16 fat = finAtTag;
    const INT16 fwh = finWhite;

    /// The '0's  will be replaced by calls of AddToken().

    const INT16 A_nTopStatus[C_nStatusSize] =
    //  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
    {fof,err,err,err,err,err,err,err,err,wht,  0,wht,wht,  0,err,err,
     err,err,err,err,err,err,err,err,err,err,fof,err,err,err,err,err, // ... 31
     wht,awd,awd,awd,awd,awd,awd,awd,awd,awd,  0,awd,awd,awd,awd,awd,
     awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,  0,awd,awd,awd, // ... 63
       0,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,
     awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, // ... 95
     awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,
     awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd  // ... 127
    };

    const INT16 A_nWhitespaceStatus[C_nStatusSize] =
  //   0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
    {fof,err,err,err,err,err,err,err,err,wht,fwh,wht,wht,fwh,err,err,
     err,err,err,err,err,err,err,err,err,err,fof,err,err,err,err,err, // ... 31
     wht,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,
     fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh, // ... 63
     fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,
     fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh, // ... 95
     fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,
     fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh  // ... 127
    };

    const INT16 A_nWordStatus[C_nStatusSize] =
    //  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
    {faw,err,err,err,err,err,err,err,err,faw,faw,faw,faw,faw,err,err,
     err,err,err,err,err,err,err,err,err,err,faw,err,err,err,err,err, // ... 31
     faw,awd,awd,awd,awd,awd,awd,awd,awd,awd,faw,awd,awd,awd,awd,awd,
     awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,faw,awd,awd,awd, // ... 63
     faw,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,
     awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, // ... 95
     awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,
     awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd  // ... 127
    };

    const INT16 A_nAtTagDefStatus[C_nStatusSize] =
    //  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
    {faw,err,err,err,err,err,err,err,err,faw,faw,faw,faw,faw,err,err,
     err,err,err,err,err,err,err,err,err,err,faw,err,err,err,err,err, // ... 31
     faw,awd,awd,awd,awd,awd,awd,awd,awd,awd,faw,awd,awd,awd,awd,awd,
     awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,faw,awd,faw,awd,awd,awd, // ... 63
     awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,
     awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, // ... 95
     awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,
     awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd  // ... 127
    };

    const INT16 A_nHtmlDefStatus[C_nStatusSize] =
    //  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
    {ght,err,err,err,err,err,err,err,err,ght,ght,ght,ght,ght,err,err,
     err,err,err,err,err,err,err,err,err,err,ght,err,err,err,err,err, // ... 31
     ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,
     ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght, // ... 63
     ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,
     ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght, // ... 95
     ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,
     ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght,ght  // ... 127
    };

    const INT16 A_nPunctDefStatus[C_nStatusSize] =
    //  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
    {err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,
     err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, // 16 ...
     err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,
     err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, // 48 ...
     err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,
     err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, // 80 ...
     err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,
     err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err  // 112 ...
    };

    DYN StmArrayStatu2 * dpStatusTop
            = new StmArrayStatu2( C_nStatusSize, A_nTopStatus, 0, true);
    DYN StmArrayStatu2 * dpStatusWhite
            = new StmArrayStatu2( C_nStatusSize, A_nWhitespaceStatus, 0, true);
    DYN StmArrayStatu2 * dpStatusWord
            = new StmArrayStatu2( C_nStatusSize, A_nWordStatus, 0, true);

    DYN StmBoundsStatu2 *   dpBst_goto_EoHtml
            = new StmBoundsStatu2( *pCx_EoHtml, nF_goto_EoHtml, true );
    DYN StmBoundsStatu2 *   dpBst_goto_EoXmlConst
            = new StmBoundsStatu2( *pCx_EoXmlConst, nF_goto_EoXmlConst, true );
    DYN StmBoundsStatu2 *   dpBst_goto_EoXmlLink_BeginTag
            = new StmBoundsStatu2( *pCx_EoXmlLink_BeginTag, nF_goto_EoXmlLink_BeginTag, true );
    DYN StmBoundsStatu2 *   dpBst_goto_EoXmlLink_EndTag
            = new StmBoundsStatu2( *pCx_EoXmlLink_EndTag, nF_goto_EoXmlLink_EndTag, true );
    DYN StmBoundsStatu2 *   dpBst_goto_EoXmlFormat_BeginTag
            = new StmBoundsStatu2( *pCx_EoXmlFormat_BeginTag, nF_goto_EoXmlFormat_BeginTag, true );
    DYN StmBoundsStatu2 *   dpBst_goto_EoXmlFormat_EndTag
            = new StmBoundsStatu2( *pCx_EoXmlFormat_EndTag, nF_goto_EoXmlFormat_EndTag, true );
    DYN StmBoundsStatu2 *   dpBst_goto_CheckStar
            = new StmBoundsStatu2( *pCx_CheckStar, nF_goto_CheckStar, true );


    DYN StmBoundsStatu2 *   dpBst_finError
            = new StmBoundsStatu2( TkpContext_Null2_(), nF_fin_Error, true );
    DYN StmBoundsStatu2 *   dpBst_finIgnore
            = new StmBoundsStatu2( *this, nF_fin_Ignore, true);
    DYN StmBoundsStatu2 *   dpBst_finEof
            = new StmBoundsStatu2( TkpContext_Null2_(), nF_fin_Eof, false);
    DYN StmBoundsStatu2 *   dpBst_finAnyWord
            = new StmBoundsStatu2( *this, nF_fin_AnyWord, true);
    DYN StmBoundsStatu2 *   dpBst_finAtTag
            = new StmBoundsStatu2( *this, nF_fin_AtTag, false);
    DYN StmBoundsStatu2 *   dpBst_finEndSign
            = new StmBoundsStatu2( *pParentContext, nF_fin_EndSign, false);
    DYN StmBoundsStatu2 *   dpBst_fin_Comma
            = new StmBoundsStatu2( *this, nF_fin_Comma, false );
    DYN StmBoundsStatu2 *   dpBst_finWhite
            = new StmBoundsStatu2( *this, nF_fin_White, false);


    // construct dpMain:
    aStateMachine.AddStatus(dpStatusTop);
    aStateMachine.AddStatus(dpStatusWhite);
    aStateMachine.AddStatus(dpStatusWord);

    aStateMachine.AddStatus(dpBst_goto_EoHtml);
    aStateMachine.AddStatus(dpBst_goto_EoXmlConst);
    aStateMachine.AddStatus(dpBst_goto_EoXmlLink_BeginTag);
    aStateMachine.AddStatus(dpBst_goto_EoXmlLink_EndTag);
    aStateMachine.AddStatus(dpBst_goto_EoXmlFormat_BeginTag);
    aStateMachine.AddStatus(dpBst_goto_EoXmlFormat_EndTag);
    aStateMachine.AddStatus(dpBst_goto_CheckStar);

    aStateMachine.AddStatus(dpBst_finError);
    aStateMachine.AddStatus(dpBst_finIgnore);
    aStateMachine.AddStatus(dpBst_finEof);
    aStateMachine.AddStatus(dpBst_finAnyWord);
    aStateMachine.AddStatus(dpBst_finAtTag);
    aStateMachine.AddStatus(dpBst_finEndSign);
    aStateMachine.AddStatus(dpBst_fin_Comma);
    aStateMachine.AddStatus(dpBst_finWhite);


    aStateMachine.AddToken( "@author",  nTok_at_author,      A_nAtTagDefStatus, finAtTag );
    aStateMachine.AddToken( "@param",   nTok_at_param,       A_nAtTagDefStatus, finAtTag );
    aStateMachine.AddToken( "@throws",  nTok_at_throws,      A_nAtTagDefStatus, finAtTag );
    aStateMachine.AddToken( "@see",     nTok_at_see,         A_nAtTagDefStatus, finAtTag );
    aStateMachine.AddToken( "@since",   nTok_at_since,       A_nAtTagDefStatus, finAtTag );
    aStateMachine.AddToken( "@example", nTok_at_example,     A_nAtTagDefStatus, finAtTag );
    aStateMachine.AddToken( "@return",  nTok_at_return,      A_nAtTagDefStatus, finAtTag );
    aStateMachine.AddToken( "@returns", nTok_at_return,      A_nAtTagDefStatus, finAtTag );
    aStateMachine.AddToken( "@deprecated",
                                        nTok_at_deprecated,  A_nAtTagDefStatus, finAtTag );
    aStateMachine.AddToken( "@suspicious",
                                        nTok_at_suspicious,  A_nAtTagDefStatus, finAtTag );
    aStateMachine.AddToken( "@missing", nTok_at_missing,     A_nAtTagDefStatus, finAtTag );
    aStateMachine.AddToken( "@incomplete",
                                        nTok_at_incomplete,  A_nAtTagDefStatus, finAtTag );
    aStateMachine.AddToken( "@version", nTok_at_version,     A_nAtTagDefStatus, finAtTag );
    aStateMachine.AddToken( "@guarantees",
                                        nTok_at_guarantees,  A_nAtTagDefStatus, finAtTag );
    aStateMachine.AddToken( "@exception",
                                        nTok_at_exception,   A_nAtTagDefStatus, finAtTag );

    aStateMachine.AddToken( "<",        0,                   A_nHtmlDefStatus,  goto_EoHtml );
    aStateMachine.AddToken( "*",        0,                   A_nPunctDefStatus, goto_CheckStar );
//  aStateMachine.AddToken( ",",        0,                   A_nPunctDefStatus, finComma );

    aStateMachine.AddToken( "<type",    nTok_link_typeB,     A_nHtmlDefStatus,  goto_EoXmlLink_BeginTag );
    aStateMachine.AddToken( "</type",   nTok_link_typeE,     A_nHtmlDefStatus,  goto_EoXmlLink_EndTag );
    aStateMachine.AddToken( "<member",  nTok_link_memberB,   A_nHtmlDefStatus,  goto_EoXmlLink_BeginTag );
    aStateMachine.AddToken( "</member", nTok_link_membeE,    A_nHtmlDefStatus,  goto_EoXmlLink_EndTag );
    aStateMachine.AddToken( "<const",   nTok_link_constB,    A_nHtmlDefStatus,  goto_EoXmlLink_BeginTag );
    aStateMachine.AddToken( "</const",  nTok_link_constE,    A_nHtmlDefStatus,  goto_EoXmlLink_EndTag );

    aStateMachine.AddToken( "<listing", nTok_format_listingB,A_nHtmlDefStatus,  goto_EoXmlFormat_BeginTag );
    aStateMachine.AddToken( "</listing",nTok_format_listingE,A_nHtmlDefStatus,  goto_EoXmlFormat_EndTag );
    aStateMachine.AddToken( "<code",    nTok_format_codeB,   A_nHtmlDefStatus,  goto_EoXmlFormat_BeginTag  );
    aStateMachine.AddToken( "</code",   nTok_format_codeE,   A_nHtmlDefStatus,  goto_EoXmlFormat_EndTag );
    aStateMachine.AddToken( "<atom",    nTok_format_atomB,   A_nHtmlDefStatus,  goto_EoXmlFormat_BeginTag  );
    aStateMachine.AddToken( "</atom",   nTok_format_atomE,   A_nHtmlDefStatus,  goto_EoXmlFormat_EndTag );

    aStateMachine.AddToken( "<TRUE/",   nTok_const_TRUE,     A_nHtmlDefStatus,  goto_EoXmlConst );
    aStateMachine.AddToken( "<true/",   nTok_const_TRUE,     A_nHtmlDefStatus,  goto_EoXmlConst );
    aStateMachine.AddToken( "<FALSE/",  nTok_const_FALSE,    A_nHtmlDefStatus,  goto_EoXmlConst );
    aStateMachine.AddToken( "<false/",  nTok_const_FALSE,    A_nHtmlDefStatus,  goto_EoXmlConst );
    aStateMachine.AddToken( "<NULL/",   nTok_const_NULL,     A_nHtmlDefStatus,  goto_EoXmlConst );
    aStateMachine.AddToken( "<void/",   nTok_const_void,     A_nHtmlDefStatus,  goto_EoXmlConst );

    aStateMachine.AddToken( "<p",       nTok_html_parastart, A_nHtmlDefStatus,  goto_EoHtml );
    aStateMachine.AddToken( "<pre",     nTok_html_parastart, A_nHtmlDefStatus,  goto_EoHtml );
    aStateMachine.AddToken( "<dl",      nTok_html_parastart, A_nHtmlDefStatus,  goto_EoHtml );
    aStateMachine.AddToken( "<ul",      nTok_html_parastart, A_nHtmlDefStatus,  goto_EoHtml );
    aStateMachine.AddToken( "<ol",      nTok_html_parastart, A_nHtmlDefStatus,  goto_EoHtml );
    aStateMachine.AddToken( "<table",   nTok_html_parastart, A_nHtmlDefStatus,  goto_EoHtml );
    aStateMachine.AddToken( "<P",       nTok_html_parastart, A_nHtmlDefStatus,  goto_EoHtml );
    aStateMachine.AddToken( "<PRE",     nTok_html_parastart, A_nHtmlDefStatus,  goto_EoHtml );
    aStateMachine.AddToken( "<DL",      nTok_html_parastart, A_nHtmlDefStatus,  goto_EoHtml );
    aStateMachine.AddToken( "<UL",      nTok_html_parastart, A_nHtmlDefStatus,  goto_EoHtml );
    aStateMachine.AddToken( "<OL",      nTok_html_parastart, A_nHtmlDefStatus,  goto_EoHtml );
    aStateMachine.AddToken( "<TABLE",   nTok_html_parastart, A_nHtmlDefStatus,  goto_EoHtml );

    aStateMachine.AddToken( "\r\n",     nTok_EOL,            A_nPunctDefStatus, finEndSign );
    aStateMachine.AddToken( "\n",       nTok_EOL,            A_nPunctDefStatus, finEndSign );
    aStateMachine.AddToken( "\r",       nTok_EOL,            A_nPunctDefStatus, finEndSign );
};

void
Context_Docu::SetMode_IsMultiLine( bool i_bTrue )
{
    bIsMultiline = i_bTrue;
}


}   // namespace dsapi
}   // namespace csi

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */