1*78bc99aaSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*78bc99aaSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*78bc99aaSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*78bc99aaSAndrew Rist  * distributed with this work for additional information
6*78bc99aaSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*78bc99aaSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*78bc99aaSAndrew Rist  * "License"); you may not use this file except in compliance
9*78bc99aaSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*78bc99aaSAndrew Rist  *
11*78bc99aaSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*78bc99aaSAndrew Rist  *
13*78bc99aaSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*78bc99aaSAndrew Rist  * software distributed under the License is distributed on an
15*78bc99aaSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*78bc99aaSAndrew Rist  * KIND, either express or implied.  See the License for the
17*78bc99aaSAndrew Rist  * specific language governing permissions and limitations
18*78bc99aaSAndrew Rist  * under the License.
19*78bc99aaSAndrew Rist  *
20*78bc99aaSAndrew Rist  *************************************************************/
21cdf0e10cSrcweir 
22cdf0e10cSrcweir #include <precomp.h>
23cdf0e10cSrcweir #include <adoc/cx_a_std.hxx>
24cdf0e10cSrcweir 
25cdf0e10cSrcweir 
26cdf0e10cSrcweir // NOT FULLY DEFINED SERVICES
27cdf0e10cSrcweir #include <adoc/cx_a_sub.hxx>
28cdf0e10cSrcweir #include <x_parse.hxx>
29cdf0e10cSrcweir #include <tools/tkpchars.hxx>
30cdf0e10cSrcweir #include <adoc/tk_attag.hxx>
31cdf0e10cSrcweir #include <adoc/tk_docw.hxx>
32cdf0e10cSrcweir #include <tokens/tokdeal.hxx>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir 
35cdf0e10cSrcweir 
36cdf0e10cSrcweir namespace adoc {
37cdf0e10cSrcweir 
38cdf0e10cSrcweir 
39cdf0e10cSrcweir const intt C_nStatusSize = 128;
40cdf0e10cSrcweir const intt C_nCppInitialNrOfStati = 400;
41cdf0e10cSrcweir 
42cdf0e10cSrcweir 
43cdf0e10cSrcweir const uintt nF_fin_Error = 1;
44cdf0e10cSrcweir const uintt nF_fin_Ignore = 2;
45cdf0e10cSrcweir const uintt nF_fin_LineStart = 3;
46cdf0e10cSrcweir const uintt nF_fin_Eol = 4;
47cdf0e10cSrcweir const uintt nF_fin_Eof = 5;
48cdf0e10cSrcweir const uintt nF_fin_AnyWord = 6;
49cdf0e10cSrcweir const uintt nF_fin_Whitespace = 7;
50cdf0e10cSrcweir 
51cdf0e10cSrcweir const uintt nF_goto_AtTag = 20;
52cdf0e10cSrcweir const uintt nF_goto_CheckStar = 21;
53cdf0e10cSrcweir 
TCF_DocWord(const char * text)54cdf0e10cSrcweir DYN TextToken * TCF_DocWord(const char * text) { return new Tok_DocWord(text); }
55cdf0e10cSrcweir 
TCF_atstd_ATT(const char *)56cdf0e10cSrcweir DYN TextToken * TCF_atstd_ATT(const char * ) { return new Tok_at_std(ary::info::atid_ATT); }
TCF_atstd_author(const char *)57cdf0e10cSrcweir DYN TextToken * TCF_atstd_author(const char * ) { return new Tok_at_std(ary::info::atid_author); }
TCF_atstd_change(const char *)58cdf0e10cSrcweir DYN TextToken * TCF_atstd_change(const char * ) { return new Tok_at_std(ary::info::atid_change); }
TCF_atstd_collab(const char *)59cdf0e10cSrcweir DYN TextToken * TCF_atstd_collab(const char * ) { return new Tok_at_std(ary::info::atid_collab); }
TCF_atstd_contact(const char *)60cdf0e10cSrcweir DYN TextToken * TCF_atstd_contact(const char * ) { return new Tok_at_std(ary::info::atid_contact); }
TCF_atstd_copyright(const char *)61cdf0e10cSrcweir DYN TextToken * TCF_atstd_copyright(const char * ) { return new Tok_at_std(ary::info::atid_copyright); }
TCF_atstd_descr(const char *)62cdf0e10cSrcweir DYN TextToken * TCF_atstd_descr(const char * ) { return new Tok_at_std(ary::info::atid_descr); }
TCF_atstd_docdate(const char *)63cdf0e10cSrcweir DYN TextToken * TCF_atstd_docdate(const char * ) { return new Tok_at_std(ary::info::atid_docdate); }
TCF_atstd_derive(const char *)64cdf0e10cSrcweir DYN TextToken * TCF_atstd_derive(const char * ) { return new Tok_at_std(ary::info::atid_derive); }
TCF_atstd_instance(const char *)65cdf0e10cSrcweir DYN TextToken * TCF_atstd_instance(const char * ) { return new Tok_at_std(ary::info::atid_instance); }
TCF_atstd_life(const char *)66cdf0e10cSrcweir DYN TextToken * TCF_atstd_life(const char * ) { return new Tok_at_std(ary::info::atid_life); }
TCF_atstd_multi(const char *)67cdf0e10cSrcweir DYN TextToken * TCF_atstd_multi(const char * ) { return new Tok_at_std(ary::info::atid_multi); }
TCF_atstd_onerror(const char *)68cdf0e10cSrcweir DYN TextToken * TCF_atstd_onerror(const char * ) { return new Tok_at_std(ary::info::atid_onerror); }
TCF_atstd_persist(const char *)69cdf0e10cSrcweir DYN TextToken * TCF_atstd_persist(const char * ) { return new Tok_at_std(ary::info::atid_persist); }
TCF_atstd_postcond(const char *)70cdf0e10cSrcweir DYN TextToken * TCF_atstd_postcond(const char * ) { return new Tok_at_std(ary::info::atid_postcond); }
TCF_atstd_precond(const char *)71cdf0e10cSrcweir DYN TextToken * TCF_atstd_precond(const char * ) { return new Tok_at_std(ary::info::atid_precond); }
TCF_atstd_responsibility(const char *)72cdf0e10cSrcweir DYN TextToken * TCF_atstd_responsibility(const char * ) { return new Tok_at_std(ary::info::atid_resp); }
TCF_atstd_return(const char *)73cdf0e10cSrcweir DYN TextToken * TCF_atstd_return(const char * ) { return new Tok_at_std(ary::info::atid_return); }
TCF_atstd_short(const char *)74cdf0e10cSrcweir DYN TextToken * TCF_atstd_short(const char * ) { return new Tok_at_std(ary::info::atid_short); }
TCF_atstd_todo(const char *)75cdf0e10cSrcweir DYN TextToken * TCF_atstd_todo(const char * ) { return new Tok_at_std(ary::info::atid_todo); }
TCF_atstd_version(const char *)76cdf0e10cSrcweir DYN TextToken * TCF_atstd_version(const char * ) { return new Tok_at_std(ary::info::atid_version); }
77cdf0e10cSrcweir 
TCF_at_base(const char *)78cdf0e10cSrcweir DYN TextToken * TCF_at_base(const char *) { return new Tok_at_base; }
TCF_at_exception(const char *)79cdf0e10cSrcweir DYN TextToken * TCF_at_exception(const char *) { return new Tok_at_exception; }
TCF_at_impl(const char *)80cdf0e10cSrcweir DYN TextToken * TCF_at_impl(const char *) { return new Tok_at_impl; }
TCF_at_interface(const char *)81cdf0e10cSrcweir DYN TextToken * TCF_at_interface(const char *) { return new Tok_at_interface; }
TCF_at_key(const char *)82cdf0e10cSrcweir DYN TextToken * TCF_at_key(const char *) { return new Tok_at_key; }
TCF_at_param(const char *)83cdf0e10cSrcweir DYN TextToken * TCF_at_param(const char *) { return new Tok_at_param; }
TCF_at_see(const char *)84cdf0e10cSrcweir DYN TextToken * TCF_at_see(const char *) { return new Tok_at_see; }
TCF_at_template(const char *)85cdf0e10cSrcweir DYN TextToken * TCF_at_template(const char *) { return new Tok_at_template; }
TCF_at_internal(const char *)86cdf0e10cSrcweir DYN TextToken * TCF_at_internal(const char *) { return new Tok_at_internal; }
TCF_at_obsolete(const char *)87cdf0e10cSrcweir DYN TextToken * TCF_at_obsolete(const char *) { return new Tok_at_obsolete; }
TCF_at_module(const char *)88cdf0e10cSrcweir DYN TextToken * TCF_at_module(const char *) { return new Tok_at_module; }
TCF_at_file(const char *)89cdf0e10cSrcweir DYN TextToken * TCF_at_file(const char *) { return new Tok_at_file; }
TCF_at_gloss(const char *)90cdf0e10cSrcweir DYN TextToken * TCF_at_gloss(const char *) { return new Tok_at_gloss; }
TCF_at_global(const char *)91cdf0e10cSrcweir DYN TextToken * TCF_at_global(const char *) { return new Tok_at_global; }
TCF_at_include(const char *)92cdf0e10cSrcweir DYN TextToken * TCF_at_include(const char *) { return new Tok_at_include; }
TCF_at_label(const char *)93cdf0e10cSrcweir DYN TextToken * TCF_at_label(const char *) { return new Tok_at_label; }
TCF_at_since(const char *)94cdf0e10cSrcweir DYN TextToken * TCF_at_since(const char *) { return new Tok_at_since; }
TCF_at_HTML(const char *)95cdf0e10cSrcweir DYN TextToken * TCF_at_HTML(const char *) { return new Tok_at_HTML; }
TCF_at_NOHTML(const char *)96cdf0e10cSrcweir DYN TextToken * TCF_at_NOHTML(const char *) { return new Tok_at_NOHTML; }
97cdf0e10cSrcweir DYN TextToken * TCF_Whitespace(const char * i_sText);
TCF_EoDocu(const char *)98cdf0e10cSrcweir DYN TextToken * TCF_EoDocu(const char *) { return new Tok_EoDocu; }
TCF_EoLine(const char *)99cdf0e10cSrcweir DYN TextToken * TCF_EoLine(const char *) { return new Tok_Eol; }
TCF_Eof(const char *)100cdf0e10cSrcweir DYN TextToken * TCF_Eof(const char *) { return new Tok_Eof; }
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 
Context_AdocStd()105cdf0e10cSrcweir Context_AdocStd::Context_AdocStd()
106cdf0e10cSrcweir 	:	aStateMachine(C_nStatusSize, C_nCppInitialNrOfStati),
107cdf0e10cSrcweir 		pDealer(0),
108cdf0e10cSrcweir 		pParentContext(0),
109cdf0e10cSrcweir 		pFollowUpContext(0),
110cdf0e10cSrcweir 		pCx_LineStart(0),
111cdf0e10cSrcweir 		pCx_CheckStar(0),
112cdf0e10cSrcweir 		pCx_AtTagCompletion(0),
113cdf0e10cSrcweir 		pNewToken(0),
114cdf0e10cSrcweir 		bIsMultiline(false)
115cdf0e10cSrcweir {
116cdf0e10cSrcweir 	pCx_LineStart = new Cx_LineStart(*this);
117cdf0e10cSrcweir 	pCx_CheckStar = new Cx_CheckStar(*this);
118cdf0e10cSrcweir 	pCx_AtTagCompletion = new Cx_AtTagCompletion(*this);
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 	SetupStateMachine();
121cdf0e10cSrcweir }
122cdf0e10cSrcweir 
123cdf0e10cSrcweir void
SetParentContext(TkpContext & io_rParentContext,const char *)124cdf0e10cSrcweir Context_AdocStd::SetParentContext( TkpContext & io_rParentContext,
125cdf0e10cSrcweir 								   const char * )
126cdf0e10cSrcweir {
127cdf0e10cSrcweir 	pFollowUpContext = pParentContext = &io_rParentContext;
128cdf0e10cSrcweir 	pCx_CheckStar->Set_End_FollowUpContext(io_rParentContext);
129cdf0e10cSrcweir }
130cdf0e10cSrcweir 
~Context_AdocStd()131cdf0e10cSrcweir Context_AdocStd::~Context_AdocStd()
132cdf0e10cSrcweir {
133cdf0e10cSrcweir }
134cdf0e10cSrcweir 
135cdf0e10cSrcweir void
AssignDealer(TokenDealer & o_rDealer)136cdf0e10cSrcweir Context_AdocStd::AssignDealer( TokenDealer & o_rDealer )
137cdf0e10cSrcweir {
138cdf0e10cSrcweir     pDealer = &o_rDealer;
139cdf0e10cSrcweir 	pCx_LineStart->AssignDealer(o_rDealer);
140cdf0e10cSrcweir 	pCx_CheckStar->AssignDealer(o_rDealer);
141cdf0e10cSrcweir 	pCx_AtTagCompletion->AssignDealer(o_rDealer);
142cdf0e10cSrcweir }
143cdf0e10cSrcweir 
144cdf0e10cSrcweir void
ReadCharChain(CharacterSource & io_rText)145cdf0e10cSrcweir Context_AdocStd::ReadCharChain( CharacterSource & io_rText )
146cdf0e10cSrcweir {
147cdf0e10cSrcweir 	csv_assert(pParentContext != 0);
148cdf0e10cSrcweir 	pNewToken = 0;
149cdf0e10cSrcweir 
150cdf0e10cSrcweir 	TextToken::F_CRTOK  fTokenCreateFunction = 0;
151cdf0e10cSrcweir 	StmBoundsStatus & rBound = aStateMachine.GetCharChain(fTokenCreateFunction, io_rText);
152cdf0e10cSrcweir 
153cdf0e10cSrcweir 	// !!!
154cdf0e10cSrcweir 	// 	 The order of the next two lines is essential, because
155cdf0e10cSrcweir 	//   pFollowUpContext may be changed by PerformStatusFunction() also,
156cdf0e10cSrcweir 	//   which then MUST override the previous assignment.
157cdf0e10cSrcweir 	pFollowUpContext = rBound.FollowUpContext();
158cdf0e10cSrcweir 	PerformStatusFunction(rBound.StatusFunctionNr(), fTokenCreateFunction, io_rText);
159cdf0e10cSrcweir }
160cdf0e10cSrcweir 
161cdf0e10cSrcweir bool
PassNewToken()162cdf0e10cSrcweir Context_AdocStd::PassNewToken()
163cdf0e10cSrcweir {
164cdf0e10cSrcweir 	if (pNewToken)
165cdf0e10cSrcweir 	{
166cdf0e10cSrcweir 		pNewToken.Release()->DealOut(*pDealer);
167cdf0e10cSrcweir 		return true;
168cdf0e10cSrcweir 	}
169cdf0e10cSrcweir 	return false;
170cdf0e10cSrcweir }
171cdf0e10cSrcweir 
172cdf0e10cSrcweir TkpContext &
FollowUpContext()173cdf0e10cSrcweir Context_AdocStd::FollowUpContext()
174cdf0e10cSrcweir {
175cdf0e10cSrcweir 	csv_assert(pFollowUpContext != 0);
176cdf0e10cSrcweir 	return *pFollowUpContext;
177cdf0e10cSrcweir }
178cdf0e10cSrcweir 
179cdf0e10cSrcweir void
PerformStatusFunction(uintt i_nStatusSignal,F_CRTOK i_fTokenCreateFunction,CharacterSource & io_rText)180cdf0e10cSrcweir Context_AdocStd::PerformStatusFunction( uintt				i_nStatusSignal,
181cdf0e10cSrcweir 										F_CRTOK		        i_fTokenCreateFunction,
182cdf0e10cSrcweir 										CharacterSource &	io_rText )
183cdf0e10cSrcweir {
184cdf0e10cSrcweir 	switch (i_nStatusSignal)
185cdf0e10cSrcweir 	{
186cdf0e10cSrcweir 		case nF_fin_Error:
187cdf0e10cSrcweir         {
188cdf0e10cSrcweir             char cCC = io_rText.CurChar();
189cdf0e10cSrcweir             String sChar( &cCC, 1 );
190cdf0e10cSrcweir 			throw X_Parser(X_Parser::x_InvalidChar, sChar, String ::Null_(), 0);
191cdf0e10cSrcweir 		}	// no break, because of throw
192cdf0e10cSrcweir 		case nF_fin_Ignore:
193cdf0e10cSrcweir 			io_rText.CutToken();
194cdf0e10cSrcweir 			pNewToken = 0;
195cdf0e10cSrcweir 			break;
196cdf0e10cSrcweir 		case nF_fin_LineStart:
197cdf0e10cSrcweir 			csv_assert(i_fTokenCreateFunction != 0);
198cdf0e10cSrcweir 			pNewToken = (*i_fTokenCreateFunction)(io_rText.CutToken());
199cdf0e10cSrcweir 			break;
200cdf0e10cSrcweir 		case nF_fin_Eol:
201cdf0e10cSrcweir 			io_rText.CutToken();
202cdf0e10cSrcweir 			pDealer->Deal_Eol();
203cdf0e10cSrcweir 			if ( bIsMultiline )
204cdf0e10cSrcweir 			{
205cdf0e10cSrcweir 				pNewToken = TCF_EoLine(0);
206cdf0e10cSrcweir 				pFollowUpContext = pCx_LineStart.Ptr();
207cdf0e10cSrcweir 			}
208cdf0e10cSrcweir 			else
209cdf0e10cSrcweir 			{
210cdf0e10cSrcweir 				pNewToken = TCF_EoDocu(0);
211cdf0e10cSrcweir 				pFollowUpContext = pParentContext;
212cdf0e10cSrcweir 			}
213cdf0e10cSrcweir 			break;
214cdf0e10cSrcweir 		case nF_fin_Eof:
215cdf0e10cSrcweir 			pNewToken = TCF_Eof(0);
216cdf0e10cSrcweir 			break;
217cdf0e10cSrcweir 		case nF_fin_AnyWord:
218cdf0e10cSrcweir 			if (i_fTokenCreateFunction != 0)
219cdf0e10cSrcweir 				pNewToken = (*i_fTokenCreateFunction)(io_rText.CutToken());
220cdf0e10cSrcweir 			else
221cdf0e10cSrcweir 				pNewToken = TCF_DocWord(io_rText.CutToken());
222cdf0e10cSrcweir 			break;
223cdf0e10cSrcweir         case nF_fin_Whitespace:
224cdf0e10cSrcweir 			pNewToken = TCF_Whitespace(io_rText.CutToken());
225cdf0e10cSrcweir             break;
226cdf0e10cSrcweir 		case nF_goto_AtTag:
227cdf0e10cSrcweir 			pNewToken = 0;
228cdf0e10cSrcweir 			pCx_AtTagCompletion->SetCurToken(i_fTokenCreateFunction);
229cdf0e10cSrcweir 			break;
230cdf0e10cSrcweir 		case nF_goto_CheckStar:
231cdf0e10cSrcweir 			pNewToken = 0;
232cdf0e10cSrcweir 			pCx_CheckStar->SetCanBeEnd( bIsMultiline );
233cdf0e10cSrcweir 			break;
234cdf0e10cSrcweir 		default:
235cdf0e10cSrcweir         {
236cdf0e10cSrcweir             char cCC = io_rText.CurChar();
237cdf0e10cSrcweir             String  sChar( &cCC, 1 );
238cdf0e10cSrcweir 			throw X_Parser(X_Parser::x_InvalidChar, sChar, String::Null_(), 0);
239cdf0e10cSrcweir         }
240cdf0e10cSrcweir 	}	// end switch (i_nStatusSignal)
241cdf0e10cSrcweir }
242cdf0e10cSrcweir 
243cdf0e10cSrcweir void
SetupStateMachine()244cdf0e10cSrcweir Context_AdocStd::SetupStateMachine()
245cdf0e10cSrcweir {
246cdf0e10cSrcweir 	// Besondere Array-Stati (kein Tokenabschluss oder Kontextwechsel):
247cdf0e10cSrcweir //	const INT16	bas = 0;		// Base-Status
248cdf0e10cSrcweir 	const INT16	wht = 1;		// Whitespace-Status
249cdf0e10cSrcweir 	const INT16	awd = 2;        // Any-Word-Read-Status
250cdf0e10cSrcweir 
251cdf0e10cSrcweir 	// Kontextwechsel-Stati:
252cdf0e10cSrcweir 	const INT16	goto_CheckStar = 3;
253cdf0e10cSrcweir 	const INT16 goto_AtTag = 4;
254cdf0e10cSrcweir 
255cdf0e10cSrcweir 	// Tokenfinish-Stati:
256cdf0e10cSrcweir 	const INT16 finError = 5;
257cdf0e10cSrcweir //	const INT16 finIgnore = 6;
258cdf0e10cSrcweir 	const INT16 finEol = 7;
259cdf0e10cSrcweir 	const INT16 finEof = 8;
260cdf0e10cSrcweir 	const INT16 finAnyWord = 9;
261cdf0e10cSrcweir     const INT16 finWhitespace = 10;
262cdf0e10cSrcweir 
263cdf0e10cSrcweir 	// Konstanten zur Benutzung in der Tabelle:
264cdf0e10cSrcweir 	const INT16 fof = finEof;
265cdf0e10cSrcweir 	const INT16 err = finError;
266cdf0e10cSrcweir 	const INT16 faw = finAnyWord;
267cdf0e10cSrcweir //	const INT16 fig = finIgnore;
268cdf0e10cSrcweir 	const INT16 fwh = finWhitespace;
269cdf0e10cSrcweir 
270cdf0e10cSrcweir 	/// The '0's  will be replaced by calls of AddToken().
271cdf0e10cSrcweir 
272cdf0e10cSrcweir 	const INT16 A_nTopStatus[C_nStatusSize] =
273cdf0e10cSrcweir 	//  0	1	2	3	4	5	6	7	8	9  10  11  12  13  14  15
274cdf0e10cSrcweir 	{fof,err,err,err,err,err,err,err,err,wht,  0,wht,wht,  0,err,err,
275cdf0e10cSrcweir 	 err,err,err,err,err,err,err,err,err,err,fof,err,err,err,err,err, // ... 31
276cdf0e10cSrcweir 	 wht,awd,awd,awd,awd,awd,awd,awd,awd,awd,  0,awd,awd,awd,awd,awd,
277cdf0e10cSrcweir 	 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, // ... 63
278cdf0e10cSrcweir 	   0,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,
279cdf0e10cSrcweir 	 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, // ... 95
280cdf0e10cSrcweir 	 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,
281cdf0e10cSrcweir 	 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd  // ... 127
282cdf0e10cSrcweir 	};
283cdf0e10cSrcweir 
284cdf0e10cSrcweir 	const INT16 A_nWhitespaceStatus[C_nStatusSize] =
285cdf0e10cSrcweir 	// 	0	1	2	3	4	5	6	7	8	9  10  11  12  13  14  15
286cdf0e10cSrcweir 	{fof,err,err,err,err,err,err,err,err,wht,fwh,wht,wht,fwh,err,err,
287cdf0e10cSrcweir 	 err,err,err,err,err,err,err,err,err,err,fof,err,err,err,err,err, // ... 31
288cdf0e10cSrcweir 	 wht,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,
289cdf0e10cSrcweir 	 fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh, // ... 63
290cdf0e10cSrcweir 	 fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,
291cdf0e10cSrcweir 	 fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh, // ... 95
292cdf0e10cSrcweir 	 fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,
293cdf0e10cSrcweir 	 fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh,fwh  // ... 127
294cdf0e10cSrcweir 	};
295cdf0e10cSrcweir 
296cdf0e10cSrcweir 	const INT16 A_nWordStatus[C_nStatusSize] =
297cdf0e10cSrcweir 	// 	0	1	2	3	4	5	6	7	8	9  10  11  12  13  14  15
298cdf0e10cSrcweir 	{faw,err,err,err,err,err,err,err,err,faw,faw,faw,faw,faw,err,err,
299cdf0e10cSrcweir 	 err,err,err,err,err,err,err,err,err,err,faw,err,err,err,err,err, // ... 31
300cdf0e10cSrcweir 	 faw,awd,awd,awd,awd,awd,awd,awd,awd,awd,faw,awd,awd,awd,awd,awd,
301cdf0e10cSrcweir 	 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, // ... 63
302cdf0e10cSrcweir 	 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,
303cdf0e10cSrcweir 	 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, // ... 95
304cdf0e10cSrcweir 	 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,
305cdf0e10cSrcweir 	 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd  // ... 127
306cdf0e10cSrcweir 	};
307cdf0e10cSrcweir 
308cdf0e10cSrcweir 	const INT16 A_nAtTagDefStatus[C_nStatusSize] =
309cdf0e10cSrcweir 	// 	0	1	2	3	4	5	6	7	8	9  10  11  12  13  14  15
310cdf0e10cSrcweir 	{faw,err,err,err,err,err,err,err,err,faw,faw,faw,faw,faw,err,err,
311cdf0e10cSrcweir 	 err,err,err,err,err,err,err,err,err,err,faw,err,err,err,err,err, // ... 31
312cdf0e10cSrcweir 	 faw,awd,awd,awd,awd,awd,awd,awd,awd,awd,faw,awd,awd,awd,awd,awd,
313cdf0e10cSrcweir 	 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, // ... 63
314cdf0e10cSrcweir 	 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,
315cdf0e10cSrcweir 	 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd, // ... 95
316cdf0e10cSrcweir 	 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,
317cdf0e10cSrcweir 	 awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd,awd  // ... 127
318cdf0e10cSrcweir 	};
319cdf0e10cSrcweir 
320cdf0e10cSrcweir 	const INT16 A_nPunctDefStatus[C_nStatusSize] =
321cdf0e10cSrcweir 	// 	0	1	2	3	4	5	6	7	8	9  10  11  12  13  14  15
322cdf0e10cSrcweir 	{err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,
323cdf0e10cSrcweir 	 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, // 16 ...
324cdf0e10cSrcweir 	 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,
325cdf0e10cSrcweir 	 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, // 48 ...
326cdf0e10cSrcweir 	 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,
327cdf0e10cSrcweir 	 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, // 80 ...
328cdf0e10cSrcweir 	 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,
329cdf0e10cSrcweir 	 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err  // 112 ...
330cdf0e10cSrcweir 	};
331cdf0e10cSrcweir 
332cdf0e10cSrcweir 	DYN StmArrayStatus * dpStatusTop
333cdf0e10cSrcweir 			= new StmArrayStatus( C_nStatusSize, A_nTopStatus, 0, true);
334cdf0e10cSrcweir 	DYN StmArrayStatus * dpStatusWhite
335cdf0e10cSrcweir 			= new StmArrayStatus( C_nStatusSize, A_nWhitespaceStatus, 0, true);
336cdf0e10cSrcweir 	DYN StmArrayStatus * dpStatusWord
337cdf0e10cSrcweir 			= new StmArrayStatus( C_nStatusSize, A_nWordStatus, TCF_DocWord, true);
338cdf0e10cSrcweir 
339cdf0e10cSrcweir 	DYN StmBoundsStatus *  	dpBst_goto_CheckStar
340cdf0e10cSrcweir 			= new StmBoundsStatus( *this, *pCx_CheckStar, nF_goto_CheckStar, true );
341cdf0e10cSrcweir 	DYN StmBoundsStatus *  	dpBst_goto_AtTag
342cdf0e10cSrcweir 			= new StmBoundsStatus( *this, *pCx_AtTagCompletion, nF_goto_AtTag, true );
343cdf0e10cSrcweir 
344cdf0e10cSrcweir 	DYN StmBoundsStatus *  	dpBst_finError
345cdf0e10cSrcweir 			= new StmBoundsStatus( *this, TkpContext::Null_(), nF_fin_Error, true );
346cdf0e10cSrcweir 	DYN StmBoundsStatus *  	dpBst_finIgnore
347cdf0e10cSrcweir 			= new StmBoundsStatus( *this, *this, nF_fin_Ignore, true);
348cdf0e10cSrcweir 	DYN StmBoundsStatus *  	dpBst_finEol
349cdf0e10cSrcweir 			= new StmBoundsStatus( *this, *pCx_LineStart, nF_fin_Eol, false);
350cdf0e10cSrcweir 	DYN StmBoundsStatus *  	dpBst_finEof
351cdf0e10cSrcweir 			= new StmBoundsStatus(  *this, TkpContext::Null_(), nF_fin_Eof, false);
352cdf0e10cSrcweir 	DYN StmBoundsStatus *  	dpBst_finAnyWord
353cdf0e10cSrcweir 			= new StmBoundsStatus( *this, *this, nF_fin_AnyWord, true);
354cdf0e10cSrcweir 	DYN StmBoundsStatus *  	dpBst_finWhitespace
355cdf0e10cSrcweir 			= new StmBoundsStatus( *this, *this, nF_fin_Whitespace, true);
356cdf0e10cSrcweir 
357cdf0e10cSrcweir 	// dpMain aufbauen:
358cdf0e10cSrcweir 	aStateMachine.AddStatus(dpStatusTop);
359cdf0e10cSrcweir 	aStateMachine.AddStatus(dpStatusWhite);
360cdf0e10cSrcweir 	aStateMachine.AddStatus(dpStatusWord);
361cdf0e10cSrcweir 
362cdf0e10cSrcweir 	aStateMachine.AddStatus(dpBst_goto_CheckStar);
363cdf0e10cSrcweir 	aStateMachine.AddStatus(dpBst_goto_AtTag);
364cdf0e10cSrcweir 
365cdf0e10cSrcweir 	aStateMachine.AddStatus(dpBst_finError);
366cdf0e10cSrcweir 	aStateMachine.AddStatus(dpBst_finIgnore);
367cdf0e10cSrcweir 	aStateMachine.AddStatus(dpBst_finEol);
368cdf0e10cSrcweir 	aStateMachine.AddStatus(dpBst_finEof);
369cdf0e10cSrcweir 	aStateMachine.AddStatus(dpBst_finAnyWord);
370cdf0e10cSrcweir 	aStateMachine.AddStatus(dpBst_finWhitespace);
371cdf0e10cSrcweir 
372cdf0e10cSrcweir 	aStateMachine.AddToken( "*",		0,	  	            A_nPunctDefStatus, goto_CheckStar );
373cdf0e10cSrcweir 	aStateMachine.AddToken( "@ATT",		TCF_atstd_ATT,	  	A_nAtTagDefStatus, goto_AtTag );
374cdf0e10cSrcweir 	aStateMachine.AddToken( "@att",		TCF_atstd_ATT,	  	A_nAtTagDefStatus, goto_AtTag );
375cdf0e10cSrcweir 	aStateMachine.AddToken( "@ATTENTION",
376cdf0e10cSrcweir                                 		TCF_atstd_ATT,	  	A_nAtTagDefStatus, goto_AtTag );
377cdf0e10cSrcweir 	aStateMachine.AddToken( "@attention",
378cdf0e10cSrcweir                                 		TCF_atstd_ATT,	  	A_nAtTagDefStatus, goto_AtTag );
379cdf0e10cSrcweir 	aStateMachine.AddToken( "@author",  TCF_atstd_author, 	A_nAtTagDefStatus, goto_AtTag );
380cdf0e10cSrcweir 	aStateMachine.AddToken( "@change",  TCF_atstd_change, 	A_nAtTagDefStatus, goto_AtTag );
381cdf0e10cSrcweir 	aStateMachine.AddToken( "@collab",  TCF_atstd_collab, 	A_nAtTagDefStatus, goto_AtTag );
382cdf0e10cSrcweir 	aStateMachine.AddToken( "@collaborator",
383cdf0e10cSrcweir                                         TCF_atstd_collab, 	A_nAtTagDefStatus, goto_AtTag );
384cdf0e10cSrcweir 	aStateMachine.AddToken( "@contact", TCF_atstd_contact, 	A_nAtTagDefStatus, goto_AtTag );
385cdf0e10cSrcweir 	aStateMachine.AddToken( "@copyright",TCF_atstd_copyright, A_nAtTagDefStatus, goto_AtTag );
386cdf0e10cSrcweir 	aStateMachine.AddToken( "@descr", 	TCF_atstd_descr,  	A_nAtTagDefStatus, goto_AtTag );
387cdf0e10cSrcweir 	aStateMachine.AddToken( "@docdate",	TCF_atstd_docdate,  A_nAtTagDefStatus, goto_AtTag );
388cdf0e10cSrcweir 	aStateMachine.AddToken( "@derive", 	TCF_atstd_derive,   A_nAtTagDefStatus, goto_AtTag );
389cdf0e10cSrcweir 	aStateMachine.AddToken( "@instance",TCF_atstd_instance, A_nAtTagDefStatus, goto_AtTag );
390cdf0e10cSrcweir 	aStateMachine.AddToken( "@life", 	TCF_atstd_life,     A_nAtTagDefStatus, goto_AtTag );
391cdf0e10cSrcweir 	aStateMachine.AddToken( "@lifecycle",
392cdf0e10cSrcweir                                         TCF_atstd_life,     A_nAtTagDefStatus, goto_AtTag );
393cdf0e10cSrcweir 	aStateMachine.AddToken( "@multi",	TCF_atstd_multi,    A_nAtTagDefStatus, goto_AtTag );
394cdf0e10cSrcweir 	aStateMachine.AddToken( "@multiplicity",
395cdf0e10cSrcweir                                         TCF_atstd_multi,    A_nAtTagDefStatus, goto_AtTag );
396cdf0e10cSrcweir 	aStateMachine.AddToken( "@onerror",	TCF_atstd_onerror,  A_nAtTagDefStatus, goto_AtTag );
397cdf0e10cSrcweir 	aStateMachine.AddToken( "@persist",	TCF_atstd_persist,  A_nAtTagDefStatus, goto_AtTag );
398cdf0e10cSrcweir 	aStateMachine.AddToken( "@postcond",TCF_atstd_postcond,A_nAtTagDefStatus, goto_AtTag );
399cdf0e10cSrcweir 	aStateMachine.AddToken( "@precond",	TCF_atstd_precond,  A_nAtTagDefStatus, goto_AtTag );
400cdf0e10cSrcweir 	aStateMachine.AddToken( "@resp",	TCF_atstd_responsibility,
401cdf0e10cSrcweir                                                             A_nAtTagDefStatus, goto_AtTag );
402cdf0e10cSrcweir 	aStateMachine.AddToken( "@responsibility",
403cdf0e10cSrcweir                                         TCF_atstd_return,   A_nAtTagDefStatus, goto_AtTag );
404cdf0e10cSrcweir 	aStateMachine.AddToken( "@return",	TCF_atstd_return,   A_nAtTagDefStatus, goto_AtTag );
405cdf0e10cSrcweir 	aStateMachine.AddToken( "@short",	TCF_atstd_short,    A_nAtTagDefStatus, goto_AtTag );
406cdf0e10cSrcweir 	aStateMachine.AddToken( "@todo",	TCF_atstd_todo,     A_nAtTagDefStatus, goto_AtTag );
407cdf0e10cSrcweir 	aStateMachine.AddToken( "@version",	TCF_atstd_version, 	A_nAtTagDefStatus, goto_AtTag );
408cdf0e10cSrcweir 
409cdf0e10cSrcweir 	aStateMachine.AddToken( "@base",	TCF_at_base,       	A_nAtTagDefStatus, goto_AtTag );
410cdf0e10cSrcweir 	aStateMachine.AddToken( "@exception",TCF_at_exception, 	A_nAtTagDefStatus, goto_AtTag );
411cdf0e10cSrcweir 	aStateMachine.AddToken( "@impl",	TCF_at_impl,       	A_nAtTagDefStatus, goto_AtTag );
412cdf0e10cSrcweir 	aStateMachine.AddToken( "@key",	    TCF_at_key,        	A_nAtTagDefStatus, goto_AtTag );
413cdf0e10cSrcweir 	aStateMachine.AddToken( "@param",	TCF_at_param,   	A_nAtTagDefStatus, goto_AtTag );
414cdf0e10cSrcweir 	aStateMachine.AddToken( "@see",	    TCF_at_see,   		A_nAtTagDefStatus, goto_AtTag );
415cdf0e10cSrcweir 	aStateMachine.AddToken( "@seealso", TCF_at_see,   		A_nAtTagDefStatus, goto_AtTag );
416cdf0e10cSrcweir 	aStateMachine.AddToken( "@since",	TCF_at_since,   	A_nAtTagDefStatus, goto_AtTag );
417cdf0e10cSrcweir 	aStateMachine.AddToken( "@tpl",	    TCF_at_template,   	A_nAtTagDefStatus, goto_AtTag );
418cdf0e10cSrcweir 	aStateMachine.AddToken( "@tplparam",
419cdf0e10cSrcweir                                         TCF_at_template,   	A_nAtTagDefStatus, goto_AtTag );
420cdf0e10cSrcweir 
421cdf0e10cSrcweir 	aStateMachine.AddToken( "@interface",TCF_at_interface,  A_nAtTagDefStatus, goto_AtTag );
422cdf0e10cSrcweir 	aStateMachine.AddToken( "@internal",TCF_at_internal,   	A_nAtTagDefStatus, goto_AtTag );
423cdf0e10cSrcweir 	aStateMachine.AddToken( "@obsolete",TCF_at_obsolete,   	A_nAtTagDefStatus, goto_AtTag );
424cdf0e10cSrcweir 	aStateMachine.AddToken( "@deprecated",TCF_at_obsolete, 	A_nAtTagDefStatus, goto_AtTag );
425cdf0e10cSrcweir 
426cdf0e10cSrcweir 	aStateMachine.AddToken( "@module",	TCF_at_module,   	A_nAtTagDefStatus, goto_AtTag );
427cdf0e10cSrcweir 	aStateMachine.AddToken( "@file",	TCF_at_file,   		A_nAtTagDefStatus, goto_AtTag );
428cdf0e10cSrcweir 	aStateMachine.AddToken( "@gloss",	TCF_at_gloss,   	A_nAtTagDefStatus, goto_AtTag );
429cdf0e10cSrcweir 	aStateMachine.AddToken( "@global#",	TCF_at_global,   	A_nAtTagDefStatus, goto_AtTag );
430cdf0e10cSrcweir 	aStateMachine.AddToken( "@include#",TCF_at_include,   	A_nAtTagDefStatus, goto_AtTag );
431cdf0e10cSrcweir 	aStateMachine.AddToken( "@#",	   	TCF_at_label,   	A_nAtTagDefStatus, goto_AtTag );
432cdf0e10cSrcweir 
433cdf0e10cSrcweir 	aStateMachine.AddToken( "@HTML",	TCF_at_HTML,   	    A_nAtTagDefStatus, goto_AtTag );
434cdf0e10cSrcweir 	aStateMachine.AddToken( "@NOHTML",	TCF_at_NOHTML,   	A_nAtTagDefStatus, goto_AtTag );
435cdf0e10cSrcweir 
436cdf0e10cSrcweir 	aStateMachine.AddToken( "\r\n",	    0,         			A_nPunctDefStatus, finEol );
437cdf0e10cSrcweir 	aStateMachine.AddToken( "\n",       0,           		A_nPunctDefStatus, finEol );
438cdf0e10cSrcweir 	aStateMachine.AddToken( "\r",       0,           		A_nPunctDefStatus, finEol );
439cdf0e10cSrcweir };
440cdf0e10cSrcweir 
441cdf0e10cSrcweir void
SetMode_IsMultiLine(bool i_bTrue)442cdf0e10cSrcweir Context_AdocStd::SetMode_IsMultiLine( bool	i_bTrue )
443cdf0e10cSrcweir {
444cdf0e10cSrcweir 	bIsMultiline = i_bTrue;
445cdf0e10cSrcweir }
446cdf0e10cSrcweir 
447cdf0e10cSrcweir DYN TextToken *
TCF_Whitespace(const char * i_sText)448cdf0e10cSrcweir TCF_Whitespace(const char * i_sText)
449cdf0e10cSrcweir {
450cdf0e10cSrcweir     UINT8 nSize = static_cast<UINT8>(strlen(i_sText));
451cdf0e10cSrcweir     for ( const char * pTab = strchr(i_sText,'\t');
452cdf0e10cSrcweir           pTab != 0;
453cdf0e10cSrcweir           pTab = strchr(pTab+1,'\t') )
454cdf0e10cSrcweir     {
455cdf0e10cSrcweir      	nSize += 3;
456cdf0e10cSrcweir     }
457cdf0e10cSrcweir 
458cdf0e10cSrcweir     return new Tok_Whitespace(nSize);
459cdf0e10cSrcweir }
460cdf0e10cSrcweir 
461cdf0e10cSrcweir 
462cdf0e10cSrcweir }   // namespace adoc
463cdf0e10cSrcweir 
464cdf0e10cSrcweir 
465cdf0e10cSrcweir /*
466cdf0e10cSrcweir @ATT[ENTION]
467cdf0e10cSrcweir @author
468cdf0e10cSrcweir @change[s]
469cdf0e10cSrcweir @collab[orators]
470cdf0e10cSrcweir @contact
471cdf0e10cSrcweir @copyright
472cdf0e10cSrcweir @descr
473cdf0e10cSrcweir @devstat[e]
474cdf0e10cSrcweir @docdate
475cdf0e10cSrcweir @derive
476cdf0e10cSrcweir @instance
477cdf0e10cSrcweir @life[cycle]
478cdf0e10cSrcweir @multi[plicity]
479cdf0e10cSrcweir @onerror
480cdf0e10cSrcweir @persist[ence]
481cdf0e10cSrcweir @postcond
482cdf0e10cSrcweir @precond
483cdf0e10cSrcweir @return
484cdf0e10cSrcweir @short
485cdf0e10cSrcweir @todo
486cdf0e10cSrcweir 
487cdf0e10cSrcweir @module
488cdf0e10cSrcweir @file
489cdf0e10cSrcweir @gloss[ary]
490cdf0e10cSrcweir 
491cdf0e10cSrcweir 
492cdf0e10cSrcweir @base <BasisklassenName>
493cdf0e10cSrcweir @exception <ExceptionName>
494cdf0e10cSrcweir @impl[ements] <IDL-Construct>
495cdf0e10cSrcweir @key[words]|[s]
496cdf0e10cSrcweir @param <FunctionParameterName> [<Range of valid values>]
497cdf0e10cSrcweir @see[also]
498cdf0e10cSrcweir @templ[ate] <FormalTemplateParameterName>
499cdf0e10cSrcweir 
500cdf0e10cSrcweir @internal
501cdf0e10cSrcweir @obsolete
502cdf0e10cSrcweir 
503cdf0e10cSrcweir @#<Label>
504cdf0e10cSrcweir 
505cdf0e10cSrcweir @global#<Label> Global comment.
506cdf0e10cSrcweir @include#<Label>
507cdf0e10cSrcweir 
508cdf0e10cSrcweir 
509cdf0e10cSrcweir */
510cdf0e10cSrcweir 
511