Classes | Macros | Typedefs | Functions | Variables
tclscanner.cpp File Reference
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <assert.h>
#include <ctype.h>
#include <qstring.h>
#include <qstringlist.h>
#include <qlist.h>
#include <qmap.h>
#include <qarray.h>
#include <qstack.h>
#include <qregexp.h>
#include <qfile.h>
#include <qdict.h>
#include "entry.h"
#include "message.h"
#include "config.h"
#include "doxygen.h"
#include "util.h"
#include "defargs.h"
#include "language.h"
#include "commentscan.h"
#include "pre.h"
#include "tclscanner.h"
#include "outputlist.h"
#include "membername.h"
#include "searchindex.h"
#include "commentcnv.h"
#include "bufstr.h"
#include "portable.h"
#include "arguments.h"
#include "namespacedef.h"
#include "filedef.h"

Go to the source code of this file.

Classes

struct  yy_buffer_state
 
struct  yy_trans_info
 
struct  tcl_scan
 Structure containing information about current scan context. More...
 

Macros

#define YY_INT_ALIGNED   short int
 
#define yy_create_buffer   tclscannerYY_create_buffer
 
#define yy_delete_buffer   tclscannerYY_delete_buffer
 
#define yy_flex_debug   tclscannerYY_flex_debug
 
#define yy_init_buffer   tclscannerYY_init_buffer
 
#define yy_flush_buffer   tclscannerYY_flush_buffer
 
#define yy_load_buffer_state   tclscannerYY_load_buffer_state
 
#define yy_switch_to_buffer   tclscannerYY_switch_to_buffer
 
#define yyin   tclscannerYYin
 
#define yyleng   tclscannerYYleng
 
#define yylex   tclscannerYYlex
 
#define yylineno   tclscannerYYlineno
 
#define yyout   tclscannerYYout
 
#define yyrestart   tclscannerYYrestart
 
#define yytext   tclscannerYYtext
 
#define yywrap   tclscannerYYwrap
 
#define yyalloc   tclscannerYYalloc
 
#define yyrealloc   tclscannerYYrealloc
 
#define yyfree   tclscannerYYfree
 
#define FLEX_SCANNER
 
#define YY_FLEX_MAJOR_VERSION   2
 
#define YY_FLEX_MINOR_VERSION   5
 
#define YY_FLEX_SUBMINOR_VERSION   35
 
#define FLEX_BETA
 
#define FLEXINT_H
 
#define INT8_MIN   (-128)
 
#define INT16_MIN   (-32767-1)
 
#define INT32_MIN   (-2147483647-1)
 
#define INT8_MAX   (127)
 
#define INT16_MAX   (32767)
 
#define INT32_MAX   (2147483647)
 
#define UINT8_MAX   (255U)
 
#define UINT16_MAX   (65535U)
 
#define UINT32_MAX   (4294967295U)
 
#define yyconst
 
#define YY_NULL   0
 
#define YY_SC_TO_UI(c)   ((unsigned int) (unsigned char) c)
 
#define BEGIN   (yy_start) = 1 + 2 *
 
#define YY_START   (((yy_start) - 1) / 2)
 
#define YYSTATE   YY_START
 
#define YY_STATE_EOF(state)   (YY_END_OF_BUFFER + state + 1)
 
#define YY_NEW_FILE   tclscannerYYrestart(tclscannerYYin )
 
#define YY_END_OF_BUFFER_CHAR   0
 
#define YY_BUF_SIZE   16384
 
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
 
#define YY_TYPEDEF_YY_BUFFER_STATE
 
#define EOB_ACT_CONTINUE_SCAN   0
 
#define EOB_ACT_END_OF_FILE   1
 
#define EOB_ACT_LAST_MATCH   2
 
#define YY_LESS_LINENO(n)
 
#define yyless(n)
 
#define unput(c)   yyunput( c, (yytext_ptr) )
 
#define YY_TYPEDEF_YY_SIZE_T
 
#define YY_STRUCT_YY_BUFFER_STATE
 
#define YY_BUFFER_NEW   0
 
#define YY_BUFFER_NORMAL   1
 
#define YY_BUFFER_EOF_PENDING   2
 
#define YY_CURRENT_BUFFER
 
#define YY_CURRENT_BUFFER_LVALUE   (yy_buffer_stack)[(yy_buffer_stack_top)]
 
#define YY_FLUSH_BUFFER   tclscannerYY_flush_buffer(YY_CURRENT_BUFFER )
 
#define yy_new_buffer   tclscannerYY_create_buffer
 
#define yy_set_interactive(is_interactive)
 
#define yy_set_bol(at_bol)
 
#define YY_AT_BOL()   (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
#define tclscannerYYwrap(n)   1
 
#define YY_SKIP_YYWRAP
 
#define yytext_ptr   tclscannerYYtext
 
#define YY_DO_BEFORE_ACTION
 
#define YY_NUM_RULES   55
 
#define YY_END_OF_BUFFER   56
 
#define REJECT   reject_used_but_not_detected
 
#define yymore()   ((yy_more_flag) = 1)
 
#define YY_MORE_ADJ   (yy_more_len)
 
#define YY_RESTORE_YY_MORE_OFFSET
 
#define YY_NO_INPUT   1
 
#define YY_NO_UNISTD_H   1
 
#define MAX_INCLUDE_DEPTH   10
 
#define tcl_err
 Application error. More...
 
#define tcl_war
 Application warning. More...
 
#define tcl_inf   if (0) printf("--- %.4d %d@%d: ",__LINE__,tclscannerYYlineno,yy_start_stack_ptr) && printf
 Application message. More...
 
#define D   if (0) printf("--- %.4d %d@%d: %s\n",__LINE__,tclscannerYYlineno,yy_start_stack_ptr,tclscannerYYtext);
 Debug message. More...
 
#define CONST   const
 
#define UCHAR   (unsigned char)
 
#define TCL_ERROR   1
 
#define TCL_OK   0
 
#define ckalloc   malloc
 
#define ckfree   free
 
#define TclCopyAndCollapse(size, src, dest)   memcpy(dest,src,size); *(dest+size)=0
 
#define YY_INPUT(buf, result, max_size)   result=yyread(buf,max_size);
 
#define INITIAL   0
 
#define ERROR   1
 
#define TOP   2
 
#define COMMAND   3
 
#define WORD   4
 
#define COMMENT   5
 
#define COMMENT_NL   6
 
#define COMMENT_CODE   7
 
#define COMMENT_VERB   8
 
#define COMMENTLINE   9
 
#define COMMENTLINE_NL   10
 
#define YY_EXTRA_TYPE   void *
 
#define YY_READ_BUF_SIZE   8192
 
#define ECHO   do { if (fwrite( tclscannerYYtext, tclscannerYYleng, 1, tclscannerYYout )) {} } while (0)
 
#define yyterminate()   return YY_NULL
 
#define YY_START_STACK_INCR   25
 
#define YY_FATAL_ERROR(msg)   yy_fatal_error( msg )
 
#define YY_DECL_IS_OURS   1
 
#define YY_DECL   int tclscannerYYlex (void)
 
#define YY_USER_ACTION
 
#define YY_BREAK   break;
 
#define YY_RULE_SETUP   YY_USER_ACTION
 
#define YY_EXIT_FAILURE   2
 
#define yyless(n)
 
#define YYTABLES_NAME   "yytables"
 

Typedefs

typedef signed char flex_int8_t
 
typedef short int flex_int16_t
 
typedef int flex_int32_t
 
typedef unsigned char flex_uint8_t
 
typedef unsigned short int flex_uint16_t
 
typedef unsigned int flex_uint32_t
 
typedef struct yy_buffer_stateYY_BUFFER_STATE
 
typedef size_t yy_size_t
 
typedef unsigned char YY_CHAR
 
typedef int yy_state_type
 

Functions

void tclscannerYYrestart (FILE *input_file)
 
void tclscannerYY_switch_to_buffer (YY_BUFFER_STATE new_buffer)
 
YY_BUFFER_STATE tclscannerYY_create_buffer (FILE *file, int size)
 
void tclscannerYY_delete_buffer (YY_BUFFER_STATE b)
 
void tclscannerYY_flush_buffer (YY_BUFFER_STATE b)
 
void tclscannerYYpush_buffer_state (YY_BUFFER_STATE new_buffer)
 
void tclscannerYYpop_buffer_state (void)
 
static void tclscannerYYensure_buffer_stack (void)
 
static void tclscannerYY_load_buffer_state (void)
 
static void tclscannerYY_init_buffer (YY_BUFFER_STATE b, FILE *file)
 
YY_BUFFER_STATE tclscannerYY_scan_buffer (char *base, yy_size_t size)
 
YY_BUFFER_STATE tclscannerYY_scan_string (yyconst char *yy_str)
 
YY_BUFFER_STATE tclscannerYY_scan_bytes (yyconst char *bytes, int len)
 
void * tclscannerYYalloc (yy_size_t)
 
void * tclscannerYYrealloc (void *, yy_size_t)
 
void tclscannerYYfree (void *)
 
static yy_state_type yy_get_previous_state (void)
 
static yy_state_type yy_try_NUL_trans (yy_state_type current_state)
 
static int yy_get_next_buffer (void)
 
static void yy_fatal_error (yyconst char msg[])
 
int TclFindElement (CONST char *list, int listLength, CONST char **elementPtr, CONST char **nextPtr, int *sizePtr, int *bracePtr)
 
int Tcl_SplitList (CONST char *list, int *argcPtr, CONST char ***argvPtr)
 
void tcl_split_list (QString &str, QStringList &list)
 
static int yyread (char *buf, int max_size)
 
static tcl_scantcl_scan_start (char type, QString content, QCString ns, Entry *entry_cl, Entry *entry_fn)
 Start new scan context for given 'content'. More...
 
static void tcl_scan_end ()
 Close current scan context. More...
 
static void tcl_comment (int what, const char *text)
 Handling of comment parsing. More...
 
static void tcl_word (int what, const char *text)
 Handling of word parsing. More...
 
static void tcl_command (int what, const char *text)
 
Entrytcl_entry_new ()
 Create new entry. More...
 
void tcl_protection (Entry *entry)
 Set protection level. More...
 
static void tcl_name (const QCString &ns0, const QCString &name0, QCString &ns, QCString &name)
 Check name. More...
 
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. More...
 
Entrytcl_entry_namespace (const QCString ns)
 
Entrytcl_entry_class (const QCString cl)
 
static int tcl_keyword (QCString str)
 Check for keywords. More...
 
static void tcl_font_end ()
 End codifying with special font class. More...
 
static void tcl_codify (const char *s, const char *str)
 Codify 'str' with special font class 's'. More...
 
static void tcl_codify_cmd (const char *s, int i)
 
static tcl_scantcl_codify_token (tcl_scan *myScan, const QCString type, const QCString string)
 codify a string token More...
 
static int yy_init_globals (void)
 
int tclscannerYYlex_destroy (void)
 
int tclscannerYYget_debug (void)
 
void tclscannerYYset_debug (int debug_flag)
 
YY_EXTRA_TYPE tclscannerYYget_extra (void)
 
void tclscannerYYset_extra (YY_EXTRA_TYPE user_defined)
 
FILE * tclscannerYYget_in (void)
 
void tclscannerYYset_in (FILE *in_str)
 
FILE * tclscannerYYget_out (void)
 
void tclscannerYYset_out (FILE *out_str)
 
int tclscannerYYget_leng (void)
 
char * tclscannerYYget_text (void)
 
int tclscannerYYget_lineno (void)
 
void tclscannerYYset_lineno (int line_number)
 
static void yyunput (int c, char *buf_ptr)
 
static void yy_push_state (int new_state)
 
static void yy_pop_state (void)
 
static int yy_top_state (void)
 
int tclscannerYYlex (void)
 
 if (!(yy_init))
 
 while (1)
 
static void yyunput (int c, register char *yy_bp)
 
static void yy_fatal_error (yyconst char *msg)
 
static void tcl_command_ARGLIST (QString &arglist)
 Parse given arglist . More...
 
static void tcl_codify_link (QCString name)
 Create link. More...
 
static tcl_scantcl_command_ARG (tcl_scan *myScan, unsigned int i, bool ignoreOutermostBraces)
 scan general argument for brackets More...
 
static void tcl_command_EVAL ()
 Handle internal tcl commands. More...
 
static void tcl_command_SWITCH ()
 Handle internal tcl commands. More...
 
static void tcl_command_CATCH ()
 Handle internal tcl commands. More...
 
static void tcl_command_IF (QStringList type)
 Handle internal tcl commands. More...
 
static void tcl_command_FOR ()
 Handle internal tcl commands. More...
 
static void tcl_command_FOREACH ()
 ! Handle internal tcl commands. More...
 
static void tcl_command_WHILE ()
 ! Handle internal tcl commands. More...
 
static void tcl_command_OTHER ()
 Handle all other commands. More...
 
static void tcl_command_PROC ()
 Handle proc statements. More...
 
static void tcl_command_METHOD ()
 Handle itcl::body statements and oo::define method and method inside itcl::class statements. More...
 
static void tcl_command_CONSTRUCTOR ()
 Handle constructor statements inside class definitions. More...
 
static void tcl_command_DESTRUCTOR ()
 Handle destructor statements inside class definitions. More...
 
static void tcl_command_NAMESPACE ()
 Handle namespace statements. More...
 
static void tcl_command_ITCL_CLASS ()
 Handle itcl::class statements. More...
 
static void tcl_command_OO_CLASS ()
 Handle oo::class statements. More...
 
static void tcl_command_OO_DEFINE ()
 Handle oo::define statements. More...
 
static void tcl_command_VARIABLE (int inclass)
 Handle variable statements. More...
 
static void tcl_init ()
 Common initializations. More...
 
static void tcl_parse (const QCString ns, const QCString cls)
 Start parsing. More...
 
void tclDummy ()
 

Variables

int tclscannerYYleng
 
FILE * tclscannerYYin = (FILE *) 0
 
FILE * tclscannerYYout = (FILE *) 0
 
static size_t yy_buffer_stack_top = 0
 
static size_t yy_buffer_stack_max = 0
 
static YY_BUFFER_STATEyy_buffer_stack = 0
 
static char yy_hold_char
 
static int yy_n_chars
 
static char * yy_c_buf_p = (char *) 0
 
static int yy_init = 0
 
static int yy_start = 0
 
static int yy_did_buffer_switch_on_eof
 
int tclscannerYYlineno = 1
 
char * tclscannerYYtext
 
static yyconst flex_int16_t yy_accept [179]
 
static yyconst flex_int32_t yy_ec [256]
 
static yyconst flex_int32_t yy_meta [41]
 
static yyconst flex_int16_t yy_base [204]
 
static yyconst flex_int16_t yy_def [204]
 
static yyconst flex_int16_t yy_nxt [656]
 
static yyconst flex_int16_t yy_chk [656]
 
static yyconst flex_int32_t yy_rule_can_match_eol [56]
 
static yy_state_type yy_last_accepting_state
 
static char * yy_last_accepting_cpos
 
int tclscannerYY_flex_debug = 0
 
static int yy_more_flag = 0
 
static int yy_more_len = 0
 
struct {
   CodeOutputInterface *   code
 
   int   code_line
 
   int   code_linenumbers
 
   const char *   code_font
 
   bool   config_autobrief
 
   QMap< QString, QString >   config_subst
 
   QCString   input_string
 
   int   input_position
 
   QCString   file_name
 
   ParserInterface *   this_parser
 
   int   command
 
   int   comment
 
   int   brace_level
 
   int   bracket_level
 
   int   bracket_quote
 
   char   word_is
 
   int   line_comment
 
   int   line_commentline
 
   int   line_command
 
   int   line_body0
 
   int   line_body1
 
   QCString   string_command
 
   QCString   string_commentline
 
   QCString   string_commentcodify
 
   QCString   string_comment
 
   QCString   string_last
 
   QCString   string
 
   Entry *   entry_main
 
   Entry *   entry_file
 
   Entry *   entry_current
 
   Entry *   entry_inside
 
   QStringList   list_commandwords
 
   QList< tcl_scan >   scan
 
   QAsciiDict< Entry >   ns
 
   QAsciiDict< Entry >   cl
 
   QAsciiDict< Entry >   fn
 
   QList< Entry >   entry
 
   Protection   protection
 
   MemberDef *   memberdef
 
   bool   collectXRefs
 
tcl
 
static int yy_start_stack_ptr = 0
 
static int yy_start_stack_depth = 0
 
static int * yy_start_stack = NULL
 
 YY_DECL
 
register char * yy_cp
 
register char * yy_bp
 
register int yy_act
 

Macro Definition Documentation

#define BEGIN   (yy_start) = 1 + 2 *

Definition at line 144 of file tclscanner.cpp.

#define ckalloc   malloc

Definition at line 786 of file tclscanner.cpp.

#define ckfree   free

Definition at line 787 of file tclscanner.cpp.

#define COMMAND   3

Definition at line 1494 of file tclscanner.cpp.

#define COMMENT   5

Definition at line 1496 of file tclscanner.cpp.

#define COMMENT_CODE   7

Definition at line 1498 of file tclscanner.cpp.

#define COMMENT_NL   6

Definition at line 1497 of file tclscanner.cpp.

#define COMMENT_VERB   8

Definition at line 1499 of file tclscanner.cpp.

#define COMMENTLINE   9

Definition at line 1500 of file tclscanner.cpp.

#define COMMENTLINE_NL   10

Definition at line 1501 of file tclscanner.cpp.

#define CONST   const

Definition at line 782 of file tclscanner.cpp.

#define D   if (0) printf("--- %.4d %d@%d: %s\n",__LINE__,tclscannerYYlineno,yy_start_stack_ptr,tclscannerYYtext);

Debug message.

Definition at line 775 of file tclscanner.cpp.

#define ECHO   do { if (fwrite( tclscannerYYtext, tclscannerYYleng, 1, tclscannerYYout )) {} } while (0)

Definition at line 1598 of file tclscanner.cpp.

#define EOB_ACT_CONTINUE_SCAN   0

Definition at line 179 of file tclscanner.cpp.

#define EOB_ACT_END_OF_FILE   1

Definition at line 180 of file tclscanner.cpp.

#define EOB_ACT_LAST_MATCH   2

Definition at line 181 of file tclscanner.cpp.

#define ERROR   1

Definition at line 1492 of file tclscanner.cpp.

#define FLEX_BETA

Definition at line 33 of file tclscanner.cpp.

#define FLEX_SCANNER

Definition at line 28 of file tclscanner.cpp.

#define FLEXINT_H

Definition at line 49 of file tclscanner.cpp.

#define INITIAL   0

Definition at line 1491 of file tclscanner.cpp.

#define INT16_MAX   (32767)

Definition at line 92 of file tclscanner.cpp.

#define INT16_MIN   (-32767-1)

Definition at line 83 of file tclscanner.cpp.

#define INT32_MAX   (2147483647)

Definition at line 95 of file tclscanner.cpp.

#define INT32_MIN   (-2147483647-1)

Definition at line 86 of file tclscanner.cpp.

#define INT8_MAX   (127)

Definition at line 89 of file tclscanner.cpp.

#define INT8_MIN   (-128)

Definition at line 80 of file tclscanner.cpp.

#define MAX_INCLUDE_DEPTH   10

Definition at line 756 of file tclscanner.cpp.

#define REJECT   reject_used_but_not_detected

Definition at line 693 of file tclscanner.cpp.

#define tcl_err
Value:
printf("Error %d %s() at line %d! ",__LINE__,tcl.file_name.data(),tclscannerYYlineno); \
yyless(0); \
printf
int tclscannerYYlineno
Definition: tclscanner.cpp:378
static void yy_push_state(int new_state)
#define yyless(n)
static struct @2 tcl
#define ERROR

Application error.

Definition at line 759 of file tclscanner.cpp.

#define TCL_ERROR   1

Definition at line 784 of file tclscanner.cpp.

#define tcl_inf   if (0) printf("--- %.4d %d@%d: ",__LINE__,tclscannerYYlineno,yy_start_stack_ptr) && printf

Application message.

Definition at line 771 of file tclscanner.cpp.

#define TCL_OK   0

Definition at line 785 of file tclscanner.cpp.

#define tcl_war
Value:
printf("Warning %d %s() at line %d: ",__LINE__,tcl.file_name.data(),tclscannerYYlineno); \
printf
int tclscannerYYlineno
Definition: tclscanner.cpp:378
static struct @2 tcl

Application warning.

Definition at line 766 of file tclscanner.cpp.

#define TclCopyAndCollapse (   size,
  src,
  dest 
)    memcpy(dest,src,size); *(dest+size)=0

Definition at line 788 of file tclscanner.cpp.

#define tclscannerYYwrap (   n)    1

Definition at line 367 of file tclscanner.cpp.

#define TOP   2

Definition at line 1493 of file tclscanner.cpp.

#define UCHAR   (unsigned char)

Definition at line 783 of file tclscanner.cpp.

#define UINT16_MAX   (65535U)

Definition at line 101 of file tclscanner.cpp.

#define UINT32_MAX   (4294967295U)

Definition at line 104 of file tclscanner.cpp.

#define UINT8_MAX   (255U)

Definition at line 98 of file tclscanner.cpp.

#define unput (   c)    yyunput( c, (yytext_ptr) )

Definition at line 212 of file tclscanner.cpp.

#define WORD   4

Definition at line 1495 of file tclscanner.cpp.

#define YY_AT_BOL ( )    (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

Definition at line 363 of file tclscanner.cpp.

#define YY_BREAK   break;

Definition at line 1677 of file tclscanner.cpp.

#define YY_BUF_SIZE   16384

Definition at line 163 of file tclscanner.cpp.

#define YY_BUFFER_EOF_PENDING   2

Definition at line 279 of file tclscanner.cpp.

#define YY_BUFFER_NEW   0

Definition at line 267 of file tclscanner.cpp.

#define YY_BUFFER_NORMAL   1

Definition at line 268 of file tclscanner.cpp.

#define yy_create_buffer   tclscannerYY_create_buffer

Definition at line 9 of file tclscanner.cpp.

#define YY_CURRENT_BUFFER
Value:
: NULL)
static YY_BUFFER_STATE * yy_buffer_stack
Definition: tclscanner.cpp:287
static size_t yy_buffer_stack_top
Definition: tclscanner.cpp:285

Definition at line 295 of file tclscanner.cpp.

#define YY_CURRENT_BUFFER_LVALUE   (yy_buffer_stack)[(yy_buffer_stack_top)]

Definition at line 302 of file tclscanner.cpp.

#define YY_DECL   int tclscannerYYlex (void)

Definition at line 1665 of file tclscanner.cpp.

#define YY_DECL_IS_OURS   1

Definition at line 1661 of file tclscanner.cpp.

#define yy_delete_buffer   tclscannerYY_delete_buffer

Definition at line 10 of file tclscanner.cpp.

#define YY_DO_BEFORE_ACTION
Value:
tclscannerYYleng = (size_t) (yy_cp - (yytext_ptr)); \
*yy_cp = '\0'; \
static char yy_hold_char
Definition: tclscanner.cpp:305
register char * yy_bp
int tclscannerYYleng
Definition: tclscanner.cpp:307
register char * yy_cp
static int yy_more_len
Definition: tclscanner.cpp:695
static char * yy_c_buf_p
Definition: tclscanner.cpp:310
#define yytext_ptr
Definition: tclscanner.cpp:381

Definition at line 391 of file tclscanner.cpp.

#define YY_END_OF_BUFFER   56

Definition at line 400 of file tclscanner.cpp.

#define YY_END_OF_BUFFER_CHAR   0

Definition at line 159 of file tclscanner.cpp.

#define YY_EXIT_FAILURE   2

Definition at line 3200 of file tclscanner.cpp.

#define YY_EXTRA_TYPE   void *

Definition at line 1512 of file tclscanner.cpp.

#define YY_FATAL_ERROR (   msg)    yy_fatal_error( msg )

Definition at line 1652 of file tclscanner.cpp.

#define yy_flex_debug   tclscannerYY_flex_debug

Definition at line 11 of file tclscanner.cpp.

#define YY_FLEX_MAJOR_VERSION   2

Definition at line 29 of file tclscanner.cpp.

#define YY_FLEX_MINOR_VERSION   5

Definition at line 30 of file tclscanner.cpp.

#define YY_FLEX_SUBMINOR_VERSION   35

Definition at line 31 of file tclscanner.cpp.

#define yy_flush_buffer   tclscannerYY_flush_buffer

Definition at line 13 of file tclscanner.cpp.

#define YY_FLUSH_BUFFER   tclscannerYY_flush_buffer(YY_CURRENT_BUFFER )

Definition at line 331 of file tclscanner.cpp.

#define yy_init_buffer   tclscannerYY_init_buffer

Definition at line 12 of file tclscanner.cpp.

#define YY_INPUT (   buf,
  result,
  max_size 
)    result=yyread(buf,max_size);

Definition at line 1477 of file tclscanner.cpp.

#define YY_INT_ALIGNED   short int

Definition at line 5 of file tclscanner.cpp.

#define YY_LESS_LINENO (   n)
Value:
do { \
int yyl;\
for ( yyl = n; yyl < tclscannerYYleng; ++yyl )\
if ( tclscannerYYtext[yyl] == '\n' )\
}while(0)
int tclscannerYYlineno
Definition: tclscanner.cpp:378
int tclscannerYYleng
Definition: tclscanner.cpp:307
std::void_t< T > n
char * tclscannerYYtext
Definition: tclscanner.cpp:699

Definition at line 190 of file tclscanner.cpp.

#define yy_load_buffer_state   tclscannerYY_load_buffer_state

Definition at line 14 of file tclscanner.cpp.

#define YY_MORE_ADJ   (yy_more_len)

Definition at line 697 of file tclscanner.cpp.

#define yy_new_buffer   tclscannerYY_create_buffer

Definition at line 341 of file tclscanner.cpp.

#define YY_NEW_FILE   tclscannerYYrestart(tclscannerYYin )

Definition at line 157 of file tclscanner.cpp.

#define YY_NO_INPUT   1

Definition at line 753 of file tclscanner.cpp.

#define YY_NO_UNISTD_H   1

Definition at line 754 of file tclscanner.cpp.

#define YY_NULL   0

Definition at line 131 of file tclscanner.cpp.

#define YY_NUM_RULES   55

Definition at line 399 of file tclscanner.cpp.

#define YY_READ_BUF_SIZE   8192

Definition at line 1590 of file tclscanner.cpp.

#define YY_RESTORE_YY_MORE_OFFSET

Definition at line 698 of file tclscanner.cpp.

#define YY_RULE_SETUP   YY_USER_ACTION

Definition at line 1680 of file tclscanner.cpp.

#define YY_SC_TO_UI (   c)    ((unsigned int) (unsigned char) c)

Definition at line 138 of file tclscanner.cpp.

#define yy_set_bol (   at_bol)
Value:
{ \
tclscannerYYensure_buffer_stack (); \
tclscannerYY_create_buffer(tclscannerYYin,YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
#define YY_BUF_SIZE
Definition: tclscanner.cpp:163
#define YY_CURRENT_BUFFER
Definition: tclscanner.cpp:295
if(!(yy_init))
FILE * tclscannerYYin
Definition: tclscanner.cpp:372
#define YY_CURRENT_BUFFER_LVALUE
Definition: tclscanner.cpp:302

Definition at line 353 of file tclscanner.cpp.

#define yy_set_interactive (   is_interactive)
Value:
{ \
tclscannerYYensure_buffer_stack (); \
tclscannerYY_create_buffer(tclscannerYYin,YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
#define YY_BUF_SIZE
Definition: tclscanner.cpp:163
#define YY_CURRENT_BUFFER
Definition: tclscanner.cpp:295
if(!(yy_init))
FILE * tclscannerYYin
Definition: tclscanner.cpp:372
#define YY_CURRENT_BUFFER_LVALUE
Definition: tclscanner.cpp:302

Definition at line 343 of file tclscanner.cpp.

#define YY_SKIP_YYWRAP

Definition at line 368 of file tclscanner.cpp.

#define YY_START   (((yy_start) - 1) / 2)

Definition at line 150 of file tclscanner.cpp.

#define YY_START_STACK_INCR   25

Definition at line 1647 of file tclscanner.cpp.

#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))

Definition at line 168 of file tclscanner.cpp.

#define YY_STATE_EOF (   state)    (YY_END_OF_BUFFER + state + 1)

Definition at line 154 of file tclscanner.cpp.

#define YY_STRUCT_YY_BUFFER_STATE

Definition at line 220 of file tclscanner.cpp.

#define yy_switch_to_buffer   tclscannerYY_switch_to_buffer

Definition at line 15 of file tclscanner.cpp.

#define YY_TYPEDEF_YY_BUFFER_STATE

Definition at line 171 of file tclscanner.cpp.

#define YY_TYPEDEF_YY_SIZE_T

Definition at line 215 of file tclscanner.cpp.

#define YY_USER_ACTION

Definition at line 1672 of file tclscanner.cpp.

#define yyalloc   tclscannerYYalloc

Definition at line 24 of file tclscanner.cpp.

#define yyconst

Definition at line 127 of file tclscanner.cpp.

#define yyfree   tclscannerYYfree

Definition at line 26 of file tclscanner.cpp.

#define yyin   tclscannerYYin

Definition at line 16 of file tclscanner.cpp.

#define yyleng   tclscannerYYleng

Definition at line 17 of file tclscanner.cpp.

#define yyless (   n)
Value:
do \
{ \
/* Undo effects of setting up tclscannerYYtext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up tclscannerYYtext again */ \
} \
while ( 0 )
#define YY_MORE_ADJ
Definition: tclscanner.cpp:697
#define YY_RESTORE_YY_MORE_OFFSET
Definition: tclscanner.cpp:698
static char yy_hold_char
Definition: tclscanner.cpp:305
register char * yy_bp
while(1)
register char * yy_cp
std::void_t< T > n
#define YY_DO_BEFORE_ACTION
Definition: tclscanner.cpp:391
static char * yy_c_buf_p
Definition: tclscanner.cpp:310

Definition at line 3212 of file tclscanner.cpp.

#define yyless (   n)
Value:
do \
{ \
/* Undo effects of setting up tclscannerYYtext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
(yy_c_buf_p) = tclscannerYYtext + yyless_macro_arg; \
*(yy_c_buf_p) = '\0'; \
tclscannerYYleng = yyless_macro_arg; \
} \
while ( 0 )
static char yy_hold_char
Definition: tclscanner.cpp:305
while(1)
int tclscannerYYleng
Definition: tclscanner.cpp:307
std::void_t< T > n
char * tclscannerYYtext
Definition: tclscanner.cpp:699
static char * yy_c_buf_p
Definition: tclscanner.cpp:310

Definition at line 3212 of file tclscanner.cpp.

#define yylex   tclscannerYYlex

Definition at line 18 of file tclscanner.cpp.

#define yylineno   tclscannerYYlineno

Definition at line 19 of file tclscanner.cpp.

#define yymore ( )    ((yy_more_flag) = 1)

Definition at line 696 of file tclscanner.cpp.

#define yyout   tclscannerYYout

Definition at line 20 of file tclscanner.cpp.

#define yyrealloc   tclscannerYYrealloc

Definition at line 25 of file tclscanner.cpp.

#define yyrestart   tclscannerYYrestart

Definition at line 21 of file tclscanner.cpp.

#define YYSTATE   YY_START

Definition at line 151 of file tclscanner.cpp.

#define YYTABLES_NAME   "yytables"

Definition at line 3413 of file tclscanner.cpp.

#define yyterminate ( )    return YY_NULL

Definition at line 1642 of file tclscanner.cpp.

#define yytext   tclscannerYYtext

Definition at line 22 of file tclscanner.cpp.

#define yytext_ptr   tclscannerYYtext

Definition at line 381 of file tclscanner.cpp.

#define yywrap   tclscannerYYwrap

Definition at line 23 of file tclscanner.cpp.

Typedef Documentation

typedef short int flex_int16_t

Definition at line 71 of file tclscanner.cpp.

typedef int flex_int32_t

Definition at line 72 of file tclscanner.cpp.

typedef signed char flex_int8_t

Definition at line 70 of file tclscanner.cpp.

typedef unsigned short int flex_uint16_t

Definition at line 74 of file tclscanner.cpp.

typedef unsigned int flex_uint32_t

Definition at line 75 of file tclscanner.cpp.

typedef unsigned char flex_uint8_t

Definition at line 73 of file tclscanner.cpp.

Definition at line 172 of file tclscanner.cpp.

typedef unsigned char YY_CHAR

Definition at line 370 of file tclscanner.cpp.

typedef size_t yy_size_t

Definition at line 216 of file tclscanner.cpp.

typedef int yy_state_type

Definition at line 374 of file tclscanner.cpp.

Function Documentation

if ( yy_init)

Definition at line 1695 of file tclscanner.cpp.

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  }
#define YY_BUF_SIZE
Definition: tclscanner.cpp:163
static int yy_start
Definition: tclscanner.cpp:312
static int yy_init
Definition: tclscanner.cpp:311
FILE * tclscannerYYout
Definition: tclscanner.cpp:372
YY_BUFFER_STATE tclscannerYY_create_buffer(FILE *file, int size)
#define YY_CURRENT_BUFFER
Definition: tclscanner.cpp:295
static void tclscannerYYensure_buffer_stack(void)
FILE * tclscannerYYin
Definition: tclscanner.cpp:372
static void tclscannerYY_load_buffer_state(void)
#define YY_CURRENT_BUFFER_LVALUE
Definition: tclscanner.cpp:302
static void tcl_codify ( const char *  s,
const char *  str 
)
static

Codify 'str' with special font class 's'.

Definition at line 1359 of file tclscanner.cpp.

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 }
const bool FALSE
Definition: qglobal.h:370
static void tcl_font_end()
End codifying with special font class.
p
Definition: test.py:223
string tmp
Definition: languages.py:63
Q_EXPORT int qstrcmp(const char *str1, const char *str2)
Definition: qcstring.h:95
static struct @2 tcl
static QCString * s
Definition: config.cpp:1042
const bool TRUE
Definition: qglobal.h:371
static QCString str
static void tcl_codify_cmd ( const char *  s,
int  i 
)
static

Definition at line 1436 of file tclscanner.cpp.

1437 {
1438  tcl_codify(s,(*tcl.list_commandwords.at(i)).utf8());
1439 }
static struct @2 tcl
static QCString * s
Definition: config.cpp:1042
static void tcl_codify(const char *s, const char *str)
Codify &#39;str&#39; with special font class &#39;s&#39;.
static void tcl_codify_link ( QCString  name)
static

Create link.

Definition at line 3939 of file tclscanner.cpp.

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 }
static QCString name
Definition: declinfo.cpp:673
static MemberNameSDict * functionNameSDict
Definition: doxygen.h:116
bool isEmpty() const
Definition: qcstring.h:189
QCString getReference() const
Definition: memberdef.cpp:1001
Definition: entry.h:63
type * find(const char *k) const
Definition: qasciidict.h:65
void insert(const char *k, const type *d)
Definition: qasciidict.h:59
QCString name
member name
Definition: entry.h:237
init
Definition: train.py:42
QAsciiDict< Entry > fn
static int tcl_keyword(QCString str)
Check for keywords.
Definition: types.h:32
const char * data() const
Definition: qcstring.h:207
QCString anchor() const
Definition: memberdef.cpp:1031
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
void addDocCrossReference(MemberDef *src, MemberDef *dst)
Definition: util.cpp:8189
QCString qualifiedName() const
Definition: memberdef.cpp:3968
static MemberNameSDict * memberNameSDict
Definition: doxygen.h:115
void addSourceReferencedBy(MemberDef *d)
QCString getOutputFileBase() const
Definition: memberdef.cpp:941
MethodTypes mtype
signal, slot, (dcop) method, or property?
Definition: entry.h:242
friend class Iterator
Definition: sortdict.h:289
static struct @2 tcl
static void tcl_codify(const char *s, const char *str)
Codify &#39;str&#39; with special font class &#39;s&#39;.
static tcl_scan* tcl_codify_token ( tcl_scan myScan,
const QCString  type,
const QCString  string 
)
static

codify a string token

Definition at line 1446 of file tclscanner.cpp.

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 }
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;.
QStringList after
QCString ns
Entry * entry_cl
QCString string
Entry * entry_fn
Q_EXPORT int qstrcmp(const char *str1, const char *str2)
Definition: qcstring.h:95
static struct @2 tcl
static void tcl_codify(const char *s, const char *str)
Codify &#39;str&#39; with special font class &#39;s&#39;.
static void tcl_command ( int  what,
const char *  text 
)
static

Handling of command parsing. what=0 -> ... what=1 -> ... what=-1 -> ...

Definition at line 4779 of file tclscanner.cpp.

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 }
#define tcl_err
Application error.
Definition: tclscanner.cpp:759
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 void tcl_command_OTHER()
Handle all other commands.
bool isEmpty() const
Definition: qcstring.h:189
QCString ns
static void tcl_command_FOREACH()
! Handle internal tcl commands.
static void tcl_command_EVAL()
Handle internal tcl commands.
Definition: types.h:26
int tclscannerYYlineno
Definition: tclscanner.cpp:378
#define tcl_inf
Application message.
Definition: tclscanner.cpp:771
Definition: types.h:26
QCString left(uint len) const
Definition: qcstring.cpp:213
Definition: types.h:29
static void yy_pop_state(void)
static void tcl_command_NAMESPACE()
Handle namespace statements.
static void yy_push_state(int new_state)
static void tcl_command_CATCH()
Handle internal tcl commands.
Entry * entry_cl
A list of strings.
Definition: qstringlist.h:51
#define COMMAND
static void tcl_command_PROC()
Handle proc statements.
static void tcl_codify_cmd(const char *s, int i)
static void tcl_command_METHOD()
Handle itcl::body statements and oo::define method and method inside itcl::class statements.
Entry * entry_fn
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
static void tcl_command_OO_DEFINE()
Handle oo::define statements.
#define tcl_war
Application warning.
Definition: tclscanner.cpp:766
static void tcl_command_DESTRUCTOR()
Handle destructor statements inside class definitions.
Protection
Definition: types.h:26
static void tcl_command_ITCL_CLASS()
Handle itcl::class statements.
static void tcl_command_WHILE()
! Handle internal tcl commands.
static void tcl_command_FOR()
Handle internal tcl commands.
static void tcl_command_IF(QStringList type)
Handle internal tcl commands.
static void tcl_command_VARIABLE(int inclass)
Handle variable statements.
Definition: entry.h:37
static struct @2 tcl
static void tcl_command_SWITCH()
Handle internal tcl commands.
static void tcl_command_OO_CLASS()
Handle oo::class statements.
static void tcl_command_CONSTRUCTOR()
Handle constructor statements inside class definitions.
Structure containing information about current scan context.
static void tcl_codify(const char *s, const char *str)
Codify &#39;str&#39; with special font class &#39;s&#39;.
static tcl_scan* tcl_command_ARG ( tcl_scan myScan,
unsigned int  i,
bool  ignoreOutermostBraces 
)
static

scan general argument for brackets

Definition at line 4058 of file tclscanner.cpp.

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 }
uint length() const
Definition: qcstring.h:195
The QChar class provides a light-weight Unicode character.
Definition: qstring.h:56
static tcl_scan * tcl_codify_token(tcl_scan *myScan, const QCString type, const QCString string)
codify a string token
static void tcl_codify_link(QCString name)
Create link.
static struct @2 tcl
static void tcl_command_ARGLIST ( QString arglist)
static

Parse given arglist .

Definition at line 3899 of file tclscanner.cpp.

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 }
This class represents an function or template argument list.
Definition: arguments.h:82
Iterator at(uint i)
Definition: qvaluelist.h:385
void tcl_split_list(QString &str, QStringList &list)
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
uint count() const
Definition: qvaluelist.h:394
This class contains the information about the argument of a function or template. ...
Definition: arguments.h:28
A list of strings.
Definition: qstringlist.h:51
QCString utf8() const
Definition: qstring.cpp:14507
static struct @2 tcl
unsigned uint
Definition: qglobal.h:351
static void tcl_command_CATCH ( )
static

Handle internal tcl commands.

Definition at line 4282 of file tclscanner.cpp.

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 }
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;.
QCString ns
Entry * entry_cl
static tcl_scan * tcl_command_ARG(tcl_scan *myScan, unsigned int i, bool ignoreOutermostBraces)
scan general argument for brackets
static void tcl_codify_cmd(const char *s, int i)
Entry * entry_fn
static struct @2 tcl
Structure containing information about current scan context.
static void tcl_command_CONSTRUCTOR ( )
static

Handle constructor statements inside class definitions.

Definition at line 4485 of file tclscanner.cpp.

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 }
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;.
QCString ns
Definition: entry.h:63
void addSubEntry(Entry *e)
Definition: entry.cpp:206
Entry * tcl_entry_class(const QCString cl)
Entry * entry_cl
Definition: types.h:32
static void tcl_command_ARGLIST(QString &arglist)
Parse given arglist .
static void tcl_codify_cmd(const char *s, int i)
void tcl_protection(Entry *entry)
Set protection level.
static struct @2 tcl
static void tcl_name(const QCString &ns0, const QCString &name0, QCString &ns, QCString &name)
Check name.
Structure containing information about current scan context.
static void tcl_command_DESTRUCTOR ( )
static

Handle destructor statements inside class definitions.

Definition at line 4522 of file tclscanner.cpp.

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 }
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;.
QCString ns
Definition: entry.h:63
void addSubEntry(Entry *e)
Definition: entry.cpp:206
Entry * tcl_entry_class(const QCString cl)
Entry * entry_cl
Definition: types.h:32
static void tcl_codify_cmd(const char *s, int i)
void tcl_protection(Entry *entry)
Set protection level.
static struct @2 tcl
static void tcl_name(const QCString &ns0, const QCString &name0, QCString &ns, QCString &name)
Check name.
Structure containing information about current scan context.
static void tcl_command_EVAL ( )
static

Handle internal tcl commands.

Definition at line 4140 of file tclscanner.cpp.

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 }
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;.
QCString ns
Entry * entry_cl
static void tcl_codify_cmd(const char *s, int i)
Entry * entry_fn
static struct @2 tcl
Structure containing information about current scan context.
static void tcl_command_FOR ( )
static

Handle internal tcl commands.

Definition at line 4328 of file tclscanner.cpp.

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 }
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;.
QStringList after
QCString ns
Entry * entry_cl
static tcl_scan * tcl_command_ARG(tcl_scan *myScan, unsigned int i, bool ignoreOutermostBraces)
scan general argument for brackets
static void tcl_codify_cmd(const char *s, int i)
Entry * entry_fn
static struct @2 tcl
Structure containing information about current scan context.
static void tcl_command_FOREACH ( )
static

! Handle internal tcl commands.

Definition at line 4347 of file tclscanner.cpp.

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 }
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;.
QStringList after
QCString ns
Entry * entry_cl
static tcl_scan * tcl_command_ARG(tcl_scan *myScan, unsigned int i, bool ignoreOutermostBraces)
scan general argument for brackets
static void tcl_codify_cmd(const char *s, int i)
Entry * entry_fn
static struct @2 tcl
Structure containing information about current scan context.
static void tcl_command_IF ( QStringList  type)
static

Handle internal tcl commands.

Definition at line 4298 of file tclscanner.cpp.

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 }
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;.
QStringList after
QCString ns
Entry * entry_cl
static tcl_scan * tcl_command_ARG(tcl_scan *myScan, unsigned int i, bool ignoreOutermostBraces)
scan general argument for brackets
static void tcl_codify_cmd(const char *s, int i)
Entry * entry_fn
static struct @2 tcl
Structure containing information about current scan context.
static void tcl_command_ITCL_CLASS ( )
static

Handle itcl::class statements.

Definition at line 4595 of file tclscanner.cpp.

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 }
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;.
QCString ns
Definition: entry.h:63
static void tcl_codify_cmd(const char *s, int i)
static struct @2 tcl
static void tcl_name(const QCString &ns0, const QCString &name0, QCString &ns, QCString &name)
Check name.
Structure containing information about current scan context.
static void tcl_command_METHOD ( )
static

Handle itcl::body statements and oo::define method and method inside itcl::class statements.

Definition at line 4443 of file tclscanner.cpp.

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 }
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;.
QCString ns
Definition: entry.h:63
void addSubEntry(Entry *e)
Definition: entry.cpp:206
Entry * tcl_entry_class(const QCString cl)
Entry * entry_cl
Definition: types.h:32
static void tcl_command_ARGLIST(QString &arglist)
Parse given arglist .
static void tcl_codify_cmd(const char *s, int i)
void tcl_protection(Entry *entry)
Set protection level.
static struct @2 tcl
static void tcl_name(const QCString &ns0, const QCString &name0, QCString &ns, QCString &name)
Check name.
Structure containing information about current scan context.
static void tcl_command_NAMESPACE ( )
static

Handle namespace statements.

Definition at line 4556 of file tclscanner.cpp.

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 }
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;.
QCString ns
static void tcl_codify_cmd(const char *s, int i)
static struct @2 tcl
unsigned uint
Definition: qglobal.h:351
static void tcl_name(const QCString &ns0, const QCString &name0, QCString &ns, QCString &name)
Check name.
Structure containing information about current scan context.
static void tcl_command_OO_CLASS ( )
static

Handle oo::class statements.

Definition at line 4624 of file tclscanner.cpp.

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 }
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;.
QCString ns
Definition: entry.h:63
static void tcl_codify_cmd(const char *s, int i)
static struct @2 tcl
static void tcl_name(const QCString &ns0, const QCString &name0, QCString &ns, QCString &name)
Check name.
Structure containing information about current scan context.
static void tcl_command_OO_DEFINE ( )
static

Handle oo::define statements.

Definition at line 4657 of file tclscanner.cpp.

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 }
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;.
QCString ns
Definition: entry.h:63
void addSubEntry(Entry *e)
Definition: entry.cpp:206
Entry * tcl_entry_class(const QCString cl)
Definition: types.h:32
std::void_t< T > n
static void tcl_command_ARGLIST(QString &arglist)
Parse given arglist .
static void tcl_codify_cmd(const char *s, int i)
void tcl_protection(Entry *entry)
Set protection level.
static struct @2 tcl
unsigned uint
Definition: qglobal.h:351
static void tcl_name(const QCString &ns0, const QCString &name0, QCString &ns, QCString &name)
Check name.
Structure containing information about current scan context.
static void tcl_command_OTHER ( )
static

Handle all other commands.

Definition at line 4393 of file tclscanner.cpp.

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 }
static tcl_scan * tcl_command_ARG(tcl_scan *myScan, unsigned int i, bool ignoreOutermostBraces)
scan general argument for brackets
static struct @2 tcl
Structure containing information about current scan context.
static void tcl_command_PROC ( )
static

Handle proc statements.

Definition at line 4403 of file tclscanner.cpp.

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 }
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;.
QCString ns
Definition: entry.h:63
void addSubEntry(Entry *e)
Definition: entry.cpp:206
QCString name
member name
Definition: entry.h:237
Definition: types.h:32
static void tcl_command_ARGLIST(QString &arglist)
Parse given arglist .
Entry * tcl_entry_namespace(const QCString ns)
static void tcl_codify_cmd(const char *s, int i)
void tcl_protection(Entry *entry)
Set protection level.
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. ...
static struct @2 tcl
Structure containing information about current scan context.
static void tcl_command_SWITCH ( )
static

Handle internal tcl commands.

Definition at line 4161 of file tclscanner.cpp.

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 }
int TclFindElement(CONST char *list, int listLength, CONST char **elementPtr, CONST char **nextPtr, int *sizePtr, int *bracePtr)
Definition: tclscanner.cpp:789
uint length() const
Definition: qcstring.h:195
QCString left(uint len) const
Definition: qcstring.cpp:213
static tcl_scan * tcl_codify_token(tcl_scan *myScan, const QCString type, const QCString string)
codify a string token
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
static tcl_scan * tcl_command_ARG(tcl_scan *myScan, unsigned int i, bool ignoreOutermostBraces)
scan general argument for brackets
static void tcl_codify_cmd(const char *s, int i)
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
#define tcl_war
Application warning.
Definition: tclscanner.cpp:766
static struct @2 tcl
Structure containing information about current scan context.
static void tcl_command_VARIABLE ( int  inclass)
static

Handle variable statements.

Definition at line 4734 of file tclscanner.cpp.

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 }
QCString ns
Definition: entry.h:63
void addSubEntry(Entry *e)
Definition: entry.cpp:206
Entry * entry_cl
Entry * tcl_entry_namespace(const QCString ns)
static void tcl_codify_cmd(const char *s, int i)
void tcl_protection(Entry *entry)
Set protection level.
Entry * tcl_entry_new()
Create new entry.
static struct @2 tcl
static void tcl_name(const QCString &ns0, const QCString &name0, QCString &ns, QCString &name)
Check name.
Structure containing information about current scan context.
static void tcl_command_WHILE ( )
static

! Handle internal tcl commands.

Definition at line 4371 of file tclscanner.cpp.

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 }
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;.
QStringList after
QCString ns
Entry * entry_cl
static tcl_scan * tcl_command_ARG(tcl_scan *myScan, unsigned int i, bool ignoreOutermostBraces)
scan general argument for brackets
static void tcl_codify_cmd(const char *s, int i)
Entry * entry_fn
static struct @2 tcl
Structure containing information about current scan context.
static void tcl_comment ( int  what,
const char *  text 
)
static

Handling of comment parsing.

Definition at line 3729 of file tclscanner.cpp.

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 }
#define tcl_err
Application error.
Definition: tclscanner.cpp:759
Definition: entry.h:63
void convertCppComments(BufStr *inBuf, BufStr *outBuf, const char *fileName)
#define tcl_inf
Application message.
Definition: tclscanner.cpp:771
const bool FALSE
Definition: qglobal.h:370
static void yy_pop_state(void)
static void yy_push_state(int new_state)
static void tcl_comment(int what, const char *text)
Handling of comment parsing.
const char * data() const
Definition: qcstring.h:207
Entry * tcl_entry_namespace(const QCString ns)
Entry * tcl_entry_new()
Create new entry.
Buffer used to store strings.
Definition: bufstr.h:30
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)
#define COMMENT
Protection
Definition: types.h:26
static struct @2 tcl
Entry* tcl_entry_class ( const QCString  cl)

Definition at line 1280 of file tclscanner.cpp.

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 }
uint length() const
Definition: qcstring.h:195
Definition: entry.h:63
QCString name
member name
Definition: entry.h:237
QAsciiDict< Entry > cl
Entry * tcl_entry_new()
Create new entry.
static struct @2 tcl
int section
entry type (see Sections);
Definition: entry.h:235
Entry* tcl_entry_namespace ( const QCString  ns)

Definition at line 1256 of file tclscanner.cpp.

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 }
uint length() const
Definition: qcstring.h:195
Definition: entry.h:63
QCString name
member name
Definition: entry.h:237
Entry * tcl_entry_new()
Create new entry.
static struct @2 tcl
QAsciiDict< Entry > ns
int section
entry type (see Sections);
Definition: entry.h:235
Entry* tcl_entry_new ( )

Create new entry.

Definition at line 1168 of file tclscanner.cpp.

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 }
Definition: entry.h:63
Definition: types.h:26
QCString name
member name
Definition: entry.h:237
QCString brief
brief description (doc block)
Definition: entry.h:263
Protection protection
class protection
Definition: entry.h:241
void initGroupInfo(Entry *e)
QCString fileName
file this entry was extracted from
Definition: entry.h:282
SrcLangExt lang
programming language in which this entry was found
Definition: entry.h:286
static struct @2 tcl
int section
entry type (see Sections);
Definition: entry.h:235
static void tcl_font_end ( )
static

End codifying with special font class.

Definition at line 1348 of file tclscanner.cpp.

1349 {
1350  if (!tcl.code) return;
1351  if (tcl.code_font)
1352  {
1353  tcl.code->endFontClass();
1354  tcl.code_font=NULL;
1355  }
1356 }
static struct @2 tcl
static void tcl_init ( )
static

Common initializations.

Definition at line 5109 of file tclscanner.cpp.

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 }
QCString stripWhiteSpace() const
Definition: qcstring.cpp:295
bool isEmpty() const
Definition: qcstring.h:189
uint length() const
Definition: qcstring.h:195
Definition: types.h:26
type * first()
Definition: qinternallist.h:87
int tclscannerYYlineno
Definition: tclscanner.cpp:378
#define tcl_inf
Application message.
Definition: tclscanner.cpp:771
const std::string instance
#define Config_getList(val)
Definition: config.cpp:662
QCString left(uint len) const
Definition: qcstring.cpp:213
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
QCString right(uint len) const
Definition: qcstring.cpp:231
#define Config_getBool(val)
Definition: config.cpp:664
type * next()
Definition: qinternallist.h:89
static struct @2 tcl
static QCString * s
Definition: config.cpp:1042
static int tcl_keyword ( QCString  str)
static

Check for keywords.

Definition at line 1299 of file tclscanner.cpp.

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 }
QCString stripWhiteSpace() const
Definition: qcstring.cpp:295
QCString left(uint len) const
Definition: qcstring.cpp:213
A list of strings.
Definition: qstringlist.h:51
int findIndex(const T &x) const
Definition: qvaluelist.h:391
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
static void tcl_name ( const QCString ns0,
const QCString name0,
QCString ns,
QCString name 
)
static

Check name.

Definition at line 1206 of file tclscanner.cpp.

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 }
Q_EXPORT int qstrncmp(const char *str1, const char *str2, uint len)
Definition: qcstring.h:101
uint length() const
Definition: qcstring.h:195
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
const char * data() const
Definition: qcstring.h:207
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
static void tcl_name_SnippetAware ( const QCString ns0,
const QCString name0,
QCString ns,
QCString name 
)
static

Check name. Strip namespace qualifiers from name0 if inside inlined code segment.

Definition at line 1238 of file tclscanner.cpp.

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 }
static QCString name
Definition: declinfo.cpp:673
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
static struct @2 tcl
static void tcl_name(const QCString &ns0, const QCString &name0, QCString &ns, QCString &name)
Check name.
QAsciiDict< Entry > ns
static void tcl_parse ( const QCString  ns,
const QCString  cls 
)
static

Start parsing.

Definition at line 5179 of file tclscanner.cpp.

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 );
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 }
Entry * entry_scan
QStringList after
QCString ns
#define TOP
Definition: entry.h:63
Definition: types.h:26
int tclscannerYYlineno
Definition: tclscanner.cpp:378
void clear()
Definition: qvaluelist.h:396
YY_BUFFER_STATE buffer_state
QCString name
member name
Definition: entry.h:237
int tclscannerYYlex(void)
char type[2]
Entry * tcl_entry_class(const QCString cl)
Entry * entry_cl
#define BEGIN
Definition: tclscanner.cpp:144
Entry * entry_fn
void tclscannerYYrestart(FILE *input_file)
Entry * tcl_entry_new()
Create new entry.
#define YY_CURRENT_BUFFER
Definition: tclscanner.cpp:295
FILE * tclscannerYYin
Definition: tclscanner.cpp:372
static struct @2 tcl
QAsciiDict< Entry > ns
Structure containing information about current scan context.
void tcl_protection ( Entry entry)

Set protection level.

Definition at line 1192 of file tclscanner.cpp.

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 }
Definition: types.h:26
Definition: types.h:26
Protection protection
class protection
Definition: entry.h:241
static struct @2 tcl
static void tcl_scan_end ( )
static

Close current scan context.

Definition at line 3468 of file tclscanner.cpp.

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 }
Entry * entry_scan
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;.
QStringList after
Iterator append(const T &x)
Definition: qvaluelist.h:372
QCString ns
Protection protection
int tclscannerYYlineno
Definition: tclscanner.cpp:378
#define tcl_inf
Application message.
Definition: tclscanner.cpp:771
YY_BUFFER_STATE buffer_state
uint count() const
Definition: qvaluelist.h:394
static void yy_pop_state(void)
char type[2]
Entry * entry_cl
Entry * entry_fn
void tclscannerYY_switch_to_buffer(YY_BUFFER_STATE new_buffer)
void tclscannerYY_delete_buffer(YY_BUFFER_STATE b)
static struct @2 tcl
Structure containing information about current scan context.
static void tcl_codify(const char *s, const char *str)
Codify &#39;str&#39; with special font class &#39;s&#39;.
static tcl_scan * tcl_scan_start ( char  type,
QString  content,
QCString  ns,
Entry entry_cls,
Entry entry_fn 
)
static

Start new scan context for given 'content'.

Definition at line 3421 of file tclscanner.cpp.

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 }
YY_BUFFER_STATE tclscannerYY_scan_string(yyconst char *yy_str)
Entry * entry_scan
QStringList after
QCString ns
#define TOP
Protection protection
QString mid(uint index, uint len=0xffffffff) const
Definition: qstring.cpp:13265
int tclscannerYYlineno
Definition: tclscanner.cpp:378
#define tcl_inf
Application message.
Definition: tclscanner.cpp:771
void clear()
Definition: qvaluelist.h:396
YY_BUFFER_STATE buffer_state
char type[2]
static void yy_push_state(int new_state)
Entry * entry_cl
const char * ascii() const
Definition: qstring.cpp:14494
uint length() const
Definition: qstring.h:679
Entry * entry_fn
Entry * tcl_entry_new()
Create new entry.
if(!(yy_init))
static QCString type
Definition: declinfo.cpp:672
void tclscannerYY_switch_to_buffer(YY_BUFFER_STATE new_buffer)
static struct @2 tcl
QAsciiDict< Entry > ns
Structure containing information about current scan context.
static void tcl_codify(const char *s, const char *str)
Codify &#39;str&#39; with special font class &#39;s&#39;.
void tcl_split_list ( QString str,
QStringList list 
)

Definition at line 1068 of file tclscanner.cpp.

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 }
Iterator append(const T &x)
Definition: qvaluelist.h:372
QString mid(uint index, uint len=0xffffffff) const
Definition: qstring.cpp:13265
#define ckfree
Definition: tclscanner.cpp:787
void clear()
Definition: qvaluelist.h:396
const char * ascii() const
Definition: qstring.cpp:14494
QString left(uint len) const
Definition: qstring.cpp:13199
uint length() const
Definition: qstring.h:679
#define TCL_OK
Definition: tclscanner.cpp:785
int Tcl_SplitList(CONST char *list, int *argcPtr, CONST char ***argvPtr)
Definition: tclscanner.cpp:976
QString right(uint len) const
Definition: qstring.cpp:13231
int Tcl_SplitList ( CONST char *  list,
int *  argcPtr,
CONST char ***  argvPtr 
)

Definition at line 976 of file tclscanner.cpp.

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 }
int TclFindElement(CONST char *list, int listLength, CONST char **elementPtr, CONST char **nextPtr, int *sizePtr, int *bracePtr)
Definition: tclscanner.cpp:789
#define UCHAR
Definition: tclscanner.cpp:783
static QCString result
#define CONST
Definition: tclscanner.cpp:782
#define ckfree
Definition: tclscanner.cpp:787
#define TCL_ERROR
Definition: tclscanner.cpp:784
static QStrList * l
Definition: config.cpp:1044
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
#define TclCopyAndCollapse(size, src, dest)
Definition: tclscanner.cpp:788
p
Definition: test.py:223
#define TCL_OK
Definition: tclscanner.cpp:785
#define ckalloc
Definition: tclscanner.cpp:786
static void tcl_word ( int  what,
const char *  text 
)
static

Handling of word parsing.

Definition at line 3508 of file tclscanner.cpp.

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 }
#define tcl_err
Application error.
Definition: tclscanner.cpp:759
#define tcl_inf
Application message.
Definition: tclscanner.cpp:771
static void yy_pop_state(void)
static void yy_push_state(int new_state)
#define WORD
#define tcl_war
Application warning.
Definition: tclscanner.cpp:766
#define yyless(n)
static struct @2 tcl
void tclDummy ( )

Definition at line 5385 of file tclscanner.cpp.

5386 {
5387  yy_top_state();
5388 }
static int yy_top_state(void)
int TclFindElement ( CONST char *  list,
int  listLength,
CONST char **  elementPtr,
CONST char **  nextPtr,
int *  sizePtr,
int *  bracePtr 
)

Definition at line 789 of file tclscanner.cpp.

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 }
#define UCHAR
Definition: tclscanner.cpp:783
#define CONST
Definition: tclscanner.cpp:782
#define TCL_ERROR
Definition: tclscanner.cpp:784
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
p
Definition: test.py:223
#define TCL_OK
Definition: tclscanner.cpp:785
YY_BUFFER_STATE tclscannerYY_create_buffer ( FILE *  file,
int  size 
)

Allocate and initialize an input buffer state.

Parameters
fileA readable stream.
sizeThe character buffer size in bytes. When in doubt, use YY_BUF_SIZE.
Returns
the allocated buffer state.

Definition at line 2880 of file tclscanner.cpp.

2881 {
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 
2900 
2901  return b;
2902 }
yy_size_t yy_buf_size
Definition: code.cpp:218
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
char * yy_ch_buf
Definition: code.cpp:212
int yy_is_our_buffer
Definition: code.cpp:229
struct yy_buffer_state * YY_BUFFER_STATE
Definition: tclscanner.cpp:172
static bool * b
Definition: config.cpp:1043
#define YY_FATAL_ERROR(msg)
void * tclscannerYYalloc(yy_size_t)
static void tclscannerYY_init_buffer(YY_BUFFER_STATE b, FILE *file)
void tclscannerYY_delete_buffer ( YY_BUFFER_STATE  b)

Destroy the buffer.

Parameters
ba buffer created with tclscannerYY_create_buffer()

Definition at line 2908 of file tclscanner.cpp.

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 }
char * yy_ch_buf
Definition: code.cpp:212
int yy_is_our_buffer
Definition: code.cpp:229
#define YY_CURRENT_BUFFER
Definition: tclscanner.cpp:295
struct yy_buffer_state * YY_BUFFER_STATE
Definition: tclscanner.cpp:172
void tclscannerYYfree(void *)
#define YY_CURRENT_BUFFER_LVALUE
Definition: tclscanner.cpp:302
void tclscannerYY_flush_buffer ( YY_BUFFER_STATE  b)

Discard all buffered characters. On the next scan, YY_INPUT will be called.

Parameters
bthe buffer state to be flushed, usually YY_CURRENT_BUFFER.

Definition at line 2955 of file tclscanner.cpp.

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 }
char * yy_buf_pos
Definition: code.cpp:213
int yy_n_chars
Definition: code.cpp:223
char * yy_ch_buf
Definition: code.cpp:212
#define YY_CURRENT_BUFFER
Definition: tclscanner.cpp:295
#define YY_BUFFER_NEW
Definition: tclscanner.cpp:267
static void tclscannerYY_load_buffer_state(void)
#define YY_END_OF_BUFFER_CHAR
Definition: tclscanner.cpp:159
int yy_buffer_status
Definition: code.cpp:252
static void tclscannerYY_init_buffer ( YY_BUFFER_STATE  b,
FILE *  file 
)
static

Definition at line 2927 of file tclscanner.cpp.

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 }
FILE * yy_input_file
Definition: code.cpp:210
int yy_fill_buffer
Definition: code.cpp:250
int yy_bs_lineno
Definition: code.cpp:244
int errno
Contains the last error code.
Definition: structcmd.h:53
int yy_bs_column
Definition: code.cpp:245
void tclscannerYY_flush_buffer(YY_BUFFER_STATE b)
#define YY_CURRENT_BUFFER
Definition: tclscanner.cpp:295
int yy_is_interactive
Definition: code.cpp:236
static void tclscannerYY_load_buffer_state ( void  )
static

Definition at line 2866 of file tclscanner.cpp.

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 }
static char yy_hold_char
Definition: tclscanner.cpp:305
FILE * tclscannerYYin
Definition: tclscanner.cpp:372
#define YY_CURRENT_BUFFER_LVALUE
Definition: tclscanner.cpp:302
static int yy_n_chars
Definition: tclscanner.cpp:306
static char * yy_c_buf_p
Definition: tclscanner.cpp:310
#define yytext_ptr
Definition: tclscanner.cpp:381
YY_BUFFER_STATE tclscannerYY_scan_buffer ( char *  base,
yy_size_t  size 
)

Setup the input buffer state to scan directly from a user-specified character buffer.

Parameters
basethe character buffer
sizethe size in bytes of the character buffer
Returns
the newly allocated buffer state object.

Definition at line 3082 of file tclscanner.cpp.

3083 {
3085 
3086  if ( size < 2 ||
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 }
char * yy_buf_pos
Definition: code.cpp:213
FILE * yy_input_file
Definition: code.cpp:210
int yy_n_chars
Definition: code.cpp:223
int yy_fill_buffer
Definition: code.cpp:250
yy_size_t yy_buf_size
Definition: code.cpp:218
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
char * yy_ch_buf
Definition: code.cpp:212
int yy_is_our_buffer
Definition: code.cpp:229
#define YY_BUFFER_NEW
Definition: tclscanner.cpp:267
struct yy_buffer_state * YY_BUFFER_STATE
Definition: tclscanner.cpp:172
static bool * b
Definition: config.cpp:1043
void tclscannerYY_switch_to_buffer(YY_BUFFER_STATE new_buffer)
int yy_is_interactive
Definition: code.cpp:236
#define YY_FATAL_ERROR(msg)
void * tclscannerYYalloc(yy_size_t)
#define YY_END_OF_BUFFER_CHAR
Definition: tclscanner.cpp:159
int yy_buffer_status
Definition: code.cpp:252
YY_BUFFER_STATE tclscannerYY_scan_bytes ( yyconst char *  yybytes,
int  _yybytes_len 
)

Setup the input buffer state to scan the given bytes. The next call to tclscannerYYlex() will scan from a copy of bytes.

Parameters
bytesthe byte buffer to scan
lenthe number of bytes in the buffer pointed to by bytes.
Returns
the newly allocated buffer state object.

Definition at line 3132 of file tclscanner.cpp.

3133 {
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 }
std::void_t< T > n
int yy_is_our_buffer
Definition: code.cpp:229
static bool * b
Definition: config.cpp:1043
#define YY_FATAL_ERROR(msg)
void * tclscannerYYalloc(yy_size_t)
YY_BUFFER_STATE tclscannerYY_scan_buffer(char *base, yy_size_t size)
#define YY_END_OF_BUFFER_CHAR
Definition: tclscanner.cpp:159
size_t yy_size_t
Definition: code.cpp:203
YY_BUFFER_STATE tclscannerYY_scan_string ( yyconst char *  yystr)

Setup the input buffer state to scan a string. The next call to tclscannerYYlex() will scan from a copy of str.

Parameters
yystra NUL-terminated string to scan
Returns
the newly allocated buffer state object.
Note
If you want to scan bytes that may contain NUL values, then use tclscannerYY_scan_bytes() instead.

Definition at line 3119 of file tclscanner.cpp.

3120 {
3121 
3122  return tclscannerYY_scan_bytes(yystr,strlen(yystr) );
3123 }
YY_BUFFER_STATE tclscannerYY_scan_bytes(yyconst char *bytes, int len)
void tclscannerYY_switch_to_buffer ( YY_BUFFER_STATE  new_buffer)

Switch to a different input buffer.

Parameters
new_bufferThe new input buffer.

Definition at line 2835 of file tclscanner.cpp.

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 }
static char yy_hold_char
Definition: tclscanner.cpp:305
static int yy_did_buffer_switch_on_eof
Definition: tclscanner.cpp:317
#define YY_CURRENT_BUFFER
Definition: tclscanner.cpp:295
static void tclscannerYYensure_buffer_stack(void)
static void tclscannerYY_load_buffer_state(void)
#define YY_CURRENT_BUFFER_LVALUE
Definition: tclscanner.cpp:302
static int yy_n_chars
Definition: tclscanner.cpp:306
static char * yy_c_buf_p
Definition: tclscanner.cpp:310
void * tclscannerYYalloc ( yy_size_t  size)

Definition at line 3391 of file tclscanner.cpp.

3392 {
3393  return (void *) malloc( size );
3394 }
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
static void tclscannerYYensure_buffer_stack ( void  )
static

Definition at line 3033 of file tclscanner.cpp.

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 }
static YY_BUFFER_STATE * yy_buffer_stack
Definition: tclscanner.cpp:287
void * tclscannerYYrealloc(void *, yy_size_t)
static size_t yy_buffer_stack_top
Definition: tclscanner.cpp:285
#define YY_FATAL_ERROR(msg)
void * tclscannerYYalloc(yy_size_t)
static size_t yy_buffer_stack_max
Definition: tclscanner.cpp:286
void tclscannerYYfree ( void *  ptr)

Definition at line 3408 of file tclscanner.cpp.

3409 {
3410  free( (char *) ptr ); /* see tclscannerYYrealloc() for (char *) cast */
3411 }
int tclscannerYYget_debug ( void  )

Definition at line 3296 of file tclscanner.cpp.

3297 {
3298  return tclscannerYY_flex_debug;
3299 }
int tclscannerYY_flex_debug
Definition: tclscanner.cpp:688
YY_EXTRA_TYPE tclscannerYYget_extra ( void  )
FILE * tclscannerYYget_in ( void  )

Get the input stream.

Definition at line 3240 of file tclscanner.cpp.

3241 {
3242  return tclscannerYYin;
3243 }
FILE * tclscannerYYin
Definition: tclscanner.cpp:372
int tclscannerYYget_leng ( void  )

Get the length of the current token.

Definition at line 3256 of file tclscanner.cpp.

3257 {
3258  return tclscannerYYleng;
3259 }
int tclscannerYYleng
Definition: tclscanner.cpp:307
int tclscannerYYget_lineno ( void  )

Get the current line number.

Definition at line 3231 of file tclscanner.cpp.

3232 {
3233 
3234  return tclscannerYYlineno;
3235 }
int tclscannerYYlineno
Definition: tclscanner.cpp:378
FILE * tclscannerYYget_out ( void  )

Get the output stream.

Definition at line 3248 of file tclscanner.cpp.

3249 {
3250  return tclscannerYYout;
3251 }
FILE * tclscannerYYout
Definition: tclscanner.cpp:372
char * tclscannerYYget_text ( void  )

Get the current token.

Definition at line 3265 of file tclscanner.cpp.

3266 {
3267  return tclscannerYYtext;
3268 }
char * tclscannerYYtext
Definition: tclscanner.cpp:699
int tclscannerYYlex ( void  )
int tclscannerYYlex_destroy ( void  )

Definition at line 3342 of file tclscanner.cpp.

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. */
3354  (yy_buffer_stack) = NULL;
3355 
3356  /* Destroy the start condition 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 }
void tclscannerYYpop_buffer_state(void)
static YY_BUFFER_STATE * yy_buffer_stack
Definition: tclscanner.cpp:287
static int yy_init_globals(void)
#define YY_CURRENT_BUFFER
Definition: tclscanner.cpp:295
void tclscannerYYfree(void *)
static int * yy_start_stack
#define YY_CURRENT_BUFFER_LVALUE
Definition: tclscanner.cpp:302
void tclscannerYY_delete_buffer(YY_BUFFER_STATE b)
void tclscannerYYpop_buffer_state ( void  )

Removes and deletes the top of the stack, if present. The next element becomes the new top.

Definition at line 3014 of file tclscanner.cpp.

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 }
static int yy_did_buffer_switch_on_eof
Definition: tclscanner.cpp:317
static size_t yy_buffer_stack_top
Definition: tclscanner.cpp:285
#define YY_CURRENT_BUFFER
Definition: tclscanner.cpp:295
static void tclscannerYY_load_buffer_state(void)
#define YY_CURRENT_BUFFER_LVALUE
Definition: tclscanner.cpp:302
void tclscannerYY_delete_buffer(YY_BUFFER_STATE b)
void tclscannerYYpush_buffer_state ( YY_BUFFER_STATE  new_buffer)

Pushes the new state onto the stack. The new state becomes the current state. This function will allocate the stack if necessary.

Parameters
new_bufferThe new state.

Definition at line 2984 of file tclscanner.cpp.

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 }
static char yy_hold_char
Definition: tclscanner.cpp:305
static int yy_did_buffer_switch_on_eof
Definition: tclscanner.cpp:317
static size_t yy_buffer_stack_top
Definition: tclscanner.cpp:285
#define YY_CURRENT_BUFFER
Definition: tclscanner.cpp:295
static void tclscannerYYensure_buffer_stack(void)
static void tclscannerYY_load_buffer_state(void)
#define YY_CURRENT_BUFFER_LVALUE
Definition: tclscanner.cpp:302
static int yy_n_chars
Definition: tclscanner.cpp:306
static char * yy_c_buf_p
Definition: tclscanner.cpp:310
void * tclscannerYYrealloc ( void *  ptr,
yy_size_t  size 
)

Definition at line 3396 of file tclscanner.cpp.

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 }
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
void tclscannerYYrestart ( FILE *  input_file)

Immediately switch to a different input stream.

Parameters
input_fileA readable stream.
Note
This function does not reset the start condition to INITIAL .

Definition at line 2818 of file tclscanner.cpp.

2819 {
2820 
2821  if ( ! YY_CURRENT_BUFFER ){
2825  }
2826 
2829 }
#define YY_BUF_SIZE
Definition: tclscanner.cpp:163
YY_BUFFER_STATE tclscannerYY_create_buffer(FILE *file, int size)
#define YY_CURRENT_BUFFER
Definition: tclscanner.cpp:295
static void tclscannerYYensure_buffer_stack(void)
FILE * tclscannerYYin
Definition: tclscanner.cpp:372
static void tclscannerYY_load_buffer_state(void)
#define YY_CURRENT_BUFFER_LVALUE
Definition: tclscanner.cpp:302
static void tclscannerYY_init_buffer(YY_BUFFER_STATE b, FILE *file)
void tclscannerYYset_debug ( int  debug_flag)

Definition at line 3301 of file tclscanner.cpp.

3302 {
3303  tclscannerYY_flex_debug = bdebug ;
3304 }
int tclscannerYY_flex_debug
Definition: tclscanner.cpp:688
void tclscannerYYset_extra ( YY_EXTRA_TYPE  user_defined)
void tclscannerYYset_in ( FILE *  in_str)

Set the input stream. This does not discard the current input buffer.

Parameters
in_strA readable stream.
See also
tclscannerYY_switch_to_buffer

Definition at line 3286 of file tclscanner.cpp.

3287 {
3288  tclscannerYYin = in_str ;
3289 }
FILE * tclscannerYYin
Definition: tclscanner.cpp:372
void tclscannerYYset_lineno ( int  line_number)

Set the current line number.

Parameters
line_number

Definition at line 3274 of file tclscanner.cpp.

3275 {
3276 
3277  tclscannerYYlineno = line_number;
3278 }
int tclscannerYYlineno
Definition: tclscanner.cpp:378
void tclscannerYYset_out ( FILE *  out_str)

Definition at line 3291 of file tclscanner.cpp.

3292 {
3293  tclscannerYYout = out_str ;
3294 }
FILE * tclscannerYYout
Definition: tclscanner.cpp:372
while ( )

Definition at line 1721 of file tclscanner.cpp.

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;
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 );
1760  yy_current_state = (yy_last_accepting_state);
1761 
1762 yy_find_action:
1763  yy_act = yy_accept[yy_current_state];
1764 
1766 
1768  {
1769  int yyl;
1770  for ( yyl = (yy_more_len); yyl < tclscannerYYleng; ++yyl )
1771  if ( tclscannerYYtext[yyl] == '\n' )
1772 
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);
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):
1803 case YY_STATE_EOF(COMMENT_CODE):
1804 case YY_STATE_EOF(COMMENT_VERB):
1805 case YY_STATE_EOF(COMMENTLINE):
1806 case YY_STATE_EOF(COMMENTLINE_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
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);
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);
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);
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
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);
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);
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;
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;
2223 }
2224  YY_BREAK
2225 case 37:
2226 /* rule 37 can match eol */
2228 #line 1061 "tclscanner.l"
2229 {
2230 D
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 = "";
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 = "";
2263 }
2264  YY_BREAK
2265 case 41:
2266 #line 1086 "tclscanner.l"
2267 case 42:
2269 #line 1086 "tclscanner.l"
2270 {
2272 }
2273  YY_BREAK
2274 case 43:
2275 /* rule 43 can match eol */
2277 #line 1089 "tclscanner.l"
2278 {
2280 }
2281  YY_BREAK
2282 case 44:
2284 #line 1092 "tclscanner.l"
2285 {
2287 }
2288  YY_BREAK
2289 case 45:
2291 #line 1095 "tclscanner.l"
2292 {
2294 }
2295  YY_BREAK
2296 case 46:
2298 #line 1098 "tclscanner.l"
2299 {
2301 }
2302  YY_BREAK
2303 case 47:
2305 #line 1101 "tclscanner.l"
2306 {
2308 }
2309  YY_BREAK
2310 case 48:
2312 #line 1104 "tclscanner.l"
2313 {
2315 }
2316  YY_BREAK
2317 case 49:
2319 #line 1107 "tclscanner.l"
2320 {
2322 }
2323  YY_BREAK
2324 case 50:
2326 #line 1110 "tclscanner.l"
2327 {
2329 }
2330  YY_BREAK
2331 case 51:
2333 #line 1113 "tclscanner.l"
2334 {
2336 }
2337  YY_BREAK
2338 case 52:
2339 /* rule 52 can match eol */
2341 #line 1116 "tclscanner.l"
2342 {
2344 }
2345  YY_BREAK
2346 case 53:
2348 #line 1119 "tclscanner.l"
2349 {
2351 }
2352  YY_BREAK
2353 case 54:
2355 #line 1122 "tclscanner.l"
2356 {
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 
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  {
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);
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);
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 */
#define tcl_err
Application error.
Definition: tclscanner.cpp:759
static void tcl_command(int what, const char *text)
#define YY_BUFFER_NORMAL
Definition: tclscanner.cpp:268
static int yy_get_next_buffer(void)
#define YY_MORE_ADJ
Definition: tclscanner.cpp:697
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
#define INITIAL
#define TOP
static char yy_hold_char
Definition: tclscanner.cpp:305
uint length() const
Definition: qcstring.h:195
register char * yy_bp
int tclscannerYYlineno
Definition: tclscanner.cpp:378
QCString left(uint len) const
Definition: qcstring.cpp:213
static int yy_more_flag
Definition: tclscanner.cpp:694
static int yy_start
Definition: tclscanner.cpp:312
static yyconst flex_int16_t yy_accept[179]
Definition: tclscanner.cpp:408
#define yymore()
Definition: tclscanner.cpp:696
static yy_state_type yy_get_previous_state(void)
register int yy_act
int yy_state_type
Definition: code.cpp:361
static void yy_pop_state(void)
static int yy_did_buffer_switch_on_eof
Definition: tclscanner.cpp:317
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
#define unput(c)
Definition: tclscanner.cpp:212
static void yy_push_state(int new_state)
static yyconst flex_int16_t yy_def[204]
Definition: tclscanner.cpp:498
static void tcl_comment(int what, const char *text)
Handling of comment parsing.
#define YY_END_OF_BUFFER
Definition: tclscanner.cpp:400
static yy_state_type yy_try_NUL_trans(yy_state_type current_state)
static char * yy_last_accepting_cpos
Definition: tclscanner.cpp:685
#define tclscannerYYwrap(n)
Definition: tclscanner.cpp:367
register char * yy_cp
static yyconst flex_int16_t yy_base[204]
Definition: tclscanner.cpp:471
#define COMMENTLINE
static void tcl_scan_end()
Close current scan context.
#define YY_STATE_EOF(state)
Definition: tclscanner.cpp:154
#define yyterminate()
#define COMMAND
#define EOB_ACT_LAST_MATCH
Definition: tclscanner.cpp:181
#define WORD
const char * data() const
Definition: qcstring.h:207
#define EOB_ACT_END_OF_FILE
Definition: tclscanner.cpp:180
unsigned char YY_CHAR
Definition: code.cpp:357
char * tclscannerYYtext
Definition: tclscanner.cpp:699
#define YY_BREAK
#define YY_RULE_SETUP
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
#define YY_BUFFER_NEW
Definition: tclscanner.cpp:267
#define COMMENT
#define YY_DO_BEFORE_ACTION
Definition: tclscanner.cpp:391
#define yyless(n)
FILE * tclscannerYYin
Definition: tclscanner.cpp:372
static yyconst flex_int16_t yy_nxt[656]
Definition: tclscanner.cpp:525
#define ECHO
void line(double t, double *p, double &x, double &y, double &z)
#define YY_CURRENT_BUFFER_LVALUE
Definition: tclscanner.cpp:302
#define COMMENTLINE_NL
#define YY_START
Definition: tclscanner.cpp:150
#define COMMENT_VERB
#define COMMENT_CODE
static yyconst flex_int32_t yy_ec[256]
Definition: tclscanner.cpp:431
static int yy_n_chars
Definition: tclscanner.cpp:306
#define YY_FATAL_ERROR(msg)
static void tcl_word(int what, const char *text)
Handling of word parsing.
#define YY_SC_TO_UI(c)
Definition: tclscanner.cpp:138
static struct @2 tcl
#define EOB_ACT_CONTINUE_SCAN
Definition: tclscanner.cpp:179
static int yy_more_len
Definition: tclscanner.cpp:695
static char * yy_c_buf_p
Definition: tclscanner.cpp:310
static yy_state_type yy_last_accepting_state
Definition: tclscanner.cpp:684
QCString & append(const char *s)
Definition: qcstring.cpp:383
#define ERROR
#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
static void yy_fatal_error ( yyconst char  msg[])
static
static void yy_fatal_error ( yyconst char *  msg)
static

Definition at line 3203 of file tclscanner.cpp.

3204 {
3205  (void) fprintf( stderr, "%s\n", msg );
3206  exit( YY_EXIT_FAILURE );
3207 }
void msg(const char *fmt,...)
Definition: message.cpp:107
#define YY_EXIT_FAILURE
static int yy_get_next_buffer ( void  )
static

Definition at line 2504 of file tclscanner.cpp.

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 */
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 }
#define YY_MORE_ADJ
Definition: tclscanner.cpp:697
#define YY_INPUT(buf, result, max_size)
yy_size_t yy_buf_size
Definition: code.cpp:218
void * tclscannerYYrealloc(void *, yy_size_t)
#define EOB_ACT_LAST_MATCH
Definition: tclscanner.cpp:181
char * yy_ch_buf
Definition: code.cpp:212
#define EOB_ACT_END_OF_FILE
Definition: tclscanner.cpp:180
void tclscannerYYrestart(FILE *input_file)
int yy_is_our_buffer
Definition: code.cpp:229
#define YY_CURRENT_BUFFER
Definition: tclscanner.cpp:295
FILE * tclscannerYYin
Definition: tclscanner.cpp:372
#define YY_CURRENT_BUFFER_LVALUE
Definition: tclscanner.cpp:302
static bool * b
Definition: config.cpp:1043
static int yy_n_chars
Definition: tclscanner.cpp:306
#define YY_FATAL_ERROR(msg)
#define EOB_ACT_CONTINUE_SCAN
Definition: tclscanner.cpp:179
#define YY_READ_BUF_SIZE
#define YY_END_OF_BUFFER_CHAR
Definition: tclscanner.cpp:159
size_t yy_size_t
Definition: code.cpp:203
static char * yy_c_buf_p
Definition: tclscanner.cpp:310
#define yytext_ptr
Definition: tclscanner.cpp:381
#define YY_BUFFER_EOF_PENDING
Definition: tclscanner.cpp:279
static yy_state_type yy_get_previous_state ( void  )
static

Definition at line 2638 of file tclscanner.cpp.

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 }
#define YY_MORE_ADJ
Definition: tclscanner.cpp:697
static int yy_start
Definition: tclscanner.cpp:312
static yyconst flex_int16_t yy_accept[179]
Definition: tclscanner.cpp:408
int yy_state_type
Definition: code.cpp:361
static yyconst flex_int32_t yy_meta[41]
Definition: tclscanner.cpp:463
static yyconst flex_int16_t yy_chk[656]
Definition: tclscanner.cpp:601
static yyconst flex_int16_t yy_def[204]
Definition: tclscanner.cpp:498
static char * yy_last_accepting_cpos
Definition: tclscanner.cpp:685
register char * yy_cp
static yyconst flex_int16_t yy_base[204]
Definition: tclscanner.cpp:471
unsigned char YY_CHAR
Definition: code.cpp:357
static yyconst flex_int16_t yy_nxt[656]
Definition: tclscanner.cpp:525
static yyconst flex_int32_t yy_ec[256]
Definition: tclscanner.cpp:431
#define YY_SC_TO_UI(c)
Definition: tclscanner.cpp:138
static char * yy_c_buf_p
Definition: tclscanner.cpp:310
static yy_state_type yy_last_accepting_state
Definition: tclscanner.cpp:684
#define yytext_ptr
Definition: tclscanner.cpp:381
static int yy_init_globals ( void  )
static

Definition at line 3306 of file tclscanner.cpp.

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 }
static int yy_start_stack_depth
static int yy_start_stack_ptr
static YY_BUFFER_STATE * yy_buffer_stack
Definition: tclscanner.cpp:287
int tclscannerYYlineno
Definition: tclscanner.cpp:378
static int yy_start
Definition: tclscanner.cpp:312
static int yy_init
Definition: tclscanner.cpp:311
FILE * tclscannerYYout
Definition: tclscanner.cpp:372
static size_t yy_buffer_stack_top
Definition: tclscanner.cpp:285
FILE * tclscannerYYin
Definition: tclscanner.cpp:372
static int * yy_start_stack
static size_t yy_buffer_stack_max
Definition: tclscanner.cpp:286
static char * yy_c_buf_p
Definition: tclscanner.cpp:310
static void yy_pop_state ( void  )
static

Definition at line 3186 of file tclscanner.cpp.

3187 {
3188  if ( --(yy_start_stack_ptr) < 0 )
3189  YY_FATAL_ERROR( "start-condition stack underflow" );
3190 
3192 }
static int yy_start_stack_ptr
#define BEGIN
Definition: tclscanner.cpp:144
static int * yy_start_stack
#define YY_FATAL_ERROR(msg)
static void yy_push_state ( int  new_state)
static

Definition at line 3162 of file tclscanner.cpp.

3163 {
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 
3182 
3183  BEGIN(new_state);
3184 }
static int yy_start_stack_depth
static int yy_start_stack_ptr
void * tclscannerYYrealloc(void *, yy_size_t)
#define BEGIN
Definition: tclscanner.cpp:144
#define YY_START_STACK_INCR
static int * yy_start_stack
#define YY_START
Definition: tclscanner.cpp:150
#define YY_FATAL_ERROR(msg)
void * tclscannerYYalloc(yy_size_t)
size_t yy_size_t
Definition: code.cpp:203
static int yy_top_state ( void  )
static

Definition at line 3194 of file tclscanner.cpp.

3195 {
3196  return (yy_start_stack)[(yy_start_stack_ptr) - 1];
3197 }
static int yy_start_stack_ptr
static int * yy_start_stack
static yy_state_type yy_try_NUL_trans ( yy_state_type  current_state)
static

Definition at line 2670 of file tclscanner.cpp.

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 }
static yyconst flex_int16_t yy_accept[179]
Definition: tclscanner.cpp:408
static yyconst flex_int32_t yy_meta[41]
Definition: tclscanner.cpp:463
static yyconst flex_int16_t yy_chk[656]
Definition: tclscanner.cpp:601
static yyconst flex_int16_t yy_def[204]
Definition: tclscanner.cpp:498
static char * yy_last_accepting_cpos
Definition: tclscanner.cpp:685
register char * yy_cp
static yyconst flex_int16_t yy_base[204]
Definition: tclscanner.cpp:471
unsigned char YY_CHAR
Definition: code.cpp:357
static yyconst flex_int16_t yy_nxt[656]
Definition: tclscanner.cpp:525
static char * yy_c_buf_p
Definition: tclscanner.cpp:310
static yy_state_type yy_last_accepting_state
Definition: tclscanner.cpp:684
static int yyread ( char *  buf,
int  max_size 
)
static

Definition at line 5368 of file tclscanner.cpp.

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 }
static struct @2 tcl
static void yyunput ( int  c,
char *  buf_ptr 
)
static
static void yyunput ( int  c,
register char *  yy_bp 
)
static

Definition at line 2693 of file tclscanner.cpp.

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 }
static char yy_hold_char
Definition: tclscanner.cpp:305
register char * yy_bp
int tclscannerYYlineno
Definition: tclscanner.cpp:378
register char * yy_cp
if(!(yy_init))
#define YY_CURRENT_BUFFER_LVALUE
Definition: tclscanner.cpp:302
static int yy_n_chars
Definition: tclscanner.cpp:306
#define YY_FATAL_ERROR(msg)
static char * yy_c_buf_p
Definition: tclscanner.cpp:310
#define yytext_ptr
Definition: tclscanner.cpp:381

Variable Documentation

int brace_level

Definition at line 1126 of file tclscanner.cpp.

int bracket_level

Definition at line 1127 of file tclscanner.cpp.

int bracket_quote

Definition at line 1128 of file tclscanner.cpp.

Definition at line 1148 of file tclscanner.cpp.

Definition at line 1114 of file tclscanner.cpp.

const char* code_font

Definition at line 1117 of file tclscanner.cpp.

int code_line

Definition at line 1115 of file tclscanner.cpp.

int code_linenumbers

Definition at line 1116 of file tclscanner.cpp.

bool collectXRefs

Definition at line 1153 of file tclscanner.cpp.

int command

Definition at line 1124 of file tclscanner.cpp.

int comment

Definition at line 1125 of file tclscanner.cpp.

bool config_autobrief

Definition at line 1118 of file tclscanner.cpp.

QMap<QString,QString> config_subst

Definition at line 1119 of file tclscanner.cpp.

QList<Entry> entry

Definition at line 1150 of file tclscanner.cpp.

Entry* entry_current

Definition at line 1143 of file tclscanner.cpp.

Entry* entry_file

Definition at line 1142 of file tclscanner.cpp.

Entry* entry_inside

Definition at line 1144 of file tclscanner.cpp.

Entry* entry_main

Definition at line 1141 of file tclscanner.cpp.

QCString file_name

Definition at line 1122 of file tclscanner.cpp.

Definition at line 1149 of file tclscanner.cpp.

int input_position

Definition at line 1121 of file tclscanner.cpp.

QCString input_string

Definition at line 1120 of file tclscanner.cpp.

int line_body0

Definition at line 1133 of file tclscanner.cpp.

int line_body1

Definition at line 1134 of file tclscanner.cpp.

int line_command

Definition at line 1132 of file tclscanner.cpp.

int line_comment

Definition at line 1130 of file tclscanner.cpp.

int line_commentline

Definition at line 1131 of file tclscanner.cpp.

QStringList list_commandwords

Definition at line 1145 of file tclscanner.cpp.

MemberDef* memberdef

Definition at line 1152 of file tclscanner.cpp.

Definition at line 1147 of file tclscanner.cpp.

Protection protection

Definition at line 1151 of file tclscanner.cpp.

QList<tcl_scan> scan

Definition at line 1146 of file tclscanner.cpp.

Definition at line 1140 of file tclscanner.cpp.

QCString string_command

Definition at line 1135 of file tclscanner.cpp.

QCString string_comment

Definition at line 1138 of file tclscanner.cpp.

QCString string_commentcodify

Definition at line 1137 of file tclscanner.cpp.

QCString string_commentline

Definition at line 1136 of file tclscanner.cpp.

QCString string_last

Definition at line 1139 of file tclscanner.cpp.

struct { ... } tcl
int tclscannerYY_flex_debug = 0

Definition at line 688 of file tclscanner.cpp.

FILE * tclscannerYYin = (FILE *) 0

Definition at line 372 of file tclscanner.cpp.

int tclscannerYYleng

Definition at line 307 of file tclscanner.cpp.

int tclscannerYYlineno = 1

Definition at line 378 of file tclscanner.cpp.

FILE * tclscannerYYout = (FILE *) 0

Definition at line 372 of file tclscanner.cpp.

char * tclscannerYYtext

Definition at line 699 of file tclscanner.cpp.

ParserInterface* this_parser

Definition at line 1123 of file tclscanner.cpp.

char word_is

Definition at line 1129 of file tclscanner.cpp.

yyconst flex_int16_t yy_accept[179]
static
Initial value:
=
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5, 5, 0, 0, 0, 0, 0, 0, 26, 26,
0, 0, 56, 55, 1, 4, 3, 3, 2, 4,
40, 37, 36, 34, 35, 40, 40, 54, 50, 52,
53, 49, 48, 51, 46, 54, 47, 44, 45, 15,
5, 14, 15, 55, 23, 24, 55, 55, 17, 18,
55, 55, 20, 21, 55, 29, 26, 29, 25, 29,
55, 31, 32, 55, 3, 0, 37, 36, 34, 35,
0, 0, 0, 0, 39, 0, 42, 43, 41, 5,
0, 12, 13, 0, 0, 0, 0, 23, 24, 0,
22, 0, 17, 18, 0, 0, 20, 21, 0, 0,
25, 26, 0, 0, 31, 32, 0, 30, 33, 0,
0, 0, 8, 13, 0, 0, 0, 0, 11, 0,
0, 0, 28, 25, 0, 38, 0, 6, 13, 0,
7, 0, 0, 0, 0, 27, 6, 0, 0, 0,
0, 0, 0, 0, 0, 12, 0, 0, 0, 9,
9, 0, 0, 0, 0, 0, 0, 0, 16, 0,
12, 0, 10, 10, 0, 0, 19, 0
}

Definition at line 408 of file tclscanner.cpp.

register int yy_act

Definition at line 1689 of file tclscanner.cpp.

yyconst flex_int16_t yy_base[204]
static
Initial value:
=
{ 0,
0, 0, 126, 112, 0, 8, 32, 70, 108, 147,
14, 22, 19, 27, 35, 42, 44, 51, 57, 63,
73, 77, 107, 615, 615, 615, 80, 91, 615, 100,
615, 116, 615, 615, 99, 96, 89, 615, 615, 615,
615, 615, 615, 615, 615, 3, 615, 615, 615, 615,
38, 615, 119, 83, 615, 132, 134, 87, 615, 124,
151, 136, 615, 139, 157, 88, 161, 615, 84, 4,
142, 615, 166, 171, 175, 81, 0, 615, 615, 183,
75, 187, 59, 60, 615, 16, 615, 615, 615, 48,
194, 615, 198, 200, 223, 259, 206, 615, 210, 213,
615, 202, 615, 217, 225, 229, 615, 236, 239, 8,
0, 245, 241, 250, 615, 254, 256, 615, 615, 0,
261, 264, 615, 268, 273, 287, 291, 297, 615, 299,
301, 304, 615, 306, 311, 615, 320, 615, 334, 336,
615, 338, 344, 340, 347, 615, 615, 363, 368, 370,
353, 379, 383, 386, 397, 213, 394, 399, 414, 615,
278, 408, 420, 434, 423, 439, 441, 451, 615, 455,
294, 457, 615, 325, 460, 462, 615, 615, 493, 498,
503, 508, 513, 518, 523, 528, 533, 538, 543, 547,
549, 554, 559, 564, 569, 574, 579, 584, 589, 594,
599, 604, 609
}

Definition at line 471 of file tclscanner.cpp.

register char * yy_bp

Definition at line 1688 of file tclscanner.cpp.

YY_BUFFER_STATE* yy_buffer_stack = 0
static

Stack as an array.

Definition at line 287 of file tclscanner.cpp.

size_t yy_buffer_stack_max = 0
static

capacity of stack.

Definition at line 286 of file tclscanner.cpp.

size_t yy_buffer_stack_top = 0
static

index of top of stack.

Definition at line 285 of file tclscanner.cpp.

char* yy_c_buf_p = (char *) 0
static

Definition at line 310 of file tclscanner.cpp.

yyconst flex_int16_t yy_chk[656]
static

Definition at line 601 of file tclscanner.cpp.

register char* yy_cp

Definition at line 1688 of file tclscanner.cpp.

YY_DECL
Initial value:
{
register yy_state_type yy_current_state
int yy_state_type
Definition: code.cpp:361

The main scanner function which does all the work.

Definition at line 1686 of file tclscanner.cpp.

yyconst flex_int16_t yy_def[204]
static
Initial value:
=
{ 0,
179, 179, 180, 180, 181, 181, 182, 182, 183, 183,
184, 184, 185, 185, 186, 186, 187, 187, 188, 188,
189, 189, 178, 178, 178, 178, 178, 178, 178, 178,
178, 178, 178, 178, 178, 190, 178, 178, 178, 178,
178, 178, 178, 178, 178, 191, 178, 178, 178, 178,
178, 178, 192, 193, 178, 193, 193, 194, 178, 194,
194, 195, 178, 195, 195, 196, 196, 178, 196, 196,
197, 178, 197, 197, 178, 178, 32, 178, 178, 178,
178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
192, 178, 192, 198, 192, 192, 193, 178, 193, 193,
178, 194, 178, 194, 194, 195, 178, 195, 195, 196,
196, 196, 199, 197, 178, 197, 197, 178, 178, 200,
192, 198, 178, 198, 201, 198, 192, 192, 178, 194,
195, 199, 178, 199, 199, 178, 201, 178, 201, 201,
178, 192, 192, 194, 195, 178, 178, 192, 192, 194,
195, 192, 192, 194, 195, 202, 192, 194, 195, 178,
202, 192, 194, 195, 192, 194, 195, 192, 178, 195,
203, 195, 178, 203, 195, 195, 178, 0, 178, 178,
178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
178, 178, 178
}

Definition at line 498 of file tclscanner.cpp.

int yy_did_buffer_switch_on_eof
static

Definition at line 317 of file tclscanner.cpp.

yyconst flex_int32_t yy_ec[256]
static

Definition at line 431 of file tclscanner.cpp.

char yy_hold_char
static

Definition at line 305 of file tclscanner.cpp.

int yy_init = 0
static

Definition at line 311 of file tclscanner.cpp.

char* yy_last_accepting_cpos
static

Definition at line 685 of file tclscanner.cpp.

yy_state_type yy_last_accepting_state
static

Definition at line 684 of file tclscanner.cpp.

yyconst flex_int32_t yy_meta[41]
static
Initial value:
=
{ 0,
1, 2, 3, 1, 2, 2, 4, 1, 2, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 2, 5, 2, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 2, 2
}

Definition at line 463 of file tclscanner.cpp.

int yy_more_flag = 0
static

Definition at line 694 of file tclscanner.cpp.

int yy_more_len = 0
static

Definition at line 695 of file tclscanner.cpp.

int yy_n_chars
static

Definition at line 306 of file tclscanner.cpp.

yyconst flex_int16_t yy_nxt[656]
static

Definition at line 525 of file tclscanner.cpp.

yyconst flex_int32_t yy_rule_can_match_eol[56]
static
Initial value:
=
{ 0,
0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1,
1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0,
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, }

Definition at line 678 of file tclscanner.cpp.

int yy_start = 0
static

Definition at line 312 of file tclscanner.cpp.

int* yy_start_stack = NULL
static

Definition at line 1580 of file tclscanner.cpp.

int yy_start_stack_depth = 0
static

Definition at line 1579 of file tclscanner.cpp.

int yy_start_stack_ptr = 0
static

Definition at line 1578 of file tclscanner.cpp.