torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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.

Data Structures

struct  yy_buffer_state
 Bison parser internals. More...
 
struct  yy_trans_info
 Bison parser internals. More...
 

Namespaces

 torc
 Implementation of class to encapsulate micro-bitstream library generation code.
 
 torc::physical
 Namespace for the Torc physical netlist, including the XDL importer, exporter, placer, router, unpacker, and packer.
 

Macros

#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 FLEXINT_H
 
#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 YY_TYPEDEF_YY_BUFFER_STATE
 
#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_TYPEDEF_YY_SIZE_T
 
#define YY_STRUCT_YY_BUFFER_STATE
 
#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. More...
 
#define DEBUG(a)
 
#define DEBUG1(a)   printf a
 
#define YY_USER_ACTION   yylloc->columns(yyleng);
 Enable C++ generation for the scanner class. More...
 
#define INITIAL   0
 Special lexing state for config strings. More...
 
#define CONFIGSTRING   1
 Bison lexer internals. More...
 
#define CONFIGSTRING2   2
 Bison lexer internals. More...
 
#define DOUBLEQUOTE   3
 Bison lexer internals. More...
 
#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_DECL_IS_OURS   1
 
#define YY_DECL   int yyFlexLexer::yylex()
 
#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 struct yy_buffer_stateYY_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. More...
 
typedef torc::XdlParser::token_type token_type
 

Functions

void * Xdlalloc (yy_size_t)
 Bison lexer internals. More...
 
void * Xdlrealloc (void *, yy_size_t)
 Bison lexer internals. More...
 
void Xdlfree (void *)
 Bison lexer internals. More...
 
yylloc step ()
 Code belonging at the beginning of yylex(). More...
 
 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.

Macro Definition Documentation

#define BEGIN   (yy_start) = 1 + 2 *

Definition at line 136 of file XdlScanner.cpp.

#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 DEBUG (   a)

Definition at line 611 of file XdlScanner.cpp.

#define DEBUG1 (   a)    printf a

Definition at line 612 of file XdlScanner.cpp.

#define DOUBLEQUOTE   3

Bison lexer internals.

Definition at line 639 of file XdlScanner.cpp.

#define ECHO   LexerOutput( yytext, yyleng )

Definition at line 672 of file XdlScanner.cpp.

#define EOB_ACT_CONTINUE_SCAN   0

Definition at line 169 of file XdlScanner.cpp.

#define EOB_ACT_END_OF_FILE   1

Definition at line 170 of file XdlScanner.cpp.

#define EOB_ACT_LAST_MATCH   2

Definition at line 171 of file XdlScanner.cpp.

#define FLEX_BETA

Definition at line 14 of file XdlScanner.cpp.

#define FLEX_SCANNER

Definition at line 9 of file XdlScanner.cpp.

#define FLEXINT_H

Definition at line 34 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 INT16_MAX   (32767)

Definition at line 77 of file XdlScanner.cpp.

#define INT16_MIN   (-32767-1)

Definition at line 68 of file XdlScanner.cpp.

#define INT32_MAX   (2147483647)

Definition at line 80 of file XdlScanner.cpp.

#define INT32_MIN   (-2147483647-1)

Definition at line 71 of file XdlScanner.cpp.

#define INT8_MAX   (127)

Definition at line 74 of file XdlScanner.cpp.

#define INT8_MIN   (-128)

Definition at line 65 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; \
}
register char * yy_cp
Definition: XdlScanner.cpp:734

Definition at line 551 of file XdlScanner.cpp.

#define UINT16_MAX   (65535U)

Definition at line 86 of file XdlScanner.cpp.

#define UINT32_MAX   (4294967295U)

Definition at line 89 of file XdlScanner.cpp.

#define UINT8_MAX   (255U)

Definition at line 83 of file XdlScanner.cpp.

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

Definition at line 189 of file XdlScanner.cpp.

#define YY_AT_BOL ( )    (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

Definition at line 303 of file XdlScanner.cpp.

#define YY_BREAK   break;

Definition at line 723 of file XdlScanner.cpp.

#define YY_BUF_SIZE   16384

Definition at line 155 of file XdlScanner.cpp.

#define YY_BUFFER_EOF_PENDING   2

Definition at line 257 of file XdlScanner.cpp.

#define YY_BUFFER_NEW   0

Definition at line 245 of file XdlScanner.cpp.

#define YY_BUFFER_NORMAL   1

Definition at line 246 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_CURRENT_BUFFER_LVALUE   (yy_buffer_stack)[(yy_buffer_stack_top)]

Definition at line 275 of file XdlScanner.cpp.

#define YY_DECL   int yyFlexLexer::yylex()

Definition at line 711 of file XdlScanner.cpp.

#define YY_DECL_IS_OURS   1

Definition at line 710 of file XdlScanner.cpp.

#define YY_DO_BEFORE_ACTION
Value:
yyleng = (size_t) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
register char * yy_cp
Definition: XdlScanner.cpp:734
register char * yy_bp
Definition: XdlScanner.cpp:734
int yyleng
#define yytext_ptr
Definition: XdlScanner.cpp:309

Definition at line 316 of file XdlScanner.cpp.

#define YY_END_OF_BUFFER   46

Definition at line 324 of file XdlScanner.cpp.

#define YY_END_OF_BUFFER_CHAR   0

Definition at line 151 of file XdlScanner.cpp.

#define YY_EXIT_FAILURE   2

Definition at line 1935 of file XdlScanner.cpp.

#define YY_EXTRA_TYPE   void *

Definition at line 650 of file XdlScanner.cpp.

#define YY_FATAL_ERROR (   msg)    LexerError( msg )

Definition at line 701 of file XdlScanner.cpp.

#define YY_FLEX_MAJOR_VERSION   2

Definition at line 10 of file XdlScanner.cpp.

#define YY_FLEX_MINOR_VERSION   5

Definition at line 11 of file XdlScanner.cpp.

#define YY_FLEX_SUBMINOR_VERSION   35

Definition at line 12 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" );
if(!(yy_init))
Definition: XdlScanner.cpp:765
#define YY_FATAL_ERROR(msg)
Definition: XdlScanner.cpp:701

Definition at line 679 of file XdlScanner.cpp.

#define YY_INT_ALIGNED   short int

Definition at line 5 of file XdlScanner.cpp.

#define YY_LESS_LINENO (   n)

Definition at line 173 of file XdlScanner.cpp.

#define YY_MORE_ADJ   0

Definition at line 560 of file XdlScanner.cpp.

#define yy_new_buffer   yy_create_buffer

Definition at line 281 of file XdlScanner.cpp.

#define YY_NEW_FILE   yyrestart( yyin )

Definition at line 149 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_NULL   0

Definition at line 123 of file XdlScanner.cpp.

#define YY_NUM_RULES   45

Definition at line 323 of file XdlScanner.cpp.

#define YY_READ_BUF_SIZE   8192

Definition at line 667 of file XdlScanner.cpp.

#define YY_RESTORE_YY_MORE_OFFSET

Definition at line 561 of file XdlScanner.cpp.

#define YY_RULE_SETUP   YY_USER_ACTION

Definition at line 726 of file XdlScanner.cpp.

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

Definition at line 130 of file XdlScanner.cpp.

#define yy_set_bol (   at_bol)
Value:
{ \
yyensure_buffer_stack (); \
yy_create_buffer( yyin, YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
if(!(yy_init))
Definition: XdlScanner.cpp:765
#define YY_CURRENT_BUFFER
Definition: XdlScanner.cpp:268
#define YY_CURRENT_BUFFER_LVALUE
Definition: XdlScanner.cpp:275
#define YY_BUF_SIZE
Definition: XdlScanner.cpp:155

Definition at line 293 of file XdlScanner.cpp.

#define yy_set_interactive (   is_interactive)
Value:
{ \
yyensure_buffer_stack (); \
yy_create_buffer( yyin, YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
if(!(yy_init))
Definition: XdlScanner.cpp:765
#define YY_CURRENT_BUFFER
Definition: XdlScanner.cpp:268
#define YY_CURRENT_BUFFER_LVALUE
Definition: XdlScanner.cpp:275
#define YY_BUF_SIZE
Definition: XdlScanner.cpp:155

Definition at line 283 of file XdlScanner.cpp.

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

Definition at line 142 of file XdlScanner.cpp.

#define YY_START_STACK_INCR   25

Definition at line 696 of file XdlScanner.cpp.

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

Definition at line 160 of file XdlScanner.cpp.

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

Definition at line 146 of file XdlScanner.cpp.

#define YY_STRUCT_YY_BUFFER_STATE

Definition at line 197 of file XdlScanner.cpp.

#define YY_TYPEDEF_YY_BUFFER_STATE

Definition at line 163 of file XdlScanner.cpp.

#define YY_TYPEDEF_YY_SIZE_T

Definition at line 192 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 yyconst

Definition at line 119 of file XdlScanner.cpp.

#define yyFlexLexer   XdlFlexLexer

Definition at line 23 of file XdlScanner.cpp.

#define yyless (   n)
Value:
do \
{ \
/* Undo effects of setting up yytext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
*yy_cp = (yy_hold_char); \
(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
register char * yy_cp
Definition: XdlScanner.cpp:734
register char * yy_bp
Definition: XdlScanner.cpp:734
#define YY_MORE_ADJ
Definition: XdlScanner.cpp:560
#define YY_LESS_LINENO(n)
Definition: XdlScanner.cpp:173
#define YY_RESTORE_YY_MORE_OFFSET
Definition: XdlScanner.cpp:561
while(1)
Definition: XdlScanner.cpp:797
#define YY_DO_BEFORE_ACTION
Definition: XdlScanner.cpp:316

Definition at line 1947 of file XdlScanner.cpp.

#define yyless (   n)
Value:
do \
{ \
/* Undo effects of setting up yytext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
yytext[yyleng] = (yy_hold_char); \
(yy_c_buf_p) = yytext + yyless_macro_arg; \
(yy_hold_char) = *(yy_c_buf_p); \
*(yy_c_buf_p) = '\0'; \
yyleng = yyless_macro_arg; \
} \
while ( 0 )
#define YY_LESS_LINENO(n)
Definition: XdlScanner.cpp:173
while(1)
Definition: XdlScanner.cpp:797
int yyleng

Definition at line 1947 of file XdlScanner.cpp.

#define yymore ( )    yymore_used_but_not_detected

Definition at line 559 of file XdlScanner.cpp.

#define YYSTATE   YY_START

Definition at line 143 of file XdlScanner.cpp.

#define YYTABLES_NAME   "yytables"

Definition at line 2009 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.

#define yytext_ptr   yytext

Definition at line 309 of file XdlScanner.cpp.

Typedef Documentation

typedef short int flex_int16_t

Definition at line 56 of file XdlScanner.cpp.

typedef int flex_int32_t

Definition at line 57 of file XdlScanner.cpp.

typedef signed char flex_int8_t

Definition at line 55 of file XdlScanner.cpp.

typedef unsigned short int flex_uint16_t

Definition at line 59 of file XdlScanner.cpp.

typedef unsigned int flex_uint32_t

Definition at line 60 of file XdlScanner.cpp.

typedef unsigned char flex_uint8_t

Definition at line 58 of file XdlScanner.cpp.

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

Definition at line 599 of file XdlScanner.cpp.

Definition at line 600 of file XdlScanner.cpp.

Definition at line 164 of file XdlScanner.cpp.

typedef unsigned char YY_CHAR

Definition at line 307 of file XdlScanner.cpp.

typedef size_t yy_size_t

Definition at line 193 of file XdlScanner.cpp.

Function Documentation

if ( yy_init)

Definition at line 765 of file XdlScanner.cpp.

766  {
767  (yy_init) = 1;
768 
769 #ifdef YY_USER_INIT
770  YY_USER_INIT;
771 #endif
772 
773  /* Create the reject buffer large enough to save one state per allowed character. */
774  if ( ! (yy_state_buf) )
775  (yy_state_buf) = (yy_state_type *)Xdlalloc(YY_STATE_BUF_SIZE );
776  if ( ! (yy_state_buf) )
777  YY_FATAL_ERROR( "out of dynamic memory in yylex()" );
778 
779  if ( ! (yy_start) )
780  (yy_start) = 1; /* first start state */
781 
782  if ( ! yyin )
783  yyin = & std::cin;
784 
785  if ( ! yyout )
786  yyout = & std::cout;
787 
788  if ( ! YY_CURRENT_BUFFER ) {
789  yyensure_buffer_stack ();
791  yy_create_buffer( yyin, YY_BUF_SIZE );
792  }
793 
794  yy_load_buffer_state( );
795  }
void * Xdlalloc(yy_size_t)
Bison lexer internals.
#define YY_FATAL_ERROR(msg)
Definition: XdlScanner.cpp:701
#define YY_CURRENT_BUFFER
Definition: XdlScanner.cpp:268
#define YY_STATE_BUF_SIZE
Definition: XdlScanner.cpp:160
#define YY_CURRENT_BUFFER_LVALUE
Definition: XdlScanner.cpp:275
#define YY_BUF_SIZE
Definition: XdlScanner.cpp:155

+ Here is the call graph for this function:

int isatty ( int  )
yylloc step ( )

Code belonging at the beginning of yylex().

while ( )
Todo:
Need to avoid obscuring IDENTIFIER.

Definition at line 797 of file XdlScanner.cpp.

798  {
799  yy_cp = (yy_c_buf_p);
800 
801  /* Support of yytext. */
802  *yy_cp = (yy_hold_char);
803 
804  /* yy_bp points to the position in yy_ch_buf of the start of
805  * the current run.
806  */
807  yy_bp = yy_cp;
808 
809  yy_current_state = (yy_start);
810 
811  (yy_state_ptr) = (yy_state_buf);
812  *(yy_state_ptr)++ = yy_current_state;
813 
814 yy_match:
815  do
816  {
817  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
818  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
819  {
821  if ( yy_current_state >= 169 )
822  yy_c = yy_meta[(unsigned int) yy_c];
823  }
824  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
825  *(yy_state_ptr)++ = yy_current_state;
826  ++yy_cp;
827  }
828  while ( yy_current_state != 168 );
829 
830 yy_find_action:
831  yy_current_state = *--(yy_state_ptr);
832  (yy_lp) = yy_accept[yy_current_state];
833 find_rule: /* we branch to this label when backing up */
834  for ( ; ; ) /* until we find what rule we matched */
835  {
836  if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
837  {
838  yy_act = yy_acclist[(yy_lp)];
839  {
840  (yy_full_match) = yy_cp;
841  break;
842  }
843  }
844  --yy_cp;
845  yy_current_state = *--(yy_state_ptr);
846  (yy_lp) = yy_accept[yy_current_state];
847  }
848 
850 
851 do_action: /* This label is used only to access EOF actions. */
852 
853  switch ( yy_act )
854  { /* beginning of action switch */
855 case 1:
857 #line 119 "scanner.ll"
858 { return token::BIDIRUNBUF; } // == Bidirectional, unbuffered
859  YY_BREAK
860 case 2:
862 #line 120 "scanner.ll"
863 { return token::BIDIRUNIBUF; } // => Bidirectional, buf in one direction
864  YY_BREAK
865 case 3:
867 #line 121 "scanner.ll"
868 { return token::BIDIRBIBUF; } // =- Bidirectional, buf in both directions
869  YY_BREAK
870 case 4:
872 #line 122 "scanner.ll"
873 { return token::UNIDIRBUF; } // -> Directional, buffered
874  YY_BREAK
875 case 5:
877 #line 124 "scanner.ll"
878 { return token::DESIGN; }
879  YY_BREAK
880 case 6:
882 #line 125 "scanner.ll"
883 { return token::MODULE; }
884  YY_BREAK
885 case 7:
887 #line 126 "scanner.ll"
888 { return token::ENDMODULE; }
889  YY_BREAK
890 case 8:
892 #line 127 "scanner.ll"
893 { return token::PORT; }
894  YY_BREAK
895 case 9:
897 #line 128 "scanner.ll"
898 { return token::INST; }
899  YY_BREAK
900 case 10:
902 #line 129 "scanner.ll"
903 { return token::NET; }
904  YY_BREAK
905 case 11:
907 #line 131 "scanner.ll"
908 {
909 ; BEGIN CONFIGSTRING; quote = colon = 0; yyless(yyleng-1);
910 ; return token::CFG;
911 ; }
912  YY_BREAK
913 case 12:
915 #line 135 "scanner.ll"
916 {
917 ; quote++; if(quote == 2) BEGIN INITIAL; /* must have been an empty config*/
918 ; return static_cast<token_type>('"');
919 ; }
920  YY_BREAK
921 case 13:
923 #line 139 "scanner.ll"
924 { /* discard whitespace */ }
925  YY_BREAK
926 case 14:
927 /* rule 14 can match eol */
929 #line 140 "scanner.ll"
930 { yylloc->lines(); /* discard whitespace */ }
931  YY_BREAK
932 case 15:
934 #line 141 "scanner.ll"
935 {
936 ; colon++; if(colon == 2) BEGIN CONFIGSTRING2;
937 ; return static_cast<token_type>(':');
938 ; }
939  YY_BREAK
940 case 16:
942 #line 145 "scanner.ll"
943 {
944 ; *yylval = yytext; return colon == 0 ? token::CFGSETTING : token::CFGNAME;
945 ; }
946  YY_BREAK
947 case 17:
949 #line 148 "scanner.ll"
950 { *yylval = yytext; return token::CFGVALUE; }
951  YY_BREAK
952 case 18:
953 /* rule 18 can match eol */
955 #line 149 "scanner.ll"
956 {
957 ; /* account for newlines embedded within trailing whitespace */
958 ; for(char* ptr = yytext; *ptr != 0; ptr++) {
959 ; if(*ptr == 0) break;
960 ; if(false && *ptr == '\n') yylloc->lines();
961 ; }
962 ; colon = 0; BEGIN INITIAL; return static_cast<token_type>('"');
963 ; }
964  YY_BREAK
965 case 19:
967 #line 157 "scanner.ll"
968 { colon = 0; BEGIN CONFIGSTRING; }
969  YY_BREAK
970 case 20:
971 /* rule 20 can match eol */
973 #line 158 "scanner.ll"
974 { yylloc->lines(); /* discard whitespace */ }
975  YY_BREAK
976 case 21:
978 #line 160 "scanner.ll"
979 { return token::PLACED; }
980  YY_BREAK
981 case 22:
983 #line 161 "scanner.ll"
984 { return token::UNPLACED; }
985  YY_BREAK
986 case 23:
988 #line 162 "scanner.ll"
989 { return token::BONDED; }
990  YY_BREAK
991 case 24:
993 #line 163 "scanner.ll"
994 { return token::UNBONDED; }
995  YY_BREAK
996 case 25:
998 #line 164 "scanner.ll"
999 { return token::POWER; }
1000  YY_BREAK
1001 case 26:
1003 #line 165 "scanner.ll"
1004 { return token::GROUND; }
1005  YY_BREAK
1006 case 27:
1008 #line 166 "scanner.ll"
1009 { return token::INPIN; }
1010  YY_BREAK
1011 case 28:
1013 #line 167 "scanner.ll"
1014 { return token::OUTPIN; }
1015  YY_BREAK
1016 case 29:
1018 #line 168 "scanner.ll"
1019 { return token::PIP; }
1020  YY_BREAK
1021 case 30:
1023 #line 169 "scanner.ll"
1024 { *yylval = yytext; return token::SPEEDGRADE; }
1025  YY_BREAK
1026 case 31:
1028 #line 170 "scanner.ll"
1029 { *yylval = yytext; return token::XDLVERSION;
1030  /** \todo Need to avoid obscuring IDENTIFIER. */ }
1031  YY_BREAK
1032 case 32:
1034 #line 172 "scanner.ll"
1035 { *yylval = yytext; return token::IDENTIFIER; }
1036  YY_BREAK
1037 case 33:
1039 #line 173 "scanner.ll"
1040 { return token::OBRACE; }
1041  YY_BREAK
1042 case 34:
1044 #line 174 "scanner.ll"
1045 { return token::EBRACE; }
1046  YY_BREAK
1047 case 35:
1049 #line 176 "scanner.ll"
1050 {
1051 ; DEBUG(("ROUTETHROUGH "));
1052 ; // be sure to strip the leading hash and spaces from the token
1053 ; char* ptr = yytext + 1;
1054 ; char* end = ptr + yyleng;
1055 ; while(*ptr == ' ' && ptr < end) ptr++;
1056 ; *yylval = ptr;
1057 ; return token::ROUTETHROUGH;
1058 ; }
1059  YY_BREAK
1060 case 36:
1062 #line 185 "scanner.ll"
1063 { // be careful not to let _ROUTETHROUGH expressions pass for comments
1064 ; char* ptr = yytext + 1;
1065 ; char* end = ptr + yyleng;
1066 ; while((*ptr == ' ' || *ptr == '\t') && ptr < end) ptr++;
1067 ; if((end - ptr > 13) && strncmp(ptr, "_ROUTETHROUGH", 13) == 0) REJECT;
1068 ; // okay, this really is a comment
1069 ; DEBUG(("COMMENT "));
1070 ; }
1071  YY_BREAK
1072 case 37:
1074 #line 194 "scanner.ll"
1075 {
1076 ; BEGIN DOUBLEQUOTE; in_double_quote = true; last_string = "";
1077 ; /* enter exclusive quoted string state */
1078 ; return static_cast<token_type>(yytext[0]);
1079 ; }
1080  YY_BREAK
1081 case 38:
1083 #line 199 "scanner.ll"
1084 {
1085 ; last_string += yytext;
1086 ; return token::STRING; /* append escaped characters to the input */
1087 ; }
1088  YY_BREAK
1089 case 39:
1090 /* rule 39 can match eol */
1092 #line 203 "scanner.ll"
1093 { yylloc->lines(); /* ignore unescaped line breaks */ }
1094  YY_BREAK
1095 case 40:
1097 #line 204 "scanner.ll"
1098 {
1099 ; last_string += yytext;
1100 ; return token::STRING; /* append characters other than \, ", \n, \r */
1101 ; }
1102  YY_BREAK
1103 case 41:
1105 #line 208 "scanner.ll"
1106 { if(!in_double_quote) {
1107 ; BEGIN INITIAL; /* exit the exclusive quoted string state */
1108 ; DEBUG(("\" "));
1109 ; return static_cast<token_type>('"');
1110 ; }
1111 ; in_double_quote = false; /* we're no longer in double-quote mode */
1112 ; yylloc->end.columns(-1);
1113 ; yyless(yyleng-1); /* push back the trailing double quote */
1114 ; //DEBUG(("[%s: length %d]\n", last_string.c_str(), last_string.length()));
1115 ; return token::STRING; /* and return the STRING token */
1116 ; }
1117  YY_BREAK
1118 case 42:
1119 /* rule 42 can match eol */
1121 #line 220 "scanner.ll"
1122 { yylloc->lines(); }
1123  YY_BREAK
1124 case 43:
1126 #line 221 "scanner.ll"
1127 { }
1128  YY_BREAK
1129 case 44:
1131 #line 222 "scanner.ll"
1132 { return static_cast<token_type>(*yytext); }
1133  YY_BREAK
1134 /* --------------------------------------------------------------------------------------------- */
1135 /* ------------------------------------- End XDL lexer rules ----------------------------------- */
1136 /* --------------------------------------------------------------------------------------------- */
1137 case 45:
1139 #line 231 "scanner.ll"
1140 ECHO;
1141  YY_BREAK
1142 #line 1143 "XdlScanner.cpp"
1143  case YY_STATE_EOF(INITIAL):
1144  case YY_STATE_EOF(CONFIGSTRING):
1145  case YY_STATE_EOF(CONFIGSTRING2):
1146  case YY_STATE_EOF(DOUBLEQUOTE):
1147  yyterminate();
1148 
1149  case YY_END_OF_BUFFER:
1150  {
1151  /* Amount of text matched not including the EOB char. */
1152  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1153 
1154  /* Undo the effects of YY_DO_BEFORE_ACTION. */
1155  *yy_cp = (yy_hold_char);
1157 
1158  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1159  {
1160  /* We're scanning a new file or input source. It's
1161  * possible that this happened because the user
1162  * just pointed yyin at a new source and called
1163  * yylex(). If so, then we have to assure
1164  * consistency between YY_CURRENT_BUFFER and our
1165  * globals. Here is the right place to do so, because
1166  * this is the first action (other than possibly a
1167  * back-up) that will match for the new input source.
1168  */
1169  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1170  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1171  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1172  }
1173 
1174  /* Note that here we test for yy_c_buf_p "<=" to the position
1175  * of the first EOB in the buffer, since yy_c_buf_p will
1176  * already have been incremented past the NUL character
1177  * (since all states make transitions on EOB to the
1178  * end-of-buffer state). Contrast this with the test
1179  * in input().
1180  */
1181  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1182  { /* This was really a NUL. */
1183  yy_state_type yy_next_state;
1184 
1185  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1186 
1187  yy_current_state = yy_get_previous_state( );
1188 
1189  /* Okay, we're now positioned to make the NUL
1190  * transition. We couldn't have
1191  * yy_get_previous_state() go ahead and do it
1192  * for us because it doesn't know how to deal
1193  * with the possibility of jamming (and we don't
1194  * want to build jamming into it because then it
1195  * will run more slowly).
1196  */
1197 
1198  yy_next_state = yy_try_NUL_trans( yy_current_state );
1199 
1201 
1202  if ( yy_next_state )
1203  {
1204  /* Consume the NUL. */
1205  yy_cp = ++(yy_c_buf_p);
1206  yy_current_state = yy_next_state;
1207  goto yy_match;
1208  }
1209 
1210  else
1211  {
1212  yy_cp = (yy_c_buf_p);
1213  goto yy_find_action;
1214  }
1215  }
1216 
1217  else switch ( yy_get_next_buffer( ) )
1218  {
1219  case EOB_ACT_END_OF_FILE:
1220  {
1221  (yy_did_buffer_switch_on_eof) = 0;
1222 
1223  if ( yywrap( ) )
1224  {
1225  /* Note: because we've taken care in
1226  * yy_get_next_buffer() to have set up
1227  * yytext, we can now set up
1228  * yy_c_buf_p so that if some total
1229  * hoser (like flex itself) wants to
1230  * call the scanner after we return the
1231  * YY_NULL, it'll still work - another
1232  * YY_NULL will get returned.
1233  */
1234  (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1235 
1237  goto do_action;
1238  }
1239 
1240  else
1241  {
1242  if ( ! (yy_did_buffer_switch_on_eof) )
1243  YY_NEW_FILE;
1244  }
1245  break;
1246  }
1247 
1248  case EOB_ACT_CONTINUE_SCAN:
1249  (yy_c_buf_p) =
1250  (yytext_ptr) + yy_amount_of_matched_text;
1251 
1252  yy_current_state = yy_get_previous_state( );
1253 
1254  yy_cp = (yy_c_buf_p);
1256  goto yy_match;
1257 
1258  case EOB_ACT_LAST_MATCH:
1259  (yy_c_buf_p) =
1260  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1261 
1262  yy_current_state = yy_get_previous_state( );
1263 
1264  yy_cp = (yy_c_buf_p);
1266  goto yy_find_action;
1267  }
1268  break;
1269  }
1270 
1271  default:
1273  "fatal flex scanner internal error--no action found" );
1274  } /* end of action switch */
1275  } /* end of scanning one token */
#define yyterminate()
Definition: XdlScanner.cpp:604
#define EOB_ACT_END_OF_FILE
Definition: XdlScanner.cpp:170
#define YY_SC_TO_UI(c)
Definition: XdlScanner.cpp:130
#define YY_STATE_EOF(state)
Definition: XdlScanner.cpp:146
#define YY_FATAL_ERROR(msg)
Definition: XdlScanner.cpp:701
#define YY_BUFFER_NEW
Definition: XdlScanner.cpp:245
#define BEGIN
Definition: XdlScanner.cpp:136
register char * yy_cp
Definition: XdlScanner.cpp:734
#define DOUBLEQUOTE
Bison lexer internals.
Definition: XdlScanner.cpp:639
register char * yy_bp
Definition: XdlScanner.cpp:734
#define YY_BREAK
Definition: XdlScanner.cpp:723
static yyconst flex_int16_t yy_def[179]
Definition: XdlScanner.cpp:448
#define YY_MORE_ADJ
Definition: XdlScanner.cpp:560
YY_DECL register yy_state_type yy_current_state
Definition: XdlScanner.cpp:733
#define yyless(n)
static yyconst flex_int16_t yy_chk[322]
Definition: XdlScanner.cpp:511
#define YY_BUFFER_NORMAL
Definition: XdlScanner.cpp:246
#define CONFIGSTRING2
Bison lexer internals.
Definition: XdlScanner.cpp:638
#define DEBUG(a)
Definition: XdlScanner.cpp:611
#define YY_NEW_FILE
Definition: XdlScanner.cpp:149
#define EOB_ACT_LAST_MATCH
Definition: XdlScanner.cpp:171
#define INITIAL
Special lexing state for config strings.
Definition: XdlScanner.cpp:636
static yyconst flex_int16_t yy_base[179]
Definition: XdlScanner.cpp:425
#define CONFIGSTRING
Bison lexer internals.
Definition: XdlScanner.cpp:637
#define YY_RESTORE_YY_MORE_OFFSET
Definition: XdlScanner.cpp:561
static yyconst flex_int32_t yy_ec[256]
Definition: XdlScanner.cpp:384
#define YY_RULE_SETUP
Definition: XdlScanner.cpp:726
static yyconst flex_int16_t yy_acclist[232]
Definition: XdlScanner.cpp:332
static yyconst flex_int16_t yy_accept[170]
Definition: XdlScanner.cpp:362
#define REJECT
Definition: XdlScanner.cpp:551
register int yy_act
Definition: XdlScanner.cpp:735
static yyconst flex_int16_t yy_nxt[322]
Definition: XdlScanner.cpp:471
#define YY_CURRENT_BUFFER_LVALUE
Definition: XdlScanner.cpp:275
int yyleng
#define YY_START
Definition: XdlScanner.cpp:142
#define YY_END_OF_BUFFER
Definition: XdlScanner.cpp:324
#define yytext_ptr
Definition: XdlScanner.cpp:309
unsigned char YY_CHAR
Bison lexer internals.
Definition: LutScanner.cpp:307
#define YY_DO_BEFORE_ACTION
Definition: XdlScanner.cpp:316
#define ECHO
Definition: XdlScanner.cpp:672
#define EOB_ACT_CONTINUE_SCAN
Definition: XdlScanner.cpp:169
static yyconst flex_int32_t yy_meta[44]
Definition: XdlScanner.cpp:416
void * Xdlalloc ( yy_size_t  size)

Bison lexer internals.

Definition at line 1987 of file XdlScanner.cpp.

1988 {
1989  return (void *) malloc( size );
1990 }

+ Here is the caller graph for this function:

void Xdlfree ( void *  ptr)

Bison lexer internals.

Definition at line 2004 of file XdlScanner.cpp.

2005 {
2006  free( (char *) ptr ); /* see Xdlrealloc() for (char *) cast */
2007 }
void * Xdlrealloc ( void *  ptr,
yy_size_t  size 
)

Bison lexer internals.

Definition at line 1992 of file XdlScanner.cpp.

1993 {
1994  /* The cast to (char *) in the following accommodates both
1995  * implementations that use char* generic pointers, and those
1996  * that use void* generic pointers. It works with the latter
1997  * because both ANSI C and C++ allow castless assignment from
1998  * any pointer type to void*, and deal with argument conversions
1999  * as though doing an assignment.
2000  */
2001  return (void *) realloc( (char *) ptr, size );
2002 }

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.

register int yy_act

Definition at line 735 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.

register char * yy_bp

Definition at line 734 of file XdlScanner.cpp.

yyconst flex_int16_t yy_chk[322]
static

Definition at line 511 of file XdlScanner.cpp.

register char* yy_cp

Definition at line 734 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_ec[256]
static

Definition at line 384 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.

yyconst flex_int16_t yy_nxt[322]
static

Definition at line 471 of file XdlScanner.cpp.

int yyleng