defargs.cpp File Reference

#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include "qtbc.h"
#include <assert.h>
#include <ctype.h>
#include <qregexp.h>
#include "defargs.h"
#include "entry.h"
#include "util.h"
#include <unistd.h>

Go to the source code of this file.

Classes

struct  yy_buffer_state
struct  yy_trans_info

Defines

#define YY_INT_ALIGNED   short int
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION   2
#define YY_FLEX_MINOR_VERSION   5
#define YY_FLEX_SUBMINOR_VERSION   33
#define FLEX_BETA
#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   defargsYYrestart(defargsYYin )
#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 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_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   defargsYY_flush_buffer(YY_CURRENT_BUFFER )
#define yy_new_buffer   defargsYY_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 defargsYYwrap(n)   1
#define YY_SKIP_YYWRAP
#define yytext_ptr   defargsYYtext
#define YY_DO_BEFORE_ACTION
#define YY_NUM_RULES   45
#define YY_END_OF_BUFFER   46
#define YY_TRAILING_MASK   0x2000
#define YY_TRAILING_HEAD_MASK   0x4000
#define REJECT
#define yymore()   yymore_used_but_not_detected
#define YY_MORE_ADJ   0
#define YY_RESTORE_YY_MORE_OFFSET
#define YY_NEVER_INTERACTIVE   1
#define YY_INPUT(buf, result, max_size)   result=yyread(buf,max_size);
#define INITIAL   0
#define Start   1
#define CopyArgString   2
#define CopyArgRound   3
#define CopyArgRound2   4
#define CopyArgSharp   5
#define CopyArgCurly   6
#define ReadFuncArgType   7
#define ReadFuncArgDef   8
#define ReadFuncArgPtr   9
#define FuncQual   10
#define ReadDocBlock   11
#define ReadDocLine   12
#define YY_EXTRA_TYPE   void *
#define YY_READ_BUF_SIZE   8192
#define ECHO   (void) fwrite( defargsYYtext, defargsYYleng, 1, defargsYYout )
#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 defargsYYlex (void)
#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 yy_buffer_stateYY_BUFFER_STATE
typedef unsigned int yy_size_t
typedef unsigned char YY_CHAR
typedef int yy_state_type

Functions

void defargsYYrestart (FILE *input_file)
void defargsYY_switch_to_buffer (YY_BUFFER_STATE new_buffer)
YY_BUFFER_STATE defargsYY_create_buffer (FILE *file, int size)
void defargsYY_delete_buffer (YY_BUFFER_STATE b)
void defargsYY_flush_buffer (YY_BUFFER_STATE b)
void defargsYYpush_buffer_state (YY_BUFFER_STATE new_buffer)
void defargsYYpop_buffer_state (void)
YY_BUFFER_STATE defargsYY_scan_buffer (char *base, yy_size_t size)
YY_BUFFER_STATE defargsYY_scan_string (yyconst char *yy_str)
YY_BUFFER_STATE defargsYY_scan_bytes (yyconst char *bytes, int len)
void * defargsYYalloc (yy_size_t)
void * defargsYYrealloc (void *, yy_size_t)
void defargsYYfree (void *)
int defargsYYlex (void)

Variables

int defargsYYleng
FILE * defargsYYin
FILE * defargsYYout
int defargsYYleng
FILE * defargsYYin = (FILE *) 0
FILE * defargsYYout = (FILE *) 0
int defargsYYlineno
int defargsYYlineno = 1
char * defargsYYtext
int defargsYY_flex_debug
int defargsYY_flex_debug = 0
char * defargsYYtext


Detailed Description

This scanner is used to convert a string into a list of function or template arguments. Each parsed argument results in a Argument struct, that is put into an ArgumentList in declaration order. Comment blocks for arguments can also be included in the string. The argument string does not contain new-lines (except inside any comment blocks). An Argument consists of the string fields: type,name,default value, and documentation The Argument list as a whole can be pure, constant or volatile.

Examples of input strings are:

    "(int a,int b) const"
    "(const char *s="hello world",int=5) = 0"
    "<class T,class N>"
    "(char c,const char)"

Note: It is not always possible to distinguish between the name and type of an argument. In case of doubt the name is added to the type, and the matchArgumentList in util.cpp is be used to further determine the correct separation.

Definition in file defargs.cpp.


Define Documentation

#define BEGIN   (yy_start) = 1 + 2 *

Definition at line 123 of file defargs.cpp.

#define CopyArgCurly   6

Definition at line 779 of file defargs.cpp.

#define CopyArgRound   3

Definition at line 776 of file defargs.cpp.

#define CopyArgRound2   4

Definition at line 777 of file defargs.cpp.

#define CopyArgSharp   5

Definition at line 778 of file defargs.cpp.

#define CopyArgString   2

Definition at line 775 of file defargs.cpp.

#define defargsYYwrap (  )     1

Definition at line 338 of file defargs.cpp.

#define ECHO   (void) fwrite( defargsYYtext, defargsYYleng, 1, defargsYYout )

Definition at line 843 of file defargs.cpp.

#define EOB_ACT_CONTINUE_SCAN   0

Definition at line 158 of file defargs.cpp.

#define EOB_ACT_END_OF_FILE   1

Definition at line 159 of file defargs.cpp.

#define EOB_ACT_LAST_MATCH   2

Definition at line 160 of file defargs.cpp.

#define FLEX_BETA

Definition at line 13 of file defargs.cpp.

#define FLEX_SCANNER

Definition at line 8 of file defargs.cpp.

#define FuncQual   10

Definition at line 783 of file defargs.cpp.

#define INITIAL   0

Definition at line 773 of file defargs.cpp.

#define INT16_MAX   (32767)

Definition at line 72 of file defargs.cpp.

#define INT16_MIN   (-32767-1)

Definition at line 63 of file defargs.cpp.

#define INT32_MAX   (2147483647)

Definition at line 75 of file defargs.cpp.

#define INT32_MIN   (-2147483647-1)

Definition at line 66 of file defargs.cpp.

#define INT8_MAX   (127)

Definition at line 69 of file defargs.cpp.

#define INT8_MIN   (-128)

Definition at line 60 of file defargs.cpp.

#define ReadDocBlock   11

Definition at line 784 of file defargs.cpp.

#define ReadDocLine   12

Definition at line 785 of file defargs.cpp.

#define ReadFuncArgDef   8

Definition at line 781 of file defargs.cpp.

#define ReadFuncArgPtr   9

Definition at line 782 of file defargs.cpp.

#define ReadFuncArgType   7

Definition at line 780 of file defargs.cpp.

#define REJECT

Value:

{ \
*yy_cp = (yy_hold_char); /* undo effects of setting up defargsYYtext */ \
yy_cp = (yy_full_match); /* restore poss. backed-over text */ \
(yy_lp) = yy_full_lp; /* restore orig. accepting pos. */ \
(yy_state_ptr) = yy_full_state; /* restore orig. state */ \
yy_current_state = *(yy_state_ptr); /* restore curr. state */ \
++(yy_lp); \
goto find_rule; \
}

Definition at line 648 of file defargs.cpp.

#define Start   1

Definition at line 774 of file defargs.cpp.

#define UINT16_MAX   (65535U)

Definition at line 81 of file defargs.cpp.

#define UINT32_MAX   (4294967295U)

Definition at line 84 of file defargs.cpp.

#define UINT8_MAX   (255U)

Definition at line 78 of file defargs.cpp.

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

Definition at line 178 of file defargs.cpp.

 
#define YY_AT_BOL (  )     (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

Definition at line 334 of file defargs.cpp.

#define YY_BREAK   break;

Definition at line 922 of file defargs.cpp.

#define YY_BUF_SIZE   16384

Definition at line 142 of file defargs.cpp.

#define YY_BUFFER_EOF_PENDING   2

Definition at line 250 of file defargs.cpp.

#define YY_BUFFER_NEW   0

Definition at line 238 of file defargs.cpp.

#define YY_BUFFER_NORMAL   1

Definition at line 239 of file defargs.cpp.

#define YY_CURRENT_BUFFER

Value:

( (yy_buffer_stack) \
                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
                          : NULL)

Definition at line 266 of file defargs.cpp.

#define YY_CURRENT_BUFFER_LVALUE   (yy_buffer_stack)[(yy_buffer_stack_top)]

Definition at line 273 of file defargs.cpp.

#define YY_DECL   int defargsYYlex (void)

Definition at line 910 of file defargs.cpp.

#define YY_DECL_IS_OURS   1

Definition at line 906 of file defargs.cpp.

#define YY_DO_BEFORE_ACTION

Value:

(yytext_ptr) = yy_bp; \
        defargsYYleng = (size_t) (yy_cp - yy_bp); \
        (yy_hold_char) = *yy_cp; \
        *yy_cp = '\0'; \
        (yy_c_buf_p) = yy_cp;

Definition at line 362 of file defargs.cpp.

#define YY_END_OF_BUFFER   46

Definition at line 370 of file defargs.cpp.

#define YY_END_OF_BUFFER_CHAR   0

Definition at line 138 of file defargs.cpp.

#define YY_EXIT_FAILURE   2

#define YY_EXTRA_TYPE   void *

Definition at line 796 of file defargs.cpp.

#define YY_FATAL_ERROR ( msg   )     yy_fatal_error( msg )

Definition at line 897 of file defargs.cpp.

#define YY_FLEX_MAJOR_VERSION   2

Definition at line 9 of file defargs.cpp.

#define YY_FLEX_MINOR_VERSION   5

Definition at line 10 of file defargs.cpp.

#define YY_FLEX_SUBMINOR_VERSION   33

Definition at line 11 of file defargs.cpp.

#define YY_FLUSH_BUFFER   defargsYY_flush_buffer(YY_CURRENT_BUFFER )

Definition at line 302 of file defargs.cpp.

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

Definition at line 746 of file defargs.cpp.

#define YY_INT_ALIGNED   short int

Definition at line 4 of file defargs.cpp.

#define YY_LESS_LINENO (  ) 

Definition at line 162 of file defargs.cpp.

#define YY_MORE_ADJ   0

Definition at line 660 of file defargs.cpp.

#define YY_NEVER_INTERACTIVE   1

Definition at line 720 of file defargs.cpp.

#define yy_new_buffer   defargsYY_create_buffer

Definition at line 312 of file defargs.cpp.

#define YY_NEW_FILE   defargsYYrestart(defargsYYin )

Definition at line 136 of file defargs.cpp.

#define YY_NULL   0

Definition at line 110 of file defargs.cpp.

#define YY_NUM_RULES   45

Definition at line 369 of file defargs.cpp.

#define YY_READ_BUF_SIZE   8192

Definition at line 835 of file defargs.cpp.

#define YY_RESTORE_YY_MORE_OFFSET

Definition at line 661 of file defargs.cpp.

#define YY_RULE_SETUP   YY_USER_ACTION

Definition at line 925 of file defargs.cpp.

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

Definition at line 117 of file defargs.cpp.

#define yy_set_bol ( at_bol   ) 

Value:

{ \
        if ( ! YY_CURRENT_BUFFER ){\
        defargsYYensure_buffer_stack (); \
                YY_CURRENT_BUFFER_LVALUE =    \
            defargsYY_create_buffer(defargsYYin,YY_BUF_SIZE ); \
        } \
        YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
        }

Definition at line 324 of file defargs.cpp.

#define yy_set_interactive ( is_interactive   ) 

Value:

{ \
        if ( ! YY_CURRENT_BUFFER ){ \
        defargsYYensure_buffer_stack (); \
                YY_CURRENT_BUFFER_LVALUE =    \
            defargsYY_create_buffer(defargsYYin,YY_BUF_SIZE ); \
        } \
        YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
        }

Definition at line 314 of file defargs.cpp.

#define YY_SKIP_YYWRAP

Definition at line 339 of file defargs.cpp.

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

Definition at line 129 of file defargs.cpp.

#define YY_START_STACK_INCR   25

Definition at line 892 of file defargs.cpp.

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

Definition at line 147 of file defargs.cpp.

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

Definition at line 133 of file defargs.cpp.

#define YY_TRAILING_HEAD_MASK   0x4000

Definition at line 647 of file defargs.cpp.

#define YY_TRAILING_MASK   0x2000

Definition at line 646 of file defargs.cpp.

#define yyconst

Definition at line 106 of file defargs.cpp.

#define yyless (  ) 

Value:

do \
                { \
                /* Undo effects of setting up defargsYYtext. */ \
        int yyless_macro_arg = (n); \
        YY_LESS_LINENO(yyless_macro_arg);\
                defargsYYtext[defargsYYleng] = (yy_hold_char); \
                (yy_c_buf_p) = defargsYYtext + yyless_macro_arg; \
                (yy_hold_char) = *(yy_c_buf_p); \
                *(yy_c_buf_p) = '\0'; \
                defargsYYleng = yyless_macro_arg; \
                } \
        while ( 0 )

Definition at line 165 of file defargs.cpp.

#define yyless (  ) 

Value:

do \
                { \
                /* Undo effects of setting up defargsYYtext. */ \
        int yyless_macro_arg = (n); \
        YY_LESS_LINENO(yyless_macro_arg);\
                *yy_cp = (yy_hold_char); \
                YY_RESTORE_YY_MORE_OFFSET \
                (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
                YY_DO_BEFORE_ACTION; /* set up defargsYYtext again */ \
                } \
        while ( 0 )

Definition at line 165 of file defargs.cpp.

 
#define yymore (  )     yymore_used_but_not_detected

Definition at line 659 of file defargs.cpp.

#define YYSTATE   YY_START

Definition at line 130 of file defargs.cpp.

#define YYTABLES_NAME   "yytables"

 
#define yyterminate (  )     return YY_NULL

Definition at line 887 of file defargs.cpp.

#define yytext_ptr   defargsYYtext

Definition at line 352 of file defargs.cpp.


Typedef Documentation

typedef short int flex_int16_t

Definition at line 51 of file defargs.cpp.

typedef int flex_int32_t

Definition at line 52 of file defargs.cpp.

typedef signed char flex_int8_t

Definition at line 50 of file defargs.cpp.

typedef unsigned short int flex_uint16_t

Definition at line 54 of file defargs.cpp.

typedef unsigned int flex_uint32_t

Definition at line 55 of file defargs.cpp.

typedef unsigned char flex_uint8_t

Definition at line 53 of file defargs.cpp.

typedef struct yy_buffer_state* YY_BUFFER_STATE

Definition at line 151 of file defargs.cpp.

typedef unsigned char YY_CHAR

Definition at line 341 of file defargs.cpp.

typedef unsigned int yy_size_t

Definition at line 187 of file defargs.cpp.

typedef int yy_state_type

Definition at line 345 of file defargs.cpp.


Function Documentation

YY_BUFFER_STATE defargsYY_create_buffer ( FILE *  file,
int  size 
)

void defargsYY_delete_buffer ( YY_BUFFER_STATE  b  ) 

void defargsYY_flush_buffer ( YY_BUFFER_STATE  b  ) 

YY_BUFFER_STATE defargsYY_scan_buffer ( char *  base,
yy_size_t  size 
)

YY_BUFFER_STATE defargsYY_scan_bytes ( yyconst char *  bytes,
int  len 
)

YY_BUFFER_STATE defargsYY_scan_string ( yyconst char *  yy_str  ) 

void defargsYY_switch_to_buffer ( YY_BUFFER_STATE  new_buffer  ) 

void* defargsYYalloc ( yy_size_t   ) 

void defargsYYfree ( void *   ) 

int defargsYYlex ( void   ) 

void defargsYYpop_buffer_state ( void   ) 

void defargsYYpush_buffer_state ( YY_BUFFER_STATE  new_buffer  ) 

void* defargsYYrealloc ( void *  ,
yy_size_t   
)

void defargsYYrestart ( FILE *  input_file  ) 


Variable Documentation

int defargsYY_flex_debug = 0

Definition at line 638 of file defargs.cpp.

int defargsYY_flex_debug

Definition at line 638 of file defargs.cpp.

FILE* defargsYYin = (FILE *) 0

Definition at line 343 of file defargs.cpp.

FILE* defargsYYin

Definition at line 343 of file defargs.cpp.

int defargsYYleng

Definition at line 278 of file defargs.cpp.

int defargsYYleng

Definition at line 278 of file defargs.cpp.

int defargsYYlineno = 1

Definition at line 349 of file defargs.cpp.

int defargsYYlineno

Definition at line 349 of file defargs.cpp.

FILE * defargsYYout = (FILE *) 0

Definition at line 343 of file defargs.cpp.

FILE * defargsYYout

Definition at line 343 of file defargs.cpp.

char* defargsYYtext

Definition at line 662 of file defargs.cpp.

char* defargsYYtext

Definition at line 662 of file defargs.cpp.



Generated on Mon Mar 31 10:58:52 2008 by  doxygen 1.5.1