torc/physical/xdl/XdlScanner.cpp File Reference

Source for the XdlScanner class. More...

#include <iostream>
#include <errno.h>
#include <cstdlib>
#include <cstring>
#include <FlexLexer.h>
#include <string>
#include "torc/physical/xdl/XdlScanner.hpp"

Include dependency graph for XdlScanner.cpp:

Go to the source code of this file.

Namespaces

namespace  torc
namespace  torc::physical

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   35
#define FLEX_BETA
#define yyFlexLexer   XdlFlexLexer
#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   yyrestart( yyin )
#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 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_new_buffer   yy_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 yytext_ptr   yytext
#define YY_DO_BEFORE_ACTION
#define YY_NUM_RULES   45
#define YY_END_OF_BUFFER   46
#define REJECT
#define yymore()   yymore_used_but_not_detected
#define YY_MORE_ADJ   0
#define YY_RESTORE_YY_MORE_OFFSET
#define yyterminate()   return token::END
#define YY_NO_UNISTD_H
 Disable the inclusion of unistd.h, which is not available under Visual C++ on Win32.
#define DEBUG(a)
#define DEBUG1(a)   printf a
 Bison lexer internals.
#define YY_USER_ACTION   yylloc->columns(yyleng);
 Enable C++ generation for the scanner class.
#define INITIAL   0
 Special lexing state for config strings.
#define CONFIGSTRING   1
 Bison lexer internals.
#define CONFIGSTRING2   2
 Bison lexer internals.
#define DOUBLEQUOTE   3
 Bison lexer internals.
#define YY_EXTRA_TYPE   void *
#define YY_READ_BUF_SIZE   8192
#define ECHO   LexerOutput( yytext, yyleng )
#define YY_INPUT(buf, result, max_size)
#define YY_START_STACK_INCR   25
#define YY_FATAL_ERROR(msg)   LexerError( msg )
#define YY_BREAK   break;
#define YY_RULE_SETUP   YY_USER_ACTION
#define YY_EXIT_FAILURE   2
#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_state * YY_BUFFER_STATE
typedef size_t yy_size_t
typedef unsigned char YY_CHAR
typedef torc::XdlParser::token token
 Import the parser's token types into a local typedef.
typedef torc::XdlParser::token_type token_type
 Bison lexer internals.

Functions

void * Xdlalloc (yy_size_t)
 Bison lexer internals.
void * Xdlrealloc (void *, yy_size_t)
 Bison lexer internals.
void Xdlfree (void *)
 Bison lexer internals.
yylloc step ()
 Code belonging at the beginning of yylex().
 if (!(yy_init))
 while (1)
int isatty (int)

Variables

int yyleng
static yyconst flex_int16_t yy_acclist [232]
static yyconst flex_int16_t yy_accept [170]
static yyconst flex_int32_t yy_ec [256]
static yyconst flex_int32_t yy_meta [44]
static yyconst flex_int16_t yy_base [179]
static yyconst flex_int16_t yy_def [179]
static yyconst flex_int16_t yy_nxt [322]
static yyconst flex_int16_t yy_chk [322]
YY_DECL register yy_state_type yy_current_state
register char * yy_cp
register char * yy_bp
register int yy_act


Detailed Description

Source for the XdlScanner class.

Definition in file XdlScanner.cpp.


Define Documentation

#define CONFIGSTRING   1

Bison lexer internals.

Definition at line 637 of file XdlScanner.cpp.

#define CONFIGSTRING2   2

Bison lexer internals.

Definition at line 638 of file XdlScanner.cpp.

#define DEBUG1 (  )     printf a

Bison lexer internals.

Definition at line 612 of file XdlScanner.cpp.

#define DOUBLEQUOTE   3

Bison lexer internals.

Definition at line 639 of file XdlScanner.cpp.

#define INITIAL   0

Special lexing state for config strings.

Special second lexing state for config strings. Special lexing state for double-quoted strings.

Definition at line 636 of file XdlScanner.cpp.

#define REJECT

Value:

{ \
*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \
yy_cp = (yy_full_match); /* restore poss. backed-over text */ \
++(yy_lp); \
goto find_rule; \
}

Definition at line 551 of file XdlScanner.cpp.

#define YY_CURRENT_BUFFER

Value:

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

Definition at line 268 of file XdlScanner.cpp.

#define YY_DO_BEFORE_ACTION

Value:

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

Definition at line 316 of file XdlScanner.cpp.

#define YY_INPUT ( buf,
result,
max_size   ) 

Value:

\
    if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
        YY_FATAL_ERROR( "input in flex scanner failed" );

Definition at line 679 of file XdlScanner.cpp.

#define YY_NO_UNISTD_H

Disable the inclusion of unistd.h, which is not available under Visual C++ on Win32.

The C++ scanner uses STL streams instead.

Definition at line 608 of file XdlScanner.cpp.

#define yy_set_bol ( at_bol   ) 

Value:

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

Definition at line 293 of file XdlScanner.cpp.

#define yy_set_interactive ( is_interactive   ) 

Value:

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

Definition at line 283 of file XdlScanner.cpp.

#define YY_USER_ACTION   yylloc->columns(yyleng);

Enable C++ generation for the scanner class.

Change the name of the scanner class to "XdlFlexLexer". The manual says batch is "somewhat more optimized". Enable debug output from the scanner. We anticipate no included XDL files. Enable the use of start condition stacks. Track location information. Each time yylex is invoked, begin is moved to end.

Definition at line 627 of file XdlScanner.cpp.

 
#define yyterminate (  )     return token::END

By default, yylex() returns int, but we want token_type instead. Unfortunately, yyterminate returns 0 by default, which is not of token_type.

Definition at line 604 of file XdlScanner.cpp.


Typedef Documentation

Import the parser's token types into a local typedef.

Definition at line 599 of file XdlScanner.cpp.

Bison lexer internals.

Definition at line 600 of file XdlScanner.cpp.


Function Documentation

yylloc step (  ) 

Code belonging at the beginning of yylex().

while (  ) 

Todo:
Need to avoid obscuring IDENTIFIER.

Definition at line 797 of file XdlScanner.cpp.

void * Xdlalloc ( yy_size_t  size  ) 

Bison lexer internals.

Definition at line 1970 of file XdlScanner.cpp.

void Xdlfree ( void *  ptr  ) 

Bison lexer internals.

Definition at line 1987 of file XdlScanner.cpp.

void * Xdlrealloc ( void *  ptr,
yy_size_t  size 
)

Bison lexer internals.

Definition at line 1975 of file XdlScanner.cpp.


Variable Documentation

yyconst flex_int16_t yy_accept[170] [static]

Initial value:

    {   0,
        1,    1,    1,    1,    1,    1,    1,    2,    3,    4,
        6,    9,   11,   13,   16,   19,   21,   23,   26,   29,
       32,   35,   38,   41,   44,   47,   50,   53,   56,   59,
       62,   65,   68,   70,   72,   74,   75,   77,   79,   81,
       83,   85,   86,   88,   90,   92,   94,   95,   97,   98,
       99,  100,  101,  102,  103,  104,  105,  106,  107,  108,
      109,  110,  111,  112,  113,  114,  115,  116,  117,  118,
      119,  120,  121,  122,  123,  124,  125,  126,  127,  128,
      129,  130,  131,  131,  132,  133,  134,  135,  136,  137,
      138,  139,  140,  141,  142,  143,  145,  146,  147,  148,

      149,  151,  152,  154,  155,  156,  157,  158,  159,  160,
      162,  163,  164,  164,  165,  166,  167,  168,  170,  171,
      172,  173,  175,  176,  177,  178,  180,  181,  182,  183,
      184,  185,  186,  188,  189,  190,  191,  192,  193,  194,
      195,  197,  199,  200,  201,  203,  205,  207,  208,  209,
      210,  211,  212,  213,  214,  215,  216,  218,  220,  222,
      223,  225,  226,  227,  228,  229,  230,  232,  232
    }

Definition at line 362 of file XdlScanner.cpp.

yyconst flex_int16_t yy_acclist[232] [static]

Initial value:

    {   0,
       40,   40,   46,   44,   45,   43,   44,   45,   42,   45,
       44,   45,   37,   44,   45,   36,   44,   45,   44,   45,
       44,   45,   32,   44,   45,   32,   44,   45,   32,   44,
       45,   32,   44,   45,   32,   44,   45,   32,   44,   45,
       32,   44,   45,   32,   44,   45,   32,   44,   45,   32,
       44,   45,   32,   44,   45,   32,   44,   45,   32,   44,
       45,   33,   44,   45,   34,   44,   45,   16,   45,   13,
       45,   14,   45,   45,   12,   45,   15,   45,   17,   45,
       19,   45,   20,   45,   45,   18,   45,   17,   45,   40,
       45,   39,   45,   45,   41,   45,   45,   43,   42,   36,

       36,   30,    4,    3,    1,    2,   32,   32,   32,   32,
       32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
       32,   32,   32,   32,   16,   13,   14,   17,   17,   19,
       18,   20,   17,   17,   40,   39,   38,   36,   32,   32,
       32,   32,   26,   32,   32,   32,   32,   32,   10,   32,
       32,   29,   32,   32,   32,   32,   32,   32,   32,   25,
       32,   36,   32,   32,   32,   32,   32,    9,   32,   32,
       32,   32,    8,   32,   32,   32,   32,   31,   32,   36,
       32,   11,   32,   32,   32,   27,   32,   32,   32,   32,
       32,   32,   32,   36,   23,   32,    5,   32,   32,   32,

        6,   32,   28,   32,   21,   32,   32,   32,   36,   32,
       32,   32,   32,   36,   32,    9,   32,   24,   32,   22,
       32,   36,    7,   32,   36,   36,   36,   36,   36,   35,
       36
    }

Definition at line 332 of file XdlScanner.cpp.

yyconst flex_int16_t yy_base[179] [static]

Initial value:

    {   0,
        0,    0,   42,   46,   55,   59,   50,   62,  277,  278,
      274,  278,  272,  278,  272,   60,   63,    0,  239,  244,
      244,  237,   45,  236,  234,  240,  227,   54,  232,   64,
      278,  278,    0,  262,  278,  260,  278,  278,  241,   89,
       93,   97,  278,  101,    0,  278,  258,  278,    0,  258,
      278,    0,   85,  250,  278,  278,  278,  278,    0,  225,
      228,  219,  229,  228,  219,   42,  226,  213,  212,  214,
      225,   68,   84,  102,  222,  220,    0,  243,  278,  223,
      110,  121,  125,  278,  130,  222,  116,    0,  278,  278,
      224,  215,  238,  209,  206,    0,  198,  206,  197,  195,

        0,  198,    0,  207,  193,  203,  195,  197,  218,    0,
      209,  198,  111,  195,  189,  189,  188,  197,  188,  188,
      190,    0,  180,  182,  191,  204,  192,  185,  278,  177,
      183,  182,    0,  174,  179,  172,  178,  177,  177,  182,
        0,    0,  161,  170,    0,    0,    0,  163,  162,  168,
      145,  148,  148,  145,  150,  141,    0,    0,    0,  151,
        0,  143,  119,   97,   71,   66,    0,  278,  137,  144,
      151,  158,   63,  165,  172,  179,  186,  192
    }

Definition at line 425 of file XdlScanner.cpp.

YY_DECL register yy_state_type yy_current_state

The main scanner function which does all the work.

Definition at line 733 of file XdlScanner.cpp.

yyconst flex_int16_t yy_def[179] [static]

Initial value:

    {   0,
      168,    1,  169,  169,  170,  170,  171,  171,  168,  168,
      168,  168,  168,  168,  172,  168,  168,  173,  173,  173,
      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
      168,  168,  174,  168,  168,  168,  168,  168,  175,  168,
      168,  168,  168,  176,  177,  168,  168,  168,  178,  168,
      168,  172,  172,  168,  168,  168,  168,  168,  173,  173,
      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
      173,  173,  173,  173,  173,  173,  174,  168,  168,  175,
      176,  168,  168,  168,  168,  175,  176,  177,  168,  168,
      172,  173,  173,  173,  173,  173,  173,  173,  173,  173,

      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
      172,  173,  168,  173,  173,  173,  173,  173,  173,  173,
      173,  173,  173,  173,  173,  173,  172,  173,  168,  173,
      173,  173,  173,  173,  173,  173,  173,  173,  173,  172,
      173,  173,  173,  173,  173,  173,  173,  173,  173,  172,
      173,  173,  173,  173,  172,  173,  173,  173,  173,  172,
      173,  172,  172,  172,  172,  172,  172,    0,  168,  168,
      168,  168,  168,  168,  168,  168,  168,  168
    }

Definition at line 448 of file XdlScanner.cpp.

yyconst flex_int32_t yy_meta[44] [static]

Initial value:

    {   0,
        1,    2,    3,    4,    4,    1,    1,    5,    5,    6,
        1,    1,    5,    5,    5,    5,    5,    5,    5,    5,
        7,    5,    5,    5,    5,    5,    5,    5,    5,    5,
        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
        5,    1,    1
    }

Definition at line 416 of file XdlScanner.cpp.


Generated on Thu Oct 13 16:47:34 2011 for TORC by  doxygen 1.5.6