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_luidl/cx_idlco.hxx>
24
25
26 // NOT FULLY DECLARED SERVICES
27 #include <s2_luidl/cx_sub.hxx>
28 #include <s2_dsapi/cx_dsapi.hxx>
29 #include <tools/tkpchars.hxx>
30 #include <tokens/tkpstam2.hxx>
31 #include <s2_luidl/tk_ident.hxx>
32 #include <s2_luidl/tk_keyw.hxx>
33 #include <s2_luidl/tk_punct.hxx>
34 #include <s2_luidl/tokrecv.hxx>
35 #include <x_parse2.hxx>
36
37
38 namespace csi
39 {
40 namespace uidl
41 {
42
43
44 const intt C_nCppInitialNrOfStati = 400;
45 const intt C_nStatusSize = 128;
46
47
48
49 const uintt nF_fin_Error = 1;
50 const uintt nF_fin_Ignore = 2;
51 const uintt nF_fin_Identifier = 3;
52 const uintt nF_fin_Keyword = 4;
53 const uintt nF_fin_Punctuation = 5;
54 const uintt nF_fin_EOL = 6;
55 const uintt nF_fin_EOF = 7;
56
57 const uintt nF_goto_MLDocu = 10;
58 const uintt nF_goto_SLDocu = 11;
59 const uintt nF_goto_MLComment = 12;
60 const uintt nF_goto_SLComment = 13;
61 const uintt nF_goto_Praeprocessor = 14;
62 const uintt nF_goto_Assignment = 15;
63
64
65
66 const UINT16 nTok_bty_any = 100 + TokBuiltInType::bty_any;
67 const UINT16 nTok_bty_boolean = 100 + TokBuiltInType::bty_boolean;
68 const UINT16 nTok_bty_byte = 100 + TokBuiltInType::bty_byte;
69 const UINT16 nTok_bty_char = 100 + TokBuiltInType::bty_char;
70 const UINT16 nTok_bty_double = 100 + TokBuiltInType::bty_double;
71 const UINT16 nTok_bty_hyper = 100 + TokBuiltInType::bty_hyper;
72 const UINT16 nTok_bty_long = 100 + TokBuiltInType::bty_long;
73 const UINT16 nTok_bty_short = 100 + TokBuiltInType::bty_short;
74 const UINT16 nTok_bty_string = 100 + TokBuiltInType::bty_string;
75 const UINT16 nTok_bty_void = 100 + TokBuiltInType::bty_void;
76 const UINT16 nTok_bty_ellipse = 100 + TokBuiltInType::bty_ellipse;
77
78 const UINT16 nTok_tmod_unsigned = 200 + TokTypeModifier::tmod_unsigned;
79 const UINT16 nTok_tmod_sequence = 200 + TokTypeModifier::tmod_sequence;
80
81 const UINT16 nTok_ph_in = 250 + TokParameterHandling::ph_in;
82 const UINT16 nTok_ph_out = 250 + TokParameterHandling::ph_out;
83 const UINT16 nTok_ph_inout = 250 + TokParameterHandling::ph_inout;
84
85 const UINT16 nTok_mt_attribute = 300 + TokMetaType::mt_attribute;
86 const UINT16 nTok_mt_constants = 300 + TokMetaType::mt_constants;
87 const UINT16 nTok_mt_enum = 300 + TokMetaType::mt_enum;
88 const UINT16 nTok_mt_exception = 300 + TokMetaType::mt_exception;
89 const UINT16 nTok_mt_ident = 300 + TokMetaType::mt_ident;
90 const UINT16 nTok_mt_interface = 300 + TokMetaType::mt_interface;
91 const UINT16 nTok_mt_module = 300 + TokMetaType::mt_module;
92 const UINT16 nTok_mt_property = 300 + TokMetaType::mt_property;
93 const UINT16 nTok_mt_service = 300 + TokMetaType::mt_service;
94 const UINT16 nTok_mt_singleton = 300 + TokMetaType::mt_singleton;
95 const UINT16 nTok_mt_struct = 300 + TokMetaType::mt_struct;
96 const UINT16 nTok_mt_typedef = 300 + TokMetaType::mt_typedef;
97 const UINT16 nTok_mt_uik = 300 + TokMetaType::mt_uik;
98
99 const UINT16 nTok_ste_bound = 400 + TokStereotype::ste_bound;
100 const UINT16 nTok_ste_constrained = 400 + TokStereotype::ste_constrained;
101 const UINT16 nTok_ste_const = 400 + TokStereotype::ste_const;
102 const UINT16 nTok_ste_maybeambiguous = 400 + TokStereotype::ste_maybeambiguous;
103 const UINT16 nTok_ste_maybedefault = 400 + TokStereotype::ste_maybedefault;
104 const UINT16 nTok_ste_maybevoid = 400 + TokStereotype::ste_maybevoid;
105 const UINT16 nTok_ste_oneway = 400 + TokStereotype::ste_oneway;
106 const UINT16 nTok_ste_optional = 400 + TokStereotype::ste_optional;
107 const UINT16 nTok_ste_readonly = 400 + TokStereotype::ste_readonly;
108 const UINT16 nTok_ste_removable = 400 + TokStereotype::ste_removable;
109 const UINT16 nTok_ste_virtual = 400 + TokStereotype::ste_virtual;
110 const UINT16 nTok_ste_transient = 400 + TokStereotype::ste_transient;
111 const UINT16 nTok_ste_published = 400 + TokStereotype::ste_published;
112
113 const UINT16 nTok_raises = 501;
114 const UINT16 nTok_needs = 502;
115 const UINT16 nTok_observes = 503;
116
117 const UINT16 nTok_assignment = 550;
118
119 const UINT16 nTok_ignore = 600;
120 const UINT16 nTok_none_MLCommentBegin = 601;
121 const UINT16 nTok_none_SLCommentBegin = 602;
122 const UINT16 nTok_none_MLDocuBegin = 603;
123 const UINT16 nTok_none_SLDocuBegin = 604;
124 const UINT16 nTok_none_PraeprocessorBegin = 605;
125
126
127 const UINT16 nTok_punct_BracketOpen = 700 + TokPunctuation::BracketOpen;
128 const UINT16 nTok_punct_BracketClose = 700 + TokPunctuation::BracketClose;
129 const UINT16 nTok_punct_ArrayBracketOpen = 700 + TokPunctuation::ArrayBracketOpen;
130 const UINT16 nTok_punct_ArrayBracketClose = 700 + TokPunctuation::ArrayBracketClose;
131 const UINT16 nTok_punct_CurledBracketOpen = 700 + TokPunctuation::CurledBracketOpen;
132 const UINT16 nTok_punct_CurledBracketClose = 700 + TokPunctuation::CurledBracketClose;
133 const UINT16 nTok_punct_Semicolon = 700 + TokPunctuation::Semicolon;
134 const UINT16 nTok_punct_Colon = 700 + TokPunctuation::Colon;
135 const UINT16 nTok_punct_DoubleColon = 700 + TokPunctuation::DoubleColon;
136 const UINT16 nTok_punct_Comma = 700 + TokPunctuation::Comma;
137 const UINT16 nTok_punct_Minus = 700 + TokPunctuation::Minus;
138 const UINT16 nTok_punct_Fullstop = 700 + TokPunctuation::Fullstop;
139 const UINT16 nTok_punct_Lesser = 700 + TokPunctuation::Lesser;
140 const UINT16 nTok_punct_Greater = 700 + TokPunctuation::Greater;
141
142 const UINT16 nTok_EOL = 801;
143 const UINT16 nTok_EOF = 802;
144
145
146
Context_UidlCode(Token_Receiver & o_rReceiver,DYN TkpDocuContext & let_drContext_Docu)147 Context_UidlCode::Context_UidlCode( Token_Receiver & o_rReceiver,
148 DYN TkpDocuContext & let_drContext_Docu )
149 : aStateMachine(C_nStatusSize,C_nCppInitialNrOfStati),
150 pReceiver(&o_rReceiver),
151 pDocuContext(&let_drContext_Docu),
152 dpContext_MLComment(0),
153 dpContext_SLComment(0),
154 dpContext_Preprocessor(0),
155 dpContext_Assignment(0),
156 pNewToken(0),
157 pFollowUpContext(0)
158 {
159 dpContext_MLComment = new Context_MLComment(o_rReceiver,*this),
160 dpContext_SLComment = new Context_SLComment(o_rReceiver,*this),
161 dpContext_Preprocessor = new Context_Praeprocessor(o_rReceiver,*this),
162 dpContext_Assignment = new Context_Assignment(o_rReceiver,*this),
163
164 pDocuContext->SetParentContext(*this,"*/");
165 SetupStateMachine();
166 }
167
~Context_UidlCode()168 Context_UidlCode::~Context_UidlCode()
169 {
170 }
171
172 void
ReadCharChain(CharacterSource & io_rText)173 Context_UidlCode::ReadCharChain( CharacterSource & io_rText )
174 {
175 pNewToken = 0;
176
177 UINT16 nTokenId = 0;
178 StmBoundsStatu2 & rBound = aStateMachine.GetCharChain(nTokenId, io_rText);
179
180 // !!!
181 // The order of the next two lines is essential, because
182 // pFollowUpContext may be changed by PerformStatusFunction() also,
183 // which then MUST override the previous assignment.
184 pFollowUpContext = rBound.FollowUpContext();
185 PerformStatusFunction(rBound.StatusFunctionNr(), nTokenId, io_rText);
186 }
187
188 bool
PassNewToken()189 Context_UidlCode::PassNewToken()
190 {
191 if (pNewToken)
192 {
193 pReceiver->Receive(*pNewToken.Release());
194 return true;
195 }
196 return false;
197 }
198
199 TkpContext &
FollowUpContext()200 Context_UidlCode::FollowUpContext()
201 {
202 csv_assert(pFollowUpContext != 0);
203 return *pFollowUpContext;
204 }
205
206 void
PerformStatusFunction(uintt i_nStatusSignal,UINT16 i_nTokenId,CharacterSource & io_rText)207 Context_UidlCode::PerformStatusFunction( uintt i_nStatusSignal,
208 UINT16 i_nTokenId,
209 CharacterSource & io_rText )
210 {
211 switch (i_nStatusSignal)
212 {
213 case nF_fin_Error:
214 // KORR_FUTURE
215 throw X_AutodocParser(X_AutodocParser::x_InvalidChar);
216 // no break, because of throw
217 case nF_fin_Ignore:
218 pNewToken = 0;
219 io_rText.CutToken();
220 break;
221 case nF_fin_Identifier:
222 pNewToken = new TokIdentifier(io_rText.CutToken());
223 break;
224 case nF_fin_Keyword:
225 io_rText.CutToken();
226 switch ( i_nTokenId / 50 )
227 {
228 case 2:
229 pNewToken = new TokBuiltInType(i_nTokenId - 100);
230 break;
231 case 4:
232 pNewToken = new TokTypeModifier(i_nTokenId - 200);
233 break;
234 case 5:
235 pNewToken = new TokParameterHandling(i_nTokenId - 250);
236 break;
237 case 6:
238 pNewToken = new TokMetaType(i_nTokenId - 300);
239 break;
240 case 8:
241 pNewToken = new TokStereotype(i_nTokenId - 400);
242 break;
243 case 10:
244 switch (i_nTokenId-500)
245 {
246 case 1:
247 pNewToken = new TokRaises;
248 break;
249 case 2:
250 pNewToken = new TokNeeds;
251 break;
252 case 3:
253 pNewToken = new TokObserves;
254 break;
255 default:
256 csv_assert(false);
257 }
258 break;
259 default:
260 csv_assert(false);
261 } // end switch ( i_nTokenId / 50 )
262 break;
263 case nF_fin_Punctuation:
264 io_rText.CutToken();
265 if (i_nTokenId == nTok_punct_DoubleColon)
266 pNewToken = new TokNameSeparator;
267 else
268 pNewToken = new TokPunctuation(i_nTokenId - 700);
269 break;
270 case nF_fin_EOL:
271 io_rText.CutToken();
272 pNewToken = new Tok_EOL;
273 pReceiver->Increment_CurLine();
274 break;
275 case nF_fin_EOF:
276 pNewToken = new Tok_EOF;
277 break;
278 case nF_goto_MLDocu:
279 while ( io_rText.CurChar() == '*')
280 io_rText.MoveOn();
281 io_rText.CutToken();
282 pDocuContext->SetMode_IsMultiLine(true);
283 break;
284 case nF_goto_SLDocu:
285 io_rText.CutToken();
286 pDocuContext->SetMode_IsMultiLine(false);
287 break;
288 case nF_goto_MLComment:
289 break;
290 case nF_goto_SLComment:
291 break;
292 case nF_goto_Praeprocessor:
293 break;
294 case nF_goto_Assignment:
295 break;
296 default:
297 csv_assert(false);
298 } // end switch (i_nStatusSignal)
299 }
300
301 void
SetupStateMachine()302 Context_UidlCode::SetupStateMachine()
303 {
304 // Besondere Array-Stati (kein Tokenabschluss oder Kontextwechsel):
305 // const INT16 top = 0; // Top-Status
306 const INT16 wht = 1; // Whitespace-�berlese-Status
307 const INT16 bez = 2; // Bezeichner-lese-Status
308
309 // Tokenfinish-Stati:
310 const INT16 finErr = 3;
311 const INT16 finIgn = 4;
312 const INT16 finBez = 5;
313 const INT16 finKeyw = 6;
314 const INT16 finPunct = 7;
315 const INT16 finEOL = 8;
316 const INT16 finEOF = 9;
317
318 // Kontextwechsel-Stati:
319 const INT16 gotoMld = 10;
320 const INT16 gotoSld = 11;
321 const INT16 gotoMlc = 12;
322 const INT16 gotoSlc = 13;
323 const INT16 gotoPrp = 14;
324 const INT16 gotoAsg = 15;
325
326 // Konstanten zur Benutzung in der Tabelle:
327 const INT16 err = finErr;
328 const INT16 fbz = finBez;
329 const INT16 fig = finIgn;
330 const INT16 fof = finEOF;
331 // const INT16 fkw = finKeyw;
332 // const INT16 fpc = finPunct;
333
334 /// Die '0'en werden spaeter durch AddToken() ersetzt.
335
336 const INT16 A_nTopStatus[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, 0,wht,wht, 0,err,err,
339 err,err,err,err,err,err,err,err,err,err,fof,err,err,err,err,err, // 16 ...
340 wht,err,wht, 0,err,err,err,err, 0, 0,err,err, 0, 0, 0,err,
341 bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,err,err,err,err,err,err, // 48 ...
342 err,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,
343 bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez, 0,err, 0,err,bez, // 80 ...
344 err,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,
345 bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez, 0,err, 0,err,err, // 112 ...
346 };
347
348 const INT16 A_nWhitespaceStatus[C_nStatusSize] =
349 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
350 {fof,err,err,err,err,err,err,err,err,wht,fig,wht,wht,fig,err,err,
351 err,err,err,err,err,err,err,err,err,err,fof,err,err,err,err,err, // 16 ...
352 wht,fig,wht,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,
353 fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig, // 48 ...
354 fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,
355 fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig, // 80 ...
356 fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,
357 fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,fig,err // 112 ...
358 };
359
360 const INT16 A_nBezeichnerStatus[C_nStatusSize] =
361 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
362 {fbz,err,err,err,err,err,err,err,err,fbz,fbz,fbz,fbz,fbz,err,err,
363 err,err,err,err,err,err,err,err,err,err,fbz,err,err,err,err,err, // 16 ...
364 fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,
365 bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,fbz,fbz,fbz,fbz,fbz,fbz, // 48 ...
366 fbz,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,
367 bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,fbz,fbz,fbz,fbz,bez, // 80 ...
368 fbz,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,
369 bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,fbz,fbz,fbz,fbz,err // 112 ...
370 };
371
372 const INT16 A_nPunctDefStatus[C_nStatusSize] =
373 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
374 {err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,
375 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, // 16 ...
376 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,
377 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, // 48 ...
378 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,
379 err,err,err,err,err,err,err,err,err,err,err,err,err,err,err,err, // 80 ...
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 // 112 ...
382 };
383
384 const INT16 A_nKeywordDefStatus[C_nStatusSize] =
385 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
386 {fbz,err,err,err,err,err,err,err,err,fbz,fbz,fbz,fbz,fbz,err,err,
387 err,err,err,err,err,err,err,err,err,err,fbz,err,err,err,err,err, // 16 ...
388 fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,fbz,
389 bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,fbz,fbz,fbz,fbz,fbz,fbz, // 48 ...
390 fbz,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,
391 bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,fbz,fbz,fbz,fbz,bez, // 80 ...
392 fbz,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,
393 bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,bez,fbz,fbz,fbz,fbz,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 * dpStatusBez
401 = new StmArrayStatu2( C_nStatusSize, A_nBezeichnerStatus, 0, true);
402
403 DYN StmBoundsStatu2 * dpBst_finErr
404 = new StmBoundsStatu2( *this, TkpContext_Null2_(), nF_fin_Error, true );
405 DYN StmBoundsStatu2 * dpBst_finIgn
406 = new StmBoundsStatu2( *this, *this, nF_fin_Ignore, true );
407 DYN StmBoundsStatu2 * dpBst_finBez
408 = new StmBoundsStatu2( *this, *this, nF_fin_Identifier, true );
409 DYN StmBoundsStatu2 * dpBst_finKeyw
410 = new StmBoundsStatu2( *this, *this, nF_fin_Keyword, false );
411 DYN StmBoundsStatu2 * dpBst_finPunct
412 = new StmBoundsStatu2( *this, *this, nF_fin_Punctuation, false );
413 DYN StmBoundsStatu2 * dpBst_finEOL
414 = new StmBoundsStatu2( *this, *this, nF_fin_EOL, false );
415 DYN StmBoundsStatu2 * dpBst_finEOF
416 = new StmBoundsStatu2( *this, TkpContext_Null2_(), nF_fin_EOF, false );
417
418 DYN StmBoundsStatu2 * dpBst_gotoMld
419 = new StmBoundsStatu2( *this, *pDocuContext, nF_goto_MLDocu, false );
420 DYN StmBoundsStatu2 * dpBst_gotoSld
421 = new StmBoundsStatu2( *this, *pDocuContext, nF_goto_SLDocu, false );
422 DYN StmBoundsStatu2 * dpBst_gotoMlc
423 = new StmBoundsStatu2( *this, *dpContext_MLComment, nF_goto_MLComment, false );
424 DYN StmBoundsStatu2 * dpBst_gotoSlc
425 = new StmBoundsStatu2( *this, *dpContext_SLComment, nF_goto_SLComment, false );
426 DYN StmBoundsStatu2 * dpBst_gotoPrp
427 = new StmBoundsStatu2( *this, *dpContext_Preprocessor, nF_goto_Praeprocessor, false );
428 DYN StmBoundsStatu2 * dpBst_gotoAsg
429 = new StmBoundsStatu2( *this, *dpContext_Assignment, nF_goto_Assignment, false );
430
431 // dpMain aufbauen:
432 aStateMachine.AddStatus(dpStatusTop);
433
434 aStateMachine.AddStatus(dpStatusWhite);
435 aStateMachine.AddStatus(dpStatusBez);
436
437 aStateMachine.AddStatus(dpBst_finErr);
438 aStateMachine.AddStatus(dpBst_finIgn);
439 aStateMachine.AddStatus(dpBst_finBez);
440 aStateMachine.AddStatus(dpBst_finKeyw);
441 aStateMachine.AddStatus(dpBst_finPunct);
442 aStateMachine.AddStatus(dpBst_finEOL);
443 aStateMachine.AddStatus(dpBst_finEOF);
444
445 aStateMachine.AddStatus(dpBst_gotoMld);
446 aStateMachine.AddStatus(dpBst_gotoSld);
447 aStateMachine.AddStatus(dpBst_gotoMlc);
448 aStateMachine.AddStatus(dpBst_gotoSlc);
449 aStateMachine.AddStatus(dpBst_gotoPrp);
450 aStateMachine.AddStatus(dpBst_gotoAsg);
451
452 aStateMachine.AddToken("any", nTok_bty_any, A_nKeywordDefStatus, finKeyw);
453 aStateMachine.AddToken("attribute", nTok_mt_attribute, A_nKeywordDefStatus, finKeyw);
454 aStateMachine.AddToken("boolean", nTok_bty_boolean, A_nKeywordDefStatus, finKeyw);
455 aStateMachine.AddToken("bound", nTok_ste_bound, A_nKeywordDefStatus, finKeyw);
456 aStateMachine.AddToken("byte", nTok_bty_byte, A_nKeywordDefStatus, finKeyw);
457 aStateMachine.AddToken("char", nTok_bty_char, A_nKeywordDefStatus, finKeyw);
458 aStateMachine.AddToken("const", nTok_ste_const, A_nKeywordDefStatus, finKeyw);
459 aStateMachine.AddToken("constants", nTok_mt_constants, A_nKeywordDefStatus, finKeyw);
460 aStateMachine.AddToken("constrained",
461 nTok_ste_constrained, A_nKeywordDefStatus, finKeyw);
462 aStateMachine.AddToken("double", nTok_bty_double, A_nKeywordDefStatus, finKeyw);
463 aStateMachine.AddToken("enum", nTok_mt_enum, A_nKeywordDefStatus, finKeyw);
464 aStateMachine.AddToken("exception", nTok_mt_exception, A_nKeywordDefStatus, finKeyw);
465 aStateMachine.AddToken("hyper", nTok_bty_hyper, A_nKeywordDefStatus, finKeyw);
466 aStateMachine.AddToken("ident", nTok_mt_ident, A_nKeywordDefStatus, finKeyw);
467 aStateMachine.AddToken("in", nTok_ph_in, A_nKeywordDefStatus, finKeyw);
468 aStateMachine.AddToken("inout", nTok_ph_inout, A_nKeywordDefStatus, finKeyw);
469 aStateMachine.AddToken("interface", nTok_mt_interface, A_nKeywordDefStatus, finKeyw);
470 aStateMachine.AddToken("long", nTok_bty_long, A_nKeywordDefStatus, finKeyw);
471 aStateMachine.AddToken("maybeambiguous",
472 nTok_ste_maybeambiguous,A_nKeywordDefStatus, finKeyw);
473 aStateMachine.AddToken("maybedefault",
474 nTok_ste_maybedefault, A_nKeywordDefStatus, finKeyw);
475 aStateMachine.AddToken("maybevoid", nTok_ste_maybevoid, A_nKeywordDefStatus, finKeyw);
476 aStateMachine.AddToken("module", nTok_mt_module, A_nKeywordDefStatus, finKeyw);
477 aStateMachine.AddToken("needs", nTok_needs, A_nKeywordDefStatus, finKeyw);
478 aStateMachine.AddToken("observes", nTok_observes, A_nKeywordDefStatus, finKeyw);
479 aStateMachine.AddToken("oneway", nTok_ste_oneway, A_nKeywordDefStatus, finKeyw);
480 aStateMachine.AddToken("optional", nTok_ste_optional, A_nKeywordDefStatus, finKeyw);
481 aStateMachine.AddToken("out", nTok_ph_out, A_nKeywordDefStatus, finKeyw);
482 aStateMachine.AddToken("property", nTok_mt_property, A_nKeywordDefStatus, finKeyw);
483 aStateMachine.AddToken("published", nTok_ste_published, A_nKeywordDefStatus, finKeyw);
484 aStateMachine.AddToken("raises", nTok_raises, A_nKeywordDefStatus, finKeyw);
485 aStateMachine.AddToken("readonly", nTok_ste_readonly, A_nKeywordDefStatus, finKeyw);
486 aStateMachine.AddToken("removable", nTok_ste_removable, A_nKeywordDefStatus, finKeyw);
487 aStateMachine.AddToken("sequence", nTok_tmod_sequence, A_nKeywordDefStatus, finKeyw);
488 aStateMachine.AddToken("service", nTok_mt_service, A_nKeywordDefStatus, finKeyw);
489 aStateMachine.AddToken("short", nTok_bty_short, A_nKeywordDefStatus, finKeyw);
490 aStateMachine.AddToken("singleton", nTok_mt_singleton, A_nKeywordDefStatus, finKeyw);
491 aStateMachine.AddToken("string", nTok_bty_string, A_nKeywordDefStatus, finKeyw);
492 aStateMachine.AddToken("struct", nTok_mt_struct, A_nKeywordDefStatus, finKeyw);
493 aStateMachine.AddToken("transient", nTok_ste_transient, A_nKeywordDefStatus, finKeyw);
494 aStateMachine.AddToken("typedef", nTok_mt_typedef, A_nKeywordDefStatus, finKeyw);
495 aStateMachine.AddToken("uik", nTok_mt_uik, A_nKeywordDefStatus, finKeyw);
496 aStateMachine.AddToken("unsigned", nTok_tmod_unsigned, A_nKeywordDefStatus, finKeyw);
497 aStateMachine.AddToken("virtual", nTok_ste_virtual, A_nKeywordDefStatus, finKeyw);
498 aStateMachine.AddToken("void", nTok_bty_void, A_nKeywordDefStatus, finKeyw);
499 aStateMachine.AddToken("...", nTok_bty_ellipse, A_nPunctDefStatus, finKeyw);
500
501 aStateMachine.AddToken("=", nTok_assignment, A_nPunctDefStatus, gotoAsg);
502
503 aStateMachine.AddToken("(", nTok_punct_BracketOpen, A_nPunctDefStatus, finPunct);
504 aStateMachine.AddToken(")", nTok_punct_BracketClose,A_nPunctDefStatus, finPunct);
505 aStateMachine.AddToken("[", nTok_punct_ArrayBracketOpen,
506 A_nPunctDefStatus, finIgn);
507 aStateMachine.AddToken("]", nTok_punct_ArrayBracketClose,
508 A_nPunctDefStatus, finIgn);
509 aStateMachine.AddToken("{", nTok_punct_CurledBracketOpen,
510 A_nPunctDefStatus, finPunct);
511 aStateMachine.AddToken("}", nTok_punct_CurledBracketClose,
512 A_nPunctDefStatus, finPunct);
513 aStateMachine.AddToken("<", nTok_punct_Lesser, A_nPunctDefStatus, finPunct);
514 aStateMachine.AddToken(">", nTok_punct_Greater, A_nPunctDefStatus, finPunct);
515 aStateMachine.AddToken(";", nTok_punct_Semicolon, A_nPunctDefStatus, finPunct);
516 aStateMachine.AddToken(":", nTok_punct_Colon, A_nPunctDefStatus, finPunct);
517 aStateMachine.AddToken("::", nTok_punct_DoubleColon, A_nPunctDefStatus, finPunct);
518 aStateMachine.AddToken(",", nTok_punct_Comma, A_nPunctDefStatus, finPunct);
519 aStateMachine.AddToken("-", nTok_punct_Minus, A_nPunctDefStatus, finPunct);
520 aStateMachine.AddToken(".", nTok_punct_Fullstop, A_nPunctDefStatus, finPunct);
521 aStateMachine.AddToken("/**", nTok_none_MLDocuBegin, A_nPunctDefStatus, gotoMld);
522 aStateMachine.AddToken("///", nTok_none_SLDocuBegin, A_nPunctDefStatus, gotoSld);
523 aStateMachine.AddToken("/*", nTok_none_MLCommentBegin,
524 A_nPunctDefStatus, gotoMlc);
525 aStateMachine.AddToken("//", nTok_none_SLCommentBegin,
526 A_nPunctDefStatus, gotoSlc);
527 aStateMachine.AddToken("/**/", nTok_ignore, A_nPunctDefStatus, finIgn);
528 aStateMachine.AddToken("#", nTok_none_PraeprocessorBegin,
529 A_nPunctDefStatus, gotoPrp);
530 aStateMachine.AddToken("\r\n", nTok_EOL, A_nPunctDefStatus, finEOL);
531 aStateMachine.AddToken("\r", nTok_EOL, A_nPunctDefStatus, finEOL);
532 aStateMachine.AddToken("\n", nTok_EOL, A_nPunctDefStatus, finEOL);
533 aStateMachine.AddToken("\n\r", nTok_EOL, A_nPunctDefStatus, finEOL);
534 };
535
536
537 } // namespace uidl
538 } // namespace csi
539
540