Aprepro 5.0x

Classes | Namespaces | Macros | Typedefs | Functions | Variables
apr_scanner.cc File Reference
`#include <cstdio>`
`#include <cstdlib>`
`#include <cstring>`
`#include <errno.h>`
`#include <iostream>`
`#include <FlexLexer.h>`
`#include <fcntl.h>`
`#include <fstream>`
`#include <sstream>`
`#include <stack>`
`#include <stdio.h>`
`#include <string.h>`
`#include <unistd.h>`
`#include "apr_getline_int.h"`
`#include "apr_scanner.h"`
`#include "apr_util.h"`
`#include "aprepro.h"`

## Classes
struct | yy_buffer_state
struct | yy_trans_info

## Namespaces
| SEAMS

## 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 37
#define | FLEX_BETA
#define | yyFlexLexer SEAMSFlexLexer
#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 | YY_TYPEDEF_YY_SIZE_T
#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_STRUCT_YY_BUFFER_STATE
#define | YY_BUFFER_NEW 0
#define | YY_BUFFER_NORMAL 1
#define | YY_BUFFER_EOF_PENDING 2
#define | YY_CURRENT_BUFFER ((yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : NULL)
#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 | FLEX_DEBUG
#define | yytext_ptr yytext
#define | YY_INTERACTIVE
#define | YY_DO_BEFORE_ACTION
#define | YY_NUM_RULES 102
#define | YY_END_OF_BUFFER 103
#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 | YY_NO_UNISTD_H
#define | yyterminate() return token::END
#define | show(x) *(aprepro->infoStream) << "<" << x << ">" << std::flush;
#define | MAX_IF_NESTING 64
#define | YY_USER_ACTION curr_index += yyleng;
#define | INITIAL 0
#define | PARSING 1
#define | GET_FILENAME 2
#define | IF_SKIP 3
#define | GET_VAR 4
#define | VERBATIM 5
#define | IF_WHILE_SKIP 6
#define | GET_LOOP_VAR 7
#define | LOOP 8
#define | LOOP_SKIP 9
#define | END_CASE_SKIP 10
#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 | 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_state * | YY_BUFFER_STATE
typedef size_t | yy_size_t
typedef unsigned char | YY_CHAR
typedef SEAMS::Parser::token | token
typedef SEAMS::Parser::token_type | token_type

## Functions
void * | SEAMSalloc (yy_size_t)
void * | SEAMSrealloc (void *, yy_size_t)
void | SEAMSfree (void *)
void | SEAMS::yyerror (const char *s)
| if (!(yy_init))
| while (1)

## Variables
yy_size_t | yyleng
static yyconst flex_int16_t | yy_accept [703]
static yyconst flex_int32_t | yy_ec [256]
static yyconst flex_int32_t | yy_meta [69]
static yyconst flex_int16_t | yy_base [752]
static yyconst flex_int16_t | yy_def [752]
static yyconst flex_int16_t | yy_nxt [2581]
static yyconst flex_int16_t | yy_chk [2581]
static yyconst flex_int16_t | yy_rule_linenum [102]
int | file_must_exist = 0
int | loop_lvl = 0
std::fstream * | tmp_file
const char * | temp_f
int | if_state [MAX_IF_NESTING] = {0}
bool | if_case_run [MAX_IF_NESTING] = {false}
int | if_lvl = 0
int | if_skip_level = 0
bool | suppress_nl = false
bool | switch_active = false
bool | switch_case_run = false
bool | switch_skip_to_endcase = false
double | switch_condition = 0.0
size_t | curr_index = 0
std::string | history_string
size_t | hist_start = 0
| YY_DECL
char * | yy_cp
char * | yy_bp
int | yy_act

## Macro Definition Documentation

## ◆ BEGIN

#define BEGIN (yy_start) = 1 + 2 *

## ◆ ECHO

#define ECHO LexerOutput(yytext, yyleng)

## ◆ END_CASE_SKIP

#define END_CASE_SKIP 10

## ◆ EOB_ACT_CONTINUE_SCAN

#define EOB_ACT_CONTINUE_SCAN 0

## ◆ EOB_ACT_END_OF_FILE

#define EOB_ACT_END_OF_FILE 1

## ◆ EOB_ACT_LAST_MATCH

#define EOB_ACT_LAST_MATCH 2

## ◆ FLEX_BETA

#define FLEX_BETA

## ◆ FLEX_DEBUG

#define FLEX_DEBUG

## ◆ FLEX_SCANNER

#define FLEX_SCANNER

## ◆ FLEXINT_H

#define FLEXINT_H

## ◆ GET_FILENAME

#define GET_FILENAME 2

## ◆ GET_LOOP_VAR

#define GET_LOOP_VAR 7

## ◆ GET_VAR

#define GET_VAR 4

## ◆ IF_SKIP

#define IF_SKIP 3

## ◆ IF_WHILE_SKIP

#define IF_WHILE_SKIP 6

## ◆ INITIAL

#define INITIAL 0

## ◆ INT16_MAX

#define INT16_MAX (32767)

## ◆ INT16_MIN

#define INT16_MIN (-32767 - 1)

## ◆ INT32_MAX

#define INT32_MAX (2147483647)

## ◆ INT32_MIN

#define INT32_MIN (-2147483647 - 1)

## ◆ INT8_MAX

#define INT8_MAX (127)

## ◆ INT8_MIN

#define INT8_MIN (-128)

## ◆ LOOP

#define LOOP 8

## ◆ LOOP_SKIP

#define LOOP_SKIP 9

## ◆ MAX_IF_NESTING

#define MAX_IF_NESTING 64

## ◆ PARSING

#define PARSING 1

## ◆ REJECT

#define REJECT reject_used_but_not_detected

## ◆ show

#define show | ( |  | x | ) | *(aprepro->infoStream) << "<" << x << ">" << std::flush;

## ◆ UINT16_MAX

#define UINT16_MAX (65535U)

## ◆ UINT32_MAX

#define UINT32_MAX (4294967295U)

## ◆ UINT8_MAX

#define UINT8_MAX (255U)

## ◆ unput

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

## ◆ VERBATIM

#define VERBATIM 5

## ◆ YY_AT_BOL

#define YY_AT_BOL | ( |  | ) | (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

## ◆ YY_BREAK

#define YY_BREAK break;

## ◆ YY_BUF_SIZE

#define YY_BUF_SIZE 16384

## ◆ YY_BUFFER_EOF_PENDING

#define YY_BUFFER_EOF_PENDING 2

## ◆ YY_BUFFER_NEW

#define YY_BUFFER_NEW 0

## ◆ YY_BUFFER_NORMAL

#define YY_BUFFER_NORMAL 1

## ◆ YY_CURRENT_BUFFER

#define YY_CURRENT_BUFFER ((yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : NULL)

## ◆ YY_CURRENT_BUFFER_LVALUE

#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]

## ◆ YY_DO_BEFORE_ACTION

#define YY_DO_BEFORE_ACTION

Value:
(yytext_ptr) = yy_bp; \
/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */ \
yyleng = (size_t)(yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */ \
(yy_c_buf_p) = yy_cp;

## ◆ YY_END_OF_BUFFER

#define YY_END_OF_BUFFER 103

## ◆ YY_END_OF_BUFFER_CHAR

#define YY_END_OF_BUFFER_CHAR 0

## ◆ YY_EXIT_FAILURE

#define YY_EXIT_FAILURE 2

## ◆ YY_EXTRA_TYPE

#define YY_EXTRA_TYPE void *

## ◆ YY_FATAL_ERROR

#define YY_FATAL_ERROR | ( |  | msg | ) | LexerError(msg)

## ◆ YY_FLEX_MAJOR_VERSION

#define YY_FLEX_MAJOR_VERSION 2

## ◆ YY_FLEX_MINOR_VERSION

#define YY_FLEX_MINOR_VERSION 5

## ◆ YY_FLEX_SUBMINOR_VERSION

#define YY_FLEX_SUBMINOR_VERSION 37

## ◆ YY_INPUT

#define YY_INPUT | ( |  | buf,
|  |  | result,
|  |  | max_size
| ) |  |

Value:
/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */ \
\
/* %if-c++-only C++ definition \ */ \
if ((result = LexerInput((char *)buf, max_size)) < 0) \
YY_FATAL_ERROR("input in flex scanner failed");

## ◆ YY_INT_ALIGNED

#define YY_INT_ALIGNED short int

## ◆ YY_INTERACTIVE

#define YY_INTERACTIVE

## ◆ YY_LESS_LINENO

#define YY_LESS_LINENO | ( |  | n | ) |

## ◆ YY_MORE_ADJ

#define YY_MORE_ADJ 0

## ◆ yy_new_buffer

#define yy_new_buffer yy_create_buffer

## ◆ YY_NEW_FILE

#define YY_NEW_FILE yyrestart(yyin)

## ◆ YY_NO_UNISTD_H

#define YY_NO_UNISTD_H

## ◆ YY_NULL

#define YY_NULL 0

## ◆ YY_NUM_RULES

#define YY_NUM_RULES 102

## ◆ YY_READ_BUF_SIZE

#define YY_READ_BUF_SIZE 8192

## ◆ YY_RESTORE_YY_MORE_OFFSET

#define YY_RESTORE_YY_MORE_OFFSET

## ◆ YY_RULE_SETUP

#define YY_RULE_SETUP YY_USER_ACTION

## ◆ YY_SC_TO_UI

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

## ◆ yy_set_bol

#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; \
}

## ◆ yy_set_interactive

#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; \
}

## ◆ YY_START

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

## ◆ YY_START_STACK_INCR

#define YY_START_STACK_INCR 25

## ◆ YY_STATE_BUF_SIZE

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

## ◆ YY_STATE_EOF

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

## ◆ YY_STRUCT_YY_BUFFER_STATE

#define YY_STRUCT_YY_BUFFER_STATE

## ◆ YY_TYPEDEF_YY_BUFFER_STATE

#define YY_TYPEDEF_YY_BUFFER_STATE

## ◆ YY_TYPEDEF_YY_SIZE_T

#define YY_TYPEDEF_YY_SIZE_T

## ◆ YY_USER_ACTION

#define YY_USER_ACTION curr_index += yyleng;

## ◆ yyconst

#define yyconst

## ◆ yyFlexLexer

#define yyFlexLexer SEAMSFlexLexer

## ◆ yyless [1/2]

#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_RESTORE_YY_MORE_OFFSET(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} while (0)

## ◆ yyless [2/2]

#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)

## ◆ yymore

#define yymore | ( |  | ) | yymore_used_but_not_detected

## ◆ YYSTATE

#define YYSTATE YY_START

## ◆ YYTABLES_NAME

#define YYTABLES_NAME "yytables"

## ◆ yyterminate

#define yyterminate | ( |  | ) | return token::END

## ◆ yytext_ptr

#define yytext_ptr yytext

## Typedef Documentation

## ◆ flex_int16_t

typedef short int flex_int16_t

## ◆ flex_int32_t

typedef int flex_int32_t

## ◆ flex_int8_t

typedef signed char flex_int8_t

## ◆ flex_uint16_t

typedef unsigned short int flex_uint16_t

## ◆ flex_uint32_t

typedef unsigned int flex_uint32_t

## ◆ flex_uint8_t

typedef unsigned char flex_uint8_t

## ◆ token

typedef SEAMS::Parser::token token

## ◆ token_type

typedef SEAMS::Parser::token_type token_type

## ◆ YY_BUFFER_STATE

typedef struct yy_buffer_state* YY_BUFFER_STATE

## ◆ YY_CHAR

typedef unsigned char YY_CHAR

## ◆ yy_size_t

typedef size_t yy_size_t

## Function Documentation

## ◆ if()

if | ( | ! | yy_init | ) |

## ◆ SEAMSalloc()

void * SEAMSalloc | ( | yy_size_t | size | ) |

## ◆ SEAMSfree()

void SEAMSfree | ( | void * | ptr | ) |

## ◆ SEAMSrealloc()

void * SEAMSrealloc | ( | void * | ptr,
|  | yy_size_t | size
| ) |  |

## ◆ while()

while | ( | 1 |  | ) |

## Variable Documentation

## ◆ curr_index

size_t curr_index = 0

## ◆ file_must_exist

int file_must_exist = 0

## ◆ hist_start

size_t hist_start = 0

## ◆ history_string

std::string history_string

## ◆ if_case_run

bool if_case_run[MAX_IF_NESTING] = {false}

## ◆ if_lvl

int if_lvl = 0

## ◆ if_skip_level

int if_skip_level = 0

## ◆ if_state

int if_state[MAX_IF_NESTING] = {0}

## ◆ loop_lvl

int loop_lvl = 0

## ◆ suppress_nl

bool suppress_nl = false

## ◆ switch_active

bool switch_active = false

## ◆ switch_case_run

bool switch_case_run = false

## ◆ switch_condition

double switch_condition = 0.0

## ◆ switch_skip_to_endcase

bool switch_skip_to_endcase = false

## ◆ temp_f

const char* temp_f

## ◆ tmp_file

std::fstream* tmp_file

## ◆ yy_accept

yyconst flex_int16_t yy_accept[703]
| static

## ◆ yy_act

int yy_act

## ◆ yy_base

yyconst flex_int16_t yy_base[752]
| static

## ◆ yy_bp

char * yy_bp

## ◆ yy_chk

yyconst flex_int16_t yy_chk[2581]
| static

## ◆ yy_cp

char* yy_cp

## ◆ YY_DECL

YY_DECL

Initial value:
{
yy_state_type yy_current_state

The main scanner function which does all the work.

## ◆ yy_def

yyconst flex_int16_t yy_def[752]
| static

## ◆ yy_ec

yyconst flex_int32_t yy_ec[256]
| static

Initial value:
= {
0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 5, 6, 1, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 21, 22, 23, 24,
25, 1, 26, 27, 28, 29, 30, 31, 29, 32, 33, 29, 29, 34, 35, 36, 37, 29, 38, 39, 29,
40, 41, 42, 29, 43, 29, 29, 44, 45, 46, 47, 29, 1, 48, 49, 50, 51,
52, 53, 29, 54, 55, 29, 29, 56, 29, 57, 58, 59, 38, 60, 61, 62, 63, 29, 64, 43, 29,
29, 65, 66, 67, 68, 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,
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,
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, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}

## ◆ yy_meta

yyconst flex_int32_t yy_meta[69]
| static

Initial value:
= {0, 1, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 5, 6, 1, 1, 1, 1, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, 1, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2, 1, 1, 1}

## ◆ yy_nxt

yyconst flex_int16_t yy_nxt[2581]
| static

## ◆ yy_rule_linenum

yyconst flex_int16_t yy_rule_linenum[102]
| static

Initial value:
= {
0, 134, 135, 136, 137, 141, 142, 143, 144, 145, 147, 148, 150, 159, 160, 187, 222,
246, 252, 273, 280, 291, 296, 310, 315, 322, 346, 353, 355, 368, 381, 406, 412, 417,
422, 427, 437, 445, 453, 462, 490, 511, 512, 513, 514, 516, 521, 544, 546, 548, 586,
587, 590, 592, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613,
614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630,
631, 632, 633, 634, 635, 636, 642, 648, 660, 662, 664, 680, 681, 691, 694, 695,
697}

## ◆ yyleng

yy_size_t yyleng

yytext_ptr
#define yytext_ptr
Definition: apr_scanner.cc:369
yy_state_type
int yy_state_type
Definition: FlexLexer.h:55
YY_BUF_SIZE
#define YY_BUF_SIZE
Definition: apr_scanner.cc:191
YY_CURRENT_BUFFER
#define YY_CURRENT_BUFFER
Definition: apr_scanner.cc:320
yyleng
yy_size_t yyleng
YY_MORE_ADJ
#define YY_MORE_ADJ
Definition: apr_scanner.cc:968
yy_cp
char * yy_cp
Definition: apr_scanner.cc:1232
yy_bp
char * yy_bp
Definition: apr_scanner.cc:1232