tclscanner.cpp
Go to the documentation of this file.
1 #line 2 "/nova/app/home/novasoft/doxygen/doxygen-1.8.11/build/generated_src/tclscanner.cpp"
2 
3 #line 4 "/nova/app/home/novasoft/doxygen/doxygen-1.8.11/build/generated_src/tclscanner.cpp"
4 
5 #define YY_INT_ALIGNED short int
6 
7 /* A lexical scanner generated by flex */
8 
9 #define yy_create_buffer tclscannerYY_create_buffer
10 #define yy_delete_buffer tclscannerYY_delete_buffer
11 #define yy_flex_debug tclscannerYY_flex_debug
12 #define yy_init_buffer tclscannerYY_init_buffer
13 #define yy_flush_buffer tclscannerYY_flush_buffer
14 #define yy_load_buffer_state tclscannerYY_load_buffer_state
15 #define yy_switch_to_buffer tclscannerYY_switch_to_buffer
16 #define yyin tclscannerYYin
17 #define yyleng tclscannerYYleng
18 #define yylex tclscannerYYlex
19 #define yylineno tclscannerYYlineno
20 #define yyout tclscannerYYout
21 #define yyrestart tclscannerYYrestart
22 #define yytext tclscannerYYtext
23 #define yywrap tclscannerYYwrap
24 #define yyalloc tclscannerYYalloc
25 #define yyrealloc tclscannerYYrealloc
26 #define yyfree tclscannerYYfree
27 
28 #define FLEX_SCANNER
29 #define YY_FLEX_MAJOR_VERSION 2
30 #define YY_FLEX_MINOR_VERSION 5
31 #define YY_FLEX_SUBMINOR_VERSION 35
32 #if YY_FLEX_SUBMINOR_VERSION > 0
33 #define FLEX_BETA
34 #endif
35 
36 /* First, we deal with platform-specific or compiler-specific issues. */
37 
38 /* begin standard C headers. */
39 #include <stdio.h>
40 #include <string.h>
41 #include <errno.h>
42 #include <stdlib.h>
43 
44 /* end standard C headers. */
45 
46 /* flex integer type definitions */
47 
48 #ifndef FLEXINT_H
49 #define FLEXINT_H
50 
51 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
52 
53 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
54 
55 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
56  * if you want the limit (max/min) macros for int types.
57  */
58 #ifndef __STDC_LIMIT_MACROS
59 #define __STDC_LIMIT_MACROS 1
60 #endif
61 
62 #include <inttypes.h>
63 typedef int8_t flex_int8_t;
64 typedef uint8_t flex_uint8_t;
65 typedef int16_t flex_int16_t;
66 typedef uint16_t flex_uint16_t;
67 typedef int32_t flex_int32_t;
68 typedef uint32_t flex_uint32_t;
69 #else
70 typedef signed char flex_int8_t;
71 typedef short int flex_int16_t;
72 typedef int flex_int32_t;
73 typedef unsigned char flex_uint8_t;
74 typedef unsigned short int flex_uint16_t;
75 typedef unsigned int flex_uint32_t;
76 #endif /* ! C99 */
77 
78 /* Limits of integral types. */
79 #ifndef INT8_MIN
80 #define INT8_MIN (-128)
81 #endif
82 #ifndef INT16_MIN
83 #define INT16_MIN (-32767-1)
84 #endif
85 #ifndef INT32_MIN
86 #define INT32_MIN (-2147483647-1)
87 #endif
88 #ifndef INT8_MAX
89 #define INT8_MAX (127)
90 #endif
91 #ifndef INT16_MAX
92 #define INT16_MAX (32767)
93 #endif
94 #ifndef INT32_MAX
95 #define INT32_MAX (2147483647)
96 #endif
97 #ifndef UINT8_MAX
98 #define UINT8_MAX (255U)
99 #endif
100 #ifndef UINT16_MAX
101 #define UINT16_MAX (65535U)
102 #endif
103 #ifndef UINT32_MAX
104 #define UINT32_MAX (4294967295U)
105 #endif
106 
107 #endif /* ! FLEXINT_H */
108 
109 #ifdef __cplusplus
110 
111 /* The "const" storage-class-modifier is valid. */
112 #define YY_USE_CONST
113 
114 #else /* ! __cplusplus */
115 
116 /* C99 requires __STDC__ to be defined as 1. */
117 #if defined (__STDC__)
118 
119 #define YY_USE_CONST
120 
121 #endif /* defined (__STDC__) */
122 #endif /* ! __cplusplus */
123 
124 #ifdef YY_USE_CONST
125 #define yyconst const
126 #else
127 #define yyconst
128 #endif
129 
130 /* Returned upon end-of-file. */
131 #define YY_NULL 0
132 
133 /* Promotes a possibly negative, possibly signed char to an unsigned
134  * integer for use as an array index. If the signed char is negative,
135  * we want to instead treat it as an 8-bit unsigned char, hence the
136  * double cast.
137  */
138 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
139 
140 /* Enter a start condition. This macro really ought to take a parameter,
141  * but we do it the disgusting crufty way forced on us by the ()-less
142  * definition of BEGIN.
143  */
144 #define BEGIN (yy_start) = 1 + 2 *
145 
146 /* Translate the current start state into a value that can be later handed
147  * to BEGIN to return to the state. The YYSTATE alias is for lex
148  * compatibility.
149  */
150 #define YY_START (((yy_start) - 1) / 2)
151 #define YYSTATE YY_START
152 
153 /* Action number for EOF rule of a given start state. */
154 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
155 
156 /* Special action meaning "start processing a new file". */
157 #define YY_NEW_FILE tclscannerYYrestart(tclscannerYYin )
158 
159 #define YY_END_OF_BUFFER_CHAR 0
160 
161 /* Size of default input buffer. */
162 #ifndef YY_BUF_SIZE
163 #define YY_BUF_SIZE 16384
164 #endif
165 
166 /* The state buf must be large enough to hold one state per character in the main buffer.
167  */
168 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
169 
170 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
171 #define YY_TYPEDEF_YY_BUFFER_STATE
173 #endif
174 
175 extern int tclscannerYYleng;
176 
177 extern FILE *tclscannerYYin, *tclscannerYYout;
178 
179 #define EOB_ACT_CONTINUE_SCAN 0
180 #define EOB_ACT_END_OF_FILE 1
181 #define EOB_ACT_LAST_MATCH 2
182 
183  /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
184  * access to the local variable yy_act. Since yyless() is a macro, it would break
185  * existing scanners that call yyless() from OUTSIDE tclscannerYYlex.
186  * One obvious solution it to make yy_act a global. I tried that, and saw
187  * a 5% performance hit in a non-tclscannerYYlineno scanner, because yy_act is
188  * normally declared as a register variable-- so it is not worth it.
189  */
190  #define YY_LESS_LINENO(n) \
191  do { \
192  int yyl;\
193  for ( yyl = n; yyl < tclscannerYYleng; ++yyl )\
194  if ( tclscannerYYtext[yyl] == '\n' )\
195  --tclscannerYYlineno;\
196  }while(0)
197 
198 /* Return all but the first "n" matched characters back to the input stream. */
199 #define yyless(n) \
200  do \
201  { \
202  /* Undo effects of setting up tclscannerYYtext. */ \
203  int yyless_macro_arg = (n); \
204  YY_LESS_LINENO(yyless_macro_arg);\
205  *yy_cp = (yy_hold_char); \
206  YY_RESTORE_YY_MORE_OFFSET \
207  (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
208  YY_DO_BEFORE_ACTION; /* set up tclscannerYYtext again */ \
209  } \
210  while ( 0 )
211 
212 #define unput(c) yyunput( c, (yytext_ptr) )
213 
214 #ifndef YY_TYPEDEF_YY_SIZE_T
215 #define YY_TYPEDEF_YY_SIZE_T
216 typedef size_t yy_size_t;
217 #endif
218 
219 #ifndef YY_STRUCT_YY_BUFFER_STATE
220 #define YY_STRUCT_YY_BUFFER_STATE
221 struct yy_buffer_state
222  {
223  FILE *yy_input_file;
224 
225  char *yy_ch_buf; /* input buffer */
226  char *yy_buf_pos; /* current position in input buffer */
227 
228  /* Size of input buffer in bytes, not including room for EOB
229  * characters.
230  */
232 
233  /* Number of characters read into yy_ch_buf, not including EOB
234  * characters.
235  */
236  int yy_n_chars;
237 
238  /* Whether we "own" the buffer - i.e., we know we created it,
239  * and can realloc() it to grow it, and should free() it to
240  * delete it.
241  */
242  int yy_is_our_buffer;
243 
244  /* Whether this is an "interactive" input source; if so, and
245  * if we're using stdio for input, then we want to use getc()
246  * instead of fread(), to make sure we stop fetching input after
247  * each newline.
248  */
249  int yy_is_interactive;
250 
251  /* Whether we're considered to be at the beginning of a line.
252  * If so, '^' rules will be active on the next match, otherwise
253  * not.
254  */
255  int yy_at_bol;
256 
257  int yy_bs_lineno; /**< The line count. */
258  int yy_bs_column; /**< The column count. */
259 
260  /* Whether to try to fill the input buffer when we reach the
261  * end of it.
262  */
263  int yy_fill_buffer;
264 
265  int yy_buffer_status;
266 
267 #define YY_BUFFER_NEW 0
268 #define YY_BUFFER_NORMAL 1
269  /* When an EOF's been seen but there's still some text to process
270  * then we mark the buffer as YY_EOF_PENDING, to indicate that we
271  * shouldn't try reading from the input source any more. We might
272  * still have a bunch of tokens to match, though, because of
273  * possible backing-up.
274  *
275  * When we actually see the EOF, we change the status to "new"
276  * (via tclscannerYYrestart()), so that the user can continue scanning by
277  * just pointing tclscannerYYin at a new input file.
278  */
279 #define YY_BUFFER_EOF_PENDING 2
280 
281  };
282 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
283 
284 /* Stack of input buffers. */
285 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
286 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
287 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
288 
289 /* We provide macros for accessing buffer states in case in the
290  * future we want to put the buffer states in a more general
291  * "scanner state".
292  *
293  * Returns the top of the stack, or NULL.
294  */
295 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
296  ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
297  : NULL)
298 
299 /* Same as previous macro, but useful when we know that the buffer stack is not
300  * NULL or when we need an lvalue. For internal use only.
301  */
302 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
303 
304 /* yy_hold_char holds the character lost when tclscannerYYtext is formed. */
305 static char yy_hold_char;
306 static int yy_n_chars; /* number of characters read into yy_ch_buf */
308 
309 /* Points to current character in buffer. */
310 static char *yy_c_buf_p = (char *) 0;
311 static int yy_init = 0; /* whether we need to initialize */
312 static int yy_start = 0; /* start state number */
313 
314 /* Flag which is used to allow tclscannerYYwrap()'s to do buffer switches
315  * instead of setting up a fresh tclscannerYYin. A bit of a hack ...
316  */
318 
319 void tclscannerYYrestart (FILE *input_file );
320 void tclscannerYY_switch_to_buffer (YY_BUFFER_STATE new_buffer );
321 YY_BUFFER_STATE tclscannerYY_create_buffer (FILE *file,int size );
322 void tclscannerYY_delete_buffer (YY_BUFFER_STATE b );
323 void tclscannerYY_flush_buffer (YY_BUFFER_STATE b );
324 void tclscannerYYpush_buffer_state (YY_BUFFER_STATE new_buffer );
325 void tclscannerYYpop_buffer_state (void );
326 
327 static void tclscannerYYensure_buffer_stack (void );
328 static void tclscannerYY_load_buffer_state (void );
329 static void tclscannerYY_init_buffer (YY_BUFFER_STATE b,FILE *file );
330 
331 #define YY_FLUSH_BUFFER tclscannerYY_flush_buffer(YY_CURRENT_BUFFER )
332 
333 YY_BUFFER_STATE tclscannerYY_scan_buffer (char *base,yy_size_t size );
334 YY_BUFFER_STATE tclscannerYY_scan_string (yyconst char *yy_str );
335 YY_BUFFER_STATE tclscannerYY_scan_bytes (yyconst char *bytes,int len );
336 
338 void *tclscannerYYrealloc (void *,yy_size_t );
339 void tclscannerYYfree (void * );
340 
341 #define yy_new_buffer tclscannerYY_create_buffer
342 
343 #define yy_set_interactive(is_interactive) \
344  { \
345  if ( ! YY_CURRENT_BUFFER ){ \
346  tclscannerYYensure_buffer_stack (); \
347  YY_CURRENT_BUFFER_LVALUE = \
348  tclscannerYY_create_buffer(tclscannerYYin,YY_BUF_SIZE ); \
349  } \
350  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
351  }
352 
353 #define yy_set_bol(at_bol) \
354  { \
355  if ( ! YY_CURRENT_BUFFER ){\
356  tclscannerYYensure_buffer_stack (); \
357  YY_CURRENT_BUFFER_LVALUE = \
358  tclscannerYY_create_buffer(tclscannerYYin,YY_BUF_SIZE ); \
359  } \
360  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
361  }
362 
363 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
364 
365 /* Begin user sect3 */
366 
367 #define tclscannerYYwrap(n) 1
368 #define YY_SKIP_YYWRAP
369 
370 typedef unsigned char YY_CHAR;
371 
372 FILE *tclscannerYYin = (FILE *) 0, *tclscannerYYout = (FILE *) 0;
373 
374 typedef int yy_state_type;
375 
376 extern int tclscannerYYlineno;
377 
378 int tclscannerYYlineno = 1;
379 
380 extern char *tclscannerYYtext;
381 #define yytext_ptr tclscannerYYtext
382 
383 static yy_state_type yy_get_previous_state (void );
384 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
385 static int yy_get_next_buffer (void );
386 static void yy_fatal_error (yyconst char msg[] );
387 
388 /* Done after the current pattern has been matched and before the
389  * corresponding action - sets up tclscannerYYtext.
390  */
391 #define YY_DO_BEFORE_ACTION \
392  (yytext_ptr) = yy_bp; \
393  (yytext_ptr) -= (yy_more_len); \
394  tclscannerYYleng = (size_t) (yy_cp - (yytext_ptr)); \
395  (yy_hold_char) = *yy_cp; \
396  *yy_cp = '\0'; \
397  (yy_c_buf_p) = yy_cp;
398 
399 #define YY_NUM_RULES 55
400 #define YY_END_OF_BUFFER 56
401 /* This struct is not used in this scanner,
402  but its presence is necessary. */
403 struct yy_trans_info
404  {
405  flex_int32_t yy_verify;
407  };
409  { 0,
410  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
411  5, 5, 0, 0, 0, 0, 0, 0, 26, 26,
412  0, 0, 56, 55, 1, 4, 3, 3, 2, 4,
413  40, 37, 36, 34, 35, 40, 40, 54, 50, 52,
414  53, 49, 48, 51, 46, 54, 47, 44, 45, 15,
415  5, 14, 15, 55, 23, 24, 55, 55, 17, 18,
416  55, 55, 20, 21, 55, 29, 26, 29, 25, 29,
417  55, 31, 32, 55, 3, 0, 37, 36, 34, 35,
418  0, 0, 0, 0, 39, 0, 42, 43, 41, 5,
419  0, 12, 13, 0, 0, 0, 0, 23, 24, 0,
420 
421  22, 0, 17, 18, 0, 0, 20, 21, 0, 0,
422  25, 26, 0, 0, 31, 32, 0, 30, 33, 0,
423  0, 0, 8, 13, 0, 0, 0, 0, 11, 0,
424  0, 0, 28, 25, 0, 38, 0, 6, 13, 0,
425  7, 0, 0, 0, 0, 27, 6, 0, 0, 0,
426  0, 0, 0, 0, 0, 12, 0, 0, 0, 9,
427  9, 0, 0, 0, 0, 0, 0, 0, 16, 0,
428  12, 0, 10, 10, 0, 0, 19, 0
429  } ;
430 
432  { 0,
433  1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
434  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
435  1, 1, 1, 1, 1, 4, 1, 1, 1, 1,
436  1, 5, 1, 6, 7, 1, 1, 1, 1, 1,
437  1, 8, 1, 1, 1, 1, 1, 1, 1, 1,
438  1, 1, 1, 1, 1, 1, 1, 1, 9, 10,
439  1, 1, 1, 11, 12, 13, 14, 15, 16, 1,
440  1, 1, 17, 1, 1, 1, 18, 19, 20, 1,
441  1, 21, 1, 22, 1, 23, 1, 1, 1, 1,
442  24, 25, 26, 1, 1, 1, 27, 28, 29, 30,
443 
444  31, 1, 1, 1, 32, 1, 1, 1, 33, 34,
445  35, 1, 1, 36, 1, 37, 1, 38, 1, 1,
446  1, 1, 39, 1, 40, 1, 1, 1, 1, 1,
447  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
448  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
449  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
450  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
451  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
452  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
453  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
454 
455  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
456  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
457  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
458  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
459  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
460  1, 1, 1, 1, 1
461  } ;
462 
464  { 0,
465  1, 2, 3, 1, 2, 2, 4, 1, 2, 1,
466  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
467  1, 1, 1, 2, 5, 2, 1, 1, 1, 1,
468  1, 1, 1, 1, 1, 1, 1, 1, 2, 2
469  } ;
470 
472  { 0,
473  0, 0, 126, 112, 0, 8, 32, 70, 108, 147,
474  14, 22, 19, 27, 35, 42, 44, 51, 57, 63,
475  73, 77, 107, 615, 615, 615, 80, 91, 615, 100,
476  615, 116, 615, 615, 99, 96, 89, 615, 615, 615,
477  615, 615, 615, 615, 615, 3, 615, 615, 615, 615,
478  38, 615, 119, 83, 615, 132, 134, 87, 615, 124,
479  151, 136, 615, 139, 157, 88, 161, 615, 84, 4,
480  142, 615, 166, 171, 175, 81, 0, 615, 615, 183,
481  75, 187, 59, 60, 615, 16, 615, 615, 615, 48,
482  194, 615, 198, 200, 223, 259, 206, 615, 210, 213,
483 
484  615, 202, 615, 217, 225, 229, 615, 236, 239, 8,
485  0, 245, 241, 250, 615, 254, 256, 615, 615, 0,
486  261, 264, 615, 268, 273, 287, 291, 297, 615, 299,
487  301, 304, 615, 306, 311, 615, 320, 615, 334, 336,
488  615, 338, 344, 340, 347, 615, 615, 363, 368, 370,
489  353, 379, 383, 386, 397, 213, 394, 399, 414, 615,
490  278, 408, 420, 434, 423, 439, 441, 451, 615, 455,
491  294, 457, 615, 325, 460, 462, 615, 615, 493, 498,
492  503, 508, 513, 518, 523, 528, 533, 538, 543, 547,
493  549, 554, 559, 564, 569, 574, 579, 584, 589, 594,
494 
495  599, 604, 609
496  } ;
497 
499  { 0,
500  179, 179, 180, 180, 181, 181, 182, 182, 183, 183,
501  184, 184, 185, 185, 186, 186, 187, 187, 188, 188,
502  189, 189, 178, 178, 178, 178, 178, 178, 178, 178,
503  178, 178, 178, 178, 178, 190, 178, 178, 178, 178,
504  178, 178, 178, 178, 178, 191, 178, 178, 178, 178,
505  178, 178, 192, 193, 178, 193, 193, 194, 178, 194,
506  194, 195, 178, 195, 195, 196, 196, 178, 196, 196,
507  197, 178, 197, 197, 178, 178, 32, 178, 178, 178,
508  178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
509  192, 178, 192, 198, 192, 192, 193, 178, 193, 193,
510 
511  178, 194, 178, 194, 194, 195, 178, 195, 195, 196,
512  196, 196, 199, 197, 178, 197, 197, 178, 178, 200,
513  192, 198, 178, 198, 201, 198, 192, 192, 178, 194,
514  195, 199, 178, 199, 199, 178, 201, 178, 201, 201,
515  178, 192, 192, 194, 195, 178, 178, 192, 192, 194,
516  195, 192, 192, 194, 195, 202, 192, 194, 195, 178,
517  202, 192, 194, 195, 192, 194, 195, 192, 178, 195,
518  203, 195, 178, 203, 195, 195, 178, 0, 178, 178,
519  178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
520  178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
521 
522  178, 178, 178
523  } ;
524 
526  { 0,
527  178, 27, 28, 111, 27, 88, 29, 111, 27, 27,
528  28, 111, 27, 113, 29, 51, 27, 52, 51, 178,
529  53, 55, 56, 51, 30, 52, 51, 89, 53, 55,
530  56, 178, 30, 32, 33, 34, 32, 59, 60, 90,
531  35, 61, 90, 57, 59, 60, 63, 64, 61, 90,
532  65, 57, 90, 63, 64, 120, 36, 65, 67, 68,
533  69, 67, 82, 70, 67, 68, 69, 67, 119, 70,
534  37, 32, 33, 34, 32, 72, 73, 77, 35, 72,
535  73, 75, 75, 75, 75, 98, 99, 111, 75, 103,
536  104, 111, 75, 75, 36, 75, 86, 74, 77, 75,
537 
538  82, 74, 75, 82, 76, 83, 178, 100, 37, 39,
539  40, 41, 42, 43, 24, 76, 44, 77, 78, 79,
540  77, 92, 93, 84, 80, 94, 103, 104, 24, 95,
541  178, 45, 46, 47, 98, 99, 101, 99, 107, 108,
542  81, 107, 108, 96, 115, 116, 48, 49, 39, 40,
543  41, 42, 43, 103, 104, 44, 100, 178, 100, 107,
544  108, 105, 112, 178, 111, 112, 117, 109, 115, 116,
545  45, 46, 47, 118, 116, 105, 75, 75, 178, 75,
546  178, 109, 178, 75, 82, 48, 49, 82, 82, 83,
547  117, 82, 178, 83, 178, 117, 92, 93, 178, 76,
548 
549  92, 93, 123, 124, 103, 104, 125, 84, 98, 99,
550  178, 84, 98, 99, 161, 101, 99, 161, 121, 103,
551  104, 178, 121, 178, 126, 92, 93, 103, 104, 178,
552  100, 107, 108, 178, 100, 178, 127, 100, 107, 108,
553  130, 107, 108, 133, 134, 128, 112, 121, 111, 112,
554  178, 127, 115, 116, 131, 130, 115, 116, 118, 116,
555  128, 129, 93, 129, 93, 135, 123, 124, 178, 131,
556  123, 124, 127, 178, 117, 138, 139, 178, 117, 161,
557  117, 128, 161, 121, 178, 121, 178, 127, 126, 141,
558  124, 178, 126, 92, 93, 174, 128, 140, 174, 92,
559 
560  93, 103, 104, 107, 108, 178, 133, 134, 133, 134,
561  142, 126, 143, 146, 134, 121, 178, 144, 178, 145,
562  178, 121, 138, 139, 178, 142, 174, 143, 135, 174,
563  135, 178, 144, 178, 145, 135, 138, 139, 147, 139,
564  92, 93, 103, 104, 140, 178, 92, 93, 178, 107,
565  108, 178, 148, 178, 150, 107, 108, 178, 140, 178,
566  140, 151, 121, 178, 149, 92, 93, 148, 121, 150,
567  92, 93, 103, 104, 178, 155, 151, 178, 152, 149,
568  153, 156, 93, 154, 178, 92, 93, 121, 103, 104,
569  155, 178, 121, 152, 157, 153, 92, 93, 154, 107,
570 
571  108, 103, 104, 121, 178, 158, 178, 121, 178, 157,
572  92, 93, 159, 163, 178, 162, 107, 108, 121, 178,
573  158, 178, 103, 104, 165, 92, 93, 159, 163, 178,
574  162, 178, 121, 178, 164, 166, 107, 108, 178, 165,
575  168, 169, 104, 107, 108, 178, 167, 121, 178, 164,
576  166, 178, 170, 171, 93, 168, 178, 107, 108, 107,
577  108, 167, 107, 108, 177, 108, 178, 170, 178, 178,
578  178, 178, 178, 175, 178, 121, 172, 176, 178, 178,
579  178, 178, 178, 178, 178, 178, 178, 178, 175, 178,
580  178, 172, 176, 24, 24, 24, 24, 24, 25, 25,
581 
582  25, 25, 25, 26, 26, 26, 26, 26, 31, 31,
583  31, 31, 31, 38, 38, 38, 38, 38, 50, 50,
584  50, 50, 50, 54, 54, 54, 54, 54, 58, 58,
585  58, 58, 58, 62, 62, 62, 62, 62, 66, 66,
586  66, 66, 66, 71, 71, 71, 71, 71, 85, 85,
587  87, 87, 178, 87, 91, 91, 91, 91, 91, 97,
588  97, 97, 97, 97, 102, 102, 102, 102, 102, 106,
589  106, 106, 106, 106, 110, 110, 178, 110, 110, 114,
590  114, 114, 114, 114, 122, 122, 122, 122, 122, 132,
591  132, 132, 132, 132, 136, 136, 178, 136, 136, 137,
592 
593  137, 137, 137, 137, 160, 160, 160, 178, 160, 173,
594  173, 173, 178, 173, 23, 178, 178, 178, 178, 178,
595  178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
596  178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
597  178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
598  178, 178, 178, 178, 178
599  } ;
600 
602  { 0,
603  0, 5, 5, 111, 5, 46, 5, 70, 5, 6,
604  6, 110, 6, 70, 6, 11, 6, 11, 11, 0,
605  11, 13, 13, 12, 5, 12, 12, 46, 12, 14,
606  14, 0, 6, 7, 7, 7, 7, 15, 15, 51,
607  7, 15, 51, 13, 16, 16, 17, 17, 16, 90,
608  17, 14, 90, 18, 18, 86, 7, 18, 19, 19,
609  19, 19, 84, 19, 20, 20, 20, 20, 83, 20,
610  7, 8, 8, 8, 8, 21, 21, 81, 8, 22,
611  22, 27, 27, 76, 27, 54, 54, 69, 27, 58,
612  58, 66, 28, 28, 8, 28, 37, 21, 36, 28,
613 
614  35, 22, 30, 35, 27, 35, 23, 54, 8, 9,
615  9, 9, 9, 9, 4, 28, 9, 32, 32, 32,
616  32, 53, 53, 35, 32, 53, 60, 60, 3, 53,
617  0, 9, 9, 9, 56, 56, 57, 57, 62, 62,
618  32, 64, 64, 53, 71, 71, 9, 9, 10, 10,
619  10, 10, 10, 61, 61, 10, 56, 0, 57, 65,
620  65, 61, 67, 0, 67, 67, 71, 65, 73, 73,
621  10, 10, 10, 74, 74, 61, 75, 75, 0, 75,
622  0, 65, 0, 75, 80, 10, 10, 80, 82, 80,
623  73, 82, 0, 82, 0, 74, 91, 91, 0, 75,
624 
625  93, 93, 94, 94, 102, 102, 94, 80, 97, 97,
626  0, 82, 99, 99, 156, 100, 100, 156, 91, 104,
627  104, 0, 93, 0, 94, 95, 95, 105, 105, 0,
628  97, 106, 106, 0, 99, 0, 95, 100, 108, 108,
629  105, 109, 109, 113, 113, 95, 112, 95, 112, 112,
630  0, 95, 114, 114, 109, 105, 116, 116, 117, 117,
631  95, 96, 96, 121, 121, 113, 122, 122, 0, 109,
632  124, 124, 96, 0, 114, 125, 125, 0, 116, 161,
633  117, 96, 161, 96, 0, 121, 0, 96, 122, 126,
634  126, 0, 124, 127, 127, 171, 96, 125, 171, 128,
635 
636  128, 130, 130, 131, 131, 0, 132, 132, 134, 134,
637  127, 126, 128, 135, 135, 127, 0, 130, 0, 131,
638  0, 128, 137, 137, 0, 127, 174, 128, 132, 174,
639  134, 0, 130, 0, 131, 135, 139, 139, 140, 140,
640  142, 142, 144, 144, 137, 0, 143, 143, 0, 145,
641  145, 0, 142, 0, 144, 151, 151, 0, 139, 0,
642  140, 145, 142, 0, 143, 148, 148, 142, 143, 144,
643  149, 149, 150, 150, 0, 151, 145, 0, 148, 143,
644  149, 152, 152, 150, 0, 153, 153, 148, 154, 154,
645  151, 0, 149, 148, 153, 149, 157, 157, 150, 155,
646 
647  155, 158, 158, 152, 0, 154, 0, 153, 0, 153,
648  162, 162, 155, 158, 0, 157, 159, 159, 157, 0,
649  154, 0, 163, 163, 162, 165, 165, 155, 158, 0,
650  157, 0, 162, 0, 159, 163, 164, 164, 0, 162,
651  165, 166, 166, 167, 167, 0, 164, 165, 0, 159,
652  163, 0, 167, 168, 168, 165, 0, 170, 170, 172,
653  172, 164, 175, 175, 176, 176, 0, 167, 0, 0,
654  0, 0, 0, 172, 0, 168, 170, 175, 0, 0,
655  0, 0, 0, 0, 0, 0, 0, 0, 172, 0,
656  0, 170, 175, 179, 179, 179, 179, 179, 180, 180,
657 
658  180, 180, 180, 181, 181, 181, 181, 181, 182, 182,
659  182, 182, 182, 183, 183, 183, 183, 183, 184, 184,
660  184, 184, 184, 185, 185, 185, 185, 185, 186, 186,
661  186, 186, 186, 187, 187, 187, 187, 187, 188, 188,
662  188, 188, 188, 189, 189, 189, 189, 189, 190, 190,
663  191, 191, 0, 191, 192, 192, 192, 192, 192, 193,
664  193, 193, 193, 193, 194, 194, 194, 194, 194, 195,
665  195, 195, 195, 195, 196, 196, 0, 196, 196, 197,
666  197, 197, 197, 197, 198, 198, 198, 198, 198, 199,
667  199, 199, 199, 199, 200, 200, 0, 200, 200, 201,
668 
669  201, 201, 201, 201, 202, 202, 202, 0, 202, 203,
670  203, 203, 0, 203, 178, 178, 178, 178, 178, 178,
671  178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
672  178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
673  178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
674  178, 178, 178, 178, 178
675  } ;
676 
677 /* Table of booleans, true if rule could match eol. */
679  { 0,
680 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1,
681  1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0,
682  0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, };
683 
684 static yy_state_type yy_last_accepting_state;
686 
687 extern int tclscannerYY_flex_debug;
688 int tclscannerYY_flex_debug = 0;
689 
690 /* The intent behind this definition is that it'll catch
691  * any uses of REJECT which flex missed.
692  */
693 #define REJECT reject_used_but_not_detected
694 static int yy_more_flag = 0;
695 static int yy_more_len = 0;
696 #define yymore() ((yy_more_flag) = 1)
697 #define YY_MORE_ADJ (yy_more_len)
698 #define YY_RESTORE_YY_MORE_OFFSET
700 #line 1 "tclscanner.l"
701 /*****************************************************************************
702  * Parser for Tcl subset
703  *
704  * Copyright (C) 2010 by Rene Zaumseil
705  * based on the work of Dimitri van Heesch.
706  *
707  * Permission to use, copy, modify, and distribute this software and its
708  * documentation under the terms of the GNU General Public License is hereby
709  * granted. No representations are made about the suitability of this software
710  * for any purpose. It is provided "as is" without express or implied warranty.
711  * See the GNU General Public License for more details.
712  *
713  * Documents produced by Doxygen are derivative works derived from the
714  * input used in their production; they are not affected by this license.
715  *
716  */
717 #line 19 "tclscanner.l"
718 #include <stdio.h>
719 #include <stdlib.h>
720 #include <assert.h>
721 #include <ctype.h>
722 
723 #include <qstring.h>
724 #include <qstringlist.h>
725 #include <qlist.h>
726 #include <qmap.h>
727 #include <qarray.h>
728 #include <qstack.h>
729 #include <qregexp.h>
730 #include <qfile.h>
731 #include <qdict.h>
732 
733 #include "entry.h"
734 #include "message.h"
735 #include "config.h"
736 #include "doxygen.h"
737 #include "util.h"
738 #include "defargs.h"
739 #include "language.h"
740 #include "commentscan.h"
741 #include "pre.h"
742 #include "tclscanner.h"
743 #include "outputlist.h"
744 #include "membername.h"
745 #include "searchindex.h"
746 #include "commentcnv.h"
747 #include "bufstr.h"
748 #include "portable.h"
749 #include "arguments.h"
750 #include "namespacedef.h"
751 #include "filedef.h"
752 
753 #define YY_NO_INPUT 1
754 #define YY_NO_UNISTD_H 1
755 
756 #define MAX_INCLUDE_DEPTH 10
757 
758 //! Application error.
759 #define tcl_err \
760  printf("Error %d %s() at line %d! ",__LINE__,tcl.file_name.data(),tclscannerYYlineno); \
761  yy_push_state(ERROR); \
762  yyless(0); \
763  printf
764 
765 //! Application warning.
766 #define tcl_war \
767  printf("Warning %d %s() at line %d: ",__LINE__,tcl.file_name.data(),tclscannerYYlineno); \
768  printf
769 
770 //! Application message.
771 #define tcl_inf \
772  if (0) printf("--- %.4d %d@%d: ",__LINE__,tclscannerYYlineno,yy_start_stack_ptr) && printf
773 
774 //! Debug message.
775 #define D\
776  if (0) printf("--- %.4d %d@%d: %s\n",__LINE__,tclscannerYYlineno,yy_start_stack_ptr,tclscannerYYtext);
777 
778 // BEGIN of copy from tclUtil.c
779 // - Tcl_Interp removed
780 // - changes are marked with RZ
781 // #define's to adapt the code:
782 #define CONST const
783 #define UCHAR (unsigned char)
784 #define TCL_ERROR 1
785 #define TCL_OK 0
786 #define ckalloc malloc
787 #define ckfree free
788 #define TclCopyAndCollapse(size,src,dest) memcpy(dest,src,size); *(dest+size)=0
790  CONST char *list, /* Points to the first byte of a string
791  * containing a Tcl list with zero or more
792  * elements (possibly in braces). */
793  int listLength, /* Number of bytes in the list's string. */
794  CONST char **elementPtr, /* Where to put address of first significant
795  * character in first element of list. */
796  CONST char **nextPtr, /* Fill in with location of character just
797  * after all white space following end of
798  * argument (next arg or end of list). */
799  int *sizePtr, /* If non-zero, fill in with size of
800  * element. */
801  int *bracePtr) /* If non-zero, fill in with non-zero/zero to
802  * indicate that arg was/wasn't in braces. */
803 {
804  CONST char *p = list;
805  CONST char *elemStart; /* Points to first byte of first element. */
806  CONST char *limit; /* Points just after list's last byte. */
807  int openBraces = 0; /* Brace nesting level during parse. */
808  int inQuotes = 0;
809  int size = 0; /* lint. */
810  //RZ int numChars;
811 
812  /*
813  * Skim off leading white space and check for an opening brace or quote.
814  * We treat embedded NULLs in the list as bytes belonging to a list
815  * element.
816  */
817 
818  limit = (list + listLength);
819  while ((p < limit) && (isspace(UCHAR(*p))))
820  { /* INTL: ISO space. */
821  p++;
822  }
823  if (p == limit)
824  { /* no element found */
825  elemStart = limit;
826  goto done;
827  }
828 
829  if (*p == '{') /* } to keep vi happy */
830  {
831  openBraces = 1;
832  p++;
833  }
834  else if (*p == '"')
835  {
836  inQuotes = 1;
837  p++;
838  }
839  elemStart = p;
840  if (bracePtr != 0)
841  {
842  *bracePtr = openBraces;
843  }
844 
845  /*
846  * Find element's end (a space, close brace, or the end of the string).
847  */
848 
849  while (p < limit)
850  {
851  switch (*p)
852  {
853  /*
854  * Open brace: don't treat specially unless the element is in
855  * braces. In this case, keep a nesting count.
856  */
857 
858  case '{':
859  if (openBraces != 0)
860  {
861  openBraces++;
862  }
863  break;
864 
865  /*
866  * Close brace: if element is in braces, keep nesting count and
867  * quit when the last close brace is seen.
868  */
869 
870  case '}':
871  if (openBraces > 1)
872  {
873  openBraces--;
874  }
875  else if (openBraces == 1)
876  {
877  size = (int)(p - elemStart);
878  p++;
879  if ((p >= limit) || isspace(UCHAR(*p)))
880  { /* INTL: ISO space. */
881  goto done;
882  }
883 
884  /*
885  * Garbage after the closing brace; return an error.
886  */
887 
888  return TCL_ERROR;
889  }
890  break;
891 
892  /*
893  * Backslash: skip over everything up to the end of the backslash
894  * sequence.
895  */
896 
897  case '\\':
898  //RZ Tcl_UtfBackslash(p, &numChars, NULL);
899  //RZ p += (numChars - 1);
900  p++; //RZ
901  break;
902 
903  /*
904  * Space: ignore if element is in braces or quotes; otherwise
905  * terminate element.
906  */
907 
908  case ' ':
909  case '\f':
910  case '\n':
911  case '\r':
912  case '\t':
913  case '\v':
914  if ((openBraces == 0) && !inQuotes)
915  {
916  size = (int)(p - elemStart);
917  goto done;
918  }
919  break;
920 
921  /*
922  * Double-quote: if element is in quotes then terminate it.
923  */
924 
925  case '"':
926  if (inQuotes)
927  {
928  size = (int)(p - elemStart);
929  p++;
930  if ((p >= limit) || isspace(UCHAR(*p)))
931  { /* INTL: ISO space */
932  goto done;
933  }
934 
935  /*
936  * Garbage after the closing quote; return an error.
937  */
938  return TCL_ERROR;
939  }
940  break;
941  }
942  p++;
943  }
944 
945  /*
946  * End of list: terminate element.
947  */
948 
949  if (p == limit)
950  {
951  if (openBraces != 0)
952  {
953  return TCL_ERROR;
954  }
955  else if (inQuotes)
956  {
957  return TCL_ERROR;
958  }
959  size = (int)(p - elemStart);
960  }
961 
962 done:
963  while ((p < limit) && (isspace(UCHAR(*p))))
964  { /* INTL: ISO space. */
965  p++;
966  }
967  *elementPtr = elemStart;
968  *nextPtr = p;
969  if (sizePtr != 0)
970  {
971  *sizePtr = size;
972  }
973  return TCL_OK;
974 }
975 
977  CONST char *list, /* Pointer to string with list structure. */
978  int *argcPtr, /* Pointer to location to fill in with the
979  * number of elements in the list. */
980  CONST char ***argvPtr) /* Pointer to place to store pointer to array
981  * of pointers to list elements. */
982 {
983  CONST char **argv, *l, *element;
984  char *p;
985  int length, size, i, result, elSize, brace;
986 
987  /*
988  * Figure out how much space to allocate. There must be enough space for
989  * both the array of pointers and also for a copy of the list. To estimate
990  * the number of pointers needed, count the number of space characters in
991  * the list.
992  */
993 
994  for (size = 2, l = list; *l != 0; l++)
995  {
996  if (isspace(UCHAR(*l)))
997  { /* INTL: ISO space. */
998  size++;
999 
1000  /*
1001  * Consecutive space can only count as a single list delimiter.
1002  */
1003 
1004  while (1)
1005  {
1006  char next = *(l + 1);
1007 
1008  if (next == '\0')
1009  {
1010  break;
1011  }
1012  ++l;
1013  if (isspace(UCHAR(next)))
1014  { /* INTL: ISO space. */
1015  continue;
1016  }
1017  break;
1018  }
1019  }
1020  }
1021  length = (int)(l - list);
1022  argv = (CONST char **) ckalloc((unsigned)
1023  ((size * sizeof(char *)) + length + 1));
1024  for (i = 0, p = ((char *) argv) + size*sizeof(char *);
1025  *list != 0; i++)
1026  {
1027  CONST char *prevList = list;
1028 
1029  result = TclFindElement(list, length, &element, &list,
1030  &elSize, &brace);
1031  length -= (int)(list - prevList);
1032  if (result != TCL_OK)
1033  {
1034  ckfree((char *) argv);
1035  return result;
1036  }
1037  if (*element == 0)
1038  {
1039  break;
1040  }
1041  if (i >= size)
1042  {
1043  ckfree((char *) argv);
1044  return TCL_ERROR;
1045  }
1046  argv[i] = p;
1047  if (brace)
1048  {
1049  memcpy(p, element, (size_t) elSize);
1050  p += elSize;
1051  *p = 0;
1052  p++;
1053  }
1054  else
1055  {
1056  TclCopyAndCollapse(elSize, element, p);
1057  p += elSize+1;
1058  }
1059  }
1060 
1061  argv[i] = NULL;
1062  *argvPtr = argv;
1063  *argcPtr = i;
1064  return TCL_OK;
1065 }
1066 // END of tclUtil.c
1067 
1069 {
1070  int argc;
1071  const char **argv;
1072 
1073  list.clear();
1074  if (str.left(1)=="{" && str.right(1)=="}")
1075  {
1076  str=str.mid(1,str.length()-2);
1077  }
1078  else if (str.left(1)=="\"" && str.right(1)=="\"")
1079  {
1080  str=str.mid(1,str.length()-2);
1081  }
1082  if (Tcl_SplitList(str.ascii(),&argc,&argv) != TCL_OK)
1083  {
1084  list.append(str);
1085  }
1086  else
1087  {
1088  for (int i = 0; i < argc; i++)
1089  {
1090  list.append(argv[i]);
1091  }
1092  ckfree((char *) argv);
1093  }
1094 }
1095 
1096 //! Structure containing information about current scan context.
1097 typedef struct
1098 {
1099  char type[2]; // type of scan context: "\"" "{" "[" "?" " "
1100  int line0; // start line of scan context
1101  int line1; // end line of scan context
1102  YY_BUFFER_STATE buffer_state; // value of scan context
1103  QCString ns; // current namespace
1104  Entry *entry_fn; // if set contains the current proc/method/constructor/destructor
1105  Entry *entry_cl; // if set contain the current class
1106  Entry *entry_scan; // current scan entry
1107  Protection protection; // current protections state
1108  QStringList after; // option/value list (options: NULL comment keyword script)
1109 } tcl_scan;
1110 
1111 //* Structure containing all internal global variables.
1112 static struct
1113 {
1114  CodeOutputInterface * code; // if set then we are codifying the file
1115  int code_line; // current line of code
1116  int code_linenumbers; // if true create line numbers in code
1117  const char *code_font; // used font to codify
1118  bool config_autobrief; // value of configuration option
1119  QMap<QString,QString> config_subst; // map of configuration option values
1120  QCString input_string; // file contents
1121  int input_position; // position in file
1122  QCString file_name; // name of used file
1124  int command; // true if command was found
1125  int comment; // set true if comment was scaned
1126  int brace_level; // bookkeeping of braces
1127  int bracket_level; // bookkeeping of brackets
1128  int bracket_quote; // bookkeeping of quotes (toggles)
1129  char word_is; // type of current word: "\"" "{" "[" "?" " "
1130  int line_comment; // line number of comment
1131  int line_commentline; // line number of comment after command
1132  int line_command; // line number of command
1133  int line_body0; // start line of body
1134  int line_body1; // end line of body
1135  QCString string_command; // contain current command
1136  QCString string_commentline; // contain current comment after command
1137  QCString string_commentcodify; // current comment string used in codifying
1138  QCString string_comment; // contain current comment
1139  QCString string_last; // contain last read word or part of word
1140  QCString string; // temporary string value
1141  Entry* entry_main; // top level entry
1142  Entry* entry_file; // entry of current file
1143  Entry* entry_current; // currently used entry
1144  Entry* entry_inside; // contain entry of current scan context
1145  QStringList list_commandwords; // list of command words
1146  QList<tcl_scan> scan; // stack of scan contexts
1147  QAsciiDict<Entry> ns; // all read namespace entries
1148  QAsciiDict<Entry> cl; // all read class entries
1149  QAsciiDict<Entry> fn; // all read function entries
1150  QList<Entry> entry; // list of all created entries, will be deleted after codifying
1151  Protection protection; // current protections state
1152  MemberDef *memberdef; // contain current MemberDef when codifying
1154 } tcl;
1155 
1156 // scanner functions
1157 static int yyread(char *buf,int max_size);
1158 static tcl_scan *tcl_scan_start(char type, QString content, QCString ns, Entry *entry_cls, Entry *entry_fn);
1159 static void tcl_scan_end();
1160 static void tcl_comment(int what,const char *text);
1161 static void tcl_word(int what,const char *text);
1162 static void tcl_command(int what,const char *text);
1163 
1164 // helper functions
1165 
1166 //! Create new entry.
1167 // @return new initialised entry
1169 {
1170  Entry *myEntry = new Entry;
1171  myEntry->section = Entry::EMPTY_SEC;
1172  myEntry->name = "";
1173 // myEntry->type = "";
1174  myEntry->brief = "";
1175 // myEntry->doc = "";
1176  myEntry->protection = Public;
1177 // myEntry->mtype = Method;
1178 // myEntry->virt = Normal;
1179 // myEntry->stat = FALSE;
1180  myEntry->fileName = tcl.file_name;
1181  myEntry->lang = SrcLangExt_Tcl;
1182  initGroupInfo(myEntry);
1183  // collect entries
1184  if (!tcl.code)
1185  {
1186  tcl.entry.insert(0,myEntry);
1187  }
1188  return myEntry;
1189 }
1190 
1191 //! Set protection level.
1193 {
1194  if (entry->protection!=Public&&entry->protection!=Protected&&entry->protection!=Private)
1195  {
1196  entry->protection = tcl.protection;
1197  }
1198  if (entry->protection!=Protected&&entry->protection!=Private)
1199  {
1200  entry->protection = Public;
1201  }
1202 }
1203 
1204 //! Check name.
1205 // @return 'ns' and 'name' of given current 'ns0' and 'name0'
1206 static void tcl_name(const QCString &ns0, const QCString &name0, QCString &ns, QCString &name)
1207 {
1208  QCString myNm;
1209  int myStart;
1210 
1211  if (qstrncmp(name0.data(),"::",2)==0)
1212  {
1213  myNm = name0.mid(2);
1214  }
1215  else if (ns0.length() && ns0 != " ")
1216  {
1217  myNm = ns0 + "::" + name0;
1218  }
1219  else
1220  {
1221  myNm = name0;
1222  }
1223  myStart = myNm.findRev("::");
1224  if (myStart == -1)
1225  {
1226  ns = "";
1227  name = myNm;
1228  }
1229  else
1230  {
1231  ns = myNm.mid(0,myStart);
1232  name = myNm.mid(myStart+2);
1233  }
1234 }
1235 
1236 //! Check name. Strip namespace qualifiers from name0 if inside inlined code segment.
1237 // @return 'ns' and 'name' of given current 'ns0' and 'name0'
1238 static void tcl_name_SnippetAware(const QCString &ns0, const QCString &name0, QCString &ns, QCString &name)
1239 {
1240  // If we are inside an inlined code snippet then ns0
1241  // already containes the complete namespace path.
1242  // Any namespace qualifiers in name0 are redundant.
1243  int i = name0.findRev("::");
1244  if (i>=0 && tcl.memberdef)
1245  {
1246  tcl_name(ns0, name0.mid(i+2), ns, name);
1247  }
1248  else
1249  {
1250  tcl_name(ns0, name0, ns, name);
1251  }
1252 }
1253 
1254 // Check and return namespace entry.
1255 // @return namespace entry
1257 {
1258  Entry *myEntry;
1259  if (ns.length())
1260  {
1261  myEntry = tcl.ns.find(ns);
1262  }
1263  else
1264  {
1265  myEntry = tcl.ns.find("::");
1266  }
1267  if (myEntry == NULL)
1268  {
1269  myEntry = tcl_entry_new();
1270  myEntry->section = Entry::NAMESPACE_SEC;
1271  myEntry->name = ns;
1272  tcl.entry_main->addSubEntry(myEntry);
1273  tcl.ns.insert(ns,myEntry);
1274  }
1275  return myEntry;
1276 }
1277 
1278 // Check and return class entry.
1279 // @return class entry
1281 {
1282  Entry *myEntry;
1283  if (!cl.length()) return(NULL);
1284 
1285  myEntry = tcl.cl.find(cl);
1286  if (myEntry == NULL)
1287  {
1288  myEntry = tcl_entry_new();
1289  myEntry->section = Entry::CLASS_SEC;
1290  myEntry->name = cl;
1291  tcl.entry_main->addSubEntry(myEntry);
1292  tcl.cl.insert(cl,myEntry);
1293  }
1294  return myEntry;
1295 }
1296 
1297 //! Check for keywords.
1298 // @return 1 if keyword and 0 otherwise
1300 {
1301  static QStringList myList;
1302  static int myInit=1;
1303  if (myInit)
1304  {
1305  // tcl keywords
1306  myList <<"append"<<"apply"<<"array"<<"auto_execok"<<"auto_import"<<"auto_load"<<"auto_mkindex"<<"auto_qualify"<<"auto_reset";
1307  myList <<"binary";
1308  myList <<"catch"<<"cd"<<"close"<<"clock"<<"concat";
1309  myList <<"eof"<<"eval"<<"exec"<<"exit"<<"expr";
1310  myList <<"fblocked"<<"fconfigure"<<"file"<<"fileevent"<<"flush"<<"for"<<"foreach"<<"format";
1311  myList <<"gets"<<"global";
1312  myList <<"http";
1313  myList <<"if"<<"incr"<<"info"<<"interp";
1314  myList <<"join";
1315  myList <<"lappend"<<"lassign"<<"lindex"<<"linsert"<<"llength"<<"load"<<"lrange"<<"lrepeat"<<"lreplace"<<"lreverse"<<"lset";
1316  myList <<"namespace";
1317  myList <<"package"<<"parray"<<"pid"<<"pkg_mkIndex"<<"proc"<<"puts"<<"pwd";
1318  myList <<"registry"<<"rename"<<"return";
1319  myList <<"scan"<<"set"<<"split"<<"string"<<"switch";
1320  myList <<"tclLog"<<"tcl_endOfWord"<<"tcl_findLibrary"<<"tcl_startOfNextWord"<<"tcl_startOfPreviousWord"<<"tcl_wordBreakAfter"<<"tcl_wordBreakBefore"<<"tell"<<"time";
1321  myList <<"unknown"<<"upvar";
1322  myList <<"variable"<<"vwait";
1323 // tk keywords
1324  myList <<"bell"<<"bind"<<"bindtags";
1325  myList <<"clipboard"<<"console"<<"consoleinterp";
1326  myList <<"destroy";
1327  myList <<"event";
1328  myList <<"focus";
1329  myList <<"grid";
1330  myList <<"lower";
1331  myList <<"option";
1332  myList <<"pack"<<"place";
1333  myList <<"raise";
1334  myList <<"send";
1335  myList <<"tkerror"<<"tkwait"<<"tk_bisque"<<"tk_focusNext"<<"tk_focusPrev"<<"tk_focusFollowsMouse"<<"tk_popup"<<"tk_setPalette"<<"tk_textCut"<<"tk_TextCopy"<<"tk_textPaste"<<"chooseColor"<<"tk_chooseColor"<<"tk_chooseDirectory"<<"tk_dialog"<<"tk_getOpenFile"<<"tkDialog"<<"tk_getSaveFile"<<"tk_messageBox";
1336  myList <<"winfo"<<"wm";
1337  myList <<"button"<<"canvas"<<"checkbutton"<<"entry"<<"frame"<<"image"<<"label"<<"labelframe"<<"listbox"<<"menu"<<"menubutton"<<"message"<<"panedwindow"<<"radiobutton"<<"scale"<<"scrollbar"<<"spinbox"<<"toplevel";
1338  myList.sort();
1339  myInit=0;
1340  }
1341  str=str.stripWhiteSpace();
1342  if (str.left(2)=="::") {str=str.mid(2);}
1343  if (myList.findIndex(str) != -1) return(1);
1344  return 0;
1345 }
1346 
1347 //! End codifying with special font class.
1348 static void tcl_font_end()
1349 {
1350  if (!tcl.code) return;
1351  if (tcl.code_font)
1352  {
1353  tcl.code->endFontClass();
1354  tcl.code_font=NULL;
1355  }
1356 }
1357 
1358 //! Codify 'str' with special font class 's'.
1359 static void tcl_codify(const char *s,const char *str)
1360 {
1361  if (!tcl.code || !str) return;
1362  if (s && qstrcmp(s,"NULL")!=0)
1363  {
1364  tcl_font_end();
1365  tcl.code->startFontClass(s);
1366  tcl.code_font=s;
1367  }
1368  char *tmp = (char *) malloc(strlen(str)+1);
1369  strcpy(tmp, str);
1370  char *p=tmp,*sp=p;
1371  char c;
1372  bool done=FALSE;
1373  while (!done)
1374  {
1375  sp=p;
1376  while ((c=*p++) && c!='\n') {}
1377  if (c=='\n')
1378  {
1379  tcl.code_line++;
1380  *(p-1)='\0'; // Dimitri: is this really needed?
1381  // wtschueller: As far as I can see: yes.
1382  // Deletes that \n that would produce ugly source listings otherwise.
1383  // However, there may exist more sophisticated solutions.
1384  tcl.code->codify(sp);
1385  if (tcl.code_font)
1386  {
1387  tcl.code->endFontClass();
1388  }
1389  tcl.code->endCodeLine();
1390  tcl.code->startCodeLine(tcl.code_linenumbers);
1391  if (tcl.code_linenumbers)
1392  {
1393  tcl.code->writeLineNumber(0,0,0,tcl.code_line);
1394  }
1395  if (tcl.code_font)
1396  {
1397  tcl.code->startFontClass(tcl.code_font);
1398  }
1399  }
1400  else
1401  {
1402  tcl.code->codify(sp);
1403  done=TRUE;
1404  }
1405  }
1406  free(tmp);
1407  tcl_font_end();
1408 }
1409 
1410 #if 0
1411 //! Codify 'str' with special font class 's'.
1412 static void tcl_codify(const char *s,const char *str)
1413 {
1414  if (tcl.code==NULL) return;
1415  char *tmp= (char *) malloc(strlen(str)+1);
1416  strcpy(tmp, str);
1417  tcl_codify(s,tmp);
1418  free(tmp);
1419 }
1420 
1421 //! Codify 'str' with special font class 's'.
1422 static void tcl_codify(const char *s,const QString &str)
1423 {
1424  if (tcl.code==NULL) return;
1425  tcl_codify(s,str.utf8());
1426 }
1427 
1428 //! Codify 'str' with special font class 's'.
1429 static void tcl_codify(const char *s,const QCString &str)
1430 {
1431  if (!tcl.code) return;
1432  tcl_codify(s,str.data());
1433 }
1434 #endif
1435 
1436 static void tcl_codify_cmd(const char *s,int i)
1437 {
1438  tcl_codify(s,(*tcl.list_commandwords.at(i)).utf8());
1439 }
1440 //! codify a string token
1441 //
1442 // codifies string according to type.
1443 // Starts a new scan context if needed (*myScan==0 and type == "script").
1444 // Returns NULL or the created scan context.
1445 //
1446 static tcl_scan *tcl_codify_token(tcl_scan *myScan, const QCString type, const QCString string)
1447 {
1448  if (myScan != NULL)
1449  {
1450  if (type != NULL)
1451  {
1452  myScan->after << type << string;
1453  }
1454  else
1455  {
1456  myScan->after << "NULL" << string;
1457  }
1458  }
1459  else
1460  {
1461  if (qstrcmp(type, "script") == 0)
1462  {
1463  myScan = tcl.scan.at(0);
1464  myScan = tcl_scan_start('?', string,
1465  myScan->ns, myScan->entry_cl, myScan->entry_fn);
1466  }
1467  else
1468  {
1469  tcl_codify((const char*)type, string);
1470  }
1471  }
1472  return myScan;
1473 }
1474 
1475 //-----------------------------------------------------------------------------
1476 #undef YY_INPUT
1477 #define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
1478 //-----------------------------------------------------------------------------
1479 
1480 
1481 
1482 
1483 
1484 
1485 
1486 
1487 
1488 
1489 #line 1490 "/nova/app/home/novasoft/doxygen/doxygen-1.8.11/build/generated_src/tclscanner.cpp"
1490 
1491 #define INITIAL 0
1492 #define ERROR 1
1493 #define TOP 2
1494 #define COMMAND 3
1495 #define WORD 4
1496 #define COMMENT 5
1497 #define COMMENT_NL 6
1498 #define COMMENT_CODE 7
1499 #define COMMENT_VERB 8
1500 #define COMMENTLINE 9
1501 #define COMMENTLINE_NL 10
1502 
1503 #ifndef YY_NO_UNISTD_H
1504 /* Special case for "unistd.h", since it is non-ANSI. We include it way
1505  * down here because we want the user's section 1 to have been scanned first.
1506  * The user has a chance to override it with an option.
1507  */
1508 #include <unistd.h>
1509 #endif
1510 
1511 #ifndef YY_EXTRA_TYPE
1512 #define YY_EXTRA_TYPE void *
1513 #endif
1514 
1515 static int yy_init_globals (void );
1516 
1517 /* Accessor methods to globals.
1518  These are made visible to non-reentrant scanners for convenience. */
1519 
1520 int tclscannerYYlex_destroy (void );
1521 
1522 int tclscannerYYget_debug (void );
1523 
1524 void tclscannerYYset_debug (int debug_flag );
1525 
1527 
1528 void tclscannerYYset_extra (YY_EXTRA_TYPE user_defined );
1529 
1530 FILE *tclscannerYYget_in (void );
1531 
1532 void tclscannerYYset_in (FILE * in_str );
1533 
1534 FILE *tclscannerYYget_out (void );
1535 
1536 void tclscannerYYset_out (FILE * out_str );
1537 
1538 int tclscannerYYget_leng (void );
1539 
1540 char *tclscannerYYget_text (void );
1541 
1542 int tclscannerYYget_lineno (void );
1543 
1544 void tclscannerYYset_lineno (int line_number );
1545 
1546 /* Macros after this point can all be overridden by user definitions in
1547  * section 1.
1548  */
1549 
1550 #ifndef YY_SKIP_YYWRAP
1551 #ifdef __cplusplus
1552 extern "C" int tclscannerYYwrap (void );
1553 #else
1554 extern int tclscannerYYwrap (void );
1555 #endif
1556 #endif
1557 
1558  static void yyunput (int c,char *buf_ptr );
1559 
1560 #ifndef yytext_ptr
1561 static void yy_flex_strncpy (char *,yyconst char *,int );
1562 #endif
1563 
1564 #ifdef YY_NEED_STRLEN
1565 static int yy_flex_strlen (yyconst char * );
1566 #endif
1567 
1568 #ifndef YY_NO_INPUT
1569 
1570 #ifdef __cplusplus
1571 static int yyinput (void );
1572 #else
1573 static int input (void );
1574 #endif
1575 
1576 #endif
1577 
1578  static int yy_start_stack_ptr = 0;
1579  static int yy_start_stack_depth = 0;
1580  static int *yy_start_stack = NULL;
1581 
1582  static void yy_push_state (int new_state );
1583 
1584  static void yy_pop_state (void );
1585 
1586  static int yy_top_state (void );
1587 
1588 /* Amount of stuff to slurp up with each read. */
1589 #ifndef YY_READ_BUF_SIZE
1590 #define YY_READ_BUF_SIZE 8192
1591 #endif
1592 
1593 /* Copy whatever the last rule matched to the standard output. */
1594 #ifndef ECHO
1595 /* This used to be an fputs(), but since the string might contain NUL's,
1596  * we now use fwrite().
1597  */
1598 #define ECHO do { if (fwrite( tclscannerYYtext, tclscannerYYleng, 1, tclscannerYYout )) {} } while (0)
1599 #endif
1600 
1601 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1602  * is returned in "result".
1603  */
1604 #ifndef YY_INPUT
1605 #define YY_INPUT(buf,result,max_size) \
1606  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1607  { \
1608  int c = '*'; \
1609  unsigned n; \
1610  for ( n = 0; n < max_size && \
1611  (c = getc( tclscannerYYin )) != EOF && c != '\n'; ++n ) \
1612  buf[n] = (char) c; \
1613  if ( c == '\n' ) \
1614  buf[n++] = (char) c; \
1615  if ( c == EOF && ferror( tclscannerYYin ) ) \
1616  YY_FATAL_ERROR( "input in flex scanner failed" ); \
1617  result = n; \
1618  } \
1619  else \
1620  { \
1621  errno=0; \
1622  while ( (result = fread(buf, 1, max_size, tclscannerYYin))==0 && ferror(tclscannerYYin)) \
1623  { \
1624  if( errno != EINTR) \
1625  { \
1626  YY_FATAL_ERROR( "input in flex scanner failed" ); \
1627  break; \
1628  } \
1629  errno=0; \
1630  clearerr(tclscannerYYin); \
1631  } \
1632  }\
1633 \
1634 
1635 #endif
1636 
1637 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1638  * we don't want an extra ';' after the "return" because that will cause
1639  * some compilers to complain about unreachable statements.
1640  */
1641 #ifndef yyterminate
1642 #define yyterminate() return YY_NULL
1643 #endif
1644 
1645 /* Number of entries by which start-condition stack grows. */
1646 #ifndef YY_START_STACK_INCR
1647 #define YY_START_STACK_INCR 25
1648 #endif
1649 
1650 /* Report a fatal error. */
1651 #ifndef YY_FATAL_ERROR
1652 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1653 #endif
1654 
1655 /* end tables serialization structures and prototypes */
1656 
1657 /* Default declaration of generated scanner - a define so the user can
1658  * easily add parameters.
1659  */
1660 #ifndef YY_DECL
1661 #define YY_DECL_IS_OURS 1
1662 
1663 extern int tclscannerYYlex (void);
1664 
1665 #define YY_DECL int tclscannerYYlex (void)
1666 #endif /* !YY_DECL */
1667 
1668 /* Code executed at the beginning of each rule, after tclscannerYYtext and tclscannerYYleng
1669  * have been set up.
1670  */
1671 #ifndef YY_USER_ACTION
1672 #define YY_USER_ACTION
1673 #endif
1674 
1675 /* Code executed at the end of each rule. */
1676 #ifndef YY_BREAK
1677 #define YY_BREAK break;
1678 #endif
1679 
1680 #define YY_RULE_SETUP \
1681  YY_USER_ACTION
1682 
1683 /** The main scanner function which does all the work.
1684  */
1685 YY_DECL
1687  register yy_state_type yy_current_state;
1688  register char *yy_cp, *yy_bp;
1689  register int yy_act;
1690 
1691 #line 797 "tclscanner.l"
1692 
1693 #line 1694 "/nova/app/home/novasoft/doxygen/doxygen-1.8.11/build/generated_src/tclscanner.cpp"
1694 
1695  if ( !(yy_init) )
1696  {
1697  (yy_init) = 1;
1698 
1699 #ifdef YY_USER_INIT
1700  YY_USER_INIT;
1701 #endif
1702 
1703  if ( ! (yy_start) )
1704  (yy_start) = 1; /* first start state */
1705 
1706  if ( ! tclscannerYYin )
1707  tclscannerYYin = stdin;
1708 
1709  if ( ! tclscannerYYout )
1711 
1712  if ( ! YY_CURRENT_BUFFER ) {
1716  }
1717 
1719  }
1720 
1721  while ( 1 ) /* loops until end-of-file is reached */
1722  {
1723  (yy_more_len) = 0;
1724  if ( (yy_more_flag) )
1725  {
1726  (yy_more_len) = (yy_c_buf_p) - (yytext_ptr);
1727  (yy_more_flag) = 0;
1728  }
1729  yy_cp = (yy_c_buf_p);
1730 
1731  /* Support of tclscannerYYtext. */
1732  *yy_cp = (yy_hold_char);
1733 
1734  /* yy_bp points to the position in yy_ch_buf of the start of
1735  * the current run.
1736  */
1737  yy_bp = yy_cp;
1738 
1739  yy_current_state = (yy_start);
1740 yy_match:
1741  do
1742  {
1743  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1744  if ( yy_accept[yy_current_state] )
1745  {
1746  (yy_last_accepting_state) = yy_current_state;
1747  (yy_last_accepting_cpos) = yy_cp;
1748  }
1749  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1750  {
1751  yy_current_state = (int) yy_def[yy_current_state];
1752  if ( yy_current_state >= 179 )
1753  yy_c = yy_meta[(unsigned int) yy_c];
1754  }
1755  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1756  ++yy_cp;
1757  }
1758  while ( yy_current_state != 178 );
1759  yy_cp = (yy_last_accepting_cpos);
1760  yy_current_state = (yy_last_accepting_state);
1761 
1762 yy_find_action:
1763  yy_act = yy_accept[yy_current_state];
1764 
1766 
1767  if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
1768  {
1769  int yyl;
1770  for ( yyl = (yy_more_len); yyl < tclscannerYYleng; ++yyl )
1771  if ( tclscannerYYtext[yyl] == '\n' )
1772 
1773  tclscannerYYlineno++;
1774 ;
1775  }
1776 
1777 do_action: /* This label is used only to access EOF actions. */
1778 
1779  switch ( yy_act )
1780  { /* beginning of action switch */
1781  case 0: /* must back up */
1782  /* undo the effects of YY_DO_BEFORE_ACTION */
1783  *yy_cp = (yy_hold_char);
1784  yy_cp = (yy_last_accepting_cpos);
1785  yy_current_state = (yy_last_accepting_state);
1786  goto yy_find_action;
1787 
1788 case 1:
1790 #line 798 "tclscanner.l"
1791 {
1792 D
1793  yyterminate();
1794 }
1795  YY_BREAK
1796 case YY_STATE_EOF(INITIAL):
1797 case YY_STATE_EOF(ERROR):
1798 case YY_STATE_EOF(TOP):
1799 case YY_STATE_EOF(COMMAND):
1800 case YY_STATE_EOF(WORD):
1801 case YY_STATE_EOF(COMMENT):
1802 case YY_STATE_EOF(COMMENT_NL):
1807 #line 802 "tclscanner.l"
1808 {
1809 D
1810  if (tcl.scan.count()<1)
1811  {// error
1812 D
1813  tcl_err("Tcl parser stack empty! Parser error in file '%s'.\n",tcl.file_name.data());
1814  yyterminate();
1815  }
1816  else if (tcl.scan.count()==1)
1817  {// exit, check on input?
1818 D
1819  yyterminate();
1820  }
1821  else
1822  {// continue
1823 D
1824  tcl_command(-1,"");
1825  tcl_scan_end();
1826  }
1827 }
1828  YY_BREAK
1829 case 2:
1831 #line 822 "tclscanner.l"
1832 {
1833 D
1834  yyless(0);
1835  tcl.line_comment=tclscannerYYlineno;
1836  tcl_comment(0,"");
1837 }
1838  YY_BREAK
1839 case 3:
1840 /* rule 3 can match eol */
1842 #line 828 "tclscanner.l"
1843 {
1844 D
1845  tcl_codify(NULL,tclscannerYYtext);
1846 }
1847  YY_BREAK
1848 case 4:
1850 #line 832 "tclscanner.l"
1851 {
1852 D
1853  yyless(0);
1854  tcl.line_command=tclscannerYYlineno;
1855  tcl_command(0,"");
1856 }
1857  YY_BREAK
1858 case 5:
1860 #line 839 "tclscanner.l"
1861 {
1862 D
1863  tcl_codify("comment",tclscannerYYtext);
1864 }
1865  YY_BREAK
1866 case 6:
1867 /* rule 6 can match eol */
1869 #line 843 "tclscanner.l"
1870 {
1871 D
1872  tcl_codify("comment",tclscannerYYtext);
1873  tcl_comment(2,tclscannerYYtext+1);
1874 }
1875  YY_BREAK
1876 case 7:
1877 /* rule 7 can match eol */
1879 #line 848 "tclscanner.l"
1880 {
1881 D
1882  tcl_codify("comment",tclscannerYYtext);
1884  t = t.mid(2,t.length()-3);
1885  t.append("\n");
1886  tcl_comment(1,t.data());
1888 }
1889  YY_BREAK
1890 case 8:
1891 /* rule 8 can match eol */
1893 #line 857 "tclscanner.l"
1894 {
1895 D
1896  tcl_codify("comment",tclscannerYYtext);
1897  tcl_comment(1,tclscannerYYtext+2);
1898 }
1899  YY_BREAK
1900 case 9:
1901 /* rule 9 can match eol */
1903 #line 862 "tclscanner.l"
1904 {
1905 D
1907  tcl_codify("comment",t.left(7));
1908  tcl_comment(2,"\n@code\n");
1909  yyless(7);
1911 }
1912  YY_BREAK
1913 case 10:
1914 /* rule 10 can match eol */
1916 #line 870 "tclscanner.l"
1917 {
1918 D
1920  tcl_codify("comment",t.left(11));
1921  tcl_comment(2,"\n@verbatim\n");
1922  yyless(11);
1924 }
1925  YY_BREAK
1926 case 11:
1927 /* rule 11 can match eol */
1929 #line 878 "tclscanner.l"
1930 {
1931 D
1932  tcl_codify("comment",tclscannerYYtext);
1934  t = t.mid(1,t.length()-3);
1935  t.append("\n");
1936  tcl_comment(2,t.data());
1938 }
1939  YY_BREAK
1940 case 12:
1941 /* rule 12 can match eol */
1943 #line 887 "tclscanner.l"
1944 {
1945 D
1946  tcl_codify("comment",tclscannerYYtext);
1947  tcl_comment(2,tclscannerYYtext+1);
1948 }
1949  YY_BREAK
1950 case 13:
1952 #line 892 "tclscanner.l"
1953 {
1954 D
1956  t = t.mid(0,t.length()-1);
1957  tcl_codify("comment",t.data());
1958  t = t.mid(1,t.length());
1959  tcl_comment(-2,t.data());
1960  unput(0x1A);
1961 }
1962  YY_BREAK
1963 case 14:
1965 #line 901 "tclscanner.l"
1966 {
1967 D
1968  tcl_comment(-2,"");
1969  unput(0x1A);
1970 }
1971  YY_BREAK
1972 case 15:
1973 /* rule 15 can match eol */
1975 #line 906 "tclscanner.l"
1976 {
1977 D
1978  tcl_comment(-2,tclscannerYYtext);
1979  yyless(0);
1980 }
1981  YY_BREAK
1982 case 16:
1983 /* rule 16 can match eol */
1985 #line 912 "tclscanner.l"
1986 {
1987 D
1989  t = t.left(t.length()-10);
1990  tcl_comment(2,t.data());
1991  tcl_comment(2,"\n@endcode\n");
1992  yy_pop_state();
1993  yyless(0);
1994 }
1995  YY_BREAK
1996 case 17:
1997 /* rule 17 can match eol */
1999 #line 921 "tclscanner.l"
2000 {
2001 D
2002  yymore();
2003 }
2004  YY_BREAK
2005 case 18:
2007 #line 925 "tclscanner.l"
2008 {
2009 D
2010  yy_pop_state();
2011  yyless(0);
2012 }
2013  YY_BREAK
2014 case 19:
2015 /* rule 19 can match eol */
2017 #line 931 "tclscanner.l"
2018 {
2019 D
2021  t = t.left(t.length()-14);
2022  tcl_comment(2,t.data());
2023  tcl_comment(2,"\n@endverbatim\n");
2024  yy_pop_state();
2025  yyless(0);
2026 }
2027  YY_BREAK
2028 case 20:
2029 /* rule 20 can match eol */
2031 #line 940 "tclscanner.l"
2032 {
2033 D
2034  yymore();
2035 }
2036  YY_BREAK
2037 case 21:
2039 #line 944 "tclscanner.l"
2040 {
2041 D
2042  yy_pop_state();
2043  yyless(0);
2044 }
2045  YY_BREAK
2046 case 22:
2047 /* rule 22 can match eol */
2049 #line 950 "tclscanner.l"
2050 {
2051 D
2052  tcl_codify("comment",tclscannerYYtext);
2053  tcl_comment(2,tclscannerYYtext);
2054 }
2055  YY_BREAK
2056 case 23:
2057 /* rule 23 can match eol */
2059 #line 955 "tclscanner.l"
2060 {
2061 D
2062  tcl_codify("comment",tclscannerYYtext);
2063  tcl_comment(2,tclscannerYYtext);
2064  yy_pop_state();
2065 }
2066  YY_BREAK
2067 case 24:
2069 #line 961 "tclscanner.l"
2070 {
2071 D
2072  yy_pop_state();
2073  yyless(0);
2074 }
2075  YY_BREAK
2076 case 25:
2078 #line 967 "tclscanner.l"
2079 {
2080 D
2081  yy_pop_state();
2082  yyless(0);
2083 }
2084  YY_BREAK
2085 case 26:
2087 #line 972 "tclscanner.l"
2088 {
2089 D
2090  tcl.string_commentcodify += tclscannerYYtext;
2091 }
2092  YY_BREAK
2093 case 27:
2094 /* rule 27 can match eol */
2096 #line 976 "tclscanner.l"
2097 {
2098 D
2099  tcl.string_commentcodify += tclscannerYYtext;
2101  t = t.mid(2,t.length()-4);
2102  t.append("\n");
2103  tcl.string_commentline += t;
2105 }
2106  YY_BREAK
2107 case 28:
2108 /* rule 28 can match eol */
2110 #line 985 "tclscanner.l"
2111 {
2112 D
2113  tcl.string_commentcodify += tclscannerYYtext;
2114  tcl.string_commentline += (tclscannerYYtext+2);
2115 }
2116  YY_BREAK
2117 case 29:
2118 /* rule 29 can match eol */
2120 #line 990 "tclscanner.l"
2121 {
2122 D
2123  yy_pop_state();
2124  if (tcl.string_commentline.length())
2125  {
2126  tcl.entry_current->brief = tcl.string_commentline;
2127  tcl.entry_current->briefLine = tcl.line_commentline;
2128  tcl.entry_current->briefFile = tcl.file_name;
2129  }
2130  yyless(0);
2131  tcl_command(-1,tcl.string_commentcodify.data());
2132  tcl.string_commentline="";
2133  tcl.string_commentcodify="";
2134 }
2135  YY_BREAK
2136 case 30:
2137 /* rule 30 can match eol */
2139 #line 1005 "tclscanner.l"
2140 {
2141 D
2142  tcl.string_commentcodify += tclscannerYYtext;
2144  t = t.left(t.length()-3);
2145  t.append("\n");
2146  tcl.string_commentline += t;
2147 }
2148  YY_BREAK
2149 case 31:
2150 /* rule 31 can match eol */
2152 #line 1013 "tclscanner.l"
2153 {
2154 D
2155  tcl.string_commentcodify += tclscannerYYtext;
2156  tcl.string_commentline += tclscannerYYtext;
2157  yy_pop_state();
2158 }
2159  YY_BREAK
2160 case 32:
2162 #line 1019 "tclscanner.l"
2163 {
2164 D
2166  t = t.left(t.length()-1);
2167  tcl.string_commentcodify += t;
2168  tcl.string_commentline += t;
2169  yy_pop_state();
2170  unput(0x1A);
2171 }
2172  YY_BREAK
2173 case 33:
2174 /* rule 33 can match eol */
2176 #line 1029 "tclscanner.l"
2177 {
2178 D
2179  tcl.string_commentcodify = tclscannerYYtext;
2180  tcl.string_commentcodify = tcl.string_commentcodify.left(tcl.string_commentcodify.length()-2);
2181  tcl.string_commentline = "";
2182  tcl.line_commentline = tclscannerYYlineno;
2183  tcl.line_body1=tclscannerYYlineno;
2184  unput('<');
2185  unput('#');
2187 }
2188  YY_BREAK
2189 case 34:
2190 /* rule 34 can match eol */
2192 #line 1040 "tclscanner.l"
2193 {
2194 D
2195  tcl.string_commentcodify = "";
2196  tcl.string_commentline = "";
2197  tcl.line_body1=tclscannerYYlineno;
2198  tcl_command(-1,"");
2199 }
2200  YY_BREAK
2201 case 35:
2202 /* rule 35 can match eol */
2204 #line 1047 "tclscanner.l"
2205 {
2206 D
2207  tcl.string_commentcodify = "";
2208  tcl.string_commentline = "";
2209  tcl.line_body1=tclscannerYYlineno;
2210  tcl_command(-1,tclscannerYYtext);
2211 }
2212  YY_BREAK
2213 case 36:
2214 /* rule 36 can match eol */
2216 #line 1054 "tclscanner.l"
2217 {
2218 D
2219  tcl.string_commentcodify = "";
2220  tcl.string_commentline = "";
2221  tcl.line_body1=tclscannerYYlineno-1;
2222  tcl_command(-1,tclscannerYYtext);
2223 }
2224  YY_BREAK
2225 case 37:
2226 /* rule 37 can match eol */
2228 #line 1061 "tclscanner.l"
2229 {
2230 D
2231  tcl_command(1,tclscannerYYtext);
2232 }
2233  YY_BREAK
2234 case 38:
2236 #line 1065 "tclscanner.l"
2237 {
2238 D
2239  tcl.word_is = ' ';
2240  tcl.string_last = "{*}";
2241  tcl_word(0,&tclscannerYYtext[3]);
2242 }
2243  YY_BREAK
2244 case 39:
2246 #line 1071 "tclscanner.l"
2247 {
2248 D
2249  tcl.word_is=' ';
2250  tcl.string_last = "";
2251  tcl_word(0,tclscannerYYtext);
2252 }
2253  YY_BREAK
2254 case 40:
2256 #line 1077 "tclscanner.l"
2257 {
2258 D
2259  tcl.word_is=' ';
2260  if (tclscannerYYtext[0]=='{'||tclscannerYYtext[0]=='['||tclscannerYYtext[0]=='"') tcl.word_is = tclscannerYYtext[0];
2261  tcl.string_last = "";
2262  tcl_word(0,tclscannerYYtext);
2263 }
2264  YY_BREAK
2265 case 41:
2266 #line 1086 "tclscanner.l"
2267 case 42:
2269 #line 1086 "tclscanner.l"
2270 {
2271  tcl_word(1,tclscannerYYtext);
2272 }
2273  YY_BREAK
2274 case 43:
2275 /* rule 43 can match eol */
2277 #line 1089 "tclscanner.l"
2278 {
2279  tcl_word(2,tclscannerYYtext);
2280 }
2281  YY_BREAK
2282 case 44:
2284 #line 1092 "tclscanner.l"
2285 {
2286  tcl_word(3,tclscannerYYtext);
2287 }
2288  YY_BREAK
2289 case 45:
2291 #line 1095 "tclscanner.l"
2292 {
2293  tcl_word(4,tclscannerYYtext);
2294 }
2295  YY_BREAK
2296 case 46:
2298 #line 1098 "tclscanner.l"
2299 {
2300  tcl_word(5,tclscannerYYtext);
2301 }
2302  YY_BREAK
2303 case 47:
2305 #line 1101 "tclscanner.l"
2306 {
2307  tcl_word(6,tclscannerYYtext);
2308 }
2309  YY_BREAK
2310 case 48:
2312 #line 1104 "tclscanner.l"
2313 {
2314  tcl_word(7,tclscannerYYtext);
2315 }
2316  YY_BREAK
2317 case 49:
2319 #line 1107 "tclscanner.l"
2320 {
2321  tcl_word(8,tclscannerYYtext);
2322 }
2323  YY_BREAK
2324 case 50:
2326 #line 1110 "tclscanner.l"
2327 {
2328  tcl_word(9,tclscannerYYtext);
2329 }
2330  YY_BREAK
2331 case 51:
2333 #line 1113 "tclscanner.l"
2334 {
2335  tcl_word(10,tclscannerYYtext);
2336 }
2337  YY_BREAK
2338 case 52:
2339 /* rule 52 can match eol */
2341 #line 1116 "tclscanner.l"
2342 {
2343  tcl_word(11,tclscannerYYtext);
2344 }
2345  YY_BREAK
2346 case 53:
2348 #line 1119 "tclscanner.l"
2349 {
2350  tcl_word(12,tclscannerYYtext);
2351 }
2352  YY_BREAK
2353 case 54:
2355 #line 1122 "tclscanner.l"
2356 {
2357  tcl_word(1,tclscannerYYtext);
2358 }
2359  YY_BREAK
2360 case 55:
2362 #line 1125 "tclscanner.l"
2363 ECHO;
2364  YY_BREAK
2365 #line 2366 "/nova/app/home/novasoft/doxygen/doxygen-1.8.11/build/generated_src/tclscanner.cpp"
2366 
2367  case YY_END_OF_BUFFER:
2368  {
2369  /* Amount of text matched not including the EOB char. */
2370  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
2371 
2372  /* Undo the effects of YY_DO_BEFORE_ACTION. */
2373  *yy_cp = (yy_hold_char);
2375 
2376  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2377  {
2378  /* We're scanning a new file or input source. It's
2379  * possible that this happened because the user
2380  * just pointed tclscannerYYin at a new source and called
2381  * tclscannerYYlex(). If so, then we have to assure
2382  * consistency between YY_CURRENT_BUFFER and our
2383  * globals. Here is the right place to do so, because
2384  * this is the first action (other than possibly a
2385  * back-up) that will match for the new input source.
2386  */
2387  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2388  YY_CURRENT_BUFFER_LVALUE->yy_input_file = tclscannerYYin;
2389  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2390  }
2391 
2392  /* Note that here we test for yy_c_buf_p "<=" to the position
2393  * of the first EOB in the buffer, since yy_c_buf_p will
2394  * already have been incremented past the NUL character
2395  * (since all states make transitions on EOB to the
2396  * end-of-buffer state). Contrast this with the test
2397  * in input().
2398  */
2399  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2400  { /* This was really a NUL. */
2401  yy_state_type yy_next_state;
2402 
2403  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
2404 
2405  yy_current_state = yy_get_previous_state( );
2406 
2407  /* Okay, we're now positioned to make the NUL
2408  * transition. We couldn't have
2409  * yy_get_previous_state() go ahead and do it
2410  * for us because it doesn't know how to deal
2411  * with the possibility of jamming (and we don't
2412  * want to build jamming into it because then it
2413  * will run more slowly).
2414  */
2415 
2416  yy_next_state = yy_try_NUL_trans( yy_current_state );
2417 
2418  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2419 
2420  if ( yy_next_state )
2421  {
2422  /* Consume the NUL. */
2423  yy_cp = ++(yy_c_buf_p);
2424  yy_current_state = yy_next_state;
2425  goto yy_match;
2426  }
2427 
2428  else
2429  {
2430  yy_cp = (yy_last_accepting_cpos);
2431  yy_current_state = (yy_last_accepting_state);
2432  goto yy_find_action;
2433  }
2434  }
2435 
2436  else switch ( yy_get_next_buffer( ) )
2437  {
2438  case EOB_ACT_END_OF_FILE:
2439  {
2441 
2442  if ( tclscannerYYwrap( ) )
2443  {
2444  /* Note: because we've taken care in
2445  * yy_get_next_buffer() to have set up
2446  * tclscannerYYtext, we can now set up
2447  * yy_c_buf_p so that if some total
2448  * hoser (like flex itself) wants to
2449  * call the scanner after we return the
2450  * YY_NULL, it'll still work - another
2451  * YY_NULL will get returned.
2452  */
2454 
2455  yy_act = YY_STATE_EOF(YY_START);
2456  goto do_action;
2457  }
2458 
2459  else
2460  {
2461  if ( ! (yy_did_buffer_switch_on_eof) )
2462  YY_NEW_FILE;
2463  }
2464  break;
2465  }
2466 
2467  case EOB_ACT_CONTINUE_SCAN:
2468  (yy_c_buf_p) =
2469  (yytext_ptr) + yy_amount_of_matched_text;
2470 
2471  yy_current_state = yy_get_previous_state( );
2472 
2473  yy_cp = (yy_c_buf_p);
2474  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2475  goto yy_match;
2476 
2477  case EOB_ACT_LAST_MATCH:
2478  (yy_c_buf_p) =
2479  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
2480 
2481  yy_current_state = yy_get_previous_state( );
2482 
2483  yy_cp = (yy_c_buf_p);
2484  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2485  goto yy_find_action;
2486  }
2487  break;
2488  }
2489 
2490  default:
2492  "fatal flex scanner internal error--no action found" );
2493  } /* end of action switch */
2494  } /* end of scanning one token */
2495 } /* end of tclscannerYYlex */
2496 
2497 /* yy_get_next_buffer - try to read in a new buffer
2498  *
2499  * Returns a code representing an action:
2500  * EOB_ACT_LAST_MATCH -
2501  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2502  * EOB_ACT_END_OF_FILE - end of file
2503  */
2504 static int yy_get_next_buffer (void)
2505 {
2506  register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2507  register char *source = (yytext_ptr);
2508  register int number_to_move, i;
2509  int ret_val;
2510 
2511  if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
2513  "fatal flex scanner internal error--end of buffer missed" );
2514 
2515  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2516  { /* Don't try to fill the buffer, so this is an EOF. */
2517  if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
2518  {
2519  /* We matched a single character, the EOB, so
2520  * treat this as a final EOF.
2521  */
2522  return EOB_ACT_END_OF_FILE;
2523  }
2524 
2525  else
2526  {
2527  /* We matched some text prior to the EOB, first
2528  * process it.
2529  */
2530  return EOB_ACT_LAST_MATCH;
2531  }
2532  }
2533 
2534  /* Try to read more data. */
2535 
2536  /* First move last chars to start of buffer. */
2537  number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
2538 
2539  for ( i = 0; i < number_to_move; ++i )
2540  *(dest++) = *(source++);
2541 
2542  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2543  /* don't do the read, it's not guaranteed to return an EOF,
2544  * just force an EOF
2545  */
2546  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
2547 
2548  else
2549  {
2550  int num_to_read =
2551  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2552 
2553  while ( num_to_read <= 0 )
2554  { /* Not enough room in the buffer - grow it. */
2555 
2556  /* just a shorter name for the current buffer */
2557  YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
2558 
2559  int yy_c_buf_p_offset =
2560  (int) ((yy_c_buf_p) - b->yy_ch_buf);
2561 
2562  if ( b->yy_is_our_buffer )
2563  {
2564  int new_size = b->yy_buf_size * 2;
2565 
2566  if ( new_size <= 0 )
2567  b->yy_buf_size += b->yy_buf_size / 8;
2568  else
2569  b->yy_buf_size *= 2;
2570 
2571  b->yy_ch_buf = (char *)
2572  /* Include room in for 2 EOB chars. */
2573  tclscannerYYrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
2574  }
2575  else
2576  /* Can't grow it, we don't own it. */
2577  b->yy_ch_buf = 0;
2578 
2579  if ( ! b->yy_ch_buf )
2581  "fatal error - scanner input buffer overflow" );
2582 
2583  (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
2584 
2585  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2586  number_to_move - 1;
2587 
2588  }
2589 
2590  if ( num_to_read > YY_READ_BUF_SIZE )
2591  num_to_read = YY_READ_BUF_SIZE;
2592 
2593  /* Read in more data. */
2594  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2595  (yy_n_chars), (size_t) num_to_read );
2596 
2597  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2598  }
2599 
2600  if ( (yy_n_chars) == 0 )
2601  {
2602  if ( number_to_move == YY_MORE_ADJ )
2603  {
2604  ret_val = EOB_ACT_END_OF_FILE;
2606  }
2607 
2608  else
2609  {
2610  ret_val = EOB_ACT_LAST_MATCH;
2611  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2613  }
2614  }
2615 
2616  else
2617  ret_val = EOB_ACT_CONTINUE_SCAN;
2618 
2619  if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2620  /* Extend the array by 50%, plus the number we really need. */
2621  yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
2622  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) tclscannerYYrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
2623  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2624  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2625  }
2626 
2627  (yy_n_chars) += number_to_move;
2630 
2631  (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2632 
2633  return ret_val;
2634 }
2635 
2636 /* yy_get_previous_state - get the state just before the EOB char was reached */
2637 
2638  static yy_state_type yy_get_previous_state (void)
2639 {
2640  register yy_state_type yy_current_state;
2641  register char *yy_cp;
2642 
2643  yy_current_state = (yy_start);
2644 
2645  for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
2646  {
2647  register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2648  if ( yy_accept[yy_current_state] )
2649  {
2650  (yy_last_accepting_state) = yy_current_state;
2651  (yy_last_accepting_cpos) = yy_cp;
2652  }
2653  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2654  {
2655  yy_current_state = (int) yy_def[yy_current_state];
2656  if ( yy_current_state >= 179 )
2657  yy_c = yy_meta[(unsigned int) yy_c];
2658  }
2659  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2660  }
2661 
2662  return yy_current_state;
2663 }
2664 
2665 /* yy_try_NUL_trans - try to make a transition on the NUL character
2666  *
2667  * synopsis
2668  * next_state = yy_try_NUL_trans( current_state );
2669  */
2670  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
2671 {
2672  register int yy_is_jam;
2673  register char *yy_cp = (yy_c_buf_p);
2674 
2675  register YY_CHAR yy_c = 1;
2676  if ( yy_accept[yy_current_state] )
2677  {
2678  (yy_last_accepting_state) = yy_current_state;
2679  (yy_last_accepting_cpos) = yy_cp;
2680  }
2681  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2682  {
2683  yy_current_state = (int) yy_def[yy_current_state];
2684  if ( yy_current_state >= 179 )
2685  yy_c = yy_meta[(unsigned int) yy_c];
2686  }
2687  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2688  yy_is_jam = (yy_current_state == 178);
2689 
2690  return yy_is_jam ? 0 : yy_current_state;
2691 }
2692 
2693  static void yyunput (int c, register char * yy_bp )
2694 {
2695  register char *yy_cp;
2696 
2697  yy_cp = (yy_c_buf_p);
2698 
2699  /* undo effects of setting up tclscannerYYtext */
2700  *yy_cp = (yy_hold_char);
2701 
2702  if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2703  { /* need to shift things up to make room */
2704  /* +2 for EOB chars. */
2705  register int number_to_move = (yy_n_chars) + 2;
2706  register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
2707  YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
2708  register char *source =
2709  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
2710 
2711  while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2712  *--dest = *--source;
2713 
2714  yy_cp += (int) (dest - source);
2715  yy_bp += (int) (dest - source);
2716  YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
2717  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
2718 
2719  if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2720  YY_FATAL_ERROR( "flex scanner push-back overflow" );
2721  }
2722 
2723  *--yy_cp = (char) c;
2724 
2725  if ( c == '\n' ){
2727  }
2728 
2729  (yytext_ptr) = yy_bp;
2730  (yy_hold_char) = *yy_cp;
2731  (yy_c_buf_p) = yy_cp;
2732 }
2733 
2734 #ifndef YY_NO_INPUT
2735 #ifdef __cplusplus
2736  static int yyinput (void)
2737 #else
2738  static int input (void)
2739 #endif
2740 
2741 {
2742  int c;
2743 
2744  *(yy_c_buf_p) = (yy_hold_char);
2745 
2746  if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2747  {
2748  /* yy_c_buf_p now points to the character we want to return.
2749  * If this occurs *before* the EOB characters, then it's a
2750  * valid NUL; if not, then we've hit the end of the buffer.
2751  */
2752  if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2753  /* This was really a NUL. */
2754  *(yy_c_buf_p) = '\0';
2755 
2756  else
2757  { /* need more input */
2758  int offset = (yy_c_buf_p) - (yytext_ptr);
2759  ++(yy_c_buf_p);
2760 
2761  switch ( yy_get_next_buffer( ) )
2762  {
2763  case EOB_ACT_LAST_MATCH:
2764  /* This happens because yy_g_n_b()
2765  * sees that we've accumulated a
2766  * token and flags that we need to
2767  * try matching the token before
2768  * proceeding. But for input(),
2769  * there's no matching to consider.
2770  * So convert the EOB_ACT_LAST_MATCH
2771  * to EOB_ACT_END_OF_FILE.
2772  */
2773 
2774  /* Reset buffer status. */
2776 
2777  /*FALLTHROUGH*/
2778 
2779  case EOB_ACT_END_OF_FILE:
2780  {
2781  if ( tclscannerYYwrap( ) )
2782  return EOF;
2783 
2784  if ( ! (yy_did_buffer_switch_on_eof) )
2785  YY_NEW_FILE;
2786 #ifdef __cplusplus
2787  return yyinput();
2788 #else
2789  return input();
2790 #endif
2791  }
2792 
2793  case EOB_ACT_CONTINUE_SCAN:
2794  (yy_c_buf_p) = (yytext_ptr) + offset;
2795  break;
2796  }
2797  }
2798  }
2799 
2800  c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
2801  *(yy_c_buf_p) = '\0'; /* preserve tclscannerYYtext */
2802  (yy_hold_char) = *++(yy_c_buf_p);
2803 
2804  if ( c == '\n' )
2805 
2806  tclscannerYYlineno++;
2807 ;
2808 
2809  return c;
2810 }
2811 #endif /* ifndef YY_NO_INPUT */
2812 
2813 /** Immediately switch to a different input stream.
2814  * @param input_file A readable stream.
2815  *
2816  * @note This function does not reset the start condition to @c INITIAL .
2817  */
2819 {
2820 
2821  if ( ! YY_CURRENT_BUFFER ){
2825  }
2826 
2829 }
2830 
2831 /** Switch to a different input buffer.
2832  * @param new_buffer The new input buffer.
2833  *
2834  */
2835  void tclscannerYY_switch_to_buffer (YY_BUFFER_STATE new_buffer )
2836 {
2837 
2838  /* TODO. We should be able to replace this entire function body
2839  * with
2840  * tclscannerYYpop_buffer_state();
2841  * tclscannerYYpush_buffer_state(new_buffer);
2842  */
2844  if ( YY_CURRENT_BUFFER == new_buffer )
2845  return;
2846 
2847  if ( YY_CURRENT_BUFFER )
2848  {
2849  /* Flush out information for old buffer. */
2850  *(yy_c_buf_p) = (yy_hold_char);
2851  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2852  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2853  }
2854 
2855  YY_CURRENT_BUFFER_LVALUE = new_buffer;
2857 
2858  /* We don't actually know whether we did this switch during
2859  * EOF (tclscannerYYwrap()) processing, but the only time this flag
2860  * is looked at is after tclscannerYYwrap() is called, so it's safe
2861  * to go ahead and always set it.
2862  */
2864 }
2865 
2867 {
2868  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2869  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2870  tclscannerYYin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2871  (yy_hold_char) = *(yy_c_buf_p);
2872 }
2873 
2874 /** Allocate and initialize an input buffer state.
2875  * @param file A readable stream.
2876  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2877  *
2878  * @return the allocated buffer state.
2879  */
2880  YY_BUFFER_STATE tclscannerYY_create_buffer (FILE * file, int size )
2881 {
2882  YY_BUFFER_STATE b;
2883 
2884  b = (YY_BUFFER_STATE) tclscannerYYalloc(sizeof( struct yy_buffer_state ) );
2885  if ( ! b )
2886  YY_FATAL_ERROR( "out of dynamic memory in tclscannerYY_create_buffer()" );
2887 
2888  b->yy_buf_size = size;
2889 
2890  /* yy_ch_buf has to be 2 characters longer than the size given because
2891  * we need to put in 2 end-of-buffer characters.
2892  */
2893  b->yy_ch_buf = (char *) tclscannerYYalloc(b->yy_buf_size + 2 );
2894  if ( ! b->yy_ch_buf )
2895  YY_FATAL_ERROR( "out of dynamic memory in tclscannerYY_create_buffer()" );
2896 
2897  b->yy_is_our_buffer = 1;
2898 
2899  tclscannerYY_init_buffer(b,file );
2900 
2901  return b;
2902 }
2903 
2904 /** Destroy the buffer.
2905  * @param b a buffer created with tclscannerYY_create_buffer()
2906  *
2907  */
2908  void tclscannerYY_delete_buffer (YY_BUFFER_STATE b )
2909 {
2910 
2911  if ( ! b )
2912  return;
2913 
2914  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2916 
2917  if ( b->yy_is_our_buffer )
2918  tclscannerYYfree((void *) b->yy_ch_buf );
2919 
2920  tclscannerYYfree((void *) b );
2921 }
2922 
2923 /* Initializes or reinitializes a buffer.
2924  * This function is sometimes called more than once on the same buffer,
2925  * such as during a tclscannerYYrestart() or at EOF.
2926  */
2927  static void tclscannerYY_init_buffer (YY_BUFFER_STATE b, FILE * file )
2928 
2929 {
2930  int oerrno = errno;
2931 
2933 
2934  b->yy_input_file = file;
2935  b->yy_fill_buffer = 1;
2936 
2937  /* If b is the current buffer, then tclscannerYY_init_buffer was _probably_
2938  * called from tclscannerYYrestart() or through yy_get_next_buffer.
2939  * In that case, we don't want to reset the lineno or column.
2940  */
2941  if (b != YY_CURRENT_BUFFER){
2942  b->yy_bs_lineno = 1;
2943  b->yy_bs_column = 0;
2944  }
2945 
2946  b->yy_is_interactive = 0;
2947 
2948  errno = oerrno;
2949 }
2950 
2951 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2952  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2953  *
2954  */
2955  void tclscannerYY_flush_buffer (YY_BUFFER_STATE b )
2956 {
2957  if ( ! b )
2958  return;
2959 
2960  b->yy_n_chars = 0;
2961 
2962  /* We always need two end-of-buffer characters. The first causes
2963  * a transition to the end-of-buffer state. The second causes
2964  * a jam in that state.
2965  */
2968 
2969  b->yy_buf_pos = &b->yy_ch_buf[0];
2970 
2971  b->yy_at_bol = 1;
2973 
2974  if ( b == YY_CURRENT_BUFFER )
2976 }
2977 
2978 /** Pushes the new state onto the stack. The new state becomes
2979  * the current state. This function will allocate the stack
2980  * if necessary.
2981  * @param new_buffer The new state.
2982  *
2983  */
2984 void tclscannerYYpush_buffer_state (YY_BUFFER_STATE new_buffer )
2985 {
2986  if (new_buffer == NULL)
2987  return;
2988 
2990 
2991  /* This block is copied from tclscannerYY_switch_to_buffer. */
2992  if ( YY_CURRENT_BUFFER )
2993  {
2994  /* Flush out information for old buffer. */
2995  *(yy_c_buf_p) = (yy_hold_char);
2996  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2997  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2998  }
2999 
3000  /* Only push if top exists. Otherwise, replace top. */
3001  if (YY_CURRENT_BUFFER)
3002  (yy_buffer_stack_top)++;
3003  YY_CURRENT_BUFFER_LVALUE = new_buffer;
3004 
3005  /* copied from tclscannerYY_switch_to_buffer. */
3008 }
3009 
3010 /** Removes and deletes the top of the stack, if present.
3011  * The next element becomes the new top.
3012  *
3013  */
3015 {
3016  if (!YY_CURRENT_BUFFER)
3017  return;
3018 
3020  YY_CURRENT_BUFFER_LVALUE = NULL;
3021  if ((yy_buffer_stack_top) > 0)
3022  --(yy_buffer_stack_top);
3023 
3024  if (YY_CURRENT_BUFFER) {
3027  }
3028 }
3029 
3030 /* Allocates the stack if it does not exist.
3031  * Guarantees space for at least one push.
3032  */
3034 {
3035  int num_to_alloc;
3036 
3037  if (!(yy_buffer_stack)) {
3038 
3039  /* First allocation is just for 2 elements, since we don't know if this
3040  * scanner will even need a stack. We use 2 instead of 1 to avoid an
3041  * immediate realloc on the next call.
3042  */
3043  num_to_alloc = 1;
3045  (num_to_alloc * sizeof(struct yy_buffer_state*)
3046  );
3047  if ( ! (yy_buffer_stack) )
3048  YY_FATAL_ERROR( "out of dynamic memory in tclscannerYYensure_buffer_stack()" );
3049 
3050  memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3051 
3052  (yy_buffer_stack_max) = num_to_alloc;
3053  (yy_buffer_stack_top) = 0;
3054  return;
3055  }
3056 
3057  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
3058 
3059  /* Increase the buffer to prepare for a possible push. */
3060  int grow_size = 8 /* arbitrary grow size */;
3061 
3062  num_to_alloc = (yy_buffer_stack_max) + grow_size;
3064  ((yy_buffer_stack),
3065  num_to_alloc * sizeof(struct yy_buffer_state*)
3066  );
3067  if ( ! (yy_buffer_stack) )
3068  YY_FATAL_ERROR( "out of dynamic memory in tclscannerYYensure_buffer_stack()" );
3069 
3070  /* zero only the new slots.*/
3071  memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
3072  (yy_buffer_stack_max) = num_to_alloc;
3073  }
3074 }
3075 
3076 /** Setup the input buffer state to scan directly from a user-specified character buffer.
3077  * @param base the character buffer
3078  * @param size the size in bytes of the character buffer
3079  *
3080  * @return the newly allocated buffer state object.
3081  */
3082 YY_BUFFER_STATE tclscannerYY_scan_buffer (char * base, yy_size_t size )
3083 {
3084  YY_BUFFER_STATE b;
3085 
3086  if ( size < 2 ||
3087  base[size-2] != YY_END_OF_BUFFER_CHAR ||
3088  base[size-1] != YY_END_OF_BUFFER_CHAR )
3089  /* They forgot to leave room for the EOB's. */
3090  return 0;
3091 
3092  b = (YY_BUFFER_STATE) tclscannerYYalloc(sizeof( struct yy_buffer_state ) );
3093  if ( ! b )
3094  YY_FATAL_ERROR( "out of dynamic memory in tclscannerYY_scan_buffer()" );
3095 
3096  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
3097  b->yy_buf_pos = b->yy_ch_buf = base;
3098  b->yy_is_our_buffer = 0;
3099  b->yy_input_file = 0;
3100  b->yy_n_chars = b->yy_buf_size;
3101  b->yy_is_interactive = 0;
3102  b->yy_at_bol = 1;
3103  b->yy_fill_buffer = 0;
3105 
3107 
3108  return b;
3109 }
3110 
3111 /** Setup the input buffer state to scan a string. The next call to tclscannerYYlex() will
3112  * scan from a @e copy of @a str.
3113  * @param yystr a NUL-terminated string to scan
3114  *
3115  * @return the newly allocated buffer state object.
3116  * @note If you want to scan bytes that may contain NUL values, then use
3117  * tclscannerYY_scan_bytes() instead.
3118  */
3119 YY_BUFFER_STATE tclscannerYY_scan_string (yyconst char * yystr )
3120 {
3121 
3122  return tclscannerYY_scan_bytes(yystr,strlen(yystr) );
3123 }
3124 
3125 /** Setup the input buffer state to scan the given bytes. The next call to tclscannerYYlex() will
3126  * scan from a @e copy of @a bytes.
3127  * @param bytes the byte buffer to scan
3128  * @param len the number of bytes in the buffer pointed to by @a bytes.
3129  *
3130  * @return the newly allocated buffer state object.
3131  */
3132 YY_BUFFER_STATE tclscannerYY_scan_bytes (yyconst char * yybytes, int _yybytes_len )
3133 {
3134  YY_BUFFER_STATE b;
3135  char *buf;
3136  yy_size_t n;
3137  int i;
3138 
3139  /* Get memory for full buffer, including space for trailing EOB's. */
3140  n = _yybytes_len + 2;
3141  buf = (char *) tclscannerYYalloc(n );
3142  if ( ! buf )
3143  YY_FATAL_ERROR( "out of dynamic memory in tclscannerYY_scan_bytes()" );
3144 
3145  for ( i = 0; i < _yybytes_len; ++i )
3146  buf[i] = yybytes[i];
3147 
3148  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3149 
3150  b = tclscannerYY_scan_buffer(buf,n );
3151  if ( ! b )
3152  YY_FATAL_ERROR( "bad buffer in tclscannerYY_scan_bytes()" );
3153 
3154  /* It's okay to grow etc. this buffer, and we should throw it
3155  * away when we're done.
3156  */
3157  b->yy_is_our_buffer = 1;
3158 
3159  return b;
3160 }
3161 
3162  static void yy_push_state (int new_state )
3163 {
3164  if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
3165  {
3166  yy_size_t new_size;
3167 
3169  new_size = (yy_start_stack_depth) * sizeof( int );
3170 
3171  if ( ! (yy_start_stack) )
3172  (yy_start_stack) = (int *) tclscannerYYalloc(new_size );
3173 
3174  else
3175  (yy_start_stack) = (int *) tclscannerYYrealloc((void *) (yy_start_stack),new_size );
3176 
3177  if ( ! (yy_start_stack) )
3178  YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
3179  }
3180 
3181  (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
3182 
3183  BEGIN(new_state);
3184 }
3185 
3186  static void yy_pop_state (void)
3187 {
3188  if ( --(yy_start_stack_ptr) < 0 )
3189  YY_FATAL_ERROR( "start-condition stack underflow" );
3190 
3191  BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
3192 }
3193 
3194  static int yy_top_state (void)
3195 {
3196  return (yy_start_stack)[(yy_start_stack_ptr) - 1];
3197 }
3198 
3199 #ifndef YY_EXIT_FAILURE
3200 #define YY_EXIT_FAILURE 2
3201 #endif
3202 
3203 static void yy_fatal_error (yyconst char* msg )
3204 {
3205  (void) fprintf( stderr, "%s\n", msg );
3206  exit( YY_EXIT_FAILURE );
3207 }
3208 
3209 /* Redefine yyless() so it works in section 3 code. */
3210 
3211 #undef yyless
3212 #define yyless(n) \
3213  do \
3214  { \
3215  /* Undo effects of setting up tclscannerYYtext. */ \
3216  int yyless_macro_arg = (n); \
3217  YY_LESS_LINENO(yyless_macro_arg);\
3218  tclscannerYYtext[tclscannerYYleng] = (yy_hold_char); \
3219  (yy_c_buf_p) = tclscannerYYtext + yyless_macro_arg; \
3220  (yy_hold_char) = *(yy_c_buf_p); \
3221  *(yy_c_buf_p) = '\0'; \
3222  tclscannerYYleng = yyless_macro_arg; \
3223  } \
3224  while ( 0 )
3225 
3226 /* Accessor methods (get/set functions) to struct members. */
3227 
3228 /** Get the current line number.
3229  *
3230  */
3232 {
3233 
3234  return tclscannerYYlineno;
3235 }
3236 
3237 /** Get the input stream.
3238  *
3239  */
3241 {
3242  return tclscannerYYin;
3243 }
3244 
3245 /** Get the output stream.
3246  *
3247  */
3249 {
3250  return tclscannerYYout;
3251 }
3252 
3253 /** Get the length of the current token.
3254  *
3255  */
3257 {
3258  return tclscannerYYleng;
3259 }
3260 
3261 /** Get the current token.
3262  *
3263  */
3264 
3266 {
3267  return tclscannerYYtext;
3268 }
3269 
3270 /** Set the current line number.
3271  * @param line_number
3272  *
3273  */
3274 void tclscannerYYset_lineno (int line_number )
3275 {
3276 
3277  tclscannerYYlineno = line_number;
3278 }
3279 
3280 /** Set the input stream. This does not discard the current
3281  * input buffer.
3282  * @param in_str A readable stream.
3283  *
3284  * @see tclscannerYY_switch_to_buffer
3285  */
3286 void tclscannerYYset_in (FILE * in_str )
3287 {
3288  tclscannerYYin = in_str ;
3289 }
3290 
3291 void tclscannerYYset_out (FILE * out_str )
3292 {
3293  tclscannerYYout = out_str ;
3294 }
3295 
3297 {
3298  return tclscannerYY_flex_debug;
3299 }
3300 
3301 void tclscannerYYset_debug (int bdebug )
3302 {
3303  tclscannerYY_flex_debug = bdebug ;
3304 }
3305 
3306 static int yy_init_globals (void)
3307 {
3308  /* Initialization is the same as for the non-reentrant scanner.
3309  * This function is called from tclscannerYYlex_destroy(), so don't allocate here.
3310  */
3311 
3312  /* We do not touch tclscannerYYlineno unless the option is enabled. */
3313  tclscannerYYlineno = 1;
3314 
3315  (yy_buffer_stack) = 0;
3316  (yy_buffer_stack_top) = 0;
3317  (yy_buffer_stack_max) = 0;
3318  (yy_c_buf_p) = (char *) 0;
3319  (yy_init) = 0;
3320  (yy_start) = 0;
3321 
3322  (yy_start_stack_ptr) = 0;
3323  (yy_start_stack_depth) = 0;
3324  (yy_start_stack) = NULL;
3325 
3326 /* Defined in main.c */
3327 #ifdef YY_STDINIT
3328  tclscannerYYin = stdin;
3330 #else
3331  tclscannerYYin = (FILE *) 0;
3332  tclscannerYYout = (FILE *) 0;
3333 #endif
3334 
3335  /* For future reference: Set errno on error, since we are called by
3336  * tclscannerYYlex_init()
3337  */
3338  return 0;
3339 }
3340 
3341 /* tclscannerYYlex_destroy is for both reentrant and non-reentrant scanners. */
3343 {
3344 
3345  /* Pop the buffer stack, destroying each element. */
3346  while(YY_CURRENT_BUFFER){
3348  YY_CURRENT_BUFFER_LVALUE = NULL;
3350  }
3351 
3352  /* Destroy the stack itself. */
3353  tclscannerYYfree((yy_buffer_stack) );
3354  (yy_buffer_stack) = NULL;
3355 
3356  /* Destroy the start condition stack. */
3357  tclscannerYYfree((yy_start_stack) );
3358  (yy_start_stack) = NULL;
3359 
3360  /* Reset the globals. This is important in a non-reentrant scanner so the next time
3361  * tclscannerYYlex() is called, initialization will occur. */
3362  yy_init_globals( );
3363 
3364  return 0;
3365 }
3366 
3367 /*
3368  * Internal utility routines.
3369  */
3370 
3371 #ifndef yytext_ptr
3372 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
3373 {
3374  register int i;
3375  for ( i = 0; i < n; ++i )
3376  s1[i] = s2[i];
3377 }
3378 #endif
3379 
3380 #ifdef YY_NEED_STRLEN
3381 static int yy_flex_strlen (yyconst char * s )
3382 {
3383  register int n;
3384  for ( n = 0; s[n]; ++n )
3385  ;
3386 
3387  return n;
3388 }
3389 #endif
3390 
3392 {
3393  return (void *) malloc( size );
3394 }
3395 
3396 void *tclscannerYYrealloc (void * ptr, yy_size_t size )
3397 {
3398  /* The cast to (char *) in the following accommodates both
3399  * implementations that use char* generic pointers, and those
3400  * that use void* generic pointers. It works with the latter
3401  * because both ANSI C and C++ allow castless assignment from
3402  * any pointer type to void*, and deal with argument conversions
3403  * as though doing an assignment.
3404  */
3405  return (void *) realloc( (char *) ptr, size );
3406 }
3407 
3408 void tclscannerYYfree (void * ptr )
3409 {
3410  free( (char *) ptr ); /* see tclscannerYYrealloc() for (char *) cast */
3411 }
3412 
3413 #define YYTABLES_NAME "yytables"
3414 
3415 #line 1125 "tclscanner.l"
3416 
3417 
3418 
3419 //! Start new scan context for given 'content'.
3420 // @return created new scan context.
3421 static tcl_scan *tcl_scan_start(char type, QString content, QCString ns, Entry *entry_cl, Entry *entry_fn)
3422 {
3423  tcl_scan *myScan=tcl.scan.at(0);
3424 tcl_inf("line=%d type=%d '%s'\n",tcl.line_body0,type,content.ascii());
3425 
3426  myScan->line1=tclscannerYYlineno;
3427  yy_push_state(TOP);
3428 
3429  myScan=new tcl_scan;
3430  myScan->type[0] =' ';
3431  myScan->type[1] = '\0';
3432  switch (type) {
3433  case '"':
3434  case '{':
3435  case '[':
3436  myScan->type[0] = type;
3437  break;
3438  case '?':
3439  if (content[0]=='"' && content[content.length()-1]=='"') myScan->type[0]='"';
3440  if (content[0]=='{' && content[content.length()-1]=='}') myScan->type[0]='{';
3441  if (content[0]=='[' && content[content.length()-1]==']') myScan->type[0]='[';
3442  }
3443  if (myScan->type[0]!=' ')
3444  {
3445  tcl_codify(NULL,&myScan->type[0]);
3446  content = content.mid(1,content.length()-2);
3447  }
3448  content += (char)0x1A;// for detection end of scan context
3449  myScan->ns = ns;
3450  myScan->entry_cl = entry_cl;
3451  myScan->entry_fn = entry_fn;
3452  myScan->entry_scan = tcl.entry_current;
3453  myScan->buffer_state=tclscannerYY_scan_string(content.ascii());
3454  myScan->line0=tcl.line_body0;
3455  myScan->line1=tcl.line_body1;
3456  myScan->after.clear();
3457  tclscannerYYlineno=myScan->line0;
3458  myScan->protection = tcl.protection;
3459 
3460  tcl.entry_inside = myScan->entry_scan;
3461  tcl.entry_current = tcl_entry_new();
3462  tcl.scan.insert(0,myScan);
3464  return (myScan);
3465 }
3466 
3467 //! Close current scan context.
3468 static void tcl_scan_end()
3469 {
3470  tcl_scan *myScan=tcl.scan.at(0);
3471  tcl_scan *myScan1=tcl.scan.at(1);
3472 tcl_inf("line=%d\n",myScan->line1);
3473 
3474  if (myScan->type[0]=='{') myScan->type[0]='}';
3475  if (myScan->type[0]=='[') myScan->type[0]=']';
3476  if (myScan->type[0]!=' ') tcl_codify(NULL,&myScan->type[0]);
3477  int myStart=-1;
3478  for (unsigned int i=0;i<myScan->after.count();i=i+2)
3479  {
3480  if (myScan->after[i]=="script") {
3481  myStart=i;
3482  break;
3483  }
3484  tcl_codify(myScan->after[i].utf8(),myScan->after[i+1].utf8());
3485  }
3487  yy_pop_state();
3488  tcl.entry_inside = myScan1->entry_scan;
3490  tclscannerYYlineno=myScan1->line1;
3491  tcl.protection = myScan1->protection;
3492  if (myStart>=0)
3493  {
3494  myScan1 = tcl_scan_start('?', myScan->after[myStart+1], myScan->ns, myScan->entry_cl, myScan->entry_fn);
3495  for (unsigned int i=myStart+2;i<myScan->after.count();i++)
3496  {
3497  myScan1->after.append(myScan->after[i]);
3498  }
3499  tcl.scan.remove(1);
3500  }
3501  else
3502  {
3503  tcl.scan.removeFirst();
3504  }
3505 }
3506 
3507 //! Handling of word parsing.
3508 static void tcl_word(int what,const char *text)
3509 {
3510  static char myList[1024]="";// nesting level list
3511  static int myLevel=0;// number of current nesting level
3512  static int myWhite=0;// set true when next char should be whitespace
3513  static char myWord;// internal state
3514 
3515  switch (what)
3516  {
3517  case 0:// start
3519  switch (text[0])
3520  {
3521  case '{':
3522  case '[':
3523  case '"': myWord = text[0]; break;
3524  default: myWord = '.';
3525  }
3526  myList[0]=myWord;
3527  myLevel=1;
3528  myWhite=0;
3529  break;
3530  case 1:// all other chars
3531  if (myWhite)
3532  {// {x}y "x"y
3533  tcl_err("expected word separator: %s\n",text);
3534  return;
3535  }
3536  if (myLevel==0)
3537  {
3538  myWord='.';
3539  myList[0]=myWord;
3540  myLevel=1;
3541  }
3542  break;
3543  case 2:// \\\n
3544  if (myLevel==0)
3545  {
3546  myWord=' ';
3547  yy_pop_state();
3548  yyless(0);
3549 tcl_inf("(\\\n) ?%s?\n",tcl.string_last.data());
3550  return;
3551  }
3552  switch (myList[myLevel-1])
3553  {
3554  case '{':
3555  case '[':
3556  case '"':
3557  break;
3558  case '.':
3559  if (myLevel==1)
3560  {
3561  myWord=' ';
3562  yy_pop_state();
3563  yyless(0);
3564 tcl_inf("(\\\n) ?%s?\n",tcl.string_last.data());
3565  return;
3566  }
3567  break;
3568  }
3569  myWhite=0;
3570  break;
3571  case 3:// {
3572  if (myWhite)
3573  {// {x}{ "x"{
3574  tcl_err("expected word separator: %s\n",text);
3575  return;
3576  }
3577  switch (myList[myLevel-1])
3578  {
3579  case '{':
3580  case '[':
3581  myList[myLevel++]='{';
3582  break;
3583  case '"':
3584  case '.':
3585  break;
3586  }
3587  myWhite=0;
3588  break;
3589  case 4:// }
3590  if (myWhite)
3591  {// {x}{ "x"{
3592  tcl_err("expected word separator: %s\n",text);
3593  return;
3594  }
3595  switch (myList[myLevel-1])
3596  {
3597  case '{':// {{x}}
3598  myLevel--;
3599  if (myLevel==0 && !tcl.code)
3600  {
3601  myWhite=1;
3602  }
3603  break;
3604  case '[':
3605  case '"':
3606  case '.':
3607  break;
3608  }
3609  break;
3610  case 5:// [
3611  if (myWhite)
3612  {// {x}[
3613  tcl_err("expected word separator: %s\n",text);
3614  return;
3615  }
3616  switch (myList[myLevel-1])
3617  {
3618  case '{':
3619  break;
3620  case '[':
3621  case '"':
3622  case '.':
3623  myList[myLevel++]='[';
3624  break;
3625  }
3626  myWhite=0;
3627  break;
3628  case 6:// ]
3629  if (myWhite)
3630  {// {x}]
3631  tcl_err("expected word separator: %s\n",text);
3632  return;
3633  }
3634  switch (myList[myLevel-1])
3635  {
3636  case '{':
3637  break;
3638  case '[':
3639  myLevel--;
3640  break;
3641  case '"':
3642  case '.':
3643  break;
3644  }
3645  myWhite=0;
3646  break;
3647  case 7:// "
3648  if (myWhite)
3649  {// {x}"
3650  tcl_err("expected word separator: %s\n",text);
3651  return;
3652  }
3653  switch (myList[myLevel-1])
3654  {
3655  case '{':
3656  break;
3657  case '[':
3658  myList[myLevel++]='"';
3659  break;
3660  case '"':
3661  myLevel--;
3662  case '.':
3663  break;
3664  }
3665  break;
3666  case 8:// ' '
3667  case 9:// \t
3668  case 10:// ;
3669  case 11:// \n
3670  if (myLevel==0)
3671  {
3672  myWord=' ';
3673  yy_pop_state();
3674  yyless(0);
3675 tcl_inf("(%d) ?%s?\n",what,tcl.string_last.data());
3676  return;
3677  }
3678  switch (myList[myLevel-1])
3679  {
3680  case '{':
3681  case '[':
3682  case '"':
3683  break;
3684  case '.':
3685  if (myLevel==1)
3686  {
3687  myWord=' ';
3688  yy_pop_state();
3689  yyless(0);
3690 tcl_inf("(.%d) ?%s?\n",what,tcl.string_last.data());
3691  return;
3692  }
3693  else
3694  {
3695  myLevel--;
3696  }
3697  break;
3698  }
3699  myWhite=0;
3700  break;
3701  case 12:// \x1A
3702  if (myLevel==0)
3703  {
3704  myWord=' ';
3705  yy_pop_state();
3706  yyless(0);
3707 tcl_inf("(%d) ?%s?\n",what,tcl.string_last.data());
3708  return;
3709  }
3710  if (myLevel!=1 || myList[0] != '.')
3711  {
3712  tcl_war("level=%d expected=%c\n",myLevel,myList[myLevel-1]);
3713  }
3714  myWord=' ';
3715  yy_pop_state();
3716  yyless(0);
3717 tcl_inf("(.%d) ?%s?\n",what,tcl.string_last.data());
3718  return;
3719  myWhite=0;
3720  break;
3721  default:
3722  tcl_err("wrong state: %d\n",what);
3723  return;
3724  }
3725  tcl.string_last += text;
3726 }
3727 
3728 //! Handling of comment parsing.
3729 static void tcl_comment(int what,const char *text)
3730 {
3731  if (what==0)
3732  { // begin of comment
3733  if (tcl.comment)
3734  {
3735  tcl_err("comment in comment\n");
3736  return;
3737  }
3739 tcl_inf("<- %s\n",text);
3740  tcl.string_comment="";
3741  tcl.comment=0;
3742  }
3743  else if (what==1)
3744  { // start new comment
3745  if (tcl.comment)
3746  {
3747  tcl_comment(99,""); // inbody
3748  }
3749  tcl.string_comment=text;
3750  tcl.comment=1;
3751  }
3752  else if (what==2)
3753  { // add to comment
3754  if (tcl.comment)
3755  {
3756  tcl.string_comment+=text;
3757  }
3758  }
3759  else if (what==-1 || what == -2)
3760  { // end of comment without/with command
3761  if (tcl.comment)
3762  {
3763  tcl.string_last=tcl.string_comment;
3764  tcl_comment(100+what,"");
3765  }
3766  else
3767  {
3768  tcl.string_last = "";
3769 tcl_inf("-> %s\n",(const char *)tcl.string_comment);
3770  }
3771  yy_pop_state();
3772  tcl.string_comment="";
3773  tcl.comment=0;
3774  }
3775  else if (what==98 || what==99)
3776  { // 98=new 99=inbody
3777  if (tcl.this_parser && tcl.string_comment.length())
3778  {
3779 tcl_inf("-> %s\n",(const char *)tcl.string_comment);
3780  int myPos=0;
3781  bool myNew=0;
3782  int myLine=tcl.line_comment;
3783  BufStr myI(1024);
3784  BufStr myO(1024);
3785  Protection myProt=tcl.protection;
3786 
3787  // resolve ALIASES
3788  myI.addArray("/*!",3);
3789  myI.addArray(tcl.string_comment.data(),tcl.string_comment.length());
3790  myI.addArray("*/",2);
3791  convertCppComments(&myI,&myO,tcl.file_name);
3792  myO.dropFromStart(3);
3793  myO.shrink(myO.curPos()-2);
3794  myO.addChar('\0');
3795  QCString myDoc = myO.data();
3796  if (what==99)
3797  { // inbody comment file or namespace or class or proc/method
3798  int myPos0;
3799  int myLine0;
3800  Entry myEntry0; // used to test parsing
3801  Entry *myEntry;
3802 
3803  Entry *myEntry1=NULL;
3804  if (tcl.scan.at(0)->entry_fn)
3805  {
3806  myEntry1=tcl.scan.at(0)->entry_fn;
3807  }
3808  else if (tcl.scan.at(0)->entry_cl)
3809  {
3810  myEntry1=tcl.scan.at(0)->entry_cl;
3811  }
3812 
3813  myPos0=myPos;
3814  myLine0=myLine;
3815  while (parseCommentBlock(tcl.this_parser, &myEntry0, myDoc, tcl.file_name,
3816  myLine, FALSE, tcl.config_autobrief, FALSE, myProt, myPos, myNew))
3817  {
3818  if (myNew)
3819  { // we need a new entry in this case
3820  myNew=0;
3821  myEntry = tcl_entry_new();
3822  parseCommentBlock(tcl.this_parser, myEntry, myDoc, tcl.file_name,
3823  myLine0, FALSE, tcl.config_autobrief, FALSE, myProt, myPos0, myNew);
3824  tcl.entry_inside->addSubEntry(myEntry);
3825  }
3826  else
3827  { // we can add to current entry in this case
3828  if (!myEntry1)
3829  {
3830  myEntry1=tcl_entry_namespace(tcl.scan.at(0)->ns);
3831  }
3832  parseCommentBlock(tcl.this_parser, myEntry1, myDoc, tcl.file_name,
3833  myLine0, FALSE, tcl.config_autobrief, FALSE, myProt, myPos0, myNew);
3834  }
3835  myPos0=myPos;
3836  myLine0=myLine;
3837  }
3838  if (myNew)
3839  { // we need a new entry
3840  myNew=0;
3841  myEntry = tcl_entry_new();
3842  parseCommentBlock(tcl.this_parser, myEntry, myDoc, tcl.file_name,
3843  myLine0, FALSE, tcl.config_autobrief, FALSE, myProt, myPos0, myNew);
3844  tcl.entry_inside->addSubEntry(myEntry);
3845  }
3846  else
3847  { // we can add to current entry
3848  if (!myEntry1)
3849  {
3850  myEntry1=tcl_entry_namespace(tcl.scan.at(0)->ns);
3851  }
3852  parseCommentBlock(tcl.this_parser, myEntry1, myDoc, tcl.file_name,
3853  myLine0, FALSE, tcl.config_autobrief, FALSE, myProt, myPos0, myNew);
3854  }
3855  }
3856  else
3857  { // new entry
3858  tcl.entry_current = tcl_entry_new();
3859  while (parseCommentBlock(tcl.this_parser, tcl.entry_current, myDoc,
3860  tcl.file_name, myLine, FALSE, tcl.config_autobrief, FALSE,
3861  myProt, myPos, myNew))
3862  {
3863  if (myNew)
3864  {
3865  tcl.entry_inside->addSubEntry(tcl.entry_current);
3866  tcl.entry_current = tcl_entry_new();
3867  }
3868  else
3869  {
3870  tcl.entry_current->section = tcl.entry_inside->section;
3871  tcl.entry_current->name = tcl.entry_inside->name;
3872  }
3873  }
3874  if (myNew)
3875  {
3876  tcl.entry_inside->addSubEntry(tcl.entry_current);
3877  tcl.entry_current = tcl_entry_new();
3878  }
3879  else
3880  {
3881  tcl.entry_current->section = tcl.entry_inside->section;
3882  tcl.entry_current->name = tcl.entry_inside->name;
3883  }
3884  }
3885  if (tcl.protection != myProt)
3886  {
3887  tcl.scan.at(0)->protection = tcl.protection = myProt;
3888  }
3889  }
3890  }
3891  else
3892  {
3893  tcl_err("what %d\n",what);
3894  return;
3895  }
3896 }
3897 
3898 //! Parse given \c arglist .
3899 static void tcl_command_ARGLIST(QString &arglist)
3900 {
3901 D
3902  Argument *myArg;
3903  QStringList myArgs;
3904  QString myArglist="";
3905 
3906  if (!tcl.entry_current->argList)
3907  {
3908  tcl.entry_current->argList=new ArgumentList;
3909  }
3910  tcl_split_list(arglist,myArgs);
3911  for (uint i=0;i<myArgs.count();i++)
3912  {
3913  QStringList myArgs1;
3914  myArg=new Argument;
3915 
3916  tcl_split_list(*myArgs.at(i),myArgs1);
3917  if (myArgs1.count()==2)
3918  {
3919  myArg->name= (*myArgs1.at(0)).utf8();
3920  myArg->defval= (*myArgs1.at(1)).utf8();
3921  if (myArg->defval.isEmpty())
3922  {
3923  myArg->defval = " ";
3924  }
3925  myArglist += "?" + QCString(myArg->name) + "? ";
3926  }
3927  else
3928  {
3929  myArg->name= (*myArgs.at(i)).utf8();
3930  myArglist += QString(myArg->name) + " ";
3931  }
3932  tcl.entry_current->argList->append(myArg);
3933  }
3934  arglist = myArglist;
3935  tcl.entry_current->args = arglist.utf8();
3936 }
3937 
3938 //! Create link.
3940 {
3941  if (tcl.code == NULL || name.isEmpty()) return;
3942  static int init=0;
3943  static QAsciiDict<MemberDef> fn;
3944  if (init==0)
3945  {
3946  init=1;
3949  MemberName *mn=0;
3950  MemberDef *md;
3951  for (mni.toFirst();(mn=mni.current());++mni)
3952  {
3953  MemberNameIterator mi(*mn);
3954  for (mi.toFirst();(md=mi.current());++mi)
3955  {
3956  fn.insert(md->qualifiedName(),md);
3957  }
3958  }
3959  for (fni.toFirst();(mn=fni.current());++fni)
3960  {
3961  MemberNameIterator fi(*mn);
3962  for (fi.toFirst();(md=fi.current());++fi)
3963  {
3964  fn.insert(md->qualifiedName(),md);
3965  }
3966  }
3967  }
3968  MemberDef *myDef;
3969  QCString myName=name;
3970  if (name.mid(0,2)=="::") // fully qualified global command
3971  {
3972  myName = myName.mid(2);
3973  myDef = fn.find(myName);
3974  }
3975  else // not qualified name
3976  {
3977  QCString myName1=myName;
3978  myDef = NULL;
3979  myName1 = tcl.scan.at(0)->ns;
3980  if (myName1 == " " || myName1 == "")
3981  {
3982  myName1 = myName;
3983  }
3984  else
3985  {
3986  myName1 = myName1 + "::" + myName;
3987  }
3988  myDef = fn.find(myName1); // search namespace command
3989  if (myDef == NULL)
3990  {
3991  myDef = fn.find(myName); // search global command
3992  }
3993  }
3994  if (myDef != NULL) // documented command
3995  {
3996  tcl.code->writeCodeLink(myDef->getReference().data(),
3997  myDef->getOutputFileBase().data(),
3998  myDef->anchor().data(),
3999  name,
4000  myDef->qualifiedName().data());
4001  if (tcl.memberdef)
4002  {
4003  myDef->addSourceReferencedBy(tcl.memberdef);
4004  tcl.memberdef->addSourceReferences(myDef);
4005  } else {
4006  Entry* callerEntry;
4007  unsigned int i;
4008  // walk the stack of scan contexts and find the enclosing method or proc
4009  for (i=0;i<tcl.scan.count();i++)
4010  {
4011  callerEntry=tcl.scan.at(i)->entry_scan;
4012  if (callerEntry->mtype==Method && !callerEntry->name.isEmpty())
4013  {
4014  break;
4015  }
4016  }
4017  if (i<tcl.scan.count())
4018  {
4019  // enclosing method found
4020  QCString callerName = callerEntry->name;
4021  if (callerName.mid(0,2)=="::") // fully qualified global command
4022  {
4023  callerName = callerName.mid(2);
4024  }
4025  else
4026  {
4027  if (!(tcl.scan.at(0)->ns.stripWhiteSpace().isEmpty()))
4028  {
4029  callerName = tcl.scan.at(0)->ns + "::" + callerEntry->name;
4030  }
4031  }
4032  MemberDef *callerDef=NULL;
4033  callerDef = fn.find(callerName);
4034  if (callerDef!=NULL && myDef!= NULL && tcl.collectXRefs)
4035  {
4036  addDocCrossReference(callerDef,myDef);
4037  }
4038  }
4039  }
4040  }
4041  else if (tcl_keyword(myName)) // check keyword
4042  {
4043  tcl_codify("keyword",name);
4044  }
4045  else
4046  {
4047  tcl_codify(NULL,name); // something else
4048  }
4049 
4050 }
4051 
4052 //! scan general argument for brackets
4053 //
4054 // parses (*tcl.list_commandwords.at(i)).utf8() and checks for brackets.
4055 // Starts a new scan context if needed (*myScan==0 and brackets found).
4056 // Returns NULL or the created scan context.
4057 //
4058 static tcl_scan *tcl_command_ARG(tcl_scan *myScan, unsigned int i, bool ignoreOutermostBraces)
4059 {
4060  QCString myName;
4061  bool insideQuotes=false;
4062  unsigned int insideBrackets=0;
4063  unsigned int insideBraces=0;
4064  myName = (*tcl.list_commandwords.at(i)).utf8();
4065  if (i%2 != 0)
4066  {
4067  // handle white space
4068  myScan = tcl_codify_token(myScan, "NULL", myName);
4069  }
4070  else
4071  {
4072  QCString myStr = "";
4073  unsigned int j;
4074  for (j=0;j<myName.length();j++)
4075  {
4076  QChar c = myName[j];
4077  bool backslashed = false;
4078  if (j>0)
4079  {
4080  backslashed = myName[j-1]=='\\';
4081  }
4082  // this is a state machine
4083  // input is c
4084  // internal state is myScan and insideXXX
4085  // these are the transitions:
4086  if (c=='[' && !backslashed && insideBraces==0)
4087  {
4088  insideBrackets++;
4089  }
4090  if (c==']' && !backslashed && insideBraces==0 && insideBrackets>0)
4091  {
4092  insideBrackets--;
4093  }
4094  if (c=='{' && !backslashed && !insideQuotes && !(ignoreOutermostBraces && j==0))
4095  {
4096  insideBraces++;
4097  }
4098  if (c=='}' && !backslashed && !insideQuotes && insideBraces>0)
4099  {
4100  insideBraces--;
4101  }
4102  if (c=='"' && !backslashed && insideBraces==0)
4103  {
4104  insideQuotes=!insideQuotes;
4105  }
4106  // all output, depending on state and input
4107  if (c=='[' && !backslashed && insideBrackets==1 && insideBraces==0)
4108  {
4109  // the first opening bracket, output what we have so far
4110  myStr+=c;
4111  myScan = tcl_codify_token(myScan, "NULL", myStr);
4112  myStr="";
4113  }
4114  else if (c==']' && !backslashed && insideBrackets==0 && insideBraces==0)
4115  {
4116  // the last closing bracket, start recursion, switch to deferred
4117  myScan = tcl_codify_token(myScan, "script", myStr);
4118  myStr="";
4119  myStr+=c;
4120  }
4121  else
4122  {
4123  myStr+=c;
4124  }
4125  }
4126  if (i == 0 && myScan == NULL)
4127  {
4128  tcl_codify_link(myStr);
4129  }
4130  else
4131  {
4132  myScan = tcl_codify_token(myScan, "NULL", myStr);
4133  }
4134  }
4135  return (myScan);
4136 }
4137 
4138 //! Handle internal tcl commands.
4139 // "eval arg ?arg ...?"
4140 static void tcl_command_EVAL()
4141 {
4142 D
4143  tcl_codify_cmd("keyword", 0);
4144  tcl_scan *myScan = tcl.scan.at(0);
4145  QCString myString = "";
4146  // we simply rescan the line without the eval
4147  // we include leading whitespace because tcl_scan_start will examine
4148  // the first char. If it finds a bracket it will assume one expression in brackets.
4149  // Example: eval [list set] [list NotInvoked] [Invoked NotInvoked]
4150  for (unsigned int i = 1; i < tcl.list_commandwords.count(); i++)
4151  {
4152  myString += (*tcl.list_commandwords.at(i)).utf8();
4153  }
4154  myScan = tcl_scan_start('?', myString,
4155  myScan->ns, myScan->entry_cl, myScan->entry_fn);
4156 }
4157 
4158 //! Handle internal tcl commands.
4159 // switch ?options? string pattern body ?pattern body ...?
4160 // switch ?options? string {pattern body ?pattern body ...?}
4161 static void tcl_command_SWITCH()
4162 {
4163 D
4164  tcl_codify_cmd("keyword",0);
4165  tcl_codify_cmd(NULL,1);
4166  tcl_scan *myScan=NULL;
4167  unsigned int i;
4168  QCString token;
4169  // first: find the last option token
4170  unsigned int lastOptionIndex = 0;
4171  for (i = 2; i<tcl.list_commandwords.count(); i += 2)
4172  {
4173  token = (*tcl.list_commandwords.at(i)).utf8();
4174  if (token == "--")
4175  {
4176  lastOptionIndex = i;
4177  break;
4178  }
4179  if (token[0] == '-' && i - lastOptionIndex == 2)
4180  {
4181  // options start with dash and should form a continuous chain
4182  lastOptionIndex = i;
4183  }
4184  }
4185  // second: eat up options
4186  for (i = 2; i <= lastOptionIndex; i++)
4187  {
4188  myScan = tcl_command_ARG(myScan, i, false);
4189  }
4190  // third: how many tokens are left?
4191  if (tcl.list_commandwords.count() - lastOptionIndex == 5)
4192  {
4193  //printf("syntax: switch ?options? string {pattern body ?pattern body ...?}\n");
4194  myScan = tcl_command_ARG(myScan, lastOptionIndex + 1, false);
4195  myScan = tcl_command_ARG(myScan, lastOptionIndex + 2, false);
4196  myScan = tcl_command_ARG(myScan, lastOptionIndex + 3, false);
4197  // walk trough the list step by step
4198  // this way we can preserve whitespace
4199  bool inBraces = false;
4200  bool nextIsPattern = true;
4201  int size;
4202  const char *elem;
4203  const char *next;
4204  token = (*tcl.list_commandwords.at(lastOptionIndex + 4)).utf8();
4205  if (token[0] == '{')
4206  {
4207  inBraces = true;
4208  token = token.mid(1, token.length() - 2);
4209  myScan = tcl_codify_token(myScan, "NULL", QCString("{"));
4210  }
4211  // ToDo: check if multibyte chars are handled correctly
4212  while (token.length() > 0)
4213  {
4214  TclFindElement((const char*)token, token.length(), &elem, &next, &size, NULL);
4215  //printf("%s\nstart=%d, elem=%d, next=%d, size=%d, brace=%d\n",
4216  // (const char*) token, (const char*) token, elem, next, size, brace);
4217  //
4218  // handle leading whitespace/opening brace/double quotes
4219  if (elem - token > 0)
4220  {
4221  myScan = tcl_codify_token(myScan, "NULL", token.left(elem - token));
4222  }
4223  // handle actual element without braces/double quotes
4224  if (nextIsPattern)
4225  {
4226  myScan = tcl_codify_token(myScan, "NULL", token.mid(elem - token,size));
4227  //printf("pattern=%s\n",(const char*) token.mid(elem - token, size));
4228  }
4229  else {
4230  myScan = tcl_codify_token(myScan, "script", token.mid(elem - token, size));
4231  //printf("script =%s\n", (const char*) token.mid(elem - token, size));
4232  }
4233  // handle trailing whitespace/closing brace/double quotes
4234  if (next - elem - size > 0)
4235  {
4236  myScan = tcl_codify_token(myScan, "NULL", token.mid(elem - token + size, next - elem - size));
4237  }
4238  nextIsPattern = !nextIsPattern;
4239  token = token.mid(next - token);
4240  }
4241  if (inBraces)
4242  {
4243  myScan = tcl_codify_token(myScan, "NULL", QCString("}"));
4244  }
4245  if (!nextIsPattern)
4246  {
4247  tcl_war("Invalid switch syntax: last token is not a list of even elements.\n");
4248  //tcl_war("%s\n", tcl.list_commandwords.join(" ").ascii());
4249  }
4250  }
4251  else if ((tcl.list_commandwords.count() - lastOptionIndex > 6) &&
4252  ((tcl.list_commandwords.count() - lastOptionIndex-3) % 4 == 0))
4253  {
4254  //printf("detected: switch ?options? string pattern body ?pattern body ...?\n");
4255  myScan = tcl_command_ARG(myScan, lastOptionIndex + 1, false);
4256  myScan = tcl_command_ARG(myScan, lastOptionIndex + 2, false);
4257  //printf("value=%s\n",(const char*) (*tcl.list_commandwords.at(lastOptionIndex + 2)).utf8());
4258  for (i = lastOptionIndex + 3; i < tcl.list_commandwords.count(); i += 4)
4259  {
4260  myScan = tcl_command_ARG(myScan, i + 0, false); // whitespace
4261  myScan = tcl_command_ARG(myScan, i + 1, false); // pattern
4262  myScan = tcl_command_ARG(myScan, i + 2, false); // whitespace
4263  myScan = tcl_codify_token(myScan, "script", (*tcl.list_commandwords.at(i+3)).utf8()); // script
4264  //printf("pattern=%s\n",(const char*) (*tcl.list_commandwords.at(i+1)).utf8());
4265  //printf("script=%s\n",(const char*) (*tcl.list_commandwords.at(i+3)).utf8());
4266  }
4267  }
4268  else
4269  {
4270  // not properly detected syntax
4271  tcl_war("Invalid switch syntax: %d options followed by %d tokens.\n",
4272  lastOptionIndex / 2, (tcl.list_commandwords.count() - 1) / 2 - lastOptionIndex / 2);
4273  for (i = lastOptionIndex + 1; i <= tcl.list_commandwords.count(); i++)
4274  {
4275  myScan = tcl_command_ARG(myScan, i, false);
4276  }
4277  }
4278 }
4279 
4280 //! Handle internal tcl commands.
4281 // "catch script ?resultVarName? ?optionsVarName?"
4282 static void tcl_command_CATCH()
4283 {
4284 D
4285  tcl_codify_cmd("keyword", 0);
4286  tcl_codify_cmd(NULL, 1);
4287  tcl_scan *myScan = tcl.scan.at(0);
4288  myScan = tcl_scan_start('?', *tcl.list_commandwords.at(2),
4289  myScan->ns, myScan->entry_cl, myScan->entry_fn);
4290  for (unsigned int i = 3; i < tcl.list_commandwords.count(); i++)
4291  {
4292  myScan = tcl_command_ARG(myScan, i, false);
4293  }
4294 }
4295 
4296 //! Handle internal tcl commands.
4297 // "if expr1 ?then? body1 elseif expr2 ?then? body2 elseif ... ?else? ?bodyN?"
4299 {
4300 D
4301  tcl_codify_cmd("keyword",0);
4302  tcl_codify_cmd(NULL,1);
4303  tcl_scan *myScan = NULL;
4304  myScan = tcl_command_ARG(myScan, 2, true);
4305  for (unsigned int i = 3;i<tcl.list_commandwords.count();i++)
4306  {
4307  if (type[i] == "expr")
4308  {
4309  myScan = tcl_command_ARG(myScan, i, true);
4310  }
4311  else
4312  {
4313  if (myScan!=0)
4314  {
4315  myScan->after << type[i] << tcl.list_commandwords[i];
4316  }
4317  else
4318  {
4319  myScan=tcl.scan.at(0);
4320  myScan = tcl_scan_start('?',*tcl.list_commandwords.at(i),
4321  myScan->ns,myScan->entry_cl,myScan->entry_fn);
4322  }
4323  }
4324  }
4325 }
4326 //! Handle internal tcl commands.
4327 // "for start test next body"
4328 static void tcl_command_FOR()
4329 {
4330 D
4331  tcl_codify_cmd("keyword",0);
4332  tcl_codify_cmd(NULL,1);
4333  tcl_scan *myScan=tcl.scan.at(0);
4334  myScan = tcl_scan_start('?',*tcl.list_commandwords.at(2),
4335  myScan->ns,myScan->entry_cl,myScan->entry_fn);
4336  myScan->after << "NULL" << tcl.list_commandwords[3];
4337  myScan = tcl_command_ARG(myScan, 4, true);
4338  myScan->after << "NULL" << tcl.list_commandwords[5];
4339  myScan->after << "script" << tcl.list_commandwords[6];
4340  myScan->after << "NULL" << tcl.list_commandwords[7];
4341  myScan->after << "script" << tcl.list_commandwords[8];
4342 }
4343 
4344 ///! Handle internal tcl commands.
4345 // "foreach varname list body" and
4346 // "foreach varlist1 list1 ?varlist2 list2 ...? body"
4347 static void tcl_command_FOREACH()
4348 {
4349 D
4350  unsigned int i;
4351  tcl_scan *myScan=NULL;
4352  tcl_codify_cmd("keyword",0);
4353  for (i = 1;i<tcl.list_commandwords.count()-1;i++)
4354  {
4355  myScan = tcl_command_ARG(myScan, i, false);
4356  }
4357  if (myScan!=0)
4358  {
4359  myScan->after << "script" << tcl.list_commandwords[tcl.list_commandwords.count()-1];
4360  }
4361  else
4362  {
4363  myScan=tcl.scan.at(0);
4364  myScan = tcl_scan_start('?',*tcl.list_commandwords.at(tcl.list_commandwords.count()-1),
4365  myScan->ns,myScan->entry_cl,myScan->entry_fn);
4366  }
4367 }
4368 
4369 ///! Handle internal tcl commands.
4370 // "while test body"
4371 static void tcl_command_WHILE()
4372 {
4373 D
4374  tcl_codify_cmd("keyword",0);
4375  tcl_codify_cmd(NULL,1);
4376  tcl_scan *myScan = NULL;
4377  myScan = tcl_command_ARG(myScan, 2, true);
4378  myScan = tcl_command_ARG(myScan, 3, false);
4379  if (myScan!=0)
4380  {
4381  myScan->after << "script" << tcl.list_commandwords[4];
4382  }
4383  else
4384  {
4385  myScan=tcl.scan.at(0);
4386  myScan = tcl_scan_start('?',*tcl.list_commandwords.at(4),
4387  myScan->ns,myScan->entry_cl,myScan->entry_fn);
4388  }
4389 }
4390 
4391 //! Handle all other commands.
4392 // Create links of first command word or first command word inside [].
4393 static void tcl_command_OTHER()
4394 {
4395  tcl_scan *myScan=NULL;
4396  for (unsigned int i=0; i< tcl.list_commandwords.count(); i++)
4397  {
4398  myScan = tcl_command_ARG(myScan, i, false);
4399  }
4400 }
4401 
4402 //! Handle \c proc statements.
4403 static void tcl_command_PROC()
4404 {
4405 D
4406  QCString myNs, myName;
4407  Entry *myEntryNs;
4408  Entry *myEntry;
4409  tcl_scan *myScan = tcl.scan.at(0);
4410 
4411  tcl_codify_cmd("keyword",0);
4412  tcl_codify_cmd(NULL,1);
4413  tcl_codify_cmd(NULL,2);
4414  tcl_codify_cmd(NULL,3);
4415  tcl_codify_cmd(NULL,4);
4416  tcl_codify_cmd(NULL,5);
4417  tcl_name_SnippetAware(myScan->ns,(*tcl.list_commandwords.at(2)).utf8(),myNs,myName);
4418  if (myNs.length())
4419  {
4420  myEntryNs = tcl_entry_namespace(myNs);
4421  }
4422  else
4423  {
4424  myEntryNs = tcl_entry_namespace(myScan->ns);
4425  }
4426  //why not needed here? tcl.fn.remove(myName);
4427  tcl.entry_current->section = Entry::FUNCTION_SEC;
4428  tcl.entry_current->mtype = Method;
4429  tcl.entry_current->name = myName;
4430  tcl.entry_current->startLine = tcl.line_command;
4431  tcl.entry_current->bodyLine = tcl.line_body0;
4432  tcl.entry_current->endBodyLine = tcl.line_body1;
4433  tcl_protection(tcl.entry_current);
4434  tcl_command_ARGLIST(*tcl.list_commandwords.at(4));
4435  myEntryNs->addSubEntry(tcl.entry_current);
4436  myEntry = tcl.entry_current;
4437  tcl.fn.insert(myName,myEntry);
4438  myScan = tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(6),
4439  myEntryNs->name,NULL,myEntry);
4440 }
4441 
4442 //! Handle \c itcl::body statements and \c oo::define method and method inside \c itcl::class statements.
4443 static void tcl_command_METHOD()
4444 {
4445 D
4446  QCString myNs, myName;
4447  Entry *myEntryCl, *myEntry;
4448  tcl_scan *myScan = tcl.scan.at(0);
4449 
4450  tcl_codify_cmd("keyword",0);
4451  tcl_codify_cmd(NULL,1);
4452  tcl_codify_cmd(NULL,2);
4453  tcl_codify_cmd(NULL,3);
4454  tcl_codify_cmd(NULL,4);
4455  tcl_codify_cmd(NULL,5);
4456  tcl_name(myScan->ns,(*tcl.list_commandwords.at(2)).utf8(),myNs,myName);
4457  if (myNs.length())
4458  {
4459  myEntryCl = tcl_entry_class(myNs);
4460  }
4461  else
4462  {
4463  myNs = myScan->ns;
4464  myEntryCl = myScan->entry_cl;
4465  }
4466  // needed in case of more then one definition p.e. itcl::method and itcl::body
4467  // see also bug #
4468  tcl.fn.remove(myName);
4469  tcl.entry_current->section = Entry::FUNCTION_SEC;
4470  tcl.entry_current->mtype = Method;
4471  tcl.entry_current->name = myName;
4472  tcl.entry_current->startLine = tcl.line_command;
4473  tcl.entry_current->bodyLine = tcl.line_body0;
4474  tcl.entry_current->endBodyLine = tcl.line_body1;
4475  tcl_protection(tcl.entry_current);
4476  tcl_command_ARGLIST(*tcl.list_commandwords.at(4));
4477  myEntryCl->addSubEntry(tcl.entry_current);
4478  tcl.fn.insert(myName,tcl.entry_current);
4479  myEntry = tcl.entry_current;
4480  myScan = tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(6),
4481  myNs, myEntryCl, myEntry);
4482 }
4483 
4484 //! Handle \c constructor statements inside class definitions.
4486 {
4487 D
4488  QCString myNs, myName;
4489  Entry *myEntryCl, *myEntry;
4490  tcl_scan *myScan = tcl.scan.at(0);
4491 
4492  tcl_codify_cmd("keyword",0);
4493  tcl_codify_cmd(NULL,1);
4494  tcl_codify_cmd(NULL,2);
4495  tcl_codify_cmd(NULL,3);
4496  tcl_name(myScan->ns,(*tcl.list_commandwords.at(0)).utf8(),myNs,myName);
4497  if (myNs.length())
4498  {
4499  myEntryCl = tcl_entry_class(myNs);
4500  }
4501  else
4502  {
4503  myNs = myScan->ns;
4504  myEntryCl = myScan->entry_cl;
4505  }
4506  tcl.entry_current->section = Entry::FUNCTION_SEC;
4507  tcl.entry_current->mtype = Method;
4508  tcl.entry_current->name = myName;
4509  tcl.entry_current->startLine = tcl.line_command;
4510  tcl.entry_current->bodyLine = tcl.line_body0;
4511  tcl.entry_current->endBodyLine = tcl.line_body1;
4512  tcl_protection(tcl.entry_current);
4513  tcl_command_ARGLIST(*tcl.list_commandwords.at(2));
4514  if (myEntryCl) myEntryCl->addSubEntry(tcl.entry_current);
4515  myEntry = tcl.entry_current;
4516  tcl.fn.insert(myName,myEntry);
4517  myScan = tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(4),
4518  myNs, myEntryCl, myEntry);
4519 }
4520 
4521 //! Handle \c destructor statements inside class definitions.
4523 {
4524 D
4525  QCString myNs, myName;
4526  Entry *myEntryCl, *myEntry;
4527  tcl_scan *myScan = tcl.scan.at(0);
4528 
4529  tcl_codify_cmd("keyword",0);
4530  tcl_codify_cmd(NULL,1);
4531  tcl_name(myScan->ns,(*tcl.list_commandwords.at(0)).utf8(),myNs,myName);
4532  if (myNs.length())
4533  {
4534  myEntryCl = tcl_entry_class(myNs);
4535  }
4536  else
4537  {
4538  myNs = myScan->ns;
4539  myEntryCl = myScan->entry_cl;
4540  }
4541  tcl.entry_current->section = Entry::FUNCTION_SEC;
4542  tcl.entry_current->mtype = Method;
4543  tcl.entry_current->name = myName;
4544  tcl.entry_current->startLine = tcl.line_command;
4545  tcl.entry_current->bodyLine = tcl.line_body0;
4546  tcl.entry_current->endBodyLine = tcl.line_body1;
4547  tcl_protection(tcl.entry_current);
4548  myEntryCl->addSubEntry(tcl.entry_current);
4549  myEntry = tcl.entry_current;
4550  tcl.fn.insert(myName,myEntry);
4551  myScan = tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(2),
4552  myNs, myEntryCl, myEntry);
4553 }
4554 
4555 //! Handle \c namespace statements.
4557 {
4558 D
4559  QCString myNs, myName, myStr;
4560  //Entry *myEntryNs=NULL;
4561  tcl_scan *myScan = tcl.scan.at(0);
4562 
4563  tcl_codify_cmd("keyword",0);
4564  tcl_codify_cmd(NULL,1);
4565  tcl_codify_cmd("keyword",2);
4566  tcl_codify_cmd(NULL,3);
4567  tcl_codify_cmd(NULL,4);
4568  tcl_codify_cmd(NULL,5);
4569  tcl_name(myScan->ns,(*tcl.list_commandwords.at(4)).utf8(),myNs,myName);
4570  if (myNs.length())
4571  {
4572  myName = myNs+"::"+myName;
4573  }
4574  tcl.entry_current->section = Entry::NAMESPACE_SEC;
4575  tcl.entry_current->name = myName;
4576  tcl.entry_current->startLine = tcl.line_command;
4577  tcl.entry_current->bodyLine = tcl.line_body0;
4578  tcl.entry_current->endBodyLine = tcl.line_body1;
4579  tcl.entry_main->addSubEntry(tcl.entry_current);
4580  tcl.ns.insert(myName,tcl.entry_current);
4581  //myEntryNs = tcl.entry_current;
4582  myStr = (*tcl.list_commandwords.at(6)).utf8();
4583  if (tcl.list_commandwords.count() > 7)
4584  {
4585  for (uint i=7;i<tcl.list_commandwords.count();i++)
4586  {
4587  myStr.append((*tcl.list_commandwords.at(i)).utf8());
4588  }
4589  tcl.word_is=' ';
4590  }
4591  myScan = tcl_scan_start(tcl.word_is,myStr, myName, NULL, NULL);
4592 }
4593 
4594 //! Handle \c itcl::class statements.
4596 {
4597 D
4598  QCString myNs, myName;
4599  Entry *myEntryCl;
4600  tcl_scan *myScan = tcl.scan.at(0);
4601 
4602  tcl_codify_cmd("keyword",0);
4603  tcl_codify_cmd(NULL,1);
4604  tcl_codify_cmd("NULL",2);
4605  tcl_codify_cmd("NULL",3);
4606  tcl_name(myScan->ns,(*tcl.list_commandwords.at(2)).utf8(),myNs,myName);
4607  if (myNs.length())
4608  {
4609  myName = myNs+"::"+myName;
4610  }
4611  tcl.entry_current->section = Entry::CLASS_SEC;
4612  tcl.entry_current->name = myName;
4613  tcl.entry_current->startLine = tcl.line_command;
4614  tcl.entry_current->bodyLine = tcl.line_body0;
4615  tcl.entry_current->endBodyLine = tcl.line_body1;
4616  tcl.entry_main->addSubEntry(tcl.entry_current);
4617  tcl.cl.insert(myName,tcl.entry_current);
4618  myEntryCl = tcl.entry_current;
4619  myScan = tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(4),
4620  myName, myEntryCl, NULL);
4621 }
4622 
4623 //! Handle \c oo::class statements.
4625 {
4626 D
4627  QCString myNs, myName;
4628  //Entry *myEntryNs;
4629  Entry *myEntryCl;
4630  tcl_scan *myScan = tcl.scan.at(0);
4631 
4632  tcl_codify_cmd("keyword",0);
4633  tcl_codify_cmd(NULL,1);
4634  tcl_codify_cmd("NULL",2);
4635  tcl_codify_cmd("NULL",3);
4636  tcl_codify_cmd("NULL",4);
4637  tcl_codify_cmd("NULL",5);
4638  tcl_name(myScan->ns,(*tcl.list_commandwords.at(4)).utf8(),myNs,myName);
4639  if (myNs.length())
4640  {
4641  myName = myNs+"::"+myName;
4642  }
4643  tcl.entry_current->section = Entry::CLASS_SEC;
4644  tcl.entry_current->name = myName;
4645  tcl.entry_current->startLine = tcl.line_command;
4646  tcl.entry_current->bodyLine = tcl.line_body0;
4647  tcl.entry_current->endBodyLine = tcl.line_body1;
4648  tcl.entry_main->addSubEntry(tcl.entry_current);
4649  //myEntryNs = tcl_entry_namespace(myName);
4650  tcl.cl.insert(myName,tcl.entry_current);
4651  myEntryCl = tcl.entry_current;
4652  myScan = tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(6),
4653  myName, myEntryCl, NULL);
4654 }
4655 
4656 //! Handle \c oo::define statements.
4658 {
4659 D
4660  QCString myNs, myName, myStr;
4661  Entry *myEntryCl;
4662  tcl_scan *myScan = tcl.scan.at(0);
4663 
4664  tcl_codify_cmd("keyword",0);
4665  tcl_codify_cmd(NULL,1);
4666  tcl_codify_cmd("NULL",2);
4667  tcl_codify_cmd("NULL",3);
4668  tcl_name(myScan->ns,(*tcl.list_commandwords.at(2)).utf8(),myNs,myName);
4669  if (myNs.length())
4670  {
4671  myName = myNs+"::"+myName;
4672  }
4673  myEntryCl = tcl_entry_class(myName);
4674  myStr = (*tcl.list_commandwords.at(4)).utf8();
4675  //
4676  // special cases first
4677  // oo::define classname method methodname args script
4678  // oo::define classname constructor argList bodyScript
4679  // oo::define classname destructor bodyScript
4680  unsigned int n =tcl.list_commandwords.count();
4681  if ((myStr == "method" && n == 11) ||
4682  (myStr == "constructor" && n == 9) ||
4683  (myStr == "destructor" && n == 7))
4684  {
4685  for (unsigned int i = 4; i < n-1; i++)
4686  {
4687  tcl_codify_cmd("NULL",i);
4688  }
4689  Entry *myEntry;
4690  QCString myMethod;
4691  tcl_name(myScan->ns,(*tcl.list_commandwords.at(n==11?6:4)).utf8(),myNs,myMethod);
4692  // code snippet taken from tcl_command_METHOD()/tcl_command_CONSTRUCTOR
4693  tcl.fn.remove(myMethod);
4694  tcl.entry_current->section = Entry::FUNCTION_SEC;
4695  tcl.entry_current->mtype = Method;
4696  tcl.entry_current->name = myMethod;
4697  tcl.entry_current->startLine = tcl.line_command;
4698  tcl.entry_current->bodyLine = tcl.line_body0;
4699  tcl.entry_current->endBodyLine = tcl.line_body1;
4700  tcl_protection(tcl.entry_current);
4701  if (n==11)
4702  {
4703  tcl_command_ARGLIST(*tcl.list_commandwords.at(8));
4704  }
4705  else if (n==9)
4706  {
4707  tcl_command_ARGLIST(*tcl.list_commandwords.at(6));
4708  }
4709  if (myEntryCl) myEntryCl->addSubEntry(tcl.entry_current);
4710  tcl.fn.insert(myMethod,tcl.entry_current);
4711  myEntry = tcl.entry_current;
4712  myScan = tcl_scan_start('?',*tcl.list_commandwords.at(n-1),
4713  myNs, myEntryCl, myEntry);
4714  }
4715  else
4716  {
4717  // The general case
4718  // Simply concat all arguments into a script.
4719  // Note: all documentation collected just before the
4720  // oo::define command is lost
4721  if (tcl.list_commandwords.count() > 5)
4722  {
4723  for (uint i=5;i<tcl.list_commandwords.count();i++)
4724  {
4725  myStr.append((*tcl.list_commandwords.at(i)).utf8());
4726  }
4727  tcl.word_is=' ';
4728  }
4729  myScan = tcl_scan_start(tcl.word_is,myStr,myName,myEntryCl,NULL);
4730  }
4731 }
4732 
4733 //! Handle \c variable statements.
4734 static void tcl_command_VARIABLE(int inclass)
4735 {
4736 D
4737  QCString myNs, myName;
4738  Entry *myEntry;
4739  tcl_scan *myScan = tcl.scan.at(0);
4740 
4741  tcl_codify_cmd("keyword",0);
4742  for (unsigned int i=1; i< tcl.list_commandwords.count(); i++)
4743  {
4744  tcl_codify_cmd(NULL,i);
4745  }
4746  tcl_name(myScan->ns,(*tcl.list_commandwords.at(2)).utf8(),myNs,myName);
4747  if (myNs.length())
4748  {// qualified variables go into namespace
4749  myEntry = tcl_entry_namespace(myNs);
4750  tcl.entry_current->stat = true;
4751  }
4752  else
4753  {
4754  if (inclass)
4755  {
4756  myEntry = myScan->entry_cl;
4757  tcl.entry_current->stat = false;
4758  }
4759  else
4760  {
4761  myEntry = tcl_entry_namespace(myScan->ns);
4762  tcl.entry_current->stat = true;
4763  }
4764  }
4765  tcl.entry_current->section = Entry::VARIABLE_SEC;
4766  tcl.entry_current->name = myName;
4767  tcl.entry_current->startLine = tcl.line_command;
4768  tcl.entry_current->bodyLine = tcl.line_body0;
4769  tcl.entry_current->endBodyLine = tcl.line_body1;
4770  tcl_protection(tcl.entry_current);
4771  myEntry->addSubEntry(tcl.entry_current);
4772  tcl.entry_current = tcl_entry_new();
4773 }
4774 
4775 //! Handling of command parsing.
4776 //! what=0 -> ...
4777 //! what=1 -> ...
4778 //! what=-1 -> ...
4779 static void tcl_command(int what,const char *text)
4780 {
4781  int myLine=0;
4782  if (what==0)
4783  {
4784  tcl.scan.at(0)->line1=tclscannerYYlineno;// current line in scan context
4785  tcl.line_body0=tclscannerYYlineno;// start line of command
4786 tcl_inf("<- %s\n",text);
4788  tcl.list_commandwords.clear();
4789  tcl.string_command="";
4790  tcl.string_last="";
4791  tcl.command=1;
4792  return;
4793  }
4794  else if (what==1)
4795  {
4796  if (tcl.string_last.length())
4797  {
4798  tcl.list_commandwords.append(tcl.string_last);
4799  tcl.string_last="";
4800  }
4801  if (text)
4802  {
4803  tcl.list_commandwords.append(text);
4804  }
4805  return;
4806  }
4807  else if (what!=-1)
4808  {// should not happen
4809  tcl_err("what %d\n",what);
4810  return;
4811  }
4812  QCString myText = text;
4813 tcl_inf("->\n");
4814  if (tcl.command==0)
4815  {
4816  return; //TODO check on inside comment
4817  }
4818  if (tcl.string_last != "")
4819  {// get last word
4820  tcl.list_commandwords.append(tcl.string_last);
4821  tcl.string_last="";
4822  }
4823  yy_pop_state();
4824 
4825  // check command
4826  QCString myStr = (*tcl.list_commandwords.at(0)).utf8();
4827  tcl_scan *myScanBackup=tcl.scan.at(0);
4828  int myLevel = 0;
4829  Protection myProt = tcl.protection;
4830 
4831  if (tcl.list_commandwords.count() < 3)
4832  {
4834  goto command_end;
4835  }
4836  // remove leading "::" and apply TCL_SUBST
4837  if (myStr.left(2)=="::") myStr = myStr.mid(2);
4838  if (tcl.config_subst.contains(myStr))
4839  {
4840  myStr=tcl.config_subst[myStr].utf8();
4841  }
4842  if (myStr=="private")
4843  {
4844  tcl.protection = Private;
4845  myLevel = 1;
4846  }
4847  else if (myStr=="protected")
4848  {
4849  tcl.protection = Protected;
4850  myLevel = 1;
4851  }
4852  else if (myStr=="public")
4853  {
4854  tcl.protection = Public;
4855  myLevel = 1;
4856  }
4857  if (myLevel)
4858  {
4859  tcl_codify_cmd("keyword",0);
4860  tcl_codify_cmd(NULL,1);
4861  tcl.list_commandwords.remove(tcl.list_commandwords.at(1));
4862  tcl.list_commandwords.remove(tcl.list_commandwords.at(0));
4863  if (tcl.list_commandwords.count()==1)
4864  {
4865  tcl_scan *myScan = tcl.scan.at(0);
4866  myScan = tcl_scan_start(tcl.word_is,*tcl.list_commandwords.at(0),
4867  myScan->ns,myScan->entry_cl,myScan->entry_fn);
4868  myProt = tcl.protection;
4869  goto command_end;
4870  }
4871  myStr = (*tcl.list_commandwords.at(0)).utf8();
4872  // remove leading "::" and apply TCL_SUBST
4873  if (myStr.left(2)=="::") myStr = myStr.mid(2);
4874  if (tcl.config_subst.contains(myStr))
4875  {
4876  myStr=tcl.config_subst[myStr].utf8();
4877  }
4878  }
4879  if (myStr=="proc")
4880  {
4881  if (tcl.list_commandwords.count() == 5)
4882  {// itcl::proc
4883  tcl.list_commandwords.append("");
4884  tcl.list_commandwords.append("");
4885  }
4886  if (tcl.list_commandwords.count() != 7) {myLine=__LINE__;goto command_warn;}
4887  tcl_command_PROC();
4888  goto command_end;
4889  }
4890  if (myStr=="method")
4891  {
4892  if (tcl.list_commandwords.count() == 5)
4893  {// itcl::method
4894  tcl.list_commandwords.append("");
4895  tcl.list_commandwords.append("");
4896  }
4897  if (tcl.list_commandwords.count() != 7) {myLine=__LINE__;goto command_warn;}
4899  goto command_end;
4900  }
4901  if (myStr=="constructor")
4902  {
4903  if (tcl.list_commandwords.count() != 5) {myLine=__LINE__;goto command_warn;}
4905  goto command_end;
4906  }
4907  if (myStr=="destructor")
4908  {
4909  if (tcl.list_commandwords.count() != 3) {myLine=__LINE__;goto command_warn;}
4911  goto command_end;
4912  }
4913  if (myStr=="namespace")
4914  {
4915  if ((*tcl.list_commandwords.at(2)).utf8()=="eval")
4916  {
4917  if (tcl.list_commandwords.count() < 7) {myLine=__LINE__;goto command_warn;}
4919  goto command_end;
4920  }
4922  goto command_end;
4923  }
4924  if (myStr=="itcl::class")
4925  {
4926  if (tcl.list_commandwords.count() != 5) {myLine=__LINE__;goto command_warn;}
4928  goto command_end;
4929  }
4930  if (myStr=="itcl::body")
4931  {
4932  if (tcl.list_commandwords.count() != 7) {myLine=__LINE__;goto command_warn;}
4934  goto command_end;
4935  }
4936  if (myStr=="oo::class")
4937  {
4938  if ((*tcl.list_commandwords.at(2)).utf8()=="create")
4939  {
4940  if (tcl.list_commandwords.count() != 7) {myLine=__LINE__;goto command_warn;}
4942  goto command_end;
4943  }
4945  goto command_end;
4946  }
4947  if (myStr=="oo::define")
4948  {
4949  if (tcl.list_commandwords.count() < 5) {myLine=__LINE__;goto command_warn;}
4951  goto command_end;
4952  }
4953  if (myStr=="variable")
4954  {
4955  if (tcl.list_commandwords.count() < 3) {myLine=__LINE__;goto command_warn;}
4956  if (tcl.scan.at(0)->entry_fn == NULL)
4957  {// only parsed outside functions
4958  tcl_command_VARIABLE(tcl.scan.at(0)->entry_cl && tcl.scan.at(0)->entry_cl->name!="");
4959  goto command_end;
4960  }
4961  }
4962  if (myStr=="common")
4963  {
4964  if (tcl.list_commandwords.count() < 3) {myLine=__LINE__;goto command_warn;}
4965  if (tcl.scan.at(0)->entry_fn == NULL)
4966  {// only parsed outside functions
4968  goto command_end;
4969  }
4970  }
4971  if (myStr=="inherit" || myStr=="superclass")
4972  {
4973  if (tcl.list_commandwords.count() < 3) {myLine=__LINE__;goto command_warn;}
4974  if (tcl.scan.at(0)->entry_cl && tcl.scan.at(0)->entry_cl->name!="")
4975  {
4976  for (unsigned int i = 2; i < tcl.list_commandwords.count(); i = i + 2)
4977  {
4978  tcl.scan.at(0)->entry_cl->extends->append(new BaseInfo((*tcl.list_commandwords.at(i)).utf8(),Public,Normal));
4979  }
4980  }
4981  goto command_end;
4982  }
4983  /*
4984  * Start of internal tcl keywords
4985  * Ready: switch, eval, catch, if, for, foreach, while
4986  */
4987  if (myStr=="switch")
4988  {
4989  if (tcl.list_commandwords.count() < 5) {myLine=__LINE__;goto command_warn;}
4991  goto command_end;
4992  }
4993  if (myStr=="eval")
4994  {
4995  if (tcl.list_commandwords.count() < 3) {myLine=__LINE__;goto command_warn;}
4996  tcl_command_EVAL();
4997  goto command_end;
4998  }
4999  if (myStr=="catch")
5000  {
5001  if (tcl.list_commandwords.count() < 3) {myLine=__LINE__;goto command_warn;}
5003  goto command_end;
5004  }
5005  if (myStr=="for")
5006  {
5007  if (tcl.list_commandwords.count() != 9) {myLine=__LINE__;goto command_warn;}
5008  tcl_command_FOR();
5009  goto command_end;
5010  }
5011  if (myStr=="foreach")
5012  {
5013  if (tcl.list_commandwords.count() < 7 || tcl.list_commandwords.count()%2==0) {myLine=__LINE__;goto command_warn;}
5015  goto command_end;
5016  }
5017  /*
5018 if expr1 ?then? body1 elseif expr2 ?then? body2 elseif ... ?else? ?bodyN?
5019  */
5020  if (myStr=="if" && tcl.list_commandwords.count() > 4)
5021  {
5022  QStringList myType;
5023  myType << "keyword" << "NULL" << "expr" << "NULL";
5024  char myState='x';// last word: e'x'pr 't'hen 'b'ody 'e'lse else'i'f..
5025  for (unsigned int i = 4; i < tcl.list_commandwords.count(); i = i + 2)
5026  {
5027  QCString myStr=(*tcl.list_commandwords.at(i)).utf8();
5028  if (myState=='x')
5029  {
5030  if (myStr=="then")
5031  {
5032  myState='t';
5033  myType << "keyword" << "NULL";
5034  }
5035  else
5036  {
5037  myState='b';
5038  myType << "script" << "NULL";
5039  }
5040  }
5041  else if (myState=='t')
5042  {
5043  myState='b';
5044  myType << "script" << "NULL";
5045  }
5046  else if (myState=='b')
5047  {
5048  if (myStr=="elseif") {
5049  myState='i';
5050  myType << "keyword" << "NULL";
5051  }
5052  else if (myStr=="else" && i==tcl.list_commandwords.count()-3)
5053  {
5054  myState = 'b';
5055  myType << "keyword" << "NULL" << "script";
5056  i = tcl.list_commandwords.count();
5057  }
5058  else if (i==tcl.list_commandwords.count()-1)
5059  {
5060  myState = 'b';
5061  myType << "script";
5062  i = tcl.list_commandwords.count();
5063  }
5064  else
5065  {
5066  myLine=__LINE__;goto command_warn;
5067  }
5068  }
5069  else if (myState=='i')
5070  {
5071  myState='x';
5072  myType << "expr" << "NULL";
5073  }
5074  }
5075  if (myState != 'b') {myLine=__LINE__;goto command_warn;}
5076  tcl_command_IF(myType);
5077  goto command_end;
5078  }
5079  if (myStr=="while")
5080  {
5081  if (tcl.list_commandwords.count() != 5) {myLine=__LINE__;goto command_warn;}
5083  goto command_end;
5084  }
5086  goto command_end;
5087  command_warn:// print warning message because of wrong used syntax
5088  tcl_war("%d count=%d: %s\n",myLine,tcl.list_commandwords.count(),tcl.list_commandwords.join(" ").ascii());
5090  command_end:// add remaining text to current context
5091  if (!myText.isEmpty())
5092  {
5093  if(myScanBackup==tcl.scan.at(0))
5094  {
5095  tcl_codify("comment",myText);
5096  }
5097  else
5098  {
5099  tcl.scan.at(0)->after << "comment" << myText;
5100  }
5101  }
5102  tcl.list_commandwords.clear();
5103  tcl.command = 0;
5104  tcl.protection = myProt;
5105 }
5106 
5107 //----------------------------------------------------------------------------
5108 //! Common initializations.
5109 static void tcl_init()
5110 {
5111  // Get values from option TCL_SUBST
5112  tcl.config_subst.clear();
5113  if (Config::instance()->get("TCL_SUBST"))
5114  {
5115  QStrList myStrList = Config_getList("TCL_SUBST");
5116  const char *s=myStrList.first();
5117  while (s)
5118  {
5119  QCString myStr=s;
5120  int i=myStr.find('=');
5121  if (i>0)
5122  {
5123  QCString myName=myStr.left(i).stripWhiteSpace();
5124  QCString myValue=myStr.right(myStr.length()-i-1).stripWhiteSpace();
5125  if (!myName.isEmpty() && !myValue.isEmpty())
5126 tcl_inf("TCL_SUBST: use '%s'\n",s);
5127  tcl.config_subst[myName] = myValue;
5128  }
5129  s = myStrList.next();
5130  }
5131  }
5132 
5133  if (tcl.input_string.at(tcl.input_string.length()-1) == 0x1A)
5134  {
5135  }
5136  else if (tcl.input_string.at(tcl.input_string.length()-1) == '\n')
5137  {
5138  tcl.input_string[tcl.input_string.length()-1] = 0x1A;
5139  }
5140  else
5141  {
5142  tcl.input_string += 0x1A;
5143  }
5144 
5145  tcl.code = NULL;
5146  tcl.code_font=NULL;
5147  tcl.code_line=1;
5148  tcl.code_linenumbers=1;
5149  tcl.config_autobrief = Config_getBool("JAVADOC_AUTOBRIEF");
5150  tcl.input_position = 0;
5151  tcl.file_name = NULL;
5152  tcl.this_parser = NULL;
5153  tcl.command=0;
5154  tcl.comment=0;
5155  tcl.brace_level=0;
5156  tcl.bracket_level=0;
5157  tcl.bracket_quote=0;
5158  tcl.word_is=' ';
5159  tcl.string_command="";
5160  tcl.string_commentline="";
5161  tcl.string_commentcodify="";
5162  tcl.string_comment = "";
5163  tcl.string_last = "";
5164  tcl.entry_main = NULL;
5165  tcl.entry_file = NULL;
5166  tcl.entry_current = NULL;
5167  tcl.entry_inside = NULL;
5168  tcl.list_commandwords.clear();
5169  tcl.scan.clear();
5170  tcl.ns.clear();
5171  tcl.cl.clear();
5172  tcl.fn.clear();
5173  tclscannerYYlineno = 1;
5174  tcl.protection = Public;
5175  tcl.memberdef = NULL;
5176 }
5177 
5178 //! Start parsing.
5179 static void tcl_parse(const QCString ns, const QCString cls)
5180 {
5181  tcl_scan *myScan;
5182 
5183  tcl.entry_file = tcl_entry_new();
5184  tcl.entry_file->name = tcl.file_name;
5185  tcl.entry_file->section = Entry::SOURCE_SEC;
5186  tcl.entry_file->protection = Public;
5187  tcl.entry_main->addSubEntry(tcl.entry_file);
5188  Entry *myEntry=tcl_entry_new();
5189  myEntry->name="";
5190  tcl.entry_main->addSubEntry(myEntry);
5191  tcl.ns.insert("::",myEntry);
5192  tcl.entry_current = tcl_entry_new();
5193 
5195  BEGIN( TOP );
5196  tclscannerYYlineno=1;
5197  myScan = new tcl_scan;
5198  myScan->type[0]=' ';myScan->type[1]='\n';
5199  myScan->after.clear();
5200  myScan->line0=tclscannerYYlineno;
5201  myScan->line1=tclscannerYYlineno;
5203  myScan->ns=ns;
5204  myScan->entry_cl=tcl_entry_class(cls);
5205  myScan->entry_fn=NULL;
5206  tcl.entry_inside = tcl.entry_file;
5207  myScan->entry_scan = tcl.entry_inside;
5208  tcl.scan.insert(0,myScan);
5209  tclscannerYYlex();
5210  tcl.scan.clear();
5211  tcl.ns.clear();
5212  tcl.cl.clear();
5213  tcl.fn.clear();
5214  tcl.entry.clear();
5215 }
5216 
5217 //! Parse text file and build up entry tree.
5219  const char *input,
5220  Entry *root,
5221  bool /*sameTranslationUnit*/,
5222  QStrList & /*filesInSameTranslationUnit*/)
5223 {
5224  QFile myFile;
5225 tcl_inf("%s\n",fileName);
5226  myFile.setName(fileName);
5227  if (!myFile.open(IO_ReadOnly)) return;
5228  if (strlen(input)<1) return;
5229 
5230  tcl.input_string = input;
5231  if (tcl.input_string.length()<1) return;
5232  printlex(tclscannerYY_flex_debug, TRUE, __FILE__, fileName);
5233 
5234  msg("Parsing %s...\n",fileName);
5235  groupEnterFile(fileName,tclscannerYYlineno);
5236 
5237  tcl_init();
5238  tcl.code = NULL;
5239  tcl.file_name = fileName;
5240  tcl.this_parser = this;
5241  tcl.entry_main = root; /* toplevel entry */
5242  tcl_parse("","");
5243  groupLeaveFile(tcl.file_name,tclscannerYYlineno);
5244  root->program.resize(0);
5245  myFile.close();
5246  printlex(tclscannerYY_flex_debug, FALSE, __FILE__, fileName);
5247 }
5248 
5249 //! Parse file and codify.
5251  const char * scopeName,
5252  const QCString & input,
5253  SrcLangExt lang,
5254  bool isExampleBlock,
5255  const char * exampleName,
5256  FileDef * fileDef,
5257  int startLine,
5258  int endLine,
5259  bool inlineFragment,
5260  MemberDef *memberDef,
5261  bool showLineNumbers,
5262  Definition *searchCtx,
5263  bool collectXRefs
5264  )
5265 {
5266  (void)scopeName;
5267  (void)lang;
5268  (void)exampleName;
5269  (void)fileDef;
5270  (void)endLine;
5271  (void)inlineFragment;
5272  (void)searchCtx;
5273  (void)collectXRefs;
5274 
5275  if (input.length()<1) return;
5276  printlex(tclscannerYY_flex_debug, TRUE, __FILE__, fileDef ? fileDef->fileName().data(): NULL);
5277  tcl.input_string = input;
5278 
5279  QCString myNs="";
5280  QCString myCls="";
5281  if (memberDef)
5282  {
5283  if (memberDef->getClassDef())
5284  {
5285  myCls = memberDef->getClassDef()->displayName();
5286  myNs = myCls;
5287  }
5288  else if (memberDef->getNamespaceDef())
5289  {
5290  myNs = memberDef->getNamespaceDef()->displayName();
5291  }
5292  }
5293 
5294  QString myStr="Codifying..";
5295  if (scopeName)
5296  {
5297  myStr +=" scope=";
5298  myStr+=scopeName;
5299  }
5300  if (exampleName)
5301  {
5302  myStr+=" example=";
5303  myStr+=exampleName;
5304  }
5305  if (memberDef)
5306  {
5307  myStr+=" member=";
5308  myStr+=memberDef->memberTypeName();
5309  myStr+=" ";
5310  myStr+=memberDef->qualifiedName();
5311  }
5312  if (fileDef)
5313  {
5314  myStr+=" file=";
5315  myStr+=fileDef->fileName();
5316  }
5317 tcl_inf("%s (%d,%d) %d %d\n",myStr.ascii(),startLine,endLine,isExampleBlock,inlineFragment);
5318 //tcl_inf("%s\n"input.data());
5319  if (isExampleBlock)
5320  {
5321  tcl_codify(NULL,input);
5322  return;
5323  }
5324  tcl_init();
5325  tcl.collectXRefs = collectXRefs;
5326  tcl.memberdef = memberDef;
5327  tcl.code = &codeOutIntf;
5328  if (startLine<0)
5329  {
5330  startLine=1;
5331  }
5332  tclscannerYYlineno=startLine;
5333  tcl.code_linenumbers = showLineNumbers;
5334  tcl.code_line=tclscannerYYlineno;
5335  tcl.code->startCodeLine(tcl.code_linenumbers);
5336  if (tcl.code_linenumbers)
5337  {
5338  tcl.code->writeLineNumber(0,0,0,tcl.code_line);
5339  }
5340  tcl.file_name = "";
5341  tcl.this_parser = NULL;
5342  tcl.entry_main = tcl_entry_new();
5343  tcl_parse(myNs,myCls);
5344  tcl.code->endCodeLine();
5345  tcl.scan.clear();
5346  tcl.ns.clear();
5347  tcl.cl.clear();
5348  tcl.fn.clear();
5349  tcl.entry.clear();
5350  printlex(tclscannerYY_flex_debug, FALSE, __FILE__, fileDef ? fileDef->fileName().data(): NULL);
5351 }
5352 
5354 {
5355  (void)extension;
5356  return FALSE;
5357 }
5358 
5360 {
5361 }
5362 
5364 {
5365  (void)text;
5366 }
5367 
5368 static int yyread(char *buf,int max_size)
5369 {
5370  int c=0;
5371 
5372  *buf = '\0';
5373  while ( c < max_size && tcl.input_string.at(tcl.input_position) )
5374  {
5375  *buf = tcl.input_string.at(tcl.input_position++) ;
5376  c++; buf++;
5377  }
5378  //printf("Read from=%d size=%d max=%d c=%d\n",tcl.input_position,strlen(&tcl.input_string[tcl.input_position]),max_size,c);
5379  return c;
5380 }
5381 
5382 //----------------------------------------------------------------------------
5383 
5384 // to avoid a warning
5385 void tclDummy()
5386 {
5387  yy_top_state();
5388 }
5389 
5390 #if !defined(YY_FLEX_SUBMINOR_VERSION)
5391 //----------------------------------------------------------------------------
5392 extern "C" { // some bogus code to keep the compiler happy
5393  void tclscannerYYdummy() { yy_flex_realloc(0,0); }
5394 }
5395 #endif
5396 
5397 
static QCString name
Definition: declinfo.cpp:673
YY_BUFFER_STATE tclscannerYY_scan_string(yyconst char *yy_str)
void tclscannerYYpop_buffer_state(void)
QGString program
the program text
Definition: entry.h:256
#define YY_BUF_SIZE
Definition: tclscanner.cpp:163
unsigned char flex_uint8_t
Definition: tclscanner.cpp:73
char * data() const
Definition: bufstr.h:81
Q_EXPORT int qstrncmp(const char *str1, const char *str2, uint len)
Definition: qcstring.h:101
static MemberNameSDict * functionNameSDict
Definition: doxygen.h:116
static int yy_start_stack_depth
int TclFindElement(CONST char *list, int listLength, CONST char **elementPtr, CONST char **nextPtr, int *sizePtr, int *bracePtr)
Definition: tclscanner.cpp:789
char * yy_buf_pos
Definition: code.cpp:213
#define tcl_err
Application error.
Definition: tclscanner.cpp:759
FILE * yy_input_file
Definition: code.cpp:210
short int flex_int16_t
Definition: code.cpp:71
static void tcl_command(int what, const char *text)
int yy_n_chars
Definition: code.cpp:223
unsigned int flex_uint32_t
Definition: tclscanner.cpp:75
QCString string_commentline
#define YY_BUFFER_NORMAL
Definition: tclscanner.cpp:268
This class represents an function or template argument list.
Definition: arguments.h:82
Entry * entry_scan
static int yy_get_next_buffer(void)
static int yy_start_stack_ptr
#define YY_MORE_ADJ
Definition: tclscanner.cpp:697
QCString stripWhiteSpace() const
Definition: qcstring.cpp:295
static tcl_scan * tcl_scan_start(char type, QString content, QCString ns, Entry *entry_cls, Entry *entry_fn)
Start new scan context for given &#39;content&#39;.
static yyconst flex_int32_t yy_rule_can_match_eol[56]
Definition: tclscanner.cpp:678
#define YY_RESTORE_YY_MORE_OFFSET
Definition: tclscanner.cpp:698
#define YY_NEW_FILE
Definition: tclscanner.cpp:157
QList< Entry > entry
FILE * tclscannerYYget_out(void)
QStringList after
#define UCHAR
Definition: tclscanner.cpp:783
static YY_BUFFER_STATE * yy_buffer_stack
Definition: tclscanner.cpp:287
#define INITIAL
Iterator append(const T &x)
Definition: qvaluelist.h:372
void parsePrototype(const char *text)
static void tcl_command_OTHER()
Handle all other commands.
static QCString result
bool isEmpty() const
Definition: qcstring.h:189
static void yyunput(int c, char *buf_ptr)
QCString getReference() const
Definition: memberdef.cpp:1001
void msg(const char *fmt,...)
Definition: message.cpp:107
QCString ns
#define CONST
Definition: tclscanner.cpp:782
void printlex(int dbg, bool enter, const char *lexName, const char *fileName)
Definition: message.cpp:242
static void tcl_command_FOREACH()
! Handle internal tcl commands.
#define TOP
int yy_fill_buffer
Definition: code.cpp:250
void tclscannerYYset_in(FILE *in_str)
#define YY_DECL
void tclscannerYYset_out(FILE *out_str)
static char yy_hold_char
Definition: tclscanner.cpp:305
uint length() const
Definition: qcstring.h:195
QCString displayName(bool=TRUE) const
unsigned char YY_CHAR
Definition: tclscanner.cpp:370
static void tcl_command_EVAL()
Handle internal tcl commands.
register char * yy_bp
Definition: entry.h:63
Abstract interface for programming language parsers.
Definition: parserintf.h:38
Definition: types.h:26
type * find(const char *k) const
Definition: qasciidict.h:65
Iterator at(uint i)
Definition: qvaluelist.h:385
void tclDummy()
Entry * entry_main
Entry * entry_current
void insert(const char *k, const type *d)
Definition: qasciidict.h:59
Protection protection
type * first()
Definition: qinternallist.h:87
QString mid(uint index, uint len=0xffffffff) const
Definition: qstring.cpp:13265
int bracket_level
int command
int tclscannerYYlineno
Definition: tclscanner.cpp:378
void convertCppComments(BufStr *inBuf, BufStr *outBuf, const char *fileName)
static int yy_top_state(void)
#define tcl_inf
Application message.
Definition: tclscanner.cpp:771
void tcl_split_list(QString &str, QStringList &list)
unsigned short int flex_uint16_t
Definition: tclscanner.cpp:74
#define ckfree
Definition: tclscanner.cpp:787
void clear()
Definition: qvaluelist.h:396
const bool FALSE
Definition: qglobal.h:370
void parseCode(CodeOutputInterface &codeOutIntf, const char *scopeName, const QCString &input, SrcLangExt lang, bool isExampleBlock, const char *exampleName=0, FileDef *fileDef=0, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, MemberDef *memberDef=0, bool showLineNumbers=TRUE, Definition *searchCtx=0, bool collectXRefs=TRUE)
Parse file and codify.
Definition: types.h:26
YY_BUFFER_STATE buffer_state
#define YY_INPUT(buf, result, max_size)
void addSubEntry(Entry *e)
Definition: entry.cpp:206
char word_is
Entry * entry_file
QCString name
member name
Definition: entry.h:237
const std::string instance
int yy_bs_lineno
Definition: code.cpp:244
bool resize(uint newlen)
Definition: qgstring.cpp:96
int brace_level
#define Config_getList(val)
Definition: config.cpp:662
QCString left(uint len) const
Definition: qcstring.cpp:213
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
int tclscannerYYlex_destroy(void)
int line_command
void addChar(char c)
Definition: bufstr.h:42
char * tclscannerYYget_text(void)
static int yy_more_flag
Definition: tclscanner.cpp:694
static int yy_start
Definition: tclscanner.cpp:312
int errno
Contains the last error code.
Definition: structcmd.h:53
init
Definition: train.py:42
QCString displayName(bool includeScope=TRUE) const
Definition: classdef.cpp:312
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
const char * code_font
static yyconst flex_int16_t yy_accept[179]
Definition: tclscanner.cpp:408
#define yymore()
Definition: tclscanner.cpp:696
QCString file_name
QCString string_comment
static yy_state_type yy_get_previous_state(void)
void setName(const QString &name)
Definition: qfile.cpp:167
#define TCL_ERROR
Definition: tclscanner.cpp:784
void parseInput(const char *fileName, const char *fileBuf, Entry *root, bool sameTranslationUnit, QStrList &filesInSameTranslationUnit)
Parse text file and build up entry tree.
yy_size_t yy_buf_size
Definition: code.cpp:218
The QChar class provides a light-weight Unicode character.
Definition: qstring.h:56
register int yy_act
SrcLangExt
Definition: types.h:41
static QStrList * l
Definition: config.cpp:1044
uint curPos() const
Definition: bufstr.h:97
int comment
static int yy_init
Definition: tclscanner.cpp:311
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
Definition: types.h:29
uint count() const
Definition: qvaluelist.h:394
QAsciiDict< Entry > cl
void tclscannerYYset_debug(int debug_flag)
FILE * tclscannerYYout
Definition: tclscanner.cpp:372
static void yy_pop_state(void)
int tclscannerYYlex(void)
char type[2]
static tcl_scan * tcl_codify_token(tcl_scan *myScan, const QCString type, const QCString string)
codify a string token
static int yy_did_buffer_switch_on_eof
Definition: tclscanner.cpp:317
Entry * tcl_entry_class(const QCString cl)
void shrink(uint newlen)
Definition: bufstr.h:58
QCString string_commentcodify
YY_BUFFER_STATE tclscannerYY_create_buffer(FILE *file, int size)
#define IO_ReadOnly
Definition: qiodevice.h:61
static yyconst flex_int32_t yy_meta[41]
Definition: tclscanner.cpp:463
int tclscannerYYleng
Definition: tclscanner.cpp:307
static yyconst flex_int16_t yy_chk[656]
Definition: tclscanner.cpp:601
int input_position
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
#define unput(c)
Definition: tclscanner.cpp:212
static void tcl_command_NAMESPACE()
Handle namespace statements.
This class contains the information about the argument of a function or template. ...
Definition: arguments.h:28
static void yy_push_state(int new_state)
static yyconst flex_int16_t yy_def[204]
Definition: tclscanner.cpp:498
static void tcl_parse(const QCString ns, const QCString cls)
Start parsing.
static void tcl_comment(int what, const char *text)
Handling of comment parsing.
static int yy_init_globals(void)
QAsciiDict< Entry > fn
static void tcl_command_CATCH()
Handle internal tcl commands.
#define YY_END_OF_BUFFER
Definition: tclscanner.cpp:400
Entry * entry_cl
static yy_state_type yy_try_NUL_trans(yy_state_type current_state)
static int tcl_keyword(QCString str)
Check for keywords.
void groupEnterFile(const char *fileName, int)
static char * yy_last_accepting_cpos
Definition: tclscanner.cpp:685
#define tclscannerYYwrap(n)
Definition: tclscanner.cpp:367
int yy_bs_column
Definition: code.cpp:245
signed char flex_int8_t
Definition: tclscanner.cpp:70
YY_EXTRA_TYPE tclscannerYYget_extra(void)
static int input(void)
Definition: code.cpp:15695
Entry * entry_inside
fileName
Definition: dumpTree.py:9
const char * ascii() const
Definition: qstring.cpp:14494
register char * yy_cp
QCString brief
brief description (doc block)
Definition: entry.h:263
void addArray(const char *a, int len)
Definition: bufstr.h:47
A list of strings.
Definition: qstringlist.h:51
void tclscannerYY_flush_buffer(YY_BUFFER_STATE b)
static void tcl_font_end()
End codifying with special font class.
Definition: types.h:32
QString left(uint len) const
Definition: qstring.cpp:13199
static void tcl_init()
Common initializations.
int code_line
QCString right(uint len) const
Definition: qcstring.cpp:231
static yyconst flex_int16_t yy_base[204]
Definition: tclscanner.cpp:471
QCString string
uint length() const
Definition: qstring.h:679
std::void_t< T > n
void * tclscannerYYrealloc(void *, yy_size_t)
int code_linenumbers
bool open(int)
Definition: qfile_unix.cpp:134
#define COMMENTLINE
int flex_int32_t
Definition: tclscanner.cpp:72
static void yy_fatal_error(yyconst char msg[])
QStringList list_commandwords
static void tcl_scan_end()
Close current scan context.
#define TclCopyAndCollapse(size, src, dest)
Definition: tclscanner.cpp:788
MemberDef * memberdef
static size_t yy_buffer_stack_top
Definition: tclscanner.cpp:285
#define YY_STATE_EOF(state)
Definition: tclscanner.cpp:154
#define BEGIN
Definition: tclscanner.cpp:144
p
Definition: test.py:223
static tcl_scan * tcl_command_ARG(tcl_scan *myScan, unsigned int i, bool ignoreOutermostBraces)
scan general argument for brackets
#define yyterminate()
#define COMMAND
YY_BUFFER_STATE tclscannerYY_scan_bytes(yyconst char *bytes, int len)
QCString string_command
A bunch of utility functions.
static void tcl_command_ARGLIST(QString &arglist)
Parse given arglist .
#define EOB_ACT_LAST_MATCH
Definition: tclscanner.cpp:181
#define WORD
const char * data() const
Definition: qcstring.h:207
QCString anchor() const
Definition: memberdef.cpp:1031
CodeOutputInterface * code
bool needsPreprocessing(const QCString &extension)
type * current() const
Definition: qlist.h:146
char * yy_ch_buf
Definition: code.cpp:212
string tmp
Definition: languages.py:63
Protection protection
class protection
Definition: entry.h:241
int yy_state_type
Definition: tclscanner.cpp:374
#define Config_getBool(val)
Definition: config.cpp:664
int findIndex(const T &x) const
Definition: qvaluelist.h:391
#define EOB_ACT_END_OF_FILE
Definition: tclscanner.cpp:180
ClassDef * getClassDef() const
Definition: memberdef.cpp:4070
Entry * tcl_entry_namespace(const QCString ns)
unsigned char YY_CHAR
Definition: code.cpp:357
static void tcl_command_PROC()
Handle proc statements.
static void tcl_codify_cmd(const char *s, int i)
char * tclscannerYYtext
Definition: tclscanner.cpp:699
void initGroupInfo(Entry *e)
type * next()
Definition: qinternallist.h:89
int flex_int32_t
Definition: code.cpp:72
static void tcl_command_METHOD()
Handle itcl::body statements and oo::define method and method inside itcl::class statements.
Entry * entry_fn
void tclscannerYYrestart(FILE *input_file)
#define YY_BREAK
int yy_is_our_buffer
Definition: code.cpp:229
void tcl_protection(Entry *entry)
Set protection level.
Entry * tcl_entry_new()
Create new entry.
size_t yy_size_t
Definition: tclscanner.cpp:216
#define YY_START_STACK_INCR
int tclscannerYYget_leng(void)
Buffer used to store strings.
Definition: bufstr.h:30
#define YY_RULE_SETUP
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
#define YY_CURRENT_BUFFER
Definition: tclscanner.cpp:295
The QFile class is an I/O device that operates on files.
Definition: qfile.h:50
#define YY_BUFFER_NEW
Definition: tclscanner.cpp:267
bool parseCommentBlock(ParserInterface *parser, Entry *curEntry, const QCString &comment, const QCString &fileName, int &lineNr, bool isBrief, bool isAutoBriefOn, bool isInbody, Protection &prot, int &position, bool &newEntryNeeded)
static void tcl_command_OO_DEFINE()
Handle oo::define statements.
if(!(yy_init))
#define YY_EXTRA_TYPE
FILE * tclscannerYYget_in(void)
static void tcl_codify_link(QCString name)
Create link.
void addDocCrossReference(MemberDef *src, MemberDef *dst)
Definition: util.cpp:8189
void tclscannerYYpush_buffer_state(YY_BUFFER_STATE new_buffer)
static void tclscannerYYensure_buffer_stack(void)
int line_comment
#define TCL_OK
Definition: tclscanner.cpp:785
#define COMMENT
#define YY_DO_BEFORE_ACTION
Definition: tclscanner.cpp:391
#define tcl_war
Application warning.
Definition: tclscanner.cpp:766
struct yy_buffer_state * YY_BUFFER_STATE
Definition: tclscanner.cpp:172
QCString qualifiedName() const
Definition: memberdef.cpp:3968
int line_commentline
#define yyless(n)
#define yyconst
Definition: tclscanner.cpp:127
static MemberNameSDict * memberNameSDict
Definition: doxygen.h:115
FILE * tclscannerYYin
Definition: tclscanner.cpp:372
int line_body0
static yyconst flex_int16_t yy_nxt[656]
Definition: tclscanner.cpp:525
static int yyread(char *buf, int max_size)
static void tcl_command_DESTRUCTOR()
Handle destructor statements inside class definitions.
void addSourceReferencedBy(MemberDef *d)
void tclscannerYYfree(void *)
#define ECHO
QCString fileName() const
Definition: filedef.h:81
static void tclscannerYY_load_buffer_state(void)
Protection protection
static int * yy_start_stack
QList< tcl_scan > scan
static QCString type
Definition: declinfo.cpp:672
#define YY_CURRENT_BUFFER_LVALUE
Definition: tclscanner.cpp:302
short int flex_int16_t
Definition: tclscanner.cpp:71
QCString fileName
file this entry was extracted from
Definition: entry.h:282
QCString getOutputFileBase() const
Definition: memberdef.cpp:941
QMap< QString, QString > config_subst
int line_body1
#define COMMENTLINE_NL
void groupLeaveFile(const char *fileName, int line)
#define YY_START
Definition: tclscanner.cpp:150
#define COMMENT_VERB
static bool * b
Definition: config.cpp:1043
#define COMMENT_CODE
NamespaceDef * getNamespaceDef() const
Definition: memberdef.cpp:4080
#define YY_EXIT_FAILURE
Protection
Definition: types.h:26
int Tcl_SplitList(CONST char *list, int *argcPtr, CONST char ***argvPtr)
Definition: tclscanner.cpp:976
void tclscannerYYset_extra(YY_EXTRA_TYPE user_defined)
void tclscannerYY_switch_to_buffer(YY_BUFFER_STATE new_buffer)
static void tcl_command_ITCL_CLASS()
Handle itcl::class statements.
QCString memberTypeName() const
Definition: memberdef.cpp:3188
static yyconst flex_int32_t yy_ec[256]
Definition: tclscanner.cpp:431
static void tcl_command_WHILE()
! Handle internal tcl commands.
MethodTypes mtype
signal, slot, (dcop) method, or property?
Definition: entry.h:242
int yy_is_interactive
Definition: code.cpp:236
ParserInterface * this_parser
friend class Iterator
Definition: sortdict.h:289
#define YY_FATAL_ERROR(msg)
static void tcl_word(int what, const char *text)
Handling of word parsing.
static void tcl_command_FOR()
Handle internal tcl commands.
static void tcl_name_SnippetAware(const QCString &ns0, const QCString &name0, QCString &ns, QCString &name)
Check name. Strip namespace qualifiers from name0 if inside inlined code segment. ...
void tclscannerYY_delete_buffer(YY_BUFFER_STATE b)
#define YY_SC_TO_UI(c)
Definition: tclscanner.cpp:138
static void tcl_command_IF(QStringList type)
Handle internal tcl commands.
static void tcl_command_VARIABLE(int inclass)
Handle variable statements.
bool config_autobrief
void tclscannerYYset_lineno(int line_number)
QCString input_string
void * tclscannerYYalloc(yy_size_t)
Q_EXPORT int qstrcmp(const char *str1, const char *str2)
Definition: qcstring.h:95
SrcLangExt lang
programming language in which this entry was found
Definition: entry.h:286
static size_t yy_buffer_stack_max
Definition: tclscanner.cpp:286
void close()
Definition: qfile_unix.cpp:614
int tclscannerYY_flex_debug
Definition: tclscanner.cpp:688
QCString utf8() const
Definition: qstring.cpp:14507
Definition: entry.h:37
static struct @2 tcl
int tclscannerYYget_debug(void)
static void tcl_command_SWITCH()
Handle internal tcl commands.
YY_BUFFER_STATE tclscannerYY_scan_buffer(char *base, yy_size_t size)
unsigned uint
Definition: qglobal.h:351
#define EOB_ACT_CONTINUE_SCAN
Definition: tclscanner.cpp:179
byte bytes
Alias for common language habits.
Definition: datasize.h:101
static void tcl_name(const QCString &ns0, const QCString &name0, QCString &ns, QCString &name)
Check name.
int bracket_quote
QAsciiDict< Entry > ns
#define YY_READ_BUF_SIZE
#define YY_END_OF_BUFFER_CHAR
Definition: tclscanner.cpp:159
size_t yy_size_t
Definition: code.cpp:203
Interface for the comment block parser.
static int yy_more_len
Definition: tclscanner.cpp:695
int yy_buffer_status
Definition: code.cpp:252
static void tclscannerYY_init_buffer(YY_BUFFER_STATE b, FILE *file)
static QCString * s
Definition: config.cpp:1042
static char * yy_c_buf_p
Definition: tclscanner.cpp:310
const bool TRUE
Definition: qglobal.h:371
bool collectXRefs
static QCString str
void dropFromStart(uint bytes)
Definition: bufstr.h:101
Portable versions of functions that are platform dependent.
QString right(uint len) const
Definition: qstring.cpp:13231
static void tcl_command_OO_CLASS()
Handle oo::class statements.
static yy_state_type yy_last_accepting_state
Definition: tclscanner.cpp:684
QCString & append(const char *s)
Definition: qcstring.cpp:383
#define ERROR
static void tcl_command_CONSTRUCTOR()
Handle constructor statements inside class definitions.
#define ckalloc
Definition: tclscanner.cpp:786
int tclscannerYYget_lineno(void)
Structure containing information about current scan context.
int section
entry type (see Sections);
Definition: entry.h:235
#define yytext_ptr
Definition: tclscanner.cpp:381
static void tcl_codify(const char *s, const char *str)
Codify &#39;str&#39; with special font class &#39;s&#39;.
#define COMMENT_NL
type * toFirst()
Definition: qlist.h:135
#define YY_BUFFER_EOF_PENDING
Definition: tclscanner.cpp:279
QCString string_last