scanner.cc File Reference

#include <stdio.h>
#include <errno.h>
#include "parser.h"
#include "scanner.hh"
#include "scope.hh"
#include <ylmm/lexmm.hh>
#include <unistd.h>

Include dependency graph for scanner.cc:

Include dependency graph

Go to the source code of this file.

Compounds

struct  yy_buffer_state

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 yytext_ptr   yytext
#define YY_DO_BEFORE_ACTION
#define YY_NUM_RULES   22
#define YY_END_OF_BUFFER   23
#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 LEX_test_scanner_ll
#define YLMM_SCANNER_CLASS   toycalc::scanner
#define NOR   1
#define CM0   2
#define CM1   3
#define CM2   4
#define PPS   5
#define PPL   6
#define INC   7
#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_BREAK   break;
#define YY_RULE_SETUP   YY_USER_ACTION
#define YY_EXIT_FAILURE   2
#define yyless(n)

Typedefs

typedef 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))
void *yy_flex_alloc YY_PROTO ((yy_size_t))
void *yy_flex_realloc YY_PROTO ((void *, yy_size_t))
void yy_flex_free YY_PROTO ((void *))
yy_state_type yy_try_NUL_trans YY_PROTO ((yy_state_type current_state))
void yy_fatal_error YY_PROTO ((yyconst char msg[]))
void yyunput YY_PROTO ((int c, char *buf_ptr))

Variables

int yyleng
FILE * yyin = (FILE *) 0
FILE * yyout = (FILE *) 0
YY_BUFFER_STATE yy_current_buffer = 0
char yy_hold_char
int yy_n_chars
char * yy_c_buf_p = (char *) 0
int yy_init = 1
int yy_start = 0
int yy_did_buffer_switch_on_eof
char * yytext
yyconst short int yy_accept [82]
yyconst int yy_ec [256]
yyconst int yy_meta [38]
yyconst short int yy_base [85]
yyconst short int yy_def [85]
yyconst short int yy_nxt [223]
yyconst short int yy_chk [223]
yy_state_type yy_last_accepting_state
char * yy_last_accepting_cpos
register char * yy_bp
int size
FILE * file
int len


Define Documentation

#define BEGIN   yy_start = 1 + 2 *
 

Definition at line 81 of file scanner.cc.

#define CM0   2
 

Definition at line 475 of file scanner.cc.

#define CM1   3
 

Definition at line 476 of file scanner.cc.

#define CM2   4
 

Definition at line 477 of file scanner.cc.

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

Definition at line 562 of file scanner.cc.

#define EOB_ACT_CONTINUE_SCAN   0
 

Definition at line 106 of file scanner.cc.

#define EOB_ACT_END_OF_FILE   1
 

Definition at line 107 of file scanner.cc.

#define EOB_ACT_LAST_MATCH   2
 

Definition at line 108 of file scanner.cc.

#define FLEX_SCANNER
 

Definition at line 7 of file scanner.cc.

#define INC   7
 

Definition at line 480 of file scanner.cc.

#define INITIAL   0
 

Definition at line 438 of file scanner.cc.

#define LEX_test_scanner_ll
 

Definition at line 468 of file scanner.cc.

#define NOR   1
 

Definition at line 474 of file scanner.cc.

#define PPL   6
 

Definition at line 479 of file scanner.cc.

#define PPS   5
 

Definition at line 478 of file scanner.cc.

#define REJECT   reject_used_but_not_detected
 

Definition at line 432 of file scanner.cc.

#define unput c       yyunput( c, yytext_ptr )
 

Definition at line 137 of file scanner.cc.

#define YLMM_SCANNER_CLASS   toycalc::scanner
 

Definition at line 472 of file scanner.cc.

 
#define YY_AT_BOL      (yy_current_buffer->yy_at_bol)
 

Definition at line 264 of file scanner.cc.

#define YY_BREAK   break;
 

Definition at line 632 of file scanner.cc.

#define YY_BUF_SIZE   16384
 

Definition at line 99 of file scanner.cc.

#define YY_BUFFER_EOF_PENDING   2
 

Definition at line 200 of file scanner.cc.

#define YY_BUFFER_NEW   0
 

Definition at line 188 of file scanner.cc.

#define YY_BUFFER_NORMAL   1
 

Definition at line 189 of file scanner.cc.

#define YY_CURRENT_BUFFER   yy_current_buffer
 

Definition at line 209 of file scanner.cc.

#define YY_DECL   int yylex YY_PROTO(( void ))
 

Definition at line 620 of file scanner.cc.

#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 280 of file scanner.cc.

#define YY_END_OF_BUFFER   23
 

Definition at line 288 of file scanner.cc.

#define YY_END_OF_BUFFER_CHAR   0
 

Definition at line 96 of file scanner.cc.

#define YY_EXIT_FAILURE   2
 

#define YY_FATAL_ERROR msg       yy_fatal_error( msg )
 

Definition at line 613 of file scanner.cc.

#define YY_FLEX_MAJOR_VERSION   2
 

Definition at line 8 of file scanner.cc.

#define YY_FLEX_MINOR_VERSION   5
 

Definition at line 9 of file scanner.cc.

#define YY_FLUSH_BUFFER   yy_flush_buffer( yy_current_buffer )
 

Definition at line 238 of file scanner.cc.

#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 \
    { \
    errno=0; \
    while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
      { \
      if( errno != EINTR) \
        { \
        YY_FATAL_ERROR( "input in flex scanner failed" ); \
        break; \
        } \
      errno=0; \
      clearerr(yyin); \
      } \
    }

Definition at line 569 of file scanner.cc.

#define YY_MORE_ADJ   0
 

Definition at line 434 of file scanner.cc.

#define yy_new_buffer   yy_create_buffer
 

Definition at line 248 of file scanner.cc.

#define YY_NEW_FILE   yyrestart( yyin )
 

Definition at line 94 of file scanner.cc.

#define YY_NO_POP_STATE   1
 

Definition at line 532 of file scanner.cc.

#define YY_NO_PUSH_STATE   1
 

Definition at line 531 of file scanner.cc.

#define YY_NO_TOP_STATE   1
 

Definition at line 533 of file scanner.cc.

#define YY_NULL   0
 

Definition at line 68 of file scanner.cc.

#define YY_NUM_RULES   22
 

Definition at line 287 of file scanner.cc.

#define YY_PROTO proto       ()
 

Definition at line 64 of file scanner.cc.

#define YY_READ_BUF_SIZE   8192
 

Definition at line 553 of file scanner.cc.

#define YY_RESTORE_YY_MORE_OFFSET
 

Definition at line 435 of file scanner.cc.

#define YY_RULE_SETUP   YY_USER_ACTION
 

Definition at line 635 of file scanner.cc.

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

Definition at line 75 of file scanner.cc.

#define yy_set_bol at_bol   
 

Value:

{ \
  if ( ! yy_current_buffer ) \
    yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
  yy_current_buffer->yy_at_bol = at_bol; \
  }

Definition at line 257 of file scanner.cc.

#define yy_set_interactive is_interactive   
 

Value:

{ \
  if ( ! yy_current_buffer ) \
    yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
  yy_current_buffer->yy_is_interactive = is_interactive; \
  }

Definition at line 250 of file scanner.cc.

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

Definition at line 87 of file scanner.cc.

#define YY_START_STACK_INCR   25
 

Definition at line 608 of file scanner.cc.

#define YY_STATE_EOF state       (YY_END_OF_BUFFER + state + 1)
 

Definition at line 91 of file scanner.cc.

#define yyconst
 

Definition at line 57 of file scanner.cc.

#define yyless  
 

Value:

do \
    { \
      \
    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 126 of file scanner.cc.

#define yyless  
 

Value:

do \
    { \
      \
    *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;   \
    } \
  while ( 0 )

Definition at line 126 of file scanner.cc.

 
#define yymore      yymore_used_but_not_detected
 

Definition at line 433 of file scanner.cc.

#define YYSTATE   YY_START
 

Definition at line 88 of file scanner.cc.

 
#define yyterminate      return YY_NULL
 

Definition at line 603 of file scanner.cc.

#define yytext_ptr   yytext
 

Definition at line 270 of file scanner.cc.


Typedef Documentation

typedef struct yy_buffer_state* YY_BUFFER_STATE
 

Definition at line 101 of file scanner.cc.

typedef unsigned char YY_CHAR
 

Definition at line 266 of file scanner.cc.

typedef unsigned int yy_size_t
 

Definition at line 143 of file scanner.cc.

typedef int yy_state_type
 

Definition at line 268 of file scanner.cc.


Function Documentation

void yyunput YY_PROTO (int c, char *buf_ptr)    [static]
 

void yy_fatal_error YY_PROTO (yyconst char msg[])    [static]
 

yy_state_type yy_try_NUL_trans YY_PROTO (yy_state_type current_state)    [static]
 

void yy_flex_free YY_PROTO (void *)    [static]
 

void* yy_flex_realloc YY_PROTO (void *, yy_size_t   [static]
 

void* yy_flex_alloc YY_PROTO (yy_size_t   [static]
 

YY_BUFFER_STATE yy_scan_bytes YY_PROTO (yyconst char *bytes, int len  
 

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  
 

void yy_init_buffer YY_PROTO (YY_BUFFER_STATE b, FILE *file  
 

void yy_flush_buffer YY_PROTO (YY_BUFFER_STATE b)   
 

YY_BUFFER_STATE yy_create_buffer YY_PROTO (FILE *file, int size  
 

int input YY_PROTO (void)   
 

void yy_switch_to_buffer YY_PROTO (YY_BUFFER_STATE new_buffer)   
 

void yyrestart YY_PROTO (FILE *input_file)   
 


Variable Documentation

FILE* file
 

Definition at line 1428 of file scanner.cc.

int len
 

Definition at line 1541 of file scanner.cc.

yy_size_t size
 

Definition at line 1709 of file scanner.cc.

yyconst short int yy_accept[82] [static]
 

Initial value:

    {   0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,   23,   21,   20,    6,
        9,   10,   16,   14,   19,   15,   21,   17,    8,    7,
       18,   13,   21,    6,    6,    6,    6,    6,   11,   12,
        6,    0,    8,    8,    8,    0,    7,    0,    6,    6,
        6,    6,    6,    0,    0,    0,    0,    8,    0,    6,
        6,    6,    1,    6,    0,    0,    8,    6,    5,    6,
        6,    2,    6,    6,    6,    3,    6,    6,    4,    6,
        0
    }

Definition at line 289 of file scanner.cc.

yyconst short int yy_base[85] [static]
 

Initial value:

    {   0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,  164,  185,  185,  143,
      185,  185,  185,  185,  185,  185,   26,  185,   31,   34,
      185,  185,   23,   31,   30,   33,   34,   32,  185,  185,
      142,   36,   54,   62,  151,   76,  149,    0,   40,   49,
       50,   57,   61,    0,   86,   89,   92,   95,  144,   53,
       74,   90,  137,   92,  142,  101,  104,  117,  135,  102,
      133,  113,  156,  107,  103,  106,  140,  105,  104,   77,
      185,  181,   75,   54
    }

Definition at line 342 of file scanner.cc.

register char* yy_bp
 

Definition at line 1192 of file scanner.cc.

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

Definition at line 221 of file scanner.cc.

yyconst short int yy_chk[223] [static]
 

Initial value:

    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,   27,   27,   27,
       29,   33,   29,   29,   29,   30,   30,   30,   29,   35,
       34,   38,   36,   37,   42,   29,   84,   33,   34,   49,
       49,   35,   36,   38,   37,   43,   43,   43,   50,   51,
       42,   43,   60,   44,   44,   44,   52,   83,   43,   44,
       53,   51,   46,   50,   46,   60,   44,   46,   46,   46,
       52,   53,   55,   61,   55,   61,   80,   55,   55,   55,

       56,   56,   56,   57,   57,   57,   58,   58,   58,   62,
       62,   64,   66,   66,   66,   67,   67,   67,   64,   68,
       74,   70,   75,   79,   78,   76,   74,   75,   68,   68,
       68,   70,   72,   68,   68,   68,   68,   68,   68,   68,
       68,   68,   68,   68,   68,   68,   68,   68,   68,   68,
       68,   68,   71,   77,   69,   65,   63,   59,   47,   77,
       45,   41,   20,   17,    0,    0,   71,   73,   73,   73,
        0,    0,   73,   73,    0,    0,   73,   73,   73,   73,
       73,   73,   82,   82,   81,   81,   81,   81,   81,   81,
       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,

       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
       81,   81
    }

Definition at line 397 of file scanner.cc.

YY_BUFFER_STATE yy_current_buffer = 0 [static]
 

Definition at line 203 of file scanner.cc.

yyconst short int yy_def[85] [static]
 

Initial value:

    {   0,
       81,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,   81,   81,   81,   82,
       81,   81,   81,   81,   81,   81,   81,   81,   81,   29,
       81,   81,   81,   82,   82,   82,   82,   82,   81,   81,
       82,   81,   81,   81,   29,   81,   30,   83,   82,   82,
       82,   82,   82,   84,   81,   81,   81,   81,   81,   82,
       82,   82,   82,   82,   81,   81,   81,   81,   82,   82,
       82,   82,   68,   82,   82,   82,   82,   82,   82,   82,
        0,   81,   81,   81
    }

Definition at line 355 of file scanner.cc.

int yy_did_buffer_switch_on_eof [static]
 

Definition at line 228 of file scanner.cc.

yyconst int yy_ec[256] [static]
 

Definition at line 302 of file scanner.cc.

char yy_hold_char [static]
 

Definition at line 213 of file scanner.cc.

int yy_init = 1 [static]
 

Definition at line 222 of file scanner.cc.

char* yy_last_accepting_cpos [static]
 

Definition at line 427 of file scanner.cc.

yy_state_type yy_last_accepting_state [static]
 

Definition at line 426 of file scanner.cc.

yyconst int yy_meta[38] [static]
 

Initial value:

    {   0,
        1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
        1,    3,    3,    3,    1,    1,    3,    3,    2,    2,
        3,    3,    3,    3,    3,    3,    2,    2,    2,    2,
        2,    2,    2,    2,    2,    1,    1
    }

Definition at line 334 of file scanner.cc.

int yy_n_chars [static]
 

Definition at line 215 of file scanner.cc.

yyconst short int yy_nxt[223] [static]
 

Initial value:

    {   0,
       18,   19,   20,   21,   22,   23,   24,   25,   26,   27,
       28,   29,   30,   30,   31,   32,   20,   20,   20,   33,
       20,   20,   34,   35,   20,   36,   20,   20,   37,   38,
       20,   20,   20,   20,   20,   39,   40,   43,   43,   43,
       44,   48,   45,   45,   45,   47,   47,   47,   46,   42,
       42,   42,   42,   42,   54,   46,   65,   48,   49,   42,
       60,   50,   51,   53,   52,   43,   43,   43,   42,   42,
       54,   55,   42,   43,   43,   43,   42,   59,   55,   55,
       42,   62,   57,   61,   57,   69,   55,   58,   58,   58,
       63,   64,   66,   42,   66,   70,   42,   67,   67,   67,

       43,   43,   43,   58,   58,   58,   58,   58,   58,   42,
       71,   42,   67,   67,   67,   67,   67,   67,   72,   41,
       78,   42,   42,   42,   42,   42,   42,   79,   74,   74,
       74,   75,   42,   74,   74,   41,   42,   74,   74,   74,
       74,   74,   74,   41,   41,   41,   41,   41,   41,   41,
       41,   41,   42,   80,   42,   73,   42,   68,   56,   42,
       56,   42,   42,   81,   81,   81,   76,   77,   77,   77,
       81,   81,   77,   77,   81,   81,   77,   77,   77,   77,
       77,   77,   41,   41,   17,   81,   81,   81,   81,   81,
       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,

       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
       81,   81
    }

Definition at line 368 of file scanner.cc.

int yy_start = 0 [static]
 

Definition at line 223 of file scanner.cc.

FILE * yyin = (FILE *) 0
 

Definition at line 267 of file scanner.cc.

int yyleng
 

Definition at line 218 of file scanner.cc.

FILE * yyout = (FILE *) 0
 

Definition at line 267 of file scanner.cc.

char * yytext
 

Definition at line 436 of file scanner.cc.

Top of page
Last update Wed Feb 5 03:34:10 2003
Christian Holm
Created by DoxyGen 1.2.15