File parse-lex.c

RCS Header: /home/amb/cxref/RCS/parse.l 1.36 2000/03/13 19:40:31 amb Exp

C Cross Referencing & Documentation tool. Version 1.5c.
C lexical analyser CPP processing, including GNU extensions, using yylval as a string.


Included Files


Preprocessor definitions

#define FLEX_SCANNER

#define YY_FLEX_MAJOR_VERSION 2

#define YY_FLEX_MINOR_VERSION 5

#define YY_USE_PROTOS

#define YY_USE_CONST

#define yyconst const

#define YY_PROTO( proto )

#define YY_NULL 0

#define YY_SC_TO_UI( c )

#define BEGIN

#define YY_START

#define YYSTATE YY_START

#define YY_STATE_EOF( state )

#define YY_NEW_FILE

#define YY_END_OF_BUFFER_CHAR 0

#define YY_BUF_SIZE 16384

#define EOB_ACT_CONTINUE_SCAN 0

#define EOB_ACT_END_OF_FILE 1

#define EOB_ACT_LAST_MATCH 2

#define yyless( n )

#define unput( c )

#define YY_BUFFER_NEW 0

#define YY_BUFFER_NORMAL 1

#define YY_BUFFER_EOF_PENDING 2

#define YY_CURRENT_BUFFER yy_current_buffer

#define YY_FLUSH_BUFFER

#define yy_new_buffer yy_create_buffer

#define yy_set_interactive( is_interactive )

#define yy_set_bol( at_bol )

#define YY_AT_BOL

#define yytext_ptr yytext

#define YY_DO_BEFORE_ACTION

#define YY_NUM_RULES 209

#define YY_END_OF_BUFFER 210

#define REJECT reject_used_but_not_detected

#define yymore

#define YY_MORE_ADJ 0

#define YY_RESTORE_YY_MORE_OFFSET

#define INITIAL 0

#define START_COMMENT 1

#define COMMENT 2

#define SPECIAL_COMMENT 3

#define START_COMMENT_CPP 4

#define COMMENT_CPP 5

#define SPECIAL_COMMENT_CPP 6

#define CPP 7

#define CPP_START 8

#define CPP_INCLUDE 9

#define CPP_INC_FILE 10

#define CPP_INC_FLAGS 11

#define CPP_DEFINE 12

#define CPP_DEFINE_ARGP 13

#define CPP_DEFINE_BODY 14

#define CPP_DEFINE_ARGS 15

#define GNU_LABEL 16

#define GNU_ATTRIBUTE 17

#define GNU_EXTENSION 18

#define GNU_TYPEOF 19

#define CHAR_VARYING 20

#define YY_NO_PUSH_STATE 1

#define YY_NO_POP_STATE 1

#define YY_NO_TOP_STATE 1

#define YY_READ_BUF_SIZE 8192

#define ECHO

#define YY_INPUT( buf, result, max_size )

#define yyterminate

#define YY_START_STACK_INCR 25

#define YY_FATAL_ERROR( msg )

#define YY_DECL

#define YY_USER_ACTION

#define YY_BREAK break

#define YY_RULE_SETUP YY_USER_ACTION

#define YY_EXIT_FAILURE 2

#define yyless( n )


Typedef YY_BUFFER_STATE

typedef struct yy_buffer_state* YY_BUFFER_STATE
See:

Typedef yy_size_t

typedef unsigned int yy_size_t

Type struct yy_buffer_state

struct yy_buffer_state
struct yy_buffer_state 
   { 
     FILE* yy_input_file; 
     char* yy_ch_buf; 
     char* yy_buf_pos; 
     yy_size_t yy_buf_size; 
     int yy_n_chars; 
     int yy_is_our_buffer; 
     int yy_is_interactive; 
     int yy_at_bol; 
     int yy_fill_buffer; 
     int yy_buffer_status; 
   } 

Typedef YY_CHAR

typedef unsigned char YY_CHAR

Typedef yy_state_type

typedef int yy_state_type

Global Variable yyleng

int yyleng
Visible in:  parse-lex.c
Used in: yylex()parse-lex.c

Global Variable yyin

FILE* yyin
Visible in:  cxref.c
   func.c
   parse-lex.c
   parse-yacc.c
   parse-yy.h
   preproc.c
   type.c
   var.c
Used in: DocumentTheFile()cxref.c
  input()parse-lex.c
  yy_get_next_buffer()parse-lex.c
  yy_load_buffer_state()parse-lex.c
  yylex()parse-lex.c
  yyrestart()parse-lex.c

Global Variable yyout

FILE* yyout
Visible in:  parse-lex.c
Used in: yylex()parse-lex.c

Global Variable yytext

char* yytext
Visible in:  parse-lex.c
Used in: input()parse-lex.c
  yy_get_next_buffer()parse-lex.c
  yy_get_previous_state()parse-lex.c
  yy_load_buffer_state()parse-lex.c
  yylex()parse-lex.c
  yyunput()parse-lex.c

Global Variable parse_file

The name of the current file.

char* parse_file
Visible in:  comment.c
   cxref.c
   func.c
   parse-lex.c
   parse-yacc.c
   parse-yy.h
   preproc.c
   type.c
   var.c
Used in: ResetLexer()parse-lex.c
  SeenComment()comment.c
  SeenFunctionDeclaration()func.c
  SeenFunctionProto()func.c
  SeenVariableDefinition()var.c
  yyerror()parse-yacc.c
  yylex()parse-lex.c


Global Variable parse_line

The current line number in the file.

int parse_line
Visible in:  cxref.c
   func.c
   parse-lex.c
   parse-yacc.c
   parse-yy.h
   preproc.c
   type.c
   var.c
Used in: ResetLexer()parse-lex.c
  SeenDefine()preproc.c
  SeenFunctionDeclaration()func.c
  SeenStructUnionStart()type.c
  SeenTypedef()type.c
  SeenVariableDefinition()var.c
  yyerror()parse-yacc.c
  yylex()parse-lex.c


External Variables

in_header
If we are in a header file then ignore the comments.

extern int in_header
Defined in: preproc.c

option_all_comments
One of the options controlling how comments are processed, use all comments not just the specially formattted ones.

extern int option_all_comments
Defined in: cxref.c

option_block_comments
One of the options controlling how comments are processed, remove the leading block comment marker.

extern int option_block_comments
Defined in: cxref.c

option_no_comments
One of the options controlling how comments are processed, ignore all comments.

extern int option_no_comments
Defined in: cxref.c

option_warn
Flag that indicates if the comment warnings are to be issued.

extern int option_warn
Defined in: cxref.c


Local Variables

yy_current_buffer
static YY_BUFFER_STATE yy_current_buffer
Used in: input()
  yy_delete_buffer()
  yy_flush_buffer()
  yy_get_next_buffer()
  yy_load_buffer_state()
  yy_switch_to_buffer()
  yylex()
  yyrestart()
  yyunput()

yy_hold_char
static char yy_hold_char
Used in: input()
  yy_load_buffer_state()
  yy_switch_to_buffer()
  yylex()
  yyunput()

yy_n_chars
static int yy_n_chars
Used in: input()
  yy_get_next_buffer()
  yy_load_buffer_state()
  yy_switch_to_buffer()
  yylex()
  yyunput()

yy_c_buf_p
static char* yy_c_buf_p
Used in: input()
  yy_get_next_buffer()
  yy_get_previous_state()
  yy_load_buffer_state()
  yy_switch_to_buffer()
  yy_try_NUL_trans()
  yylex()
  yyunput()

yy_init
static int yy_init
Used in: yylex()

yy_start
static int yy_start
Used in: ResetLexer()
  yy_get_previous_state()
  yylex()

yy_did_buffer_switch_on_eof
static int yy_did_buffer_switch_on_eof
Used in: input()
  yy_switch_to_buffer()
  yylex()

yy_accept
static const short int yy_accept[698]
Used in: yy_get_previous_state()
  yy_try_NUL_trans()
  yylex()

yy_ec
static const int yy_ec[256]
Used in: yy_get_previous_state()
  yylex()

yy_meta
static const int yy_meta[74]
Used in: yy_get_previous_state()
  yy_try_NUL_trans()
  yylex()

yy_base
static const short int yy_base[735]
Used in: yy_get_previous_state()
  yy_try_NUL_trans()
  yylex()

yy_def
static const short int yy_def[735]
Used in: yy_get_previous_state()
  yy_try_NUL_trans()
  yylex()

yy_nxt
static const short int yy_nxt[2109]
Used in: yy_get_previous_state()
  yy_try_NUL_trans()
  yylex()

yy_chk
static const short int yy_chk[2109]
Used in: yy_get_previous_state()
  yy_try_NUL_trans()
  yylex()

yy_last_accepting_state
static yy_state_type yy_last_accepting_state
Used in: yy_get_previous_state()
  yy_try_NUL_trans()
  yylex()

yy_last_accepting_cpos
static char* yy_last_accepting_cpos
Used in: yy_get_previous_state()
  yy_try_NUL_trans()
  yylex()

inc_file_flags
The flags that come out of GCC when a file is included.

static int inc_file_flags
Used in: ResetLexer()
  yylex()

inc_file
The name of a file seen in a CPP_INC_FILE state.

static char* inc_file
Used in: ResetLexer()
  yylex()

define_value
The value of the thing that is defined (but only if it is simple).

static char* define_value
Used in: ResetLexer()
  yylex()

comment_init_state
The lex state at the time that a comment is seen.

static int comment_init_state
Used in: ResetLexer()
  yylex()

gnu_att_depth
To get around the GCC __attribute__ keyword, skip over matched () counted by this.

static int gnu_att_depth
Used in: ResetLexer()
  yylex()

gnu_typ_depth
To get around the GCC __typeof__ keyword, skip over matched () counted by this.

static int gnu_typ_depth
Used in: ResetLexer()
  yylex()

push_past
If we see a comment immediately after a ',', ';', '};', '},' or ')' then push it before.

static int push_past
Used in: ResetLexer()
  yylex()


Global Function ResetLexer()

Reset the Lexer, ready for the next file.

void ResetLexer ( void )
Prototyped in: cxref.h
Called by: main()cxref.c
References Variables: comment_init_stateparse-lex.c
  define_valueparse-lex.c
  gnu_att_depthparse-lex.c
  gnu_typ_depthparse-lex.c
  inc_fileparse-lex.c
  inc_file_flagsparse-lex.c
  parse_fileparse-lex.c
  parse_lineparse-lex.c
  push_pastparse-lex.c
  yy_startparse-lex.c


Global Function yy_create_buffer()

YY_BUFFER_STATE yy_create_buffer ( FILE* file, int size )
Prototyped in: parse-lex.c
Calls: yy_fatal_error()parse-lex.c
  yy_flex_alloc()parse-lex.c
  yy_init_buffer()parse-lex.c
Called by: yylex()parse-lex.c
  yyrestart()parse-lex.c

Global Function yy_delete_buffer()

void yy_delete_buffer ( YY_BUFFER_STATE b )
Prototyped in: parse-lex.c
Calls: yy_flex_free()parse-lex.c
References Variables: yy_current_bufferparse-lex.c

Global Function yy_flush_buffer()

void yy_flush_buffer ( YY_BUFFER_STATE b )
Prototyped in: parse-lex.c
Calls: yy_load_buffer_state()parse-lex.c
Called by: yy_init_buffer()parse-lex.c
References Variables: yy_current_bufferparse-lex.c

Global Function yy_init_buffer()

void yy_init_buffer ( YY_BUFFER_STATE b, FILE* file )
Prototyped in: parse-lex.c
Calls: yy_flush_buffer()parse-lex.c
  fileno(), isatty()
Called by: yy_create_buffer()parse-lex.c
  yyrestart()parse-lex.c

Global Function yy_load_buffer_state()

void yy_load_buffer_state ( void )
Prototyped in: parse-lex.c
Called by: yy_flush_buffer()parse-lex.c
  yy_switch_to_buffer()parse-lex.c
  yylex()parse-lex.c
  yyrestart()parse-lex.c
References Variables: yy_c_buf_pparse-lex.c
  yy_current_bufferparse-lex.c
  yy_hold_charparse-lex.c
  yy_n_charsparse-lex.c
  yyinparse-lex.c
  yytextparse-lex.c

Global Function yy_scan_buffer()

YY_BUFFER_STATE yy_scan_buffer ( char* base, yy_size_t size )
Prototyped in: parse-lex.c
Calls: yy_fatal_error()parse-lex.c
  yy_flex_alloc()parse-lex.c
  yy_switch_to_buffer()parse-lex.c
Called by: yy_scan_bytes()parse-lex.c

Global Function yy_scan_bytes()

YY_BUFFER_STATE yy_scan_bytes ( const char* bytes, int len )
Prototyped in: parse-lex.c
Calls: yy_fatal_error()parse-lex.c
  yy_flex_alloc()parse-lex.c
  yy_scan_buffer()parse-lex.c
Called by: yy_scan_string()parse-lex.c

Global Function yy_scan_string()

YY_BUFFER_STATE yy_scan_string ( const char* yy_str )
Prototyped in: parse-lex.c
Calls: yy_scan_bytes()parse-lex.c

Global Function yy_switch_to_buffer()

void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer )
Prototyped in: parse-lex.c
Calls: yy_load_buffer_state()parse-lex.c
Called by: yy_scan_buffer()parse-lex.c
References Variables: yy_c_buf_pparse-lex.c
  yy_current_bufferparse-lex.c
  yy_did_buffer_switch_on_eofparse-lex.c
  yy_hold_charparse-lex.c
  yy_n_charsparse-lex.c

Global Function yylex()

int yylex ( void )
Prototyped in: parse-yy.h
Calls: CopyString()memory.c
  GetCurrentComment()comment.c
  IsAScopeVariable()var.c
  IsATypeName()type.c
  SeenComment()comment.c
  SeenDefine()preproc.c
  SeenDefineComment()preproc.c
  SeenDefineFuncArgComment()preproc.c
  SeenDefineFunctionArg()preproc.c
  SeenDefineValue()preproc.c
  SeenFileChange()preproc.c
  SeenInclude()preproc.c
  SeenIncludeComment()preproc.c
  yy_create_buffer()parse-lex.c
  yy_fatal_error()parse-lex.c
  yy_get_next_buffer()parse-lex.c
  yy_get_previous_state()parse-lex.c
  yy_load_buffer_state()parse-lex.c
  yy_try_NUL_trans()parse-lex.c
  yyrestart()parse-lex.c
  yyunput()parse-lex.c
  atoi(), fprintf(), fwrite(), strlen()
Called by: cxref_yylex()parse-yacc.c
  yyerror()parse-yacc.c
References Variables: comment_init_stateparse-lex.c
  define_valueparse-lex.c
  gnu_att_depthparse-lex.c
  gnu_typ_depthparse-lex.c
  in_headerpreproc.c
  inc_fileparse-lex.c
  inc_file_flagsparse-lex.c
  option_all_commentscxref.c
  option_block_commentscxref.c
  option_no_commentscxref.c
  option_warncxref.c
  parse_fileparse-lex.c
  parse_lineparse-lex.c
  push_pastparse-lex.c
  yy_acceptparse-lex.c
  yy_baseparse-lex.c
  yy_c_buf_pparse-lex.c
  yy_chkparse-lex.c
  yy_current_bufferparse-lex.c
  yy_defparse-lex.c
  yy_did_buffer_switch_on_eofparse-lex.c
  yy_ecparse-lex.c
  yy_hold_charparse-lex.c
  yy_initparse-lex.c
  yy_last_accepting_cposparse-lex.c
  yy_last_accepting_stateparse-lex.c
  yy_metaparse-lex.c
  yy_n_charsparse-lex.c
  yy_nxtparse-lex.c
  yy_startparse-lex.c
  yyinparse-lex.c
  yylengparse-lex.c
  yylvalparse-yacc.c
  yyoutparse-lex.c
  yytextparse-lex.c

Global Function yyrestart()

void yyrestart ( FILE* input_file )
Prototyped in: parse-lex.c
Calls: yy_create_buffer()parse-lex.c
  yy_init_buffer()parse-lex.c
  yy_load_buffer_state()parse-lex.c
Called by: DocumentTheFile()cxref.c
  input()parse-lex.c
  yy_get_next_buffer()parse-lex.c
  yylex()parse-lex.c
References Variables: yy_current_bufferparse-lex.c
  yyinparse-lex.c

Local Function input()

static int input ( void )
Prototyped in: parse-lex.c
Calls: input()parse-lex.c
  yy_get_next_buffer()parse-lex.c
  yyrestart()parse-lex.c
Called by: input()parse-lex.c
References Variables: yy_c_buf_pparse-lex.c
  yy_current_bufferparse-lex.c
  yy_did_buffer_switch_on_eofparse-lex.c
  yy_hold_charparse-lex.c
  yy_n_charsparse-lex.c
  yyinparse-lex.c
  yytextparse-lex.c

Local Function yy_fatal_error()

static void yy_fatal_error ( const char msg[] )
Prototyped in: parse-lex.c
Calls: exit(), fprintf()
Called by: yy_create_buffer()parse-lex.c
  yy_get_next_buffer()parse-lex.c
  yy_scan_buffer()parse-lex.c
  yy_scan_bytes()parse-lex.c
  yylex()parse-lex.c
  yyunput()parse-lex.c

Local Function yy_flex_alloc()

static void* yy_flex_alloc ( yy_size_t size )
Prototyped in: parse-lex.c
Calls: malloc()
Called by: yy_create_buffer()parse-lex.c
  yy_scan_buffer()parse-lex.c
  yy_scan_bytes()parse-lex.c

Local Function yy_flex_free()

static void yy_flex_free ( void* ptr )
Prototyped in: parse-lex.c
Calls: free()
Called by: yy_delete_buffer()parse-lex.c

Local Function yy_flex_realloc()

static void* yy_flex_realloc ( void* ptr, yy_size_t size )
Prototyped in: parse-lex.c
Calls: realloc()
Called by: yy_get_next_buffer()parse-lex.c

Local Function yy_get_next_buffer()

static int yy_get_next_buffer ( void )
Prototyped in: parse-lex.c
Calls: yy_fatal_error()parse-lex.c
  yy_flex_realloc()parse-lex.c
  yyrestart()parse-lex.c
  _IO_getc(), ferror(), fread()
Called by: input()parse-lex.c
  yylex()parse-lex.c
References Variables: yy_c_buf_pparse-lex.c
  yy_current_bufferparse-lex.c
  yy_n_charsparse-lex.c
  yyinparse-lex.c
  yytextparse-lex.c

Local Function yy_get_previous_state()

static yy_state_type yy_get_previous_state ( void )
Prototyped in: parse-lex.c
Called by: yylex()parse-lex.c
References Variables: yy_acceptparse-lex.c
  yy_baseparse-lex.c
  yy_c_buf_pparse-lex.c
  yy_chkparse-lex.c
  yy_defparse-lex.c
  yy_ecparse-lex.c
  yy_last_accepting_cposparse-lex.c
  yy_last_accepting_stateparse-lex.c
  yy_metaparse-lex.c
  yy_nxtparse-lex.c
  yy_startparse-lex.c
  yytextparse-lex.c

Local Function yy_try_NUL_trans()

static yy_state_type yy_try_NUL_trans ( yy_state_type yy_current_state )
Prototyped in: parse-lex.c
Called by: yylex()parse-lex.c
References Variables: yy_acceptparse-lex.c
  yy_baseparse-lex.c
  yy_c_buf_pparse-lex.c
  yy_chkparse-lex.c
  yy_defparse-lex.c
  yy_last_accepting_cposparse-lex.c
  yy_last_accepting_stateparse-lex.c
  yy_metaparse-lex.c
  yy_nxtparse-lex.c

Local Function yyunput()

static void yyunput ( int c, char* yy_bp )
Prototyped in: parse-lex.c
Calls: yy_fatal_error()parse-lex.c
Called by: yylex()parse-lex.c
References Variables: yy_c_buf_pparse-lex.c
  yy_current_bufferparse-lex.c
  yy_hold_charparse-lex.c
  yy_n_charsparse-lex.c
  yytextparse-lex.c