OpenCOBOL 1.1pre-rel
Data Structures | Defines | Typedefs | Functions | Variables
scanner.c File Reference
#include <stdio.h>
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "cobc.h"
#include "tree.h"
#include "parser.h"
Include dependency graph for scanner.c:

Go to the source code of this file.

Data Structures

struct  yy_buffer_state
struct  cb_level_78

Defines

#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION   2
#define YY_FLEX_MINOR_VERSION   5
#define yyconst
#define YY_PROTO(proto)   ()
#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   yyrestart( yyin )
#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)   yyunput( c, yytext_ptr )
#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   yy_flush_buffer( yy_current_buffer )
#define yy_new_buffer   yy_create_buffer
#define yy_set_interactive(is_interactive)
#define yy_set_bol(at_bol)
#define YY_AT_BOL()   (yy_current_buffer->yy_at_bol)
#define yywrap()   1
#define YY_SKIP_YYWRAP
#define yytext_ptr   yytext
#define YY_DO_BEFORE_ACTION
#define YY_NUM_RULES   99
#define YY_END_OF_BUFFER   100
#define REJECT   reject_used_but_not_detected
#define yymore()   yymore_used_but_not_detected
#define YY_MORE_ADJ   0
#define YY_RESTORE_YY_MORE_OFFSET
#define INITIAL   0
#define YY_NEVER_INTERACTIVE   1
#define SET_LOCATION(x)
#define DECIMAL_IS_PERIOD   1
#define DECIMAL_IS_COMMA   2
#define PICTURE_STATE   3
#define FUNCTION_STATE   4
#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   (void) fwrite( yytext, yyleng, 1, yyout )
#define YY_INPUT(buf, result, max_size)
#define yyterminate()   return YY_NULL
#define YY_START_STACK_INCR   25
#define YY_FATAL_ERROR(msg)   yy_fatal_error( msg )
#define YY_DECL   int yylex YY_PROTO(( void ))
#define YY_USER_ACTION
#define YY_BREAK   break;
#define YY_RULE_SETUP
#define YY_EXIT_FAILURE   2
#define yyless(n)

Typedefs

typedef struct yy_buffer_stateYY_BUFFER_STATE
typedef unsigned int yy_size_t
typedef unsigned char YY_CHAR
typedef int yy_state_type

Functions

void yyrestart YY_PROTO ((FILE *input_file))
void yy_switch_to_buffer YY_PROTO ((YY_BUFFER_STATE new_buffer))
void yy_load_buffer_state YY_PROTO ((void))
YY_BUFFER_STATE yy_create_buffer YY_PROTO ((FILE *file, int size))
void yy_delete_buffer YY_PROTO ((YY_BUFFER_STATE b))
void yy_init_buffer YY_PROTO ((YY_BUFFER_STATE b, FILE *file))
YY_BUFFER_STATE yy_scan_buffer YY_PROTO ((char *base, yy_size_t size))
YY_BUFFER_STATE yy_scan_string YY_PROTO ((yyconst char *yy_str))
YY_BUFFER_STATE yy_scan_bytes YY_PROTO ((yyconst char *bytes, int len))
static void *yy_flex_alloc YY_PROTO ((yy_size_t))
static void *yy_flex_realloc YY_PROTO ((void *, yy_size_t))
static void yy_flex_free YY_PROTO ((void *))
static yy_state_type
yy_try_NUL_trans 
YY_PROTO ((yy_state_type current_state))
static void yy_fatal_error YY_PROTO ((yyconst char msg[]))
static int read_literal (int mark)
static int scan_x (char *text)
static int scan_h (char *text)
static int scan_numeric (char *text)
static int scan_picture (char *text)
static void count_lines (char *text)
static void yyunput YY_PROTO ((int c, char *buf_ptr))

Variables

int yyleng
FILE * yyin = (FILE *) 0
FILE * yyout = (FILE *) 0
static YY_BUFFER_STATE yy_current_buffer = 0
static char yy_hold_char
static int yy_n_chars
static char * yy_c_buf_p = (char *) 0
static int yy_init = 1
static int yy_start = 0
static int yy_did_buffer_switch_on_eof
char * yytext
static yyconst short int yy_accept [607]
static yyconst int yy_ec [256]
static yyconst int yy_meta [54]
static yyconst short int yy_base [622]
static yyconst short int yy_def [622]
static yyconst short int yy_nxt [1339]
static yyconst short int yy_chk [1339]
static yy_state_type yy_last_accepting_state
static char * yy_last_accepting_cpos
static struct cb_level_78lev78ptr = NULL
static unsigned char * plexbuff = NULL
static size_t plexsize
static size_t in_procedure
static size_t cb_force_pid_literal = 0
static int last_token_is_dot = 0
static int integer_is_label = 0
static int inside_bracket = 0
static int inside_repository = 0
register char * yy_bp
int size
FILE * file
int len

Define Documentation

#define BEGIN   yy_start = 1 + 2 *

Definition at line 80 of file scanner.c.

#define DECIMAL_IS_COMMA   2

Definition at line 925 of file scanner.c.

#define DECIMAL_IS_PERIOD   1

Definition at line 924 of file scanner.c.

#define ECHO   (void) fwrite( yytext, yyleng, 1, yyout )

Definition at line 1010 of file scanner.c.

#define EOB_ACT_CONTINUE_SCAN   0

Definition at line 105 of file scanner.c.

#define EOB_ACT_END_OF_FILE   1

Definition at line 106 of file scanner.c.

#define EOB_ACT_LAST_MATCH   2

Definition at line 107 of file scanner.c.

#define FLEX_SCANNER

Definition at line 8 of file scanner.c.

#define FUNCTION_STATE   4

Definition at line 928 of file scanner.c.

#define INITIAL   0

Definition at line 864 of file scanner.c.

#define PICTURE_STATE   3

Definition at line 927 of file scanner.c.

#define REJECT   reject_used_but_not_detected

Definition at line 858 of file scanner.c.

#define SET_LOCATION (   x)
Value:
(x)->source_file = (unsigned char *)cb_source_file;             \
  (x)->source_line = cb_source_line

Definition at line 897 of file scanner.c.

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

Definition at line 136 of file scanner.c.

#define YY_AT_BOL ( )    (yy_current_buffer->yy_at_bol)

Definition at line 263 of file scanner.c.

#define YY_BREAK   break;

Definition at line 1069 of file scanner.c.

#define YY_BUF_SIZE   16384

Definition at line 98 of file scanner.c.

#define YY_BUFFER_EOF_PENDING   2

Definition at line 199 of file scanner.c.

#define YY_BUFFER_NEW   0

Definition at line 187 of file scanner.c.

#define YY_BUFFER_NORMAL   1

Definition at line 188 of file scanner.c.

#define YY_CURRENT_BUFFER   yy_current_buffer

Definition at line 208 of file scanner.c.

#define YY_DECL   int yylex YY_PROTO(( void ))

Definition at line 1057 of file scanner.c.

#define YY_DO_BEFORE_ACTION
Value:
yytext_ptr = yy_bp; \
        yyleng = (int) (yy_cp - yy_bp); \
        yy_hold_char = *yy_cp; \
        *yy_cp = '\0'; \
        yy_c_buf_p = yy_cp;

Definition at line 282 of file scanner.c.

#define YY_END_OF_BUFFER   100

Definition at line 290 of file scanner.c.

#define YY_END_OF_BUFFER_CHAR   0

Definition at line 95 of file scanner.c.

#define YY_EXIT_FAILURE   2
#define YY_FATAL_ERROR (   msg)    yy_fatal_error( msg )

Definition at line 1050 of file scanner.c.

#define YY_FLEX_MAJOR_VERSION   2

Definition at line 9 of file scanner.c.

#define YY_FLEX_MINOR_VERSION   5

Definition at line 10 of file scanner.c.

#define YY_FLUSH_BUFFER   yy_flush_buffer( yy_current_buffer )

Definition at line 237 of file scanner.c.

#define YY_INPUT (   buf,
  result,
  max_size 
)
Value:
if ( yy_current_buffer->yy_is_interactive ) \
                { \
                int c = '*', n; \
                for ( n = 0; n < max_size && \
                             (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
                        buf[n] = (char) c; \
                if ( c == '\n' ) \
                        buf[n++] = (char) c; \
                if ( c == EOF && ferror( yyin ) ) \
                        YY_FATAL_ERROR( "input in flex scanner failed" ); \
                result = n; \
                } \
        else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
                  && ferror( yyin ) ) \
                YY_FATAL_ERROR( "input in flex scanner failed" );

Definition at line 1017 of file scanner.c.

#define YY_MORE_ADJ   0

Definition at line 860 of file scanner.c.

#define YY_NEVER_INTERACTIVE   1

Definition at line 884 of file scanner.c.

#define yy_new_buffer   yy_create_buffer

Definition at line 247 of file scanner.c.

#define YY_NEW_FILE   yyrestart( yyin )

Definition at line 93 of file scanner.c.

#define YY_NO_POP_STATE   1

Definition at line 980 of file scanner.c.

#define YY_NO_PUSH_STATE   1

Definition at line 979 of file scanner.c.

#define YY_NO_TOP_STATE   1

Definition at line 981 of file scanner.c.

#define YY_NULL   0

Definition at line 67 of file scanner.c.

#define YY_NUM_RULES   99

Definition at line 289 of file scanner.c.

#define YY_PROTO (   proto)    ()

Definition at line 63 of file scanner.c.

#define YY_READ_BUF_SIZE   8192

Definition at line 1001 of file scanner.c.

#define YY_RESTORE_YY_MORE_OFFSET

Definition at line 861 of file scanner.c.

#define YY_RULE_SETUP
Value:
if ( yyleng > 0 ) \
                yy_current_buffer->yy_at_bol = \
                                (yytext[yyleng - 1] == '\n'); \
        YY_USER_ACTION

Definition at line 1072 of file scanner.c.

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

Definition at line 74 of file scanner.c.

#define yy_set_bol (   at_bol)
Value:

Definition at line 256 of file scanner.c.

#define yy_set_interactive (   is_interactive)
Value:

Definition at line 249 of file scanner.c.

#define YY_SKIP_YYWRAP

Definition at line 267 of file scanner.c.

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

Definition at line 86 of file scanner.c.

#define YY_START_STACK_INCR   25

Definition at line 1045 of file scanner.c.

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

Definition at line 90 of file scanner.c.

#define YY_USER_ACTION

Definition at line 1064 of file scanner.c.

#define yyconst

Definition at line 56 of file scanner.c.

#define yyless (   n)
Value:
do \
                { \
                /* Undo effects of setting up yytext. */ \
                yytext[yyleng] = yy_hold_char; \
                yy_c_buf_p = yytext + n; \
                yy_hold_char = *yy_c_buf_p; \
                *yy_c_buf_p = '\0'; \
                yyleng = n; \
                } \
        while ( 0 )

Definition at line 125 of file scanner.c.

#define yyless (   n)
Value:
do \
                { \
                /* Undo effects of setting up yytext. */ \
                *yy_cp = yy_hold_char; \
                YY_RESTORE_YY_MORE_OFFSET \
                yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
                YY_DO_BEFORE_ACTION; /* set up yytext again */ \
                } \
        while ( 0 )

Definition at line 125 of file scanner.c.

#define yymore ( )    yymore_used_but_not_detected

Definition at line 859 of file scanner.c.

#define YYSTATE   YY_START

Definition at line 87 of file scanner.c.

#define yyterminate ( )    return YY_NULL

Definition at line 1040 of file scanner.c.

#define yytext_ptr   yytext

Definition at line 272 of file scanner.c.

#define yywrap ( )    1

Definition at line 266 of file scanner.c.


Typedef Documentation

Definition at line 100 of file scanner.c.

typedef unsigned char YY_CHAR

Definition at line 268 of file scanner.c.

typedef unsigned int yy_size_t

Definition at line 142 of file scanner.c.

typedef int yy_state_type

Definition at line 270 of file scanner.c.


Function Documentation

static void count_lines ( char *  text) [static]
static int read_literal ( int  mark) [static]
static int scan_h ( char *  text) [static]
static int scan_numeric ( char *  text) [static]
static int scan_picture ( char *  text) [static]
static int scan_x ( char *  text) [static]
YY_BUFFER_STATE yy_scan_string YY_PROTO ( (yyconst char *yy_str)  )
YY_BUFFER_STATE yy_scan_buffer YY_PROTO ( (char *base, yy_size_t size )
static void yy_fatal_error YY_PROTO ( (yyconst char msg[])  ) [static]
static yy_state_type yy_try_NUL_trans YY_PROTO ( (yy_state_type current_state)  ) [static]
static void yy_flex_free YY_PROTO ( (void *)  ) [static]
static void* yy_flex_realloc YY_PROTO ( (void *, yy_size_t ) [static]
void yy_delete_buffer YY_PROTO ( (YY_BUFFER_STATE b)  )
static void* yy_flex_alloc YY_PROTO ( (yy_size_t ) [static]
void yy_switch_to_buffer YY_PROTO ( (YY_BUFFER_STATE new_buffer)  )
void yy_load_buffer_state YY_PROTO ( (void)  )
void yy_init_buffer YY_PROTO ( (YY_BUFFER_STATE b, FILE *file )
static void yyunput YY_PROTO ( (int c, char *buf_ptr)  ) [static]
YY_BUFFER_STATE yy_scan_bytes YY_PROTO ( (yyconst char *bytes, int len )
void yyrestart YY_PROTO ( (FILE *input_file)  )
YY_BUFFER_STATE yy_create_buffer YY_PROTO ( (FILE *file, int size )

Variable Documentation

size_t cb_force_pid_literal = 0 [static]

Definition at line 911 of file scanner.c.

FILE* file

Definition at line 2622 of file scanner.c.

size_t in_procedure [static]

Definition at line 910 of file scanner.c.

int inside_bracket = 0 [static]

Definition at line 914 of file scanner.c.

int inside_repository = 0 [static]

Definition at line 915 of file scanner.c.

int integer_is_label = 0 [static]

Definition at line 913 of file scanner.c.

int last_token_is_dot = 0 [static]

Definition at line 912 of file scanner.c.

int len

Definition at line 2744 of file scanner.c.

struct cb_level_78* lev78ptr = NULL [static]

Definition at line 907 of file scanner.c.

unsigned char* plexbuff = NULL [static]

Definition at line 908 of file scanner.c.

size_t plexsize [static]

Definition at line 909 of file scanner.c.

Definition at line 2533 of file scanner.c.

yyconst short int yy_accept[607] [static]

Definition at line 291 of file scanner.c.

yyconst short int yy_base[622] [static]

Definition at line 404 of file scanner.c.

register char* yy_bp

Definition at line 2385 of file scanner.c.

char* yy_c_buf_p = (char *) 0 [static]

Definition at line 220 of file scanner.c.

yyconst short int yy_chk[1339] [static]

Definition at line 701 of file scanner.c.

Definition at line 202 of file scanner.c.

yyconst short int yy_def[622] [static]

Definition at line 477 of file scanner.c.

Definition at line 227 of file scanner.c.

yyconst int yy_ec[256] [static]

Definition at line 362 of file scanner.c.

char yy_hold_char [static]

Definition at line 212 of file scanner.c.

int yy_init = 1 [static]

Definition at line 221 of file scanner.c.

char* yy_last_accepting_cpos [static]

Definition at line 853 of file scanner.c.

Definition at line 852 of file scanner.c.

yyconst int yy_meta[54] [static]
Initial value:
    {   0,
        1,    2,    3,    2,    1,    1,    1,    1,    1,    1,
        1,    4,    5,    6,    7,    7,    7,    7,    7,    7,
        7,    7,    7,    2,    1,    1,    1,    8,    5,    5,
        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
        5,    5,    5
    }

Definition at line 394 of file scanner.c.

int yy_n_chars [static]

Definition at line 214 of file scanner.c.

yyconst short int yy_nxt[1339] [static]

Definition at line 550 of file scanner.c.

int yy_start = 0 [static]

Definition at line 222 of file scanner.c.

FILE* yyin = (FILE *) 0

Definition at line 269 of file scanner.c.

int yyleng

Definition at line 217 of file scanner.c.

FILE * yyout = (FILE *) 0

Definition at line 269 of file scanner.c.

char* yytext

Definition at line 862 of file scanner.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines