ReactOS  0.4.14-dev-77-gd9e7c48
ppl.yy.c File Reference
#include "config.h"
#include "wine/port.h"
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <ctype.h>
#include <assert.h>
#include <limits.h>
#include "wine/wpp.h"
#include "wpp_private.h"
#include "ppy.tab.h"
Include dependency graph for ppl.yy.c:

Go to the source code of this file.

Classes

struct  yy_buffer_state
 
struct  yy_trans_info
 
struct  bufferstackentry
 
struct  macexpstackentry
 

Macros

#define YY_INT_ALIGNED   short int
 
#define yy_create_buffer   ppy__create_buffer
 
#define yy_delete_buffer   ppy__delete_buffer
 
#define yy_flex_debug   ppy__flex_debug
 
#define yy_init_buffer   ppy__init_buffer
 
#define yy_flush_buffer   ppy__flush_buffer
 
#define yy_load_buffer_state   ppy__load_buffer_state
 
#define yy_switch_to_buffer   ppy__switch_to_buffer
 
#define yyin   ppy_in
 
#define yyleng   ppy_leng
 
#define yylex   ppy_lex
 
#define yylineno   ppy_lineno
 
#define yyout   ppy_out
 
#define yyrestart   ppy_restart
 
#define yytext   ppy_text
 
#define yywrap   ppy_wrap
 
#define yyalloc   ppy_alloc
 
#define yyrealloc   ppy_realloc
 
#define yyfree   ppy_free
 
#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 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   ppy_restart(ppy_in )
 
#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_FLUSH_BUFFER   ppy__flush_buffer(YY_CURRENT_BUFFER )
 
#define yy_new_buffer   ppy__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   ppy_text
 
#define YY_DO_BEFORE_ACTION
 
#define YY_NUM_RULES   143
 
#define YY_END_OF_BUFFER   144
 
#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_INPUT   1
 
#define LLONG_MAX   ((long long)0x7fffffff << 32 | 0xffffffff)
 
#define LLONG_MIN   (-LLONG_MAX - 1)
 
#define ULLONG_MAX   ((long long)0xffffffff << 32 | 0xffffffff)
 
#define YY_NO_UNISTD_H
 
#define YY_READ_BUF_SIZE   65536 /* So we read most of a file at once */
 
#define yy_current_state()   YY_START
 
#define yy_pp_state(x)   yy_pop_state(); yy_push_state(x)
 
#define YY_USER_ACTION   pp_status.char_number+=ppy_leng;
 
#define MAXBUFFERSTACK   128 /* Nesting more than 128 includes or macro expansion textss is insane */
 
#define ALLOCBLOCKSIZE   (1 << 10) /* Allocate these chunks at a time for string-buffers */
 
#define MAXMACEXPSTACK   128 /* Nesting more than 128 macro expansions is insane */
 
#define MACROPARENTHESES()   (top_macro()->parentheses)
 
#define YY_INPUT(buf, result, max_size)
 
#define BUFFERINITIALCAPACITY   256
 
#define INITIAL   0
 
#define pp_pp   1
 
#define pp_eol   2
 
#define pp_inc   3
 
#define pp_dqs   4
 
#define pp_sqs   5
 
#define pp_iqs   6
 
#define pp_comment   7
 
#define pp_def   8
 
#define pp_define   9
 
#define pp_macro   10
 
#define pp_mbody   11
 
#define pp_macign   12
 
#define pp_macscan   13
 
#define pp_macexp   14
 
#define pp_if   15
 
#define pp_ifd   16
 
#define pp_endif   17
 
#define pp_line   18
 
#define pp_defined   19
 
#define pp_ignore   20
 
#define RCINCL   21
 
#define YY_EXTRA_TYPE   void *
 
#define ECHO   do { if (fwrite( ppy_text, ppy_leng, 1, ppy_out )) {} } while (0)
 
#define yyterminate()   return YY_NULL
 
#define YY_START_STACK_INCR   25
 
#define YY_FATAL_ERROR(msg)   yy_fatal_error( msg )
 
#define YY_DECL_IS_OURS   1
 
#define YY_DECL   int ppy_lex (void)
 
#define YY_BREAK   break;
 
#define YY_RULE_SETUP
 
#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 int yy_state_type
 
typedef struct bufferstackentry bufferstackentry_t
 
typedef struct macexpstackentry macexpstackentry_t
 

Functions

void ppy_restart (FILE *input_file)
 
void ppy__switch_to_buffer (YY_BUFFER_STATE new_buffer)
 
YY_BUFFER_STATE ppy__create_buffer (FILE *file, int size)
 
void ppy__delete_buffer (YY_BUFFER_STATE b)
 
void ppy__flush_buffer (YY_BUFFER_STATE b)
 
void ppy_push_buffer_state (YY_BUFFER_STATE new_buffer)
 
void ppy_pop_buffer_state (void)
 
static void ppy_ensure_buffer_stack (void)
 
static void ppy__load_buffer_state (void)
 
static void ppy__init_buffer (YY_BUFFER_STATE b, FILE *file)
 
YY_BUFFER_STATE ppy__scan_buffer (char *base, yy_size_t size)
 
YY_BUFFER_STATE ppy__scan_string (yyconst char *yy_str)
 
YY_BUFFER_STATE ppy__scan_bytes (yyconst char *bytes, int len)
 
voidppy_alloc (yy_size_t)
 
voidppy_realloc (void *, yy_size_t)
 
void ppy_free (void *)
 
static yy_state_type yy_get_previous_state (void)
 
static yy_state_type yy_try_NUL_trans (yy_state_type current_state)
 
static int yy_get_next_buffer (void)
 
static void yy_fatal_error (yyconst char msg[])
 
static void newline (int)
 
static int make_number (int radix, YYSTYPE *val, const char *str, int len)
 
static void put_buffer (const char *s, int len)
 
static void push_buffer (pp_entry_t *ppp, char *filename, char *incname, int pop)
 
static bufferstackentry_tpop_buffer (void)
 
static void new_string (void)
 
static void add_string (const char *str, int len)
 
static charget_string (void)
 
static void put_string (void)
 
static int string_start (void)
 
static void push_macro (pp_entry_t *ppp)
 
static macexpstackentry_ttop_macro (void)
 
static macexpstackentry_tpop_macro (void)
 
static void free_macro (macexpstackentry_t *mep)
 
static void add_text_to_macro (const char *text, int len)
 
static void macro_add_arg (int last)
 
static void macro_add_expansion (void)
 
static void expand_special (pp_entry_t *ppp)
 
static void expand_define (pp_entry_t *ppp)
 
static void expand_macro (macexpstackentry_t *mep)
 
void pp_writestring (const char *format,...)
 
static int yy_init_globals (void)
 
int ppy_lex_destroy (void)
 
int ppy_get_debug (void)
 
void ppy_set_debug (int debug_flag)
 
YY_EXTRA_TYPE ppy_get_extra (void)
 
void ppy_set_extra (YY_EXTRA_TYPE user_defined)
 
FILEppy_get_in (void)
 
void ppy_set_in (FILE *in_str)
 
FILEppy_get_out (void)
 
void ppy_set_out (FILE *out_str)
 
int ppy_get_leng (void)
 
charppy_get_text (void)
 
int ppy_get_lineno (void)
 
void ppy_set_lineno (int line_number)
 
int ppy_wrap (void)
 
static void yy_push_state (int new_state)
 
static void yy_pop_state (void)
 
static int yy_top_state (void)
 
int ppy_lex (void)
 
 if (!(yy_init))
 
 while (1)
 
static void yy_fatal_error (yyconst char *msg)
 
static void add_text (const char *str, int len)
 
static mtext_tadd_expand_text (mtext_t *mtp, macexpstackentry_t *mep, int *nnl)
 
void pp_do_include (char *fname, int type)
 
void pp_push_ignore_state (void)
 
void pp_pop_ignore_state (void)
 

Variables

int ppy_leng
 
FILEppy_in = (FILE *) 0
 
FILEppy_out = (FILE *) 0
 
static size_t yy_buffer_stack_top = 0
 
static size_t yy_buffer_stack_max = 0
 
static YY_BUFFER_STATEyy_buffer_stack = 0
 
static char yy_hold_char
 
static int yy_n_chars
 
static charyy_c_buf_p = (char *) 0
 
static int yy_init = 0
 
static int yy_start = 0
 
static int yy_did_buffer_switch_on_eof
 
int ppy_lineno = 1
 
charppy_text
 
static yyconst flex_int16_t yy_accept [416]
 
static yyconst flex_int32_t yy_ec [256]
 
static yyconst flex_int32_t yy_meta [50]
 
static yyconst flex_int16_t yy_base [460]
 
static yyconst flex_int16_t yy_def [460]
 
static yyconst flex_int16_t yy_nxt [1936]
 
static yyconst flex_int16_t yy_chk [1936]
 
static yy_state_type yy_last_accepting_state
 
static charyy_last_accepting_cpos
 
int ppy__flex_debug = 0
 
static int ncontinuations
 
static int strbuf_idx = 0
 
static int strbuf_alloc = 0
 
static charstrbuffer = NULL
 
static int str_startline
 
static macexpstackentry_tmacexpstack [MAXMACEXPSTACK]
 
static int macexpstackidx = 0
 
static bufferstackentry_t bufferstack [MAXBUFFERSTACK]
 
static int bufferstackidx = 0
 
include_state_t pp_incl_state
 
includelogicentry_tpp_includelogiclist = NULL
 
static int yy_start_stack_ptr = 0
 
static int yy_start_stack_depth = 0
 
static intyy_start_stack = NULL
 
 YY_DECL
 
register charyy_cp
 
register charyy_bp
 
register int yy_act
 
static int curdef_idx = 0
 
static int curdef_alloc = 0
 
static charcurdef_text = NULL
 

Macro Definition Documentation

◆ ALLOCBLOCKSIZE

#define ALLOCBLOCKSIZE   (1 << 10) /* Allocate these chunks at a time for string-buffers */

Definition at line 1263 of file ppl.yy.c.

◆ BEGIN

#define BEGIN   (yy_start) = 1 + 2 *

Definition at line 150 of file ppl.yy.c.

◆ BUFFERINITIALCAPACITY

#define BUFFERINITIALCAPACITY   256

Definition at line 1349 of file ppl.yy.c.

◆ ECHO

#define ECHO   do { if (fwrite( ppy_text, ppy_leng, 1, ppy_out )) {} } while (0)

Definition at line 1524 of file ppl.yy.c.

◆ EOB_ACT_CONTINUE_SCAN

#define EOB_ACT_CONTINUE_SCAN   0

Definition at line 193 of file ppl.yy.c.

◆ EOB_ACT_END_OF_FILE

#define EOB_ACT_END_OF_FILE   1

Definition at line 194 of file ppl.yy.c.

◆ EOB_ACT_LAST_MATCH

#define EOB_ACT_LAST_MATCH   2

Definition at line 195 of file ppl.yy.c.

◆ FLEX_BETA

#define FLEX_BETA

Definition at line 38 of file ppl.yy.c.

◆ FLEX_SCANNER

#define FLEX_SCANNER

Definition at line 33 of file ppl.yy.c.

◆ FLEXINT_H

#define FLEXINT_H

Definition at line 54 of file ppl.yy.c.

◆ INITIAL

#define INITIAL   0

Definition at line 1403 of file ppl.yy.c.

◆ INT16_MAX

#define INT16_MAX   (32767)

Definition at line 96 of file ppl.yy.c.

◆ INT16_MIN

#define INT16_MIN   (-32767-1)

Definition at line 87 of file ppl.yy.c.

◆ INT32_MAX

#define INT32_MAX   (2147483647)

Definition at line 99 of file ppl.yy.c.

◆ INT32_MIN

#define INT32_MIN   (-2147483647-1)

Definition at line 90 of file ppl.yy.c.

◆ INT8_MAX

#define INT8_MAX   (127)

Definition at line 93 of file ppl.yy.c.

◆ INT8_MIN

#define INT8_MIN   (-128)

Definition at line 84 of file ppl.yy.c.

◆ LLONG_MAX

#define LLONG_MAX   ((long long)0x7fffffff << 32 | 0xffffffff)

Definition at line 1211 of file ppl.yy.c.

◆ LLONG_MIN

#define LLONG_MIN   (-LLONG_MAX - 1)

Definition at line 1212 of file ppl.yy.c.

◆ MACROPARENTHESES

#define MACROPARENTHESES ( )    (top_macro()->parentheses)

Definition at line 1285 of file ppl.yy.c.

◆ MAXBUFFERSTACK

#define MAXBUFFERSTACK   128 /* Nesting more than 128 includes or macro expansion textss is insane */

Definition at line 1246 of file ppl.yy.c.

◆ MAXMACEXPSTACK

#define MAXMACEXPSTACK   128 /* Nesting more than 128 macro expansions is insane */

Definition at line 1271 of file ppl.yy.c.

◆ pp_comment

#define pp_comment   7

Definition at line 1410 of file ppl.yy.c.

◆ pp_def

#define pp_def   8

Definition at line 1411 of file ppl.yy.c.

◆ pp_define

#define pp_define   9

Definition at line 1412 of file ppl.yy.c.

◆ pp_defined

#define pp_defined   19

Definition at line 1422 of file ppl.yy.c.

◆ pp_dqs

#define pp_dqs   4

Definition at line 1407 of file ppl.yy.c.

◆ pp_endif

#define pp_endif   17

Definition at line 1420 of file ppl.yy.c.

◆ pp_eol

#define pp_eol   2

Definition at line 1405 of file ppl.yy.c.

◆ pp_if

#define pp_if   15

Definition at line 1418 of file ppl.yy.c.

◆ pp_ifd

#define pp_ifd   16

Definition at line 1419 of file ppl.yy.c.

◆ pp_ignore

#define pp_ignore   20

Definition at line 1423 of file ppl.yy.c.

◆ pp_inc

#define pp_inc   3

Definition at line 1406 of file ppl.yy.c.

◆ pp_iqs

#define pp_iqs   6

Definition at line 1409 of file ppl.yy.c.

◆ pp_line

#define pp_line   18

Definition at line 1421 of file ppl.yy.c.

◆ pp_macexp

#define pp_macexp   14

Definition at line 1417 of file ppl.yy.c.

◆ pp_macign

#define pp_macign   12

Definition at line 1415 of file ppl.yy.c.

◆ pp_macro

#define pp_macro   10

Definition at line 1413 of file ppl.yy.c.

◆ pp_macscan

#define pp_macscan   13

Definition at line 1416 of file ppl.yy.c.

◆ pp_mbody

#define pp_mbody   11

Definition at line 1414 of file ppl.yy.c.

◆ pp_pp

#define pp_pp   1

Definition at line 1404 of file ppl.yy.c.

◆ pp_sqs

#define pp_sqs   5

Definition at line 1408 of file ppl.yy.c.

◆ RCINCL

#define RCINCL   21

Definition at line 1424 of file ppl.yy.c.

◆ REJECT

#define REJECT   reject_used_but_not_detected

Definition at line 1047 of file ppl.yy.c.

◆ UINT16_MAX

#define UINT16_MAX   (65535U)

Definition at line 105 of file ppl.yy.c.

◆ UINT32_MAX

#define UINT32_MAX   (4294967295U)

Definition at line 108 of file ppl.yy.c.

◆ UINT8_MAX

#define UINT8_MAX   (255U)

Definition at line 102 of file ppl.yy.c.

◆ ULLONG_MAX

#define ULLONG_MAX   ((long long)0xffffffff << 32 | 0xffffffff)

Definition at line 1215 of file ppl.yy.c.

◆ unput

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

Definition at line 213 of file ppl.yy.c.

◆ YY_AT_BOL

#define YY_AT_BOL ( )    (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

Definition at line 364 of file ppl.yy.c.

◆ YY_BREAK

#define YY_BREAK   break;

Definition at line 1603 of file ppl.yy.c.

◆ YY_BUF_SIZE

#define YY_BUF_SIZE   16384

Definition at line 176 of file ppl.yy.c.

◆ YY_BUFFER_EOF_PENDING

#define YY_BUFFER_EOF_PENDING   2

Definition at line 280 of file ppl.yy.c.

◆ YY_BUFFER_NEW

#define YY_BUFFER_NEW   0

Definition at line 268 of file ppl.yy.c.

◆ YY_BUFFER_NORMAL

#define YY_BUFFER_NORMAL   1

Definition at line 269 of file ppl.yy.c.

◆ yy_create_buffer

#define yy_create_buffer   ppy__create_buffer

Definition at line 14 of file ppl.yy.c.

◆ YY_CURRENT_BUFFER

#define YY_CURRENT_BUFFER
Value:
: NULL)
static YY_BUFFER_STATE * yy_buffer_stack
Definition: ppl.yy.c:288
smooth NULL
Definition: ftsmooth.c:416
static size_t yy_buffer_stack_top
Definition: ppl.yy.c:286

Definition at line 296 of file ppl.yy.c.

◆ YY_CURRENT_BUFFER_LVALUE

#define YY_CURRENT_BUFFER_LVALUE   (yy_buffer_stack)[(yy_buffer_stack_top)]

Definition at line 303 of file ppl.yy.c.

◆ yy_current_state

#define yy_current_state ( )    YY_START

Definition at line 1235 of file ppl.yy.c.

◆ YY_DECL

#define YY_DECL   int ppy_lex (void)

Definition at line 1591 of file ppl.yy.c.

◆ YY_DECL_IS_OURS

#define YY_DECL_IS_OURS   1

Definition at line 1587 of file ppl.yy.c.

◆ yy_delete_buffer

#define yy_delete_buffer   ppy__delete_buffer

Definition at line 15 of file ppl.yy.c.

◆ YY_DO_BEFORE_ACTION

#define YY_DO_BEFORE_ACTION
Value:
ppy_leng = (size_t) (yy_cp - yy_bp); \
*yy_cp = '\0'; \
__kernel_size_t size_t
Definition: linux.h:237
register char * yy_bp
Definition: ppl.yy.c:1617
static char yy_hold_char
Definition: ppl.yy.c:306
static char * yy_c_buf_p
Definition: ppl.yy.c:311
register char * yy_cp
Definition: ppl.yy.c:1617
#define yytext_ptr
Definition: ppl.yy.c:379

Definition at line 389 of file ppl.yy.c.

◆ YY_END_OF_BUFFER

#define YY_END_OF_BUFFER   144

Definition at line 397 of file ppl.yy.c.

◆ YY_END_OF_BUFFER_CHAR

#define YY_END_OF_BUFFER_CHAR   0

Definition at line 165 of file ppl.yy.c.

◆ YY_EXIT_FAILURE

#define YY_EXIT_FAILURE   2

Definition at line 3530 of file ppl.yy.c.

◆ YY_EXTRA_TYPE

#define YY_EXTRA_TYPE   void *

Definition at line 1435 of file ppl.yy.c.

◆ YY_FATAL_ERROR

#define YY_FATAL_ERROR (   msg)    yy_fatal_error( msg )

Definition at line 1578 of file ppl.yy.c.

◆ yy_flex_debug

#define yy_flex_debug   ppy__flex_debug

Definition at line 16 of file ppl.yy.c.

◆ YY_FLEX_MAJOR_VERSION

#define YY_FLEX_MAJOR_VERSION   2

Definition at line 34 of file ppl.yy.c.

◆ YY_FLEX_MINOR_VERSION

#define YY_FLEX_MINOR_VERSION   5

Definition at line 35 of file ppl.yy.c.

◆ YY_FLEX_SUBMINOR_VERSION

#define YY_FLEX_SUBMINOR_VERSION   35

Definition at line 36 of file ppl.yy.c.

◆ yy_flush_buffer

#define yy_flush_buffer   ppy__flush_buffer

Definition at line 18 of file ppl.yy.c.

◆ YY_FLUSH_BUFFER

#define YY_FLUSH_BUFFER   ppy__flush_buffer(YY_CURRENT_BUFFER )

Definition at line 332 of file ppl.yy.c.

◆ yy_init_buffer

#define yy_init_buffer   ppy__init_buffer

Definition at line 17 of file ppl.yy.c.

◆ YY_INPUT

#define YY_INPUT (   buf,
  result,
  max_size 
)
Value:
{ \
}
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static INT max_size
Definition: history.c:51
void * file
Definition: wpp_private.h:232
int(* read)(void *file, char *buffer, unsigned int len)
Definition: wpp.h:42

Definition at line 1344 of file ppl.yy.c.

◆ YY_INT_ALIGNED

#define YY_INT_ALIGNED   short int

Definition at line 10 of file ppl.yy.c.

◆ YY_LESS_LINENO

#define YY_LESS_LINENO (   n)

Definition at line 197 of file ppl.yy.c.

◆ yy_load_buffer_state

#define yy_load_buffer_state   ppy__load_buffer_state

Definition at line 19 of file ppl.yy.c.

◆ YY_MORE_ADJ

#define YY_MORE_ADJ   0

Definition at line 1049 of file ppl.yy.c.

◆ yy_new_buffer

#define yy_new_buffer   ppy__create_buffer

Definition at line 342 of file ppl.yy.c.

◆ YY_NEW_FILE

#define YY_NEW_FILE   ppy_restart(ppy_in )

Definition at line 163 of file ppl.yy.c.

◆ YY_NO_INPUT

#define YY_NO_INPUT   1

Definition at line 1179 of file ppl.yy.c.

◆ YY_NO_UNISTD_H

#define YY_NO_UNISTD_H

Definition at line 1219 of file ppl.yy.c.

◆ YY_NULL

#define YY_NULL   0

Definition at line 137 of file ppl.yy.c.

◆ YY_NUM_RULES

#define YY_NUM_RULES   143

Definition at line 396 of file ppl.yy.c.

◆ yy_pp_state

#define yy_pp_state (   x)    yy_pop_state(); yy_push_state(x)

Definition at line 1236 of file ppl.yy.c.

◆ YY_READ_BUF_SIZE

#define YY_READ_BUF_SIZE   65536 /* So we read most of a file at once */

Definition at line 1233 of file ppl.yy.c.

◆ YY_RESTORE_YY_MORE_OFFSET

#define YY_RESTORE_YY_MORE_OFFSET

Definition at line 1050 of file ppl.yy.c.

◆ YY_RULE_SETUP

#define YY_RULE_SETUP
Value:
if ( ppy_leng > 0 ) \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
(ppy_text[ppy_leng - 1] == '\n'); \
YY_USER_ACTION
int ppy_leng
Definition: ppl.yy.c:308
char * ppy_text
Definition: ppl.yy.c:1051

Definition at line 1606 of file ppl.yy.c.

◆ YY_SC_TO_UI

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

Definition at line 144 of file ppl.yy.c.

◆ yy_set_bol

#define yy_set_bol (   at_bol)
Value:
{ \
if ( ! YY_CURRENT_BUFFER ){\
ppy_ensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
ppy__create_buffer(ppy_in,YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
#define YY_BUF_SIZE
Definition: ppl.yy.c:176
FILE * ppy_in
Definition: ppl.yy.c:370
#define YY_CURRENT_BUFFER
Definition: ppl.yy.c:296

Definition at line 354 of file ppl.yy.c.

◆ yy_set_interactive

#define yy_set_interactive (   is_interactive)
Value:
{ \
if ( ! YY_CURRENT_BUFFER ){ \
ppy_ensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
ppy__create_buffer(ppy_in,YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
#define YY_BUF_SIZE
Definition: ppl.yy.c:176
FILE * ppy_in
Definition: ppl.yy.c:370
#define YY_CURRENT_BUFFER
Definition: ppl.yy.c:296

Definition at line 344 of file ppl.yy.c.

◆ YY_START

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

Definition at line 156 of file ppl.yy.c.

◆ YY_START_STACK_INCR

#define YY_START_STACK_INCR   25

Definition at line 1573 of file ppl.yy.c.

◆ YY_STATE_BUF_SIZE

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

Definition at line 182 of file ppl.yy.c.

◆ YY_STATE_EOF

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

Definition at line 160 of file ppl.yy.c.

◆ YY_STRUCT_YY_BUFFER_STATE

#define YY_STRUCT_YY_BUFFER_STATE

Definition at line 221 of file ppl.yy.c.

◆ yy_switch_to_buffer

#define yy_switch_to_buffer   ppy__switch_to_buffer

Definition at line 20 of file ppl.yy.c.

◆ YY_TYPEDEF_YY_BUFFER_STATE

#define YY_TYPEDEF_YY_BUFFER_STATE

Definition at line 185 of file ppl.yy.c.

◆ YY_TYPEDEF_YY_SIZE_T

#define YY_TYPEDEF_YY_SIZE_T

Definition at line 216 of file ppl.yy.c.

◆ YY_USER_ACTION

#define YY_USER_ACTION   pp_status.char_number+=ppy_leng;

Definition at line 1241 of file ppl.yy.c.

◆ yyalloc

Definition at line 29 of file ppl.yy.c.

◆ yyconst

#define yyconst

Definition at line 133 of file ppl.yy.c.

◆ yyfree

#define yyfree   ppy_free

Definition at line 31 of file ppl.yy.c.

◆ yyin

#define yyin   ppy_in

Definition at line 21 of file ppl.yy.c.

◆ yyleng

#define yyleng   ppy_leng

Definition at line 22 of file ppl.yy.c.

◆ yyless [1/2]

#define yyless (   n)
Value:
do \
{ \
/* Undo effects of setting up ppy_text. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
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 ppy_text again */ \
} \
while ( 0 )
GLdouble n
Definition: glext.h:7729
register char * yy_bp
Definition: ppl.yy.c:1617
static char yy_hold_char
Definition: ppl.yy.c:306
#define YY_MORE_ADJ
Definition: ppl.yy.c:1049
static char * yy_c_buf_p
Definition: ppl.yy.c:311
register char * yy_cp
Definition: ppl.yy.c:1617

Definition at line 3542 of file ppl.yy.c.

◆ yyless [2/2]

#define yyless (   n)
Value:
do \
{ \
/* Undo effects of setting up ppy_text. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
ppy_text[ppy_leng] = (yy_hold_char); \
(yy_c_buf_p) = ppy_text + yyless_macro_arg; \
*(yy_c_buf_p) = '\0'; \
ppy_leng = yyless_macro_arg; \
} \
while ( 0 )
int ppy_leng
Definition: ppl.yy.c:308
GLdouble n
Definition: glext.h:7729
char * ppy_text
Definition: ppl.yy.c:1051
static char yy_hold_char
Definition: ppl.yy.c:306
static char * yy_c_buf_p
Definition: ppl.yy.c:311

Definition at line 3542 of file ppl.yy.c.

◆ yylex

#define yylex   ppy_lex

Definition at line 23 of file ppl.yy.c.

◆ yylineno

#define yylineno   ppy_lineno

Definition at line 24 of file ppl.yy.c.

◆ yymore

#define yymore ( )    yymore_used_but_not_detected

Definition at line 1048 of file ppl.yy.c.

◆ yyout

#define yyout   ppy_out

Definition at line 25 of file ppl.yy.c.

◆ yyrealloc

#define yyrealloc   ppy_realloc

Definition at line 30 of file ppl.yy.c.

◆ yyrestart

#define yyrestart   ppy_restart

Definition at line 26 of file ppl.yy.c.

◆ YYSTATE

#define YYSTATE   YY_START

Definition at line 157 of file ppl.yy.c.

◆ YYTABLES_NAME

#define YYTABLES_NAME   "yytables"

Definition at line 3740 of file ppl.yy.c.

◆ yyterminate

#define yyterminate ( )    return YY_NULL

Definition at line 1568 of file ppl.yy.c.

◆ yytext

#define yytext   ppy_text

Definition at line 27 of file ppl.yy.c.

◆ yytext_ptr

#define yytext_ptr   ppy_text

Definition at line 379 of file ppl.yy.c.

◆ yywrap

#define yywrap   ppy_wrap

Definition at line 28 of file ppl.yy.c.

Typedef Documentation

◆ bufferstackentry_t

◆ flex_int16_t

Definition at line 76 of file ppl.yy.c.

◆ flex_int32_t

typedef int flex_int32_t

Definition at line 77 of file ppl.yy.c.

◆ flex_int8_t

Definition at line 75 of file ppl.yy.c.

◆ flex_uint16_t

typedef unsigned short int flex_uint16_t

Definition at line 79 of file ppl.yy.c.

◆ flex_uint32_t

typedef unsigned int flex_uint32_t

Definition at line 80 of file ppl.yy.c.

◆ flex_uint8_t

typedef unsigned char flex_uint8_t

Definition at line 78 of file ppl.yy.c.

◆ macexpstackentry_t

◆ YY_BUFFER_STATE

Definition at line 186 of file ppl.yy.c.

◆ YY_CHAR

typedef unsigned char YY_CHAR

Definition at line 368 of file ppl.yy.c.

◆ yy_size_t

typedef size_t yy_size_t

Definition at line 217 of file ppl.yy.c.

◆ yy_state_type

typedef int yy_state_type

Definition at line 372 of file ppl.yy.c.

Function Documentation

◆ add_expand_text()

static mtext_t* add_expand_text ( mtext_t mtp,
macexpstackentry_t mep,
int nnl 
)
static

Definition at line 4004 of file ppl.yy.c.

4005 {
4006  char *cptr;
4007  char *exp;
4008  int tag;
4009  int n;
4010 
4011  if(mtp == NULL)
4012  return NULL;
4013 
4014  switch(mtp->type)
4015  {
4016  case exp_text:
4017  if(pp_flex_debug)
4018  fprintf(stderr, "add_expand_text: exp_text: '%s'\n", mtp->subst.text);
4019  add_text(mtp->subst.text, strlen(mtp->subst.text));
4020  break;
4021 
4022  case exp_stringize:
4023  if(pp_flex_debug)
4024  fprintf(stderr, "add_expand_text: exp_stringize(%d): '%s'\n",
4025  mtp->subst.argidx,
4026  mep->args[mtp->subst.argidx]);
4027  cptr = mep->args[mtp->subst.argidx];
4028  add_text("\"", 1);
4029  while(*cptr)
4030  {
4031  if(*cptr == '"' || *cptr == '\\')
4032  add_text("\\", 1);
4033  add_text(cptr, 1);
4034  cptr++;
4035  }
4036  add_text("\"", 1);
4037  break;
4038 
4039  case exp_concat:
4040  if(pp_flex_debug)
4041  fprintf(stderr, "add_expand_text: exp_concat\n");
4042  /* Remove trailing whitespace from current expansion text */
4043  while(curdef_idx)
4044  {
4045  if(isspace(curdef_text[curdef_idx-1] & 0xff))
4046  curdef_idx--;
4047  else
4048  break;
4049  }
4050  /* tag current position and recursively expand the next part */
4051  tag = curdef_idx;
4052  mtp = add_expand_text(mtp->next, mep, nnl);
4053 
4054  /* Now get rid of the leading space of the expansion */
4055  cptr = &curdef_text[tag];
4056  n = curdef_idx - tag;
4057  while(n)
4058  {
4059  if(isspace(*cptr & 0xff))
4060  {
4061  cptr++;
4062  n--;
4063  }
4064  else
4065  break;
4066  }
4067  if(cptr != &curdef_text[tag])
4068  {
4069  memmove(&curdef_text[tag], cptr, n);
4070  curdef_idx -= (curdef_idx - tag) - n;
4071  }
4072  break;
4073 
4074  case exp_subst:
4075  if((mtp->next && mtp->next->type == exp_concat) || (mtp->prev && mtp->prev->type == exp_concat))
4076  exp = mep->args[mtp->subst.argidx];
4077  else
4078  exp = mep->ppargs[mtp->subst.argidx];
4079  if(exp)
4080  {
4081  add_text(exp, strlen(exp));
4082  *nnl -= mep->nnls[mtp->subst.argidx];
4083  cptr = strchr(exp, '\n');
4084  while(cptr)
4085  {
4086  *cptr = ' ';
4087  cptr = strchr(cptr+1, '\n');
4088  }
4089  mep->nnls[mtp->subst.argidx] = 0;
4090  }
4091  if(pp_flex_debug)
4092  fprintf(stderr, "add_expand_text: exp_subst(%d): '%s'\n", mtp->subst.argidx, exp);
4093  break;
4094 
4095  default:
4096  pp_internal_error(__FILE__, __LINE__, "Invalid expansion type (%d) in macro expansion\n", mtp->type);
4097  }
4098  return mtp;
4099 }
static char * curdef_text
Definition: ppl.yy.c:3980
#define isspace(c)
Definition: acclib.h:69
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
union mtext::@4033 subst
static mtext_t * add_expand_text(mtext_t *mtp, macexpstackentry_t *mep, int *nnl)
Definition: ppl.yy.c:4004
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
void pp_internal_error(const char *file, int line, const char *s,...)
Definition: preproc.c:754
struct mtext * prev
Definition: wpp_private.h:69
GLdouble n
Definition: glext.h:7729
Definition: ecma_167.h:138
int argidx
Definition: wpp_private.h:73
static void add_text(const char *str, int len)
Definition: ppl.yy.c:3982
struct mtext * next
Definition: wpp_private.h:68
char ** ppargs
Definition: ppl.yy.c:1276
static int curdef_idx
Definition: ppl.yy.c:3978
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
smooth NULL
Definition: ftsmooth.c:416
char ** args
Definition: ppl.yy.c:1275
def_exp_t type
Definition: wpp_private.h:70
DWORD exp
Definition: msg.c:15681
char * strchr(const char *String, int ch)
Definition: utclib.c:501
int pp_flex_debug
Definition: wpp.c:31
FILE * stderr
char * text
Definition: wpp_private.h:72
char * tag
Definition: main.c:59

Referenced by expand_macro().

◆ add_string()

static void add_string ( const char str,
int  len 
)
static

Definition at line 4192 of file ppl.yy.c.

4193 {
4194  int new_alloc;
4195  char *new_buffer;
4196 
4197  if(len == 0)
4198  return;
4200  {
4201  new_alloc = strbuf_alloc + ((len + ALLOCBLOCKSIZE-1) & ~(ALLOCBLOCKSIZE-1));
4202  new_buffer = pp_xrealloc(strbuffer, new_alloc * sizeof(strbuffer[0]));
4203  if(!new_buffer)
4204  return;
4205  strbuffer = new_buffer;
4206  strbuf_alloc = new_alloc;
4207  if(strbuf_alloc > 65536)
4208  ppy_warning("Reallocating string buffer larger than 64kB");
4209  }
4211  strbuf_idx += len;
4212 }
void * pp_xrealloc(void *p, size_t size)
Definition: preproc.c:91
static int strbuf_idx
Definition: ppl.yy.c:1320
static int strbuf_alloc
Definition: ppl.yy.c:1321
const WCHAR * str
static char * strbuffer
Definition: ppl.yy.c:1322
int ppy_warning(const char *s,...)
Definition: preproc.c:745
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define ALLOCBLOCKSIZE
Definition: ppl.yy.c:1263

Referenced by while().

◆ add_text()

static void add_text ( const char str,
int  len 
)
static

Definition at line 3982 of file ppl.yy.c.

3983 {
3984  int new_alloc;
3985  char *new_text;
3986 
3987  if(len == 0)
3988  return;
3990  {
3991  new_alloc = curdef_alloc + ((len + ALLOCBLOCKSIZE-1) & ~(ALLOCBLOCKSIZE-1));
3992  new_text = pp_xrealloc(curdef_text, new_alloc * sizeof(curdef_text[0]));
3993  if(!new_text)
3994  return;
3995  curdef_text = new_text;
3996  curdef_alloc = new_alloc;
3997  if(curdef_alloc > 65536)
3998  ppy_warning("Reallocating macro-expansion buffer larger than 64kB");
3999  }
4001  curdef_idx += len;
4002 }
static char * curdef_text
Definition: ppl.yy.c:3980
void * pp_xrealloc(void *p, size_t size)
Definition: preproc.c:91
static int curdef_idx
Definition: ppl.yy.c:3978
const WCHAR * str
int ppy_warning(const char *s,...)
Definition: preproc.c:745
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
static int curdef_alloc
Definition: ppl.yy.c:3979
#define ALLOCBLOCKSIZE
Definition: ppl.yy.c:1263

Referenced by add_expand_text(), and expand_macro().

◆ add_text_to_macro()

static void add_text_to_macro ( const char text,
int  len 
)
static

Definition at line 4413 of file ppl.yy.c.

4414 {
4415  macexpstackentry_t *mep = top_macro();
4416 
4417  assert(mep->ppp->expanding == 0);
4418 
4419  if(mep->curargalloc - mep->curargsize <= len+1) /* +1 for '\0' */
4420  {
4421  char *new_curarg;
4422  int new_alloc = mep->curargalloc + ((ALLOCBLOCKSIZE > len+1) ? ALLOCBLOCKSIZE : len+1);
4423  new_curarg = pp_xrealloc(mep->curarg, new_alloc * sizeof(mep->curarg[0]));
4424  if(!new_curarg)
4425  return;
4426  mep->curarg = new_curarg;
4427  mep->curargalloc = new_alloc;
4428  }
4429  memcpy(mep->curarg + mep->curargsize, text, len);
4430  mep->curargsize += len;
4431  mep->curarg[mep->curargsize] = '\0';
4432 }
void * pp_xrealloc(void *p, size_t size)
Definition: preproc.c:91
const WCHAR * text
Definition: package.c:1827
#define assert(x)
Definition: debug.h:53
int expanding
Definition: wpp_private.h:98
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
static macexpstackentry_t * top_macro(void)
Definition: ppl.yy.c:4389
pp_entry_t * ppp
Definition: ppl.yy.c:1274
char * curarg
Definition: ppl.yy.c:1282
#define ALLOCBLOCKSIZE
Definition: ppl.yy.c:1263

Referenced by put_buffer(), and while().

◆ expand_define()

static void expand_define ( pp_entry_t ppp)
static

Definition at line 3960 of file ppl.yy.c.

3961 {
3962  assert(ppp->type == def_define);
3963 
3964  if(pp_flex_debug)
3965  fprintf(stderr, "expand_define(%d): %s:%d: '%s' -> '%s'\n",
3967  pp_status.input,
3969  ppp->ident,
3970  ppp->subst.text);
3971  if(ppp->subst.text && ppp->subst.text[0])
3972  {
3973  push_buffer(ppp, NULL, NULL, 0);
3974  ppy__scan_string(ppp->subst.text);
3975  }
3976 }
char * text
Definition: wpp_private.h:96
int line_number
Definition: wpp_private.h:233
#define assert(x)
Definition: debug.h:53
char * input
Definition: wpp_private.h:231
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
smooth NULL
Definition: ftsmooth.c:416
static int macexpstackidx
Definition: ppl.yy.c:1326
char * ident
Definition: wpp_private.h:91
union pp_entry::@4034 subst
int pp_flex_debug
Definition: wpp.c:31
def_type_t type
Definition: wpp_private.h:90
static void push_buffer(pp_entry_t *ppp, char *filename, char *incname, int pop)
Definition: ppl.yy.c:4246
FILE * stderr
YY_BUFFER_STATE ppy__scan_string(yyconst char *yy_str)
Definition: ppl.yy.c:3449

Referenced by while().

◆ expand_macro()

static void expand_macro ( macexpstackentry_t mep)
static

Definition at line 4101 of file ppl.yy.c.

4102 {
4103  mtext_t *mtp;
4104  int n, k;
4105  char *cptr;
4106  int nnl = 0;
4107  pp_entry_t *ppp = mep->ppp;
4108  int nargs = mep->nargs;
4109 
4110  assert(ppp->type == def_macro);
4111  assert(ppp->expanding == 0);
4112 
4113  if((ppp->nargs >= 0 && nargs != ppp->nargs) || (ppp->nargs < 0 && nargs < -ppp->nargs))
4114  {
4115  ppy_error("Too %s macro arguments (%d)", nargs < abs(ppp->nargs) ? "few" : "many", nargs);
4116  return;
4117  }
4118 
4119  for(n = 0; n < nargs; n++)
4120  nnl += mep->nnls[n];
4121 
4122  if(pp_flex_debug)
4123  fprintf(stderr, "expand_macro(%d): %s:%d: '%s'(%d,%d) -> ...\n",
4125  pp_status.input,
4127  ppp->ident,
4128  mep->nargs,
4129  nnl);
4130 
4131  curdef_idx = 0;
4132 
4133  for(mtp = ppp->subst.mtext; mtp; mtp = mtp->next)
4134  {
4135  if(!(mtp = add_expand_text(mtp, mep, &nnl)))
4136  break;
4137  }
4138 
4139  for(n = 0; n < nnl; n++)
4140  add_text("\n", 1);
4141 
4142  /* To make sure there is room and termination (see below) */
4143  add_text(" \0", 2);
4144 
4145  /* Strip trailing whitespace from expansion */
4146  for(k = curdef_idx, cptr = &curdef_text[curdef_idx-1]; k > 0; k--, cptr--)
4147  {
4148  if(!isspace(*cptr & 0xff))
4149  break;
4150  }
4151 
4152  /*
4153  * We must add *one* whitespace to make sure that there
4154  * is a token-separation after the expansion.
4155  */
4156  *(++cptr) = ' ';
4157  *(++cptr) = '\0';
4158  k++;
4159 
4160  /* Strip leading whitespace from expansion */
4161  for(n = 0, cptr = curdef_text; n < k; n++, cptr++)
4162  {
4163  if(!isspace(*cptr & 0xff))
4164  break;
4165  }
4166 
4167  if(k - n > 0)
4168  {
4169  if(pp_flex_debug)
4170  fprintf(stderr, "expand_text: '%s'\n", curdef_text + n);
4171  push_buffer(ppp, NULL, NULL, 0);
4172  /*ppy__scan_bytes(curdef_text + n,k - n);*/
4174  }
4175 }
static char * curdef_text
Definition: ppl.yy.c:3980
int nargs
Definition: wpp_private.h:93
#define abs(i)
Definition: fconv.c:206
#define isspace(c)
Definition: acclib.h:69
static mtext_t * add_expand_text(mtext_t *mtp, macexpstackentry_t *mep, int *nnl)
Definition: ppl.yy.c:4004
int line_number
Definition: wpp_private.h:233
GLdouble n
Definition: glext.h:7729
#define assert(x)
Definition: debug.h:53
static void add_text(const char *str, int len)
Definition: ppl.yy.c:3982
struct mtext * next
Definition: wpp_private.h:68
int expanding
Definition: wpp_private.h:98
char * input
Definition: wpp_private.h:231
static int curdef_idx
Definition: ppl.yy.c:3978
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
smooth NULL
Definition: ftsmooth.c:416
mtext_t * mtext
Definition: wpp_private.h:95
int ppy_error(const char *s,...)
Definition: preproc.c:735
static int macexpstackidx
Definition: ppl.yy.c:1326
char * ident
Definition: wpp_private.h:91
Definition: wpp_private.h:87
union pp_entry::@4034 subst
int pp_flex_debug
Definition: wpp.c:31
pp_entry_t * ppp
Definition: ppl.yy.c:1274
def_type_t type
Definition: wpp_private.h:90
static void push_buffer(pp_entry_t *ppp, char *filename, char *incname, int pop)
Definition: ppl.yy.c:4246
FILE * stderr
YY_BUFFER_STATE ppy__scan_string(yyconst char *yy_str)
Definition: ppl.yy.c:3449
int k
Definition: mpi.c:3369

Referenced by while().

◆ expand_special()

static void expand_special ( pp_entry_t ppp)
static

Definition at line 3919 of file ppl.yy.c.

3920 {
3921  static char *buf = NULL;
3922  char *new_buf;
3923 
3924  assert(ppp->type == def_special);
3925 
3926  if(!strcmp(ppp->ident, "__LINE__"))
3927  {
3928  new_buf = pp_xrealloc(buf, 32);
3929  if(!new_buf)
3930  return;
3931  buf = new_buf;
3932  sprintf(buf, "%d", pp_status.line_number);
3933  }
3934  else if(!strcmp(ppp->ident, "__FILE__"))
3935  {
3936  new_buf = pp_xrealloc(buf, strlen(pp_status.input) + 3);
3937  if(!new_buf)
3938  return;
3939  buf = new_buf;
3940  sprintf(buf, "\"%s\"", pp_status.input);
3941  }
3942  else
3943  pp_internal_error(__FILE__, __LINE__, "Special macro '%s' not found...\n", ppp->ident);
3944 
3945  if(pp_flex_debug)
3946  fprintf(stderr, "expand_special(%d): %s:%d: '%s' -> '%s'\n",
3948  pp_status.input,
3950  ppp->ident,
3951  buf ? buf : "");
3952 
3953  if(buf && buf[0])
3954  {
3955  push_buffer(ppp, NULL, NULL, 0);
3957  }
3958 }
void * pp_xrealloc(void *p, size_t size)
Definition: preproc.c:91
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
void pp_internal_error(const char *file, int line, const char *s,...)
Definition: preproc.c:754
int line_number
Definition: wpp_private.h:233
#define assert(x)
Definition: debug.h:53
char * input
Definition: wpp_private.h:231
#define sprintf(buf, format,...)
Definition: sprintf.c:55
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
smooth NULL
Definition: ftsmooth.c:416
static int macexpstackidx
Definition: ppl.yy.c:1326
char * ident
Definition: wpp_private.h:91
int pp_flex_debug
Definition: wpp.c:31
def_type_t type
Definition: wpp_private.h:90
static void push_buffer(pp_entry_t *ppp, char *filename, char *incname, int pop)
Definition: ppl.yy.c:4246
FILE * stderr
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
YY_BUFFER_STATE ppy__scan_string(yyconst char *yy_str)
Definition: ppl.yy.c:3449

Referenced by while().

◆ free_macro()

static void free_macro ( macexpstackentry_t mep)
static

Definition at line 4401 of file ppl.yy.c.

4402 {
4403  int i;
4404 
4405  for(i = 0; i < mep->nargs; i++)
4406  free(mep->args[i]);
4407  free(mep->args);
4408  free(mep->nnls);
4409  free(mep->curarg);
4410  free(mep);
4411 }
#define free
Definition: debug_ros.c:5
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
char ** args
Definition: ppl.yy.c:1275
char * curarg
Definition: ppl.yy.c:1282

Referenced by while().

◆ get_string()

static char * get_string ( void  )
static

Definition at line 4214 of file ppl.yy.c.

4215 {
4216  char *str = pp_xmalloc(strbuf_idx + 1);
4217  if(!str)
4218  return NULL;
4220  str[strbuf_idx] = '\0';
4221 #ifdef DEBUG
4222  strbuf_idx = 0;
4223 #endif
4224  return str;
4225 }
static int strbuf_idx
Definition: ppl.yy.c:1320
const WCHAR * str
static char * strbuffer
Definition: ppl.yy.c:1322
smooth NULL
Definition: ftsmooth.c:416
void * pp_xmalloc(size_t size)
Definition: preproc.c:77
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

Referenced by while().

◆ if()

if ( yy_init)

Definition at line 1636 of file ppl.yy.c.

1637  {
1638  (yy_init) = 1;
1639 
1640 #ifdef YY_USER_INIT
1641  YY_USER_INIT;
1642 #endif
1643 
1644  if ( ! (yy_start) )
1645  (yy_start) = 1; /* first start state */
1646 
1647  if ( ! ppy_in )
1648  ppy_in = stdin;
1649 
1650  if ( ! ppy_out )
1651  ppy_out = stdout;
1652 
1653  if ( ! YY_CURRENT_BUFFER ) {
1657  }
1658 
1660  }
static void ppy__load_buffer_state(void)
Definition: ppl.yy.c:3196
FILE * stdin
static int yy_start
Definition: ppl.yy.c:313
FILE * stdout
#define YY_BUF_SIZE
Definition: ppl.yy.c:176
FILE * ppy_in
Definition: ppl.yy.c:370
#define YY_CURRENT_BUFFER
Definition: ppl.yy.c:296
YY_BUFFER_STATE ppy__create_buffer(FILE *file, int size)
Definition: ppl.yy.c:3210
static int yy_init
Definition: ppl.yy.c:312
#define YY_CURRENT_BUFFER_LVALUE
Definition: ppl.yy.c:303
FILE * ppy_out
Definition: ppl.yy.c:370
static void ppy_ensure_buffer_stack(void)
Definition: ppl.yy.c:3363

◆ macro_add_arg()

static void macro_add_arg ( int  last)
static

Definition at line 4434 of file ppl.yy.c.

4435 {
4436  int nnl = 0;
4437  char *cptr;
4438  char **new_args, **new_ppargs;
4439  int *new_nnls;
4440  macexpstackentry_t *mep = top_macro();
4441 
4442  assert(mep->ppp->expanding == 0);
4443 
4444  new_args = pp_xrealloc(mep->args, (mep->nargs+1) * sizeof(mep->args[0]));
4445  if(!new_args)
4446  return;
4447  mep->args = new_args;
4448 
4449  new_ppargs = pp_xrealloc(mep->ppargs, (mep->nargs+1) * sizeof(mep->ppargs[0]));
4450  if(!new_ppargs)
4451  return;
4452  mep->ppargs = new_ppargs;
4453 
4454  new_nnls = pp_xrealloc(mep->nnls, (mep->nargs+1) * sizeof(mep->nnls[0]));
4455  if(!new_nnls)
4456  return;
4457  mep->nnls = new_nnls;
4458 
4459  mep->args[mep->nargs] = pp_xstrdup(mep->curarg ? mep->curarg : "");
4460  if(!mep->args[mep->nargs])
4461  return;
4462  cptr = mep->args[mep->nargs]-1;
4463  while((cptr = strchr(cptr+1, '\n')))
4464  {
4465  nnl++;
4466  }
4467  mep->nnls[mep->nargs] = nnl;
4468  mep->nargs++;
4469  free(mep->curarg);
4470  mep->curargalloc = mep->curargsize = 0;
4471  mep->curarg = NULL;
4472 
4473  if(pp_flex_debug)
4474  fprintf(stderr, "macro_add_arg: %s:%d: %d -> '%s'\n",
4475  pp_status.input,
4477  mep->nargs-1,
4478  mep->args[mep->nargs-1]);
4479 
4480  /* Each macro argument must be expanded to cope with stingize */
4481  if(last || mep->args[mep->nargs-1][0])
4482  {
4484  push_buffer(NULL, NULL, NULL, last ? 2 : 1);
4485  ppy__scan_string(mep->args[mep->nargs-1]);
4486  /*mep->bufferstackidx = bufferstackidx; But not nested! */
4487  }
4488 }
#define pp_macexp
Definition: ppl.yy.c:1417
void * pp_xrealloc(void *p, size_t size)
Definition: preproc.c:91
POINT last
Definition: font.c:46
#define free
Definition: debug_ros.c:5
int line_number
Definition: wpp_private.h:233
#define assert(x)
Definition: debug.h:53
char ** ppargs
Definition: ppl.yy.c:1276
int expanding
Definition: wpp_private.h:98
char * input
Definition: wpp_private.h:231
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
smooth NULL
Definition: ftsmooth.c:416
char ** args
Definition: ppl.yy.c:1275
char * pp_xstrdup(const char *str)
Definition: preproc.c:105
static macexpstackentry_t * top_macro(void)
Definition: ppl.yy.c:4389
char * strchr(const char *String, int ch)
Definition: utclib.c:501
int pp_flex_debug
Definition: wpp.c:31
pp_entry_t * ppp
Definition: ppl.yy.c:1274
static void push_buffer(pp_entry_t *ppp, char *filename, char *incname, int pop)
Definition: ppl.yy.c:4246
FILE * stderr
char * curarg
Definition: ppl.yy.c:1282
YY_BUFFER_STATE ppy__scan_string(yyconst char *yy_str)
Definition: ppl.yy.c:3449
static void yy_push_state(int new_state)
Definition: ppl.yy.c:3492

Referenced by while().

◆ macro_add_expansion()

static void macro_add_expansion ( void  )
static

Definition at line 4490 of file ppl.yy.c.

4491 {
4492  macexpstackentry_t *mep = top_macro();
4493 
4494  assert(mep->ppp->expanding == 0);
4495 
4496  mep->ppargs[mep->nargs-1] = pp_xstrdup(mep->curarg ? mep->curarg : "");
4497  free(mep->curarg);
4498  mep->curargalloc = mep->curargsize = 0;
4499  mep->curarg = NULL;
4500 
4501  if(pp_flex_debug)
4502  fprintf(stderr, "macro_add_expansion: %s:%d: %d -> '%s'\n",
4503  pp_status.input,
4505  mep->nargs-1,
4506  mep->ppargs[mep->nargs-1] ? mep->ppargs[mep->nargs-1] : "");
4507 }
#define free
Definition: debug_ros.c:5
int line_number
Definition: wpp_private.h:233
#define assert(x)
Definition: debug.h:53
char ** ppargs
Definition: ppl.yy.c:1276
int expanding
Definition: wpp_private.h:98
char * input
Definition: wpp_private.h:231
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
smooth NULL
Definition: ftsmooth.c:416
char * pp_xstrdup(const char *str)
Definition: preproc.c:105
static macexpstackentry_t * top_macro(void)
Definition: ppl.yy.c:4389
int pp_flex_debug
Definition: wpp.c:31
pp_entry_t * ppp
Definition: ppl.yy.c:1274
FILE * stderr
char * curarg
Definition: ppl.yy.c:1282

Referenced by pop_buffer().

◆ make_number()

static int make_number ( int  radix,
YYSTYPE val,
const char str,
int  len 
)
static

Definition at line 3809 of file ppl.yy.c.

3810 {
3811  int is_l = 0;
3812  int is_ll = 0;
3813  int is_u = 0;
3814  char ext[4];
3815  long l;
3816 
3817  ext[3] = '\0';
3818  ext[2] = toupper(str[len-1]);
3819  ext[1] = len > 1 ? toupper(str[len-2]) : ' ';
3820  ext[0] = len > 2 ? toupper(str[len-3]) : ' ';
3821 
3822  if(!strcmp(ext, "LUL"))
3823  {
3824  ppy_error("Invalid constant suffix");
3825  return 0;
3826  }
3827  else if(!strcmp(ext, "LLU") || !strcmp(ext, "ULL"))
3828  {
3829  is_ll++;
3830  is_u++;
3831  }
3832  else if(!strcmp(ext+1, "LU") || !strcmp(ext+1, "UL"))
3833  {
3834  is_l++;
3835  is_u++;
3836  }
3837  else if(!strcmp(ext+1, "LL"))
3838  {
3839  is_ll++;
3840  }
3841  else if(!strcmp(ext+2, "L"))
3842  {
3843  is_l++;
3844  }
3845  else if(!strcmp(ext+2, "U"))
3846  {
3847  is_u++;
3848  }
3849 
3850  if(is_ll)
3851  {
3852 /* Assume as in the declaration of wrc_ull_t and wrc_sll_t */
3853 #ifdef HAVE_LONG_LONG
3854  if (is_u)
3855  {
3856  errno = 0;
3857  val->ull = strtoull(str, NULL, radix);
3858  if (val->ull == ULLONG_MAX && errno == ERANGE)
3859  ppy_error("integer constant %s is too large\n", str);
3860  return tULONGLONG;
3861  }
3862  else
3863  {
3864  errno = 0;
3865  val->sll = strtoll(str, NULL, radix);
3866  if ((val->sll == LLONG_MIN || val->sll == LLONG_MAX) && errno == ERANGE)
3867  ppy_error("integer constant %s is too large\n", str);
3868  return tSLONGLONG;
3869  }
3870 #else
3871  pp_internal_error(__FILE__, __LINE__, "long long constants not supported on this platform");
3872 #endif
3873  }
3874  else if(is_u && is_l)
3875  {
3876  errno = 0;
3877  val->ulong = strtoul(str, NULL, radix);
3878  if (val->ulong == ULONG_MAX && errno == ERANGE)
3879  ppy_error("integer constant %s is too large\n", str);
3880  return tULONG;
3881  }
3882  else if(!is_u && is_l)
3883  {
3884  errno = 0;
3885  val->slong = strtol(str, NULL, radix);
3886  if ((val->slong == LONG_MIN || val->slong == LONG_MAX) && errno == ERANGE)
3887  ppy_error("integer constant %s is too large\n", str);
3888  return tSLONG;
3889  }
3890  else if(is_u && !is_l)
3891  {
3892  unsigned long ul;
3893  errno = 0;
3894  ul = strtoul(str, NULL, radix);
3895  if ((ul == ULONG_MAX && errno == ERANGE) || (ul > UINT_MAX))
3896  ppy_error("integer constant %s is too large\n", str);
3897  val->uint = (unsigned int)ul;
3898  return tUINT;
3899  }
3900 
3901  /* Else it must be an int... */
3902  errno = 0;
3903  l = strtol(str, NULL, radix);
3904  if (((l == LONG_MIN || l == LONG_MAX) && errno == ERANGE) ||
3905  (l > INT_MAX) || (l < INT_MIN))
3906  ppy_error("integer constant %s is too large\n", str);
3907  val->sint = (int)l;
3908  return tSINT;
3909 }
UINT32 strtoul(const char *String, char **Terminator, UINT32 Base)
Definition: utclib.c:696
#define INT_MAX
Definition: limits.h:40
void pp_internal_error(const char *file, int line, const char *s,...)
Definition: preproc.c:754
Definition: ppy.tab.c:229
int errno
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
char ext[3]
Definition: mkdosfs.c:358
__MINGW_EXTENSION long long __cdecl strtoll(const char *__restrict__, char **__restrict, int)
GLuint GLfloat * val
Definition: glext.h:7180
int ppy_error(const char *s,...)
Definition: preproc.c:735
r l[0]
Definition: byte_order.h:167
#define LLONG_MAX
Definition: ppl.yy.c:1211
int toupper(int c)
Definition: utclib.c:881
#define strtoull
Definition: stabs.c:72
#define LLONG_MIN
Definition: ppl.yy.c:1212
#define LONG_MAX
Definition: limits.h:43
#define ERANGE
Definition: acclib.h:92
GLenum GLsizei len
Definition: glext.h:6722
#define INT_MIN
Definition: limits.h:39
#define UINT_MAX
Definition: limits.h:41
_Check_return_ long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
#define LONG_MIN
Definition: limits.h:42
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
Definition: ppy.tab.c:230
#define ULLONG_MAX
Definition: ppl.yy.c:1215
#define ULONG_MAX
Definition: limits.h:44
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by while().

◆ new_string()

static void new_string ( void  )
static

Definition at line 4182 of file ppl.yy.c.

4183 {
4184 #ifdef DEBUG
4185  if(strbuf_idx)
4186  ppy_warning("new_string: strbuf_idx != 0");
4187 #endif
4188  strbuf_idx = 0;
4190 }
int line_number
Definition: wpp_private.h:233
static int str_startline
Definition: ppl.yy.c:1323
static int strbuf_idx
Definition: ppl.yy.c:1320
int ppy_warning(const char *s,...)
Definition: preproc.c:745

Referenced by AppendUnicodeString(), PerfDataGetCommandLine(), and while().

◆ newline()

static void newline ( int  dowrite)
static

Definition at line 3768 of file ppl.yy.c.

3769 {
3771  pp_status.char_number = 1;
3772 
3773  if(dowrite == -1)
3774  return;
3775 
3776  ncontinuations++;
3777  if(dowrite)
3778  {
3780  put_buffer("\n", 1);
3781  }
3782 }
int line_number
Definition: wpp_private.h:233
int char_number
Definition: wpp_private.h:234
static int ncontinuations
Definition: ppl.yy.c:1318
static void put_buffer(const char *s, int len)
Definition: ppl.yy.c:4515

Referenced by check_version(), export_newline(), read_line(), read_stdin(), REGPROC_export_binary(), str_handle_lines(), and while().

◆ pop_buffer()

static bufferstackentry_t * pop_buffer ( void  )
static

Definition at line 4281 of file ppl.yy.c.

4282 {
4283  if(bufferstackidx < 0)
4284  pp_internal_error(__FILE__, __LINE__, "Bufferstack underflow?");
4285 
4286  if(bufferstackidx == 0)
4287  return NULL;
4288 
4289  bufferstackidx--;
4290 
4293  else
4294  {
4295  includelogicentry_t *iep = NULL;
4296 
4297  if(!bufferstack[bufferstackidx].should_pop)
4298  {
4301 
4302  /* We have EOF, check the include logic */
4304  {
4306  if(ppp)
4307  {
4308  iep = pp_xmalloc(sizeof(includelogicentry_t));
4309  if (iep)
4310  {
4311  iep->ppp = ppp;
4312  ppp->iep = iep;
4314  iep->prev = NULL;
4315  iep->next = pp_includelogiclist;
4316  if(iep->next)
4317  iep->next->prev = iep;
4318  pp_includelogiclist = iep;
4319  if(pp_status.debug)
4320  fprintf(stderr, "pop_buffer: %s:%d: includelogic added, include_ppp='%s', file='%s'\n",
4322  }
4323  }
4324  }
4327 
4328  }
4329  if (bufferstack[bufferstackidx].include_filename)
4330  {
4331  free(pp_status.input);
4333  }
4337  if (!iep)
4338  free(bufferstack[bufferstackidx].include_filename);
4339  }
4340 
4341  if(ppy_debug)
4342  printf("pop_buffer(%d): %p %p (%d, %d, %d) %p %d\n",
4344  bufferstack[bufferstackidx].bufferstate,
4348  bufferstack[bufferstackidx].if_depth,
4350  bufferstack[bufferstackidx].should_pop);
4351 
4354 
4355  if(bufferstack[bufferstackidx].should_pop)
4356  {
4357  if(yy_current_state() == pp_macexp)
4359  else
4360  pp_internal_error(__FILE__, __LINE__, "Pop buffer and state without macro expansion state");
4361  yy_pop_state();
4362  }
4363 
4364  return &bufferstack[bufferstackidx];
4365 }
pp_entry_t * pplookup(const char *ident)
Definition: preproc.c:221
int ppy_debug
Definition: wpp.c:31
static void macro_add_expansion(void)
Definition: ppl.yy.c:4490
includelogicentry_t * iep
Definition: wpp_private.h:101
static bufferstackentry_t bufferstack[MAXBUFFERSTACK]
Definition: ppl.yy.c:1328
#define pp_macexp
Definition: ppl.yy.c:1417
struct includelogicentry * next
Definition: wpp_private.h:37
#define free
Definition: debug_ros.c:5
void pp_internal_error(const char *file, int line, const char *s,...)
Definition: preproc.c:754
int line_number
Definition: wpp_private.h:233
void pp_writestring(const char *format,...)
Definition: ppl.yy.c:1351
int line_number
Definition: parser.yy.c:775
#define yy_current_state()
Definition: ppl.yy.c:1235
const char * filename
Definition: ioapi.h:135
Definition: wpp.c:33
void(* close)(void *file)
Definition: wpp.h:40
char * filename
Definition: ppl.yy.c:1254
int expanding
Definition: wpp_private.h:98
char * input
Definition: wpp_private.h:231
include_state_t incl
Definition: ppl.yy.c:1259
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
char * include_filename
Definition: ppl.yy.c:1260
int char_number
Definition: wpp_private.h:234
include_state_t pp_incl_state
Definition: ppl.yy.c:1334
smooth NULL
Definition: ftsmooth.c:416
void * file
Definition: wpp_private.h:232
void * pp_xmalloc(size_t size)
Definition: preproc.c:77
Definition: wpp_private.h:87
int char_number
pp_entry_t * define
Definition: ppl.yy.c:1251
static int ncontinuations
Definition: ppl.yy.c:1318
includelogicentry_t * pp_includelogiclist
Definition: ppl.yy.c:1342
void * filehandle
Definition: ppl.yy.c:1250
static int bufferstackidx
Definition: ppl.yy.c:1329
struct includelogicentry * prev
Definition: wpp_private.h:38
FILE * stderr
void ppy__switch_to_buffer(YY_BUFFER_STATE new_buffer)
Definition: ppl.yy.c:3165
struct pp_entry * ppp
Definition: wpp_private.h:39
int ncontinuations
Definition: ppl.yy.c:1256
#define printf
Definition: config.h:203
static void yy_pop_state(void)
Definition: ppl.yy.c:3516

Referenced by while().

◆ pop_macro()

static macexpstackentry_t * pop_macro ( void  )
static

Definition at line 4394 of file ppl.yy.c.

4395 {
4396  if(macexpstackidx <= 0)
4397  pp_internal_error(__FILE__, __LINE__, "Macro expansion stack underflow\n");
4398  return macexpstack[--macexpstackidx];
4399 }
static macexpstackentry_t * macexpstack[MAXMACEXPSTACK]
Definition: ppl.yy.c:1325
void pp_internal_error(const char *file, int line, const char *s,...)
Definition: preproc.c:754
static int macexpstackidx
Definition: ppl.yy.c:1326

Referenced by while().

◆ pp_do_include()

void pp_do_include ( char fname,
int  type 
)

Definition at line 4529 of file ppl.yy.c.

4530 {
4531  char *newpath;
4532  int n;
4533  includelogicentry_t *iep;
4534  void *fp;
4535 
4536  if(!fname)
4537  return;
4538 
4539  for(iep = pp_includelogiclist; iep; iep = iep->next)
4540  {
4541  if(!strcmp(iep->filename, fname))
4542  {
4543  /*
4544  * We are done. The file was included before.
4545  * If the define was deleted, then this entry would have
4546  * been deleted too.
4547  */
4548  free(fname);
4549  return;
4550  }
4551  }
4552 
4553  n = strlen(fname);
4554 
4555  if(n <= 2)
4556  {
4557  ppy_error("Empty include filename");
4558  free(fname);
4559  return;
4560  }
4561 
4562  /* Undo the effect of the quotation */
4563  fname[n-1] = '\0';
4564 
4565  if((fp = pp_open_include(fname+1, type, pp_status.input, &newpath)) == NULL)
4566  {
4567  ppy_error("Unable to open include file %s", fname+1);
4568  free(fname);
4569  return;
4570  }
4571 
4572  fname[n-1] = *fname; /* Redo the quotes */
4573  push_buffer(NULL, newpath, fname, 0);
4575  pp_incl_state.state = 0;
4577 
4578  if(pp_status.debug)
4579  fprintf(stderr, "pp_do_include: %s:%d: include_state=%d, include_ppp='%s', include_ifdepth=%d\n",
4581  pp_status.file = fp;
4583 
4584  pp_writestring("# 1 \"%s\" 1%s\n", newpath, type ? "" : " 3");
4585 }
struct includelogicentry * next
Definition: wpp_private.h:37
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define free
Definition: debug_ros.c:5
int line_number
Definition: wpp_private.h:233
GLdouble n
Definition: glext.h:7729
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
void pp_writestring(const char *format,...)
Definition: ppl.yy.c:1351
char * input
Definition: wpp_private.h:231
#define YY_BUF_SIZE
Definition: ppl.yy.c:176
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
include_state_t pp_incl_state
Definition: ppl.yy.c:1334
smooth NULL
Definition: ftsmooth.c:416
void * file
Definition: wpp_private.h:232
YY_BUFFER_STATE ppy__create_buffer(FILE *file, int size)
Definition: ppl.yy.c:3210
int ppy_error(const char *s,...)
Definition: preproc.c:735
includelogicentry_t * pp_includelogiclist
Definition: ppl.yy.c:1342
static void push_buffer(pp_entry_t *ppp, char *filename, char *incname, int pop)
Definition: ppl.yy.c:4246
FILE * stderr
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
void ppy__switch_to_buffer(YY_BUFFER_STATE new_buffer)
Definition: ppl.yy.c:3165
void * pp_open_include(const char *name, int type, const char *parent_name, char **newpath)
Definition: preproc.c:514

Referenced by yyparse().

◆ pp_pop_ignore_state()

void pp_pop_ignore_state ( void  )

Definition at line 4598 of file ppl.yy.c.

4599 {
4600  yy_pop_state();
4601 }
static void yy_pop_state(void)
Definition: ppl.yy.c:3516

Referenced by pp_pop_if().

◆ pp_push_ignore_state()

void pp_push_ignore_state ( void  )

Definition at line 4593 of file ppl.yy.c.

4594 {
4596 }
#define pp_ignore
Definition: ppl.yy.c:1423
static void yy_push_state(int new_state)
Definition: ppl.yy.c:3492

Referenced by pp_push_if().

◆ pp_writestring()

void pp_writestring ( const char format,
  ... 
)

Definition at line 1351 of file ppl.yy.c.

1352 {
1353  va_list valist;
1354  int len;
1355  static char *buffer;
1356  static int buffercapacity;
1357  char *new_buffer;
1358 
1359  if(buffercapacity == 0)
1360  {
1362  if(buffer == NULL)
1363  return;
1364  buffercapacity = BUFFERINITIALCAPACITY;
1365  }
1366 
1368  len = vsnprintf(buffer, buffercapacity,
1369  format, valist);
1370  va_end(valist);
1371  /* If the string is longer than buffersize, vsnprintf returns
1372  * the string length with glibc >= 2.1, -1 with glibc < 2.1 */
1373  while(len > buffercapacity || len < 0)
1374  {
1375  do
1376  {
1377  buffercapacity *= 2;
1378  } while(len > buffercapacity);
1379 
1380  new_buffer = pp_xrealloc(buffer, buffercapacity);
1381  if(new_buffer == NULL)
1382  {
1383  va_end(valist);
1384  return;
1385  }
1386  buffer = new_buffer;
1388  len = vsnprintf(buffer, buffercapacity,
1389  format, valist);
1390  va_end(valist);
1391  }
1392 
1394 }
#define vsnprintf
Definition: tif_win32.c:406
void * pp_xrealloc(void *p, size_t size)
Definition: preproc.c:91
GLuint buffer
Definition: glext.h:5915
#define BUFFERINITIALCAPACITY
Definition: ppl.yy.c:1349
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define va_end(ap)
Definition: acmsvcex.h:90
smooth NULL
Definition: ftsmooth.c:416
char * va_list
Definition: acmsvcex.h:78
void * pp_xmalloc(size_t size)
Definition: preproc.c:77
GLenum GLsizei len
Definition: glext.h:6722
void(* write)(const char *buffer, unsigned int len)
Definition: wpp.h:44
#define va_start(ap, A)
Definition: acmsvcex.h:91
static __ms_va_list valist
Definition: printf.c:59

Referenced by pop_buffer(), pp_do_include(), wpp_parse(), and yyparse().

◆ ppy__create_buffer()

YY_BUFFER_STATE ppy__create_buffer ( FILE file,
int  size 
)

Allocate and initialize an input buffer state.

Parameters
fileA readable stream.
sizeThe character buffer size in bytes. When in doubt, use YY_BUF_SIZE.
Returns
the allocated buffer state.

Definition at line 3210 of file ppl.yy.c.

3211 {
3213 
3214  b = (YY_BUFFER_STATE) ppy_alloc(sizeof( struct yy_buffer_state ) );
3215  if ( ! b )
3216  YY_FATAL_ERROR( "out of dynamic memory in ppy__create_buffer()" );
3217 
3218  b->yy_buf_size = size;
3219 
3220  /* yy_ch_buf has to be 2 characters longer than the size given because
3221  * we need to put in 2 end-of-buffer characters.
3222  */
3223  b->yy_ch_buf = (char *) ppy_alloc(b->yy_buf_size + 2 );
3224  if ( ! b->yy_ch_buf )
3225  YY_FATAL_ERROR( "out of dynamic memory in ppy__create_buffer()" );
3226 
3227  b->yy_is_our_buffer = 1;
3228 
3230 
3231  return b;
3232 }
static void ppy__init_buffer(YY_BUFFER_STATE b, FILE *file)
Definition: ppl.yy.c:3257
struct yy_buffer_state * YY_BUFFER_STATE
Definition: ppl.yy.c:186
void * ppy_alloc(yy_size_t)
Definition: ppl.yy.c:3718
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLsizeiptr size
Definition: glext.h:5919
#define YY_FATAL_ERROR(msg)
Definition: ppl.yy.c:1578
Definition: fci.c:126

Referenced by if(), pp_do_include(), and ppy_restart().

◆ ppy__delete_buffer()

void ppy__delete_buffer ( YY_BUFFER_STATE  b)

Destroy the buffer.

Parameters
ba buffer created with ppy__create_buffer()

Definition at line 3238 of file ppl.yy.c.

3239 {
3240 
3241  if ( ! b )
3242  return;
3243 
3244  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
3246 
3247  if ( b->yy_is_our_buffer )
3248  ppy_free((void *) b->yy_ch_buf );
3249 
3250  ppy_free((void *) b );
3251 }
struct yy_buffer_state * YY_BUFFER_STATE
Definition: ppl.yy.c:186
#define YY_CURRENT_BUFFER
Definition: ppl.yy.c:296
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
void ppy_free(void *)
Definition: ppl.yy.c:3735
#define YY_CURRENT_BUFFER_LVALUE
Definition: ppl.yy.c:303

Referenced by ppy_lex_destroy(), ppy_pop_buffer_state(), and while().

◆ ppy__flush_buffer()

void ppy__flush_buffer ( YY_BUFFER_STATE  b)

Discard all buffered characters. On the next scan, YY_INPUT will be called.

Parameters
bthe buffer state to be flushed, usually YY_CURRENT_BUFFER.

Definition at line 3285 of file ppl.yy.c.

3286 {
3287  if ( ! b )
3288  return;
3289 
3290  b->yy_n_chars = 0;
3291 
3292  /* We always need two end-of-buffer characters. The first causes
3293  * a transition to the end-of-buffer state. The second causes
3294  * a jam in that state.
3295  */
3296  b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3297  b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3298 
3299  b->yy_buf_pos = &b->yy_ch_buf[0];
3300 
3301  b->yy_at_bol = 1;
3302  b->yy_buffer_status = YY_BUFFER_NEW;
3303 
3304  if ( b == YY_CURRENT_BUFFER )
3306 }
static void ppy__load_buffer_state(void)
Definition: ppl.yy.c:3196
#define YY_END_OF_BUFFER_CHAR
Definition: ppl.yy.c:165
#define YY_CURRENT_BUFFER
Definition: ppl.yy.c:296
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define YY_BUFFER_NEW
Definition: ppl.yy.c:268

Referenced by ppy__init_buffer().

◆ ppy__init_buffer()

static void ppy__init_buffer ( YY_BUFFER_STATE  b,
FILE file 
)
static

Definition at line 3257 of file ppl.yy.c.

3259 {
3260  int oerrno = errno;
3261 
3262  ppy__flush_buffer(b );
3263 
3264  b->yy_input_file = file;
3265  b->yy_fill_buffer = 1;
3266 
3267  /* If b is the current buffer, then ppy__init_buffer was _probably_
3268  * called from ppy_restart() or through yy_get_next_buffer.
3269  * In that case, we don't want to reset the lineno or column.
3270  */
3271  if (b != YY_CURRENT_BUFFER){
3272  b->yy_bs_lineno = 1;
3273  b->yy_bs_column = 0;
3274  }
3275 
3276  b->yy_is_interactive = 0;
3277 
3278  errno = oerrno;
3279 }
int errno
#define YY_CURRENT_BUFFER
Definition: ppl.yy.c:296
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
const char file[]
Definition: icontest.c:11
void ppy__flush_buffer(YY_BUFFER_STATE b)
Definition: ppl.yy.c:3285

Referenced by ppy__create_buffer(), and ppy_restart().

◆ ppy__load_buffer_state()

static void ppy__load_buffer_state ( void  )
static

Definition at line 3196 of file ppl.yy.c.

3197 {
3198  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
3199  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
3200  ppy_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
3201  (yy_hold_char) = *(yy_c_buf_p);
3202 }
static int yy_n_chars
Definition: ppl.yy.c:307
FILE * ppy_in
Definition: ppl.yy.c:370
static char yy_hold_char
Definition: ppl.yy.c:306
#define YY_CURRENT_BUFFER_LVALUE
Definition: ppl.yy.c:303
static char * yy_c_buf_p
Definition: ppl.yy.c:311
#define yytext_ptr
Definition: ppl.yy.c:379

Referenced by if(), ppy__flush_buffer(), ppy__switch_to_buffer(), ppy_pop_buffer_state(), ppy_push_buffer_state(), and ppy_restart().

◆ ppy__scan_buffer()

YY_BUFFER_STATE ppy__scan_buffer ( char base,
yy_size_t  size 
)

Setup the input buffer state to scan directly from a user-specified character buffer.

Parameters
basethe character buffer
sizethe size in bytes of the character buffer
Returns
the newly allocated buffer state object.

Definition at line 3412 of file ppl.yy.c.

3413 {
3415 
3416  if ( size < 2 ||
3419  /* They forgot to leave room for the EOB's. */
3420  return 0;
3421 
3422  b = (YY_BUFFER_STATE) ppy_alloc(sizeof( struct yy_buffer_state ) );
3423  if ( ! b )
3424  YY_FATAL_ERROR( "out of dynamic memory in ppy__scan_buffer()" );
3425 
3426  b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
3427  b->yy_buf_pos = b->yy_ch_buf = base;
3428  b->yy_is_our_buffer = 0;
3429  b->yy_input_file = 0;
3430  b->yy_n_chars = b->yy_buf_size;
3431  b->yy_is_interactive = 0;
3432  b->yy_at_bol = 1;
3433  b->yy_fill_buffer = 0;
3434  b->yy_buffer_status = YY_BUFFER_NEW;
3435 
3437 
3438  return b;
3439 }
struct yy_buffer_state * YY_BUFFER_STATE
Definition: ppl.yy.c:186
void * ppy_alloc(yy_size_t)
Definition: ppl.yy.c:3718
#define YY_END_OF_BUFFER_CHAR
Definition: ppl.yy.c:165
GLuint base
Definition: 3dtext.c:35
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLsizeiptr size
Definition: glext.h:5919
#define YY_FATAL_ERROR(msg)
Definition: ppl.yy.c:1578
void ppy__switch_to_buffer(YY_BUFFER_STATE new_buffer)
Definition: ppl.yy.c:3165
#define YY_BUFFER_NEW
Definition: ppl.yy.c:268

Referenced by ppy__scan_bytes().

◆ ppy__scan_bytes()

YY_BUFFER_STATE ppy__scan_bytes ( yyconst char yybytes,
int  _yybytes_len 
)

Setup the input buffer state to scan the given bytes. The next call to ppy_lex() will scan from a copy of bytes.

Parameters
yybytesthe byte buffer to scan
_yybytes_lenthe number of bytes in the buffer pointed to by bytes.
Returns
the newly allocated buffer state object.

Definition at line 3462 of file ppl.yy.c.

3463 {
3465  char *buf;
3466  yy_size_t n;
3467  int i;
3468 
3469  /* Get memory for full buffer, including space for trailing EOB's. */
3470  n = _yybytes_len + 2;
3471  buf = (char *) ppy_alloc(n );
3472  if ( ! buf )
3473  YY_FATAL_ERROR( "out of dynamic memory in ppy__scan_bytes()" );
3474 
3475  for ( i = 0; i < _yybytes_len; ++i )
3476  buf[i] = yybytes[i];
3477 
3478  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3479 
3480  b = ppy__scan_buffer(buf,n );
3481  if ( ! b )
3482  YY_FATAL_ERROR( "bad buffer in ppy__scan_bytes()" );
3483 
3484  /* It's okay to grow etc. this buffer, and we should throw it
3485  * away when we're done.
3486  */
3487  b->yy_is_our_buffer = 1;
3488 
3489  return b;
3490 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLdouble n
Definition: glext.h:7729
size_t yy_size_t
Definition: macro.lex.yy.c:159
void * ppy_alloc(yy_size_t)
Definition: ppl.yy.c:3718
#define YY_END_OF_BUFFER_CHAR
Definition: ppl.yy.c:165
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
YY_BUFFER_STATE ppy__scan_buffer(char *base, yy_size_t size)
Definition: ppl.yy.c:3412
#define YY_FATAL_ERROR(msg)
Definition: ppl.yy.c:1578

Referenced by ppy__scan_string().

◆ ppy__scan_string()

YY_BUFFER_STATE ppy__scan_string ( yyconst char yystr)

Setup the input buffer state to scan a string. The next call to ppy_lex() will scan from a copy of str.

Parameters
yystra NUL-terminated string to scan
Returns
the newly allocated buffer state object.
Note
If you want to scan bytes that may contain NUL values, then use ppy__scan_bytes() instead.

Definition at line 3449 of file ppl.yy.c.

3450 {
3451 
3452  return ppy__scan_bytes(yystr,strlen(yystr) );
3453 }
YY_BUFFER_STATE ppy__scan_bytes(yyconst char *bytes, int len)
Definition: ppl.yy.c:3462
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269

Referenced by expand_define(), expand_macro(), expand_special(), and macro_add_arg().

◆ ppy__switch_to_buffer()

void ppy__switch_to_buffer ( YY_BUFFER_STATE  new_buffer)

Switch to a different input buffer.

Parameters
new_bufferThe new input buffer.

Definition at line 3165 of file ppl.yy.c.

3166 {
3167 
3168  /* TODO. We should be able to replace this entire function body
3169  * with
3170  * ppy_pop_buffer_state();
3171  * ppy_push_buffer_state(new_buffer);
3172  */
3174  if ( YY_CURRENT_BUFFER == new_buffer )
3175  return;
3176 
3177  if ( YY_CURRENT_BUFFER )
3178  {
3179  /* Flush out information for old buffer. */
3180  *(yy_c_buf_p) = (yy_hold_char);
3181  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
3182  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3183  }
3184 
3185  YY_CURRENT_BUFFER_LVALUE = new_buffer;
3187 
3188  /* We don't actually know whether we did this switch during
3189  * EOF (ppy_wrap()) processing, but the only time this flag
3190  * is looked at is after ppy_wrap() is called, so it's safe
3191  * to go ahead and always set it.
3192  */
3194 }
static void ppy__load_buffer_state(void)
Definition: ppl.yy.c:3196
static int yy_n_chars
Definition: ppl.yy.c:307
static int yy_did_buffer_switch_on_eof
Definition: ppl.yy.c:318
#define YY_CURRENT_BUFFER
Definition: ppl.yy.c:296
static char yy_hold_char
Definition: ppl.yy.c:306
#define YY_CURRENT_BUFFER_LVALUE
Definition: ppl.yy.c:303
static void ppy_ensure_buffer_stack(void)
Definition: ppl.yy.c:3363
static char * yy_c_buf_p
Definition: ppl.yy.c:311

Referenced by pop_buffer(), pp_do_include(), and ppy__scan_buffer().

◆ ppy_alloc()

void * ppy_alloc ( yy_size_t  size)

Definition at line 3718 of file ppl.yy.c.

3719 {
3720  return (void *) malloc( size );
3721 }
GLsizeiptr size
Definition: glext.h:5919
#define malloc
Definition: debug_ros.c:4

Referenced by ppy__create_buffer(), ppy__scan_buffer(), ppy__scan_bytes(), ppy_ensure_buffer_stack(), and yy_push_state().

◆ ppy_ensure_buffer_stack()

static void ppy_ensure_buffer_stack ( void  )
static

Definition at line 3363 of file ppl.yy.c.

3364 {
3365  int num_to_alloc;
3366 
3367  if (!(yy_buffer_stack)) {
3368 
3369  /* First allocation is just for 2 elements, since we don't know if this
3370  * scanner will even need a stack. We use 2 instead of 1 to avoid an
3371  * immediate realloc on the next call.
3372  */
3373  num_to_alloc = 1;
3375  (num_to_alloc * sizeof(struct yy_buffer_state*)
3376  );
3377  if ( ! (yy_buffer_stack) )
3378  YY_FATAL_ERROR( "out of dynamic memory in ppy_ensure_buffer_stack()" );
3379 
3380  memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3381 
3382  (yy_buffer_stack_max) = num_to_alloc;
3383  (yy_buffer_stack_top) = 0;
3384  return;
3385  }
3386 
3387  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
3388 
3389  /* Increase the buffer to prepare for a possible push. */
3390  int grow_size = 8 /* arbitrary grow size */;
3391 
3392  num_to_alloc = (yy_buffer_stack_max) + grow_size;
3394  ((yy_buffer_stack),
3395  num_to_alloc * sizeof(struct yy_buffer_state*)
3396  );
3397  if ( ! (yy_buffer_stack) )
3398  YY_FATAL_ERROR( "out of dynamic memory in ppy_ensure_buffer_stack()" );
3399 
3400  /* zero only the new slots.*/
3401  memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
3402  (yy_buffer_stack_max) = num_to_alloc;
3403  }
3404 }
void * ppy_realloc(void *, yy_size_t)
Definition: ppl.yy.c:3723
void * ppy_alloc(yy_size_t)
Definition: ppl.yy.c:3718
static YY_BUFFER_STATE * yy_buffer_stack
Definition: ppl.yy.c:288
static size_t yy_buffer_stack_top
Definition: ppl.yy.c:286
static size_t yy_buffer_stack_max
Definition: ppl.yy.c:287
#define YY_FATAL_ERROR(msg)
Definition: ppl.yy.c:1578
#define memset(x, y, z)
Definition: compat.h:39

Referenced by if(), ppy__switch_to_buffer(), ppy_push_buffer_state(), and ppy_restart().

◆ ppy_free()

void ppy_free ( void ptr)

Definition at line 3735 of file ppl.yy.c.

3736 {
3737  free( (char *) ptr ); /* see ppy_realloc() for (char *) cast */
3738 }
#define free
Definition: debug_ros.c:5
static PVOID ptr
Definition: dispmode.c:27

Referenced by ppy__delete_buffer(), and ppy_lex_destroy().

◆ ppy_get_debug()

int ppy_get_debug ( void  )

Definition at line 3626 of file ppl.yy.c.

3627 {
3628  return ppy__flex_debug;
3629 }
int ppy__flex_debug
Definition: ppl.yy.c:1042

◆ ppy_get_extra()

YY_EXTRA_TYPE ppy_get_extra ( void  )

◆ ppy_get_in()

FILE * ppy_get_in ( void  )

Get the input stream.

Definition at line 3570 of file ppl.yy.c.

3571 {
3572  return ppy_in;
3573 }
FILE * ppy_in
Definition: ppl.yy.c:370

◆ ppy_get_leng()

int ppy_get_leng ( void  )

Get the length of the current token.

Definition at line 3586 of file ppl.yy.c.

3587 {
3588  return ppy_leng;
3589 }
int ppy_leng
Definition: ppl.yy.c:308

◆ ppy_get_lineno()

int ppy_get_lineno ( void  )

Get the current line number.

Definition at line 3561 of file ppl.yy.c.

3562 {
3563 
3564  return ppy_lineno;
3565 }
int ppy_lineno
Definition: ppl.yy.c:376

◆ ppy_get_out()

FILE * ppy_get_out ( void  )

Get the output stream.

Definition at line 3578 of file ppl.yy.c.

3579 {
3580  return ppy_out;
3581 }
FILE * ppy_out
Definition: ppl.yy.c:370

◆ ppy_get_text()

char * ppy_get_text ( void  )

Get the current token.

Definition at line 3595 of file ppl.yy.c.

3596 {
3597  return ppy_text;
3598 }
char * ppy_text
Definition: ppl.yy.c:1051

◆ ppy_lex()

int ppy_lex ( void  )

◆ ppy_lex_destroy()

int ppy_lex_destroy ( void  )

Definition at line 3669 of file ppl.yy.c.

3670 {
3671 
3672  /* Pop the buffer stack, destroying each element. */
3673  while(YY_CURRENT_BUFFER){
3677  }
3678 
3679  /* Destroy the stack itself. */
3681  (yy_buffer_stack) = NULL;
3682 
3683  /* Destroy the start condition stack. */
3685  (yy_start_stack) = NULL;
3686 
3687  /* Reset the globals. This is important in a non-reentrant scanner so the next time
3688  * ppy_lex() is called, initialization will occur. */
3689  yy_init_globals( );
3690 
3691  return 0;
3692 }
void ppy__delete_buffer(YY_BUFFER_STATE b)
Definition: ppl.yy.c:3238
void ppy_pop_buffer_state(void)
Definition: ppl.yy.c:3344
static YY_BUFFER_STATE * yy_buffer_stack
Definition: ppl.yy.c:288
smooth NULL
Definition: ftsmooth.c:416
#define YY_CURRENT_BUFFER
Definition: ppl.yy.c:296
static int yy_init_globals(void)
Definition: ppl.yy.c:3636
void ppy_free(void *)
Definition: ppl.yy.c:3735
#define YY_CURRENT_BUFFER_LVALUE
Definition: ppl.yy.c:303
static int * yy_start_stack
Definition: ppl.yy.c:1501

◆ ppy_pop_buffer_state()

void ppy_pop_buffer_state ( void  )

Removes and deletes the top of the stack, if present. The next element becomes the new top.

Definition at line 3344 of file ppl.yy.c.

3345 {
3346  if (!YY_CURRENT_BUFFER)
3347  return;
3348 
3351  if ((yy_buffer_stack_top) > 0)
3352  --(yy_buffer_stack_top);
3353 
3354  if (YY_CURRENT_BUFFER) {
3357  }
3358 }
void ppy__delete_buffer(YY_BUFFER_STATE b)
Definition: ppl.yy.c:3238
static void ppy__load_buffer_state(void)
Definition: ppl.yy.c:3196
static int yy_did_buffer_switch_on_eof
Definition: ppl.yy.c:318
smooth NULL
Definition: ftsmooth.c:416
#define YY_CURRENT_BUFFER
Definition: ppl.yy.c:296
static size_t yy_buffer_stack_top
Definition: ppl.yy.c:286
#define YY_CURRENT_BUFFER_LVALUE
Definition: ppl.yy.c:303

Referenced by ppy_lex_destroy().

◆ ppy_push_buffer_state()

void ppy_push_buffer_state ( YY_BUFFER_STATE  new_buffer)

Pushes the new state onto the stack. The new state becomes the current state. This function will allocate the stack if necessary.

Parameters
new_bufferThe new state.

Definition at line 3314 of file ppl.yy.c.

3315 {
3316  if (new_buffer == NULL)
3317  return;
3318 
3320 
3321  /* This block is copied from ppy__switch_to_buffer. */
3322  if ( YY_CURRENT_BUFFER )
3323  {
3324  /* Flush out information for old buffer. */
3325  *(yy_c_buf_p) = (yy_hold_char);
3326  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
3327  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3328  }
3329 
3330  /* Only push if top exists. Otherwise, replace top. */
3331  if (YY_CURRENT_BUFFER)
3332  (yy_buffer_stack_top)++;
3333  YY_CURRENT_BUFFER_LVALUE = new_buffer;
3334 
3335  /* copied from ppy__switch_to_buffer. */
3338 }
static void ppy__load_buffer_state(void)
Definition: ppl.yy.c:3196
static int yy_n_chars
Definition: ppl.yy.c:307
static int yy_did_buffer_switch_on_eof
Definition: ppl.yy.c:318
smooth NULL
Definition: ftsmooth.c:416
#define YY_CURRENT_BUFFER
Definition: ppl.yy.c:296
static size_t yy_buffer_stack_top
Definition: ppl.yy.c:286
static char yy_hold_char
Definition: ppl.yy.c:306
#define YY_CURRENT_BUFFER_LVALUE
Definition: ppl.yy.c:303
static void ppy_ensure_buffer_stack(void)
Definition: ppl.yy.c:3363
static char * yy_c_buf_p
Definition: ppl.yy.c:311

◆ ppy_realloc()

void * ppy_realloc ( void ptr,
yy_size_t  size 
)

Definition at line 3723 of file ppl.yy.c.

3724 {
3725  /* The cast to (char *) in the following accommodates both
3726  * implementations that use char* generic pointers, and those
3727  * that use void* generic pointers. It works with the latter
3728  * because both ANSI C and C++ allow castless assignment from
3729  * any pointer type to void*, and deal with argument conversions
3730  * as though doing an assignment.
3731  */
3732  return (void *) realloc( (char *) ptr, size );
3733 }
#define realloc
Definition: debug_ros.c:6
static PVOID ptr
Definition: dispmode.c:27
GLsizeiptr size
Definition: glext.h:5919

Referenced by ppy_ensure_buffer_stack(), yy_get_next_buffer(), and yy_push_state().

◆ ppy_restart()

void ppy_restart ( FILE input_file)

Immediately switch to a different input stream.

Parameters
input_fileA readable stream.
Note
This function does not reset the start condition to INITIAL .

Definition at line 3148 of file ppl.yy.c.

3149 {
3150 
3151  if ( ! YY_CURRENT_BUFFER ){
3155  }
3156 
3157  ppy__init_buffer(YY_CURRENT_BUFFER,input_file );
3159 }
static void ppy__init_buffer(YY_BUFFER_STATE b, FILE *file)
Definition: ppl.yy.c:3257
static void ppy__load_buffer_state(void)
Definition: ppl.yy.c:3196
#define YY_BUF_SIZE
Definition: ppl.yy.c:176
FILE * ppy_in
Definition: ppl.yy.c:370
#define YY_CURRENT_BUFFER
Definition: ppl.yy.c:296
YY_BUFFER_STATE ppy__create_buffer(FILE *file, int size)
Definition: ppl.yy.c:3210
#define YY_CURRENT_BUFFER_LVALUE
Definition: ppl.yy.c:303
static void ppy_ensure_buffer_stack(void)
Definition: ppl.yy.c:3363

Referenced by yy_get_next_buffer().

◆ ppy_set_debug()

void ppy_set_debug ( int  debug_flag)

Definition at line 3631 of file ppl.yy.c.

3632 {
3633  ppy__flex_debug = bdebug ;
3634 }
int ppy__flex_debug
Definition: ppl.yy.c:1042

◆ ppy_set_extra()

void ppy_set_extra ( YY_EXTRA_TYPE  user_defined)

◆ ppy_set_in()

void ppy_set_in ( FILE in_str)

Set the input stream. This does not discard the current input buffer.

Parameters
in_strA readable stream.
See also
ppy__switch_to_buffer

Definition at line 3616 of file ppl.yy.c.

3617 {
3618  ppy_in = in_str ;
3619 }
FILE * ppy_in
Definition: ppl.yy.c:370

◆ ppy_set_lineno()

void ppy_set_lineno ( int  line_number)

Set the current line number.

Parameters
line_number

Definition at line 3604 of file ppl.yy.c.

3605 {
3606 
3608 }
int line_number
Definition: parser.yy.c:775
int ppy_lineno
Definition: ppl.yy.c:376

◆ ppy_set_out()

void ppy_set_out ( FILE out_str)

Definition at line 3621 of file ppl.yy.c.

3622 {
3623  ppy_out = out_str ;
3624 }
FILE * ppy_out
Definition: ppl.yy.c:370

◆ ppy_wrap()

int ppy_wrap ( void  )

Definition at line 3752 of file ppl.yy.c.

3753 {
3754  return 1;
3755 }

Referenced by while().

◆ push_buffer()

static void push_buffer ( pp_entry_t ppp,
char filename,
char incname,
int  pop 
)
static

Definition at line 4246 of file ppl.yy.c.

4247 {
4248  if(ppy_debug)
4249  printf("push_buffer(%d): %p %p %p %d\n", bufferstackidx, ppp, filename, incname, pop);
4251  pp_internal_error(__FILE__, __LINE__, "Buffer stack overflow");
4252 
4253  memset(&bufferstack[bufferstackidx], 0, sizeof(bufferstack[0]));
4265 
4266  if(ppp)
4267  ppp->expanding = 1;
4268  else if(filename)
4269  {
4270  /* These will track the ppy_error to the correct file and line */
4271  pp_status.line_number = 1;
4272  pp_status.char_number = 1;
4274  ncontinuations = 0;
4275  }
4276  else if(!pop)
4277  pp_internal_error(__FILE__, __LINE__, "Pushing buffer without knowing where to go to");
4278  bufferstackidx++;
4279 }
int ppy_debug
Definition: wpp.c:31
static bufferstackentry_t bufferstack[MAXBUFFERSTACK]
Definition: ppl.yy.c:1328
void pp_internal_error(const char *file, int line, const char *s,...)
Definition: preproc.c:754
int line_number
Definition: wpp_private.h:233
int pp_get_if_depth(void)
Definition: preproc.c:681
const char * filename
Definition: ioapi.h:135
static calc_node_t * pop(void)
Definition: rpn_ieee.c:90
char * filename
Definition: ppl.yy.c:1254
int expanding
Definition: wpp_private.h:98
char * input
Definition: wpp_private.h:231
include_state_t incl
Definition: ppl.yy.c:1259
char * include_filename
Definition: ppl.yy.c:1260
int char_number
Definition: wpp_private.h:234
include_state_t pp_incl_state
Definition: ppl.yy.c:1334
#define YY_CURRENT_BUFFER
Definition: ppl.yy.c:296
void * file
Definition: wpp_private.h:232
#define MAXBUFFERSTACK
Definition: ppl.yy.c:1246
pp_entry_t * define
Definition: ppl.yy.c:1251
static int ncontinuations
Definition: ppl.yy.c:1318
void * filehandle
Definition: ppl.yy.c:1250
static int bufferstackidx
Definition: ppl.yy.c:1329
YY_BUFFER_STATE bufferstate
Definition: ppl.yy.c:1249
#define memset(x, y, z)
Definition: compat.h:39
int ncontinuations
Definition: ppl.yy.c:1256
#define printf
Definition: config.h:203

Referenced by expand_define(), expand_macro(), expand_special(), macro_add_arg(), and pp_do_include().

◆ push_macro()

static void push_macro ( pp_entry_t ppp)
static

Definition at line 4373 of file ppl.yy.c.

4374 {
4376  {
4377  ppy_error("Too many nested macros");
4378  return;
4379  }
4380 
4383  return;
4384  memset( macexpstack[macexpstackidx], 0, sizeof(macexpstack[0][0]));
4385  macexpstack[macexpstackidx]->ppp = ppp;
4386  macexpstackidx++;
4387 }
static macexpstackentry_t * macexpstack[MAXMACEXPSTACK]
Definition: ppl.yy.c:1325
void * pp_xmalloc(size_t size)
Definition: preproc.c:77
int ppy_error(const char *s,...)
Definition: preproc.c:735
static int macexpstackidx
Definition: ppl.yy.c:1326
pp_entry_t * ppp
Definition: ppl.yy.c:1274
#define MAXMACEXPSTACK
Definition: ppl.yy.c:1271
#define memset(x, y, z)
Definition: compat.h:39

Referenced by while().

◆ put_buffer()

static void put_buffer ( const char s,
int  len 
)
static

Definition at line 4515 of file ppl.yy.c.

4516 {
4517  if(top_macro())
4519  else
4520  wpp_callbacks->write(s, len);
4521 }
static void add_text_to_macro(const char *text, int len)
Definition: ppl.yy.c:4413
GLenum GLsizei len
Definition: glext.h:6722
GLdouble s
Definition: gl.h:2039
void(* write)(const char *buffer, unsigned int len)
Definition: wpp.h:44
static macexpstackentry_t * top_macro(void)
Definition: ppl.yy.c:4389

Referenced by emit_bits_e(), emit_bits_s(), newline(), put_string(), and while().

◆ put_string()

static void put_string ( void  )
static

Definition at line 4227 of file ppl.yy.c.

4228 {
4230 #ifdef DEBUG
4231  strbuf_idx = 0;
4232 #endif
4233 }
static int strbuf_idx
Definition: ppl.yy.c:1320
static char * strbuffer
Definition: ppl.yy.c:1322
static void put_buffer(const char *s, int len)
Definition: ppl.yy.c:4515

Referenced by while().

◆ string_start()

static int string_start ( void  )
static

Definition at line 4235 of file ppl.yy.c.

4236 {
4237  return str_startline;
4238 }
static int str_startline
Definition: ppl.yy.c:1323

Referenced by while().

◆ top_macro()

static macexpstackentry_t * top_macro ( void  )
static

Definition at line 4389 of file ppl.yy.c.

4390 {
4391  return macexpstackidx > 0 ? macexpstack[macexpstackidx-1] : NULL;
4392 }
static macexpstackentry_t * macexpstack[MAXMACEXPSTACK]
Definition: ppl.yy.c:1325
smooth NULL
Definition: ftsmooth.c:416
static int macexpstackidx
Definition: ppl.yy.c:1326

Referenced by add_text_to_macro(), macro_add_arg(), macro_add_expansion(), and put_buffer().

◆ while()

while ( )

Definition at line 1662 of file ppl.yy.c.

1663  {
1664  yy_cp = (yy_c_buf_p);
1665 
1666  /* Support of ppy_text. */
1667  *yy_cp = (yy_hold_char);
1668 
1669  /* yy_bp points to the position in yy_ch_buf of the start of
1670  * the current run.
1671  */
1672  yy_bp = yy_cp;
1673 
1676 yy_match:
1677  do
1678  {
1679  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1680  if ( yy_accept[yy_current_state] )
1681  {
1684  }
1685  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1686  {
1688  if ( yy_current_state >= 416 )
1689  yy_c = yy_meta[(unsigned int) yy_c];
1690  }
1691  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1692  ++yy_cp;
1693  }
1694  while ( yy_current_state != 415 );
1697 
1698 yy_find_action:
1700 
1702 
1703 do_action: /* This label is used only to access EOF actions. */
1704 
1705  switch ( yy_act )
1706  { /* beginning of action switch */
1707  case 0: /* must back up */
1708  /* undo the effects of YY_DO_BEFORE_ACTION */
1709  *yy_cp = (yy_hold_char);
1712  goto yy_find_action;
1713 
1714 case 1:
1716 #line 379 "ppl.l"
1718  YY_BREAK
1719 /*
1720  * Scan for the preprocessor directives
1721  */
1722 case 2:
1724 #line 384 "ppl.l"
1725 if(yy_top_state() != pp_ignore) {yy_pp_state(pp_inc); return tINCLUDE;} else {yy_pp_state(pp_eol);}
1726  YY_BREAK
1727 case 3:
1729 #line 385 "ppl.l"
1731  YY_BREAK
1732 case 4:
1734 #line 386 "ppl.l"
1735 yy_pp_state(pp_eol); if(yy_top_state() != pp_ignore) return tERROR;
1736  YY_BREAK
1737 case 5:
1739 #line 387 "ppl.l"
1741  YY_BREAK
1742 case 6:
1744 #line 388 "ppl.l"
1745 yy_pp_state(pp_eol); if(yy_top_state() != pp_ignore) return tPRAGMA;
1746  YY_BREAK
1747 case 7:
1749 #line 389 "ppl.l"
1751  YY_BREAK
1752 case 8:
1754 #line 390 "ppl.l"
1755 if(yy_top_state() != pp_ignore) {yy_pp_state(pp_ifd); return tUNDEF;} else {yy_pp_state(pp_eol);}
1756  YY_BREAK
1757 case 9:
1759 #line 391 "ppl.l"
1760 yy_pp_state(pp_ifd); return tIFDEF;
1761  YY_BREAK
1762 case 10:
1764 #line 392 "ppl.l"
1766  YY_BREAK
1767 case 11:
1769 #line 393 "ppl.l"
1770 yy_pp_state(pp_if); return tIF;
1771  YY_BREAK
1772 case 12:
1774 #line 394 "ppl.l"
1775 yy_pp_state(pp_if); return tELIF;
1776  YY_BREAK
1777 case 13:
1779 #line 395 "ppl.l"
1780 yy_pp_state(pp_endif); return tELSE;
1781  YY_BREAK
1782 case 14:
1784 #line 396 "ppl.l"
1785 yy_pp_state(pp_endif); return tENDIF;
1786  YY_BREAK
1787 case 15:
1789 #line 397 "ppl.l"
1790 if(yy_top_state() != pp_ignore) {yy_pp_state(pp_line); return tLINE;} else {yy_pp_state(pp_eol);}
1791  YY_BREAK
1792 case 16:
1794 #line 398 "ppl.l"
1795 if(yy_top_state() != pp_ignore) {yy_pp_state(pp_line); return tGCCLINE;} else {yy_pp_state(pp_eol);}
1796  YY_BREAK
1797 case 17:
1799 #line 399 "ppl.l"
1800 ppy_error("Invalid preprocessor token '%s'", ppy_text);
1801  YY_BREAK
1802 case 18:
1803 /* rule 18 can match eol */
1805 #line 400 "ppl.l"
1806 newline(1); yy_pop_state(); return tNL; /* This could be the null-token */
1807  YY_BREAK
1808 case 19:
1809 /* rule 19 can match eol */
1811 #line 401 "ppl.l"
1812 newline(0);
1813  YY_BREAK
1814 case 20:
1816 #line 402 "ppl.l"
1817 ppy_error("Preprocessor junk '%s'", ppy_text);
1818  YY_BREAK
1819 case 21:
1821 #line 403 "ppl.l"
1822 return *ppy_text;
1823  YY_BREAK
1824 /*
1825  * Handle #include and #line
1826  */
1827 case 22:
1829 #line 408 "ppl.l"
1830 return make_number(10, &ppy_lval, ppy_text, ppy_leng);
1831  YY_BREAK
1832 case 23:
1834 #line 409 "ppl.l"
1836  YY_BREAK
1837 case 24:
1839 #line 410 "ppl.l"
1841  YY_BREAK
1842 case 25:
1844 #line 411 "ppl.l"
1845 ;
1846  YY_BREAK
1847 case 26:
1848 /* rule 26 can match eol */
1850 #line 412 "ppl.l"
1851 newline(1); yy_pop_state(); return tNL;
1852  YY_BREAK
1853 case 27:
1854 /* rule 27 can match eol */
1856 #line 413 "ppl.l"
1857 newline(0);
1858  YY_BREAK
1859 case 28:
1861 #line 414 "ppl.l"
1862 ppy_error(yy_current_state() == pp_inc ? "Trailing junk in #include" : "Trailing junk in #line");
1863  YY_BREAK
1864 /*
1865  * Ignore all input when a false clause is parsed
1866  */
1867 case 29:
1869 #line 419 "ppl.l"
1870 ;
1871  YY_BREAK
1872 case 30:
1873 /* rule 30 can match eol */
1875 #line 420 "ppl.l"
1876 newline(1);
1877  YY_BREAK
1878 case 31:
1879 /* rule 31 can match eol */
1881 #line 421 "ppl.l"
1882 newline(0);
1883  YY_BREAK
1884 case 32:
1886 #line 422 "ppl.l"
1887 ;
1888  YY_BREAK
1889 /*
1890  * Handle #if and #elif.
1891  * These require conditionals to be evaluated, but we do not
1892  * want to jam the scanner normally when we see these tokens.
1893  * Note: tIDENT is handled below.
1894  */
1895 case 33:
1897 #line 431 "ppl.l"
1898 return make_number(8, &ppy_lval, ppy_text, ppy_leng);
1899  YY_BREAK
1900 case 34:
1902 #line 432 "ppl.l"
1903 ppy_error("Invalid octal digit");
1904  YY_BREAK
1905 case 35:
1907 #line 433 "ppl.l"
1908 return make_number(10, &ppy_lval, ppy_text, ppy_leng);
1909  YY_BREAK
1910 case 36:
1912 #line 434 "ppl.l"
1913 return make_number(16, &ppy_lval, ppy_text, ppy_leng);
1914  YY_BREAK
1915 case 37:
1917 #line 435 "ppl.l"
1918 ppy_error("Invalid hex number");
1919  YY_BREAK
1920 case 38:
1922 #line 436 "ppl.l"
1924  YY_BREAK
1925 case 39:
1927 #line 437 "ppl.l"
1928 return tLSHIFT;
1929  YY_BREAK
1930 case 40:
1932 #line 438 "ppl.l"
1933 return tRSHIFT;
1934  YY_BREAK
1935 case 41:
1937 #line 439 "ppl.l"
1938 return tLOGAND;
1939  YY_BREAK
1940 case 42:
1942 #line 440 "ppl.l"
1943 return tLOGOR;
1944  YY_BREAK
1945 case 43:
1947 #line 441 "ppl.l"
1948 return tEQ;
1949  YY_BREAK
1950 case 44:
1952 #line 442 "ppl.l"
1953 return tNE;
1954  YY_BREAK
1955 case 45:
1957 #line 443 "ppl.l"
1958 return tLTE;
1959  YY_BREAK
1960 case 46:
1962 #line 444 "ppl.l"
1963 return tGTE;
1964  YY_BREAK
1965 case 47:
1966 /* rule 47 can match eol */
1968 #line 445 "ppl.l"
1969 newline(1); yy_pop_state(); return tNL;
1970  YY_BREAK
1971 case 48:
1972 /* rule 48 can match eol */
1974 #line 446 "ppl.l"
1975 newline(0);
1976  YY_BREAK
1977 case 49:
1979 #line 447 "ppl.l"
1980 ppy_error("Junk in conditional expression");
1981  YY_BREAK
1982 case 50:
1984 #line 448 "ppl.l"
1985 ;
1986  YY_BREAK
1987 case 51:
1989 #line 449 "ppl.l"
1991  YY_BREAK
1992 case 52:
1994 #line 450 "ppl.l"
1995 ppy_error("String constants not allowed in conditionals");
1996  YY_BREAK
1997 case 53:
1999 #line 451 "ppl.l"
2000 return *ppy_text;
2001  YY_BREAK
2002 /*
2003  * Handle #ifdef, #ifndef and #undef
2004  * to get only an untranslated/unexpanded identifier
2005  */
2006 case 54:
2008 #line 457 "ppl.l"
2010  YY_BREAK
2011 case 55:
2013 #line 458 "ppl.l"
2014 ;
2015  YY_BREAK
2016 case 56:
2017 /* rule 56 can match eol */
2019 #line 459 "ppl.l"
2020 newline(1); yy_pop_state(); return tNL;
2021  YY_BREAK
2022 case 57:
2023 /* rule 57 can match eol */
2025 #line 460 "ppl.l"
2026 newline(0);
2027  YY_BREAK
2028 case 58:
2030 #line 461 "ppl.l"
2031 ppy_error("Identifier expected");
2032  YY_BREAK
2033 /*
2034  * Handle #else and #endif.
2035  */
2036 case 59:
2038 #line 466 "ppl.l"
2039 ;
2040  YY_BREAK
2041 case 60:
2042 /* rule 60 can match eol */
2044 #line 467 "ppl.l"
2045 newline(1); yy_pop_state(); return tNL;
2046  YY_BREAK
2047 case 61:
2048 /* rule 61 can match eol */
2050 #line 468 "ppl.l"
2051 newline(0);
2052  YY_BREAK
2053 case 62:
2055 #line 469 "ppl.l"
2056 ppy_error("Garbage after #else or #endif.");
2057  YY_BREAK
2058 /*
2059  * Handle the special 'defined' keyword.
2060  * This is necessary to get the identifier prior to any
2061  * substitutions.
2062  */
2063 case 63:
2065 #line 476 "ppl.l"
2067  YY_BREAK
2068 case 64:
2070 #line 477 "ppl.l"
2071 ;
2072  YY_BREAK
2073 case 65:
2075 #line 478 "ppl.l"
2076 return *ppy_text;
2077  YY_BREAK
2078 case 66:
2079 /* rule 66 can match eol */
2081 #line 479 "ppl.l"
2082 newline(0);
2083  YY_BREAK
2084 case 67:
2085 /* rule 67 can match eol */
2087 #line 480 "ppl.l"
2088 ppy_error("Identifier expected");
2089  YY_BREAK
2090 /*
2091  * Handle #error, #warning, #pragma and #ident.
2092  * Pass everything literally to the parser, which
2093  * will act appropriately.
2094  * Comments are stripped from the literal text.
2095  */
2096 case 68:
2098 #line 488 "ppl.l"
2100  YY_BREAK
2101 case 69:
2103 #line 489 "ppl.l"
2105  YY_BREAK
2106 case 70:
2107 /* rule 70 can match eol */
2109 #line 490 "ppl.l"
2111  YY_BREAK
2112 case 71:
2113 /* rule 71 can match eol */
2115 #line 491 "ppl.l"
2116 newline(1); yy_pop_state(); if(yy_current_state() != pp_ignore) { return tNL; }
2117  YY_BREAK
2118 case 72:
2119 /* rule 72 can match eol */
2121 #line 492 "ppl.l"
2122 newline(0);
2123  YY_BREAK
2124 /*
2125  * Handle left side of #define
2126  */
2127 case 73:
2129 #line 497 "ppl.l"
2131  YY_BREAK
2132 case 74:
2134 #line 498 "ppl.l"
2136  YY_BREAK
2137 case 75:
2139 #line 499 "ppl.l"
2140 ;
2141  YY_BREAK
2142 case 76:
2143 /* rule 76 can match eol */
2145 #line 500 "ppl.l"
2146 newline(0);
2147  YY_BREAK
2148 case 77:
2149 /* rule 77 can match eol */
2151 #line 501 "ppl.l"
2152 perror("Identifier expected");
2153  YY_BREAK
2154 /*
2155  * Scan the substitution of a define
2156  */
2157 case 78:
2159 #line 506 "ppl.l"
2161  YY_BREAK
2162 case 79:
2163 /* rule 79 can match eol */
2165 #line 507 "ppl.l"
2167  YY_BREAK
2168 case 80:
2169 /* rule 80 can match eol */
2171 #line 508 "ppl.l"
2172 newline(0); ppy_lval.cptr = pp_xstrdup(" "); return tLITERAL;
2173  YY_BREAK
2174 case 81:
2175 /* rule 81 can match eol */
2177 #line 509 "ppl.l"
2178 newline(0);
2179  YY_BREAK
2180 case 82:
2181 /* rule 82 can match eol */
2183 #line 510 "ppl.l"
2184 newline(1); yy_pop_state(); return tNL;
2185  YY_BREAK
2186 case 83:
2188 #line 511 "ppl.l"
2190  YY_BREAK
2191 case 84:
2193 #line 512 "ppl.l"
2195  YY_BREAK
2196 /*
2197  * Scan the definition macro arguments
2198  */
2199 case 85:
2201 #line 517 "ppl.l"
2202 yy_pp_state(pp_mbody); return tMACROEND;
2203  YY_BREAK
2204 case 86:
2206 #line 518 "ppl.l"
2207 ;
2208  YY_BREAK
2209 case 87:
2211 #line 519 "ppl.l"
2213  YY_BREAK
2214 case 88:
2216 #line 520 "ppl.l"
2217 return ',';
2218  YY_BREAK
2219 case 89:
2221 #line 521 "ppl.l"
2222 return tELIPSIS;
2223  YY_BREAK
2224 case 90:
2225 /* rule 90 can match eol */
2227 #line 522 "ppl.l"
2228 ppy_error("Argument identifier expected");
2229  YY_BREAK
2230 case 91:
2231 /* rule 91 can match eol */
2233 #line 523 "ppl.l"
2234 newline(0);
2235  YY_BREAK
2236 /*
2237  * Scan the substitution of a macro
2238  */
2239 case 92:
2241 #line 528 "ppl.l"
2243  YY_BREAK
2244 case 93:
2246 #line 529 "ppl.l"
2248  YY_BREAK
2249 case 94:
2251 #line 530 "ppl.l"
2252 return tCONCAT;
2253  YY_BREAK
2254 case 95:
2256 #line 531 "ppl.l"
2257 return tSTRINGIZE;
2258  YY_BREAK
2259 case 96:
2261 #line 532 "ppl.l"
2263  YY_BREAK
2264 case 97:
2266 #line 533 "ppl.l"
2268  YY_BREAK
2269 case 98:
2270 /* rule 98 can match eol */
2272 #line 534 "ppl.l"
2273 newline(0); ppy_lval.cptr = pp_xstrdup(" "); return tLITERAL;
2274  YY_BREAK
2275 case 99:
2276 /* rule 99 can match eol */
2278 #line 535 "ppl.l"
2279 newline(0);
2280  YY_BREAK
2281 case 100:
2282 /* rule 100 can match eol */
2284 #line 536 "ppl.l"
2285 newline(1); yy_pop_state(); return tNL;
2286  YY_BREAK
2287 case 101:
2289 #line 537 "ppl.l"
2291  YY_BREAK
2292 case 102:
2294 #line 538 "ppl.l"
2296  YY_BREAK
2297 /*
2298  * Macro expansion text scanning.
2299  * This state is active just after the identifier is scanned
2300  * that triggers an expansion. We *must* delete the leading
2301  * whitespace before we can start scanning for arguments.
2302  *
2303  * If we do not see a '(' as next trailing token, then we have
2304  * a false alarm. We just continue with a nose-bleed...
2305  */
2306 case 103:
2307 *yy_cp = (yy_hold_char); /* undo effects of setting up ppy_text */
2308 (yy_c_buf_p) = yy_cp -= 1;
2309 YY_DO_BEFORE_ACTION; /* set up ppy_text again */
2311 #line 549 "ppl.l"
2313  YY_BREAK
2314 case 104:
2315 /* rule 104 can match eol */
2317 #line 550 "ppl.l"
2318 {
2319  if(yy_top_state() != pp_macscan)
2320  newline(0);
2321  }
2322  YY_BREAK
2323 case 105:
2324 /* rule 105 can match eol */
2326 #line 554 "ppl.l"
2327 newline(0);
2328  YY_BREAK
2329 case 106:
2331 #line 555 "ppl.l"
2332 {
2333  macexpstackentry_t *mac = pop_macro();
2334  yy_pop_state();
2335  put_buffer(mac->ppp->ident, strlen(mac->ppp->ident));
2337  free_macro(mac);
2338  }
2339  YY_BREAK
2340 /*
2341  * Macro expansion argument text scanning.
2342  * This state is active when a macro's arguments are being read for expansion.
2343  */
2344 case 107:
2346 #line 567 "ppl.l"
2347 {
2348  if(++MACROPARENTHESES() > 1)
2350  }
2351  YY_BREAK
2352 case 108:
2354 #line 571 "ppl.l"
2355 {
2356  if(--MACROPARENTHESES() == 0)
2357  {
2358  yy_pop_state();
2359  macro_add_arg(1);
2360  }
2361  else
2363  }
2364  YY_BREAK
2365 case 109:
2367 #line 580 "ppl.l"
2368 {
2369  if(MACROPARENTHESES() > 1)
2371  else
2372  macro_add_arg(0);
2373  }
2374  YY_BREAK
2375 case 110:
2377 #line 586 "ppl.l"
2379  YY_BREAK
2380 case 111:
2382 #line 587 "ppl.l"
2384  YY_BREAK
2385 case 112:
2387 #line 588 "ppl.l"
2389  YY_BREAK
2390 case 113:
2391 /* rule 113 can match eol */
2393 #line 589 "ppl.l"
2395  YY_BREAK
2396 case 114:
2398 #line 590 "ppl.l"
2400  YY_BREAK
2401 case 115:
2402 /* rule 115 can match eol */
2404 #line 591 "ppl.l"
2405 newline(0);
2406  YY_BREAK
2407 /*
2408  * Comment handling (almost all start-conditions)
2409  */
2410 case 116:
2412 #line 596 "ppl.l"
2414  YY_BREAK
2415 case 117:
2417 #line 597 "ppl.l"
2418 ;
2419  YY_BREAK
2420 case 118:
2421 /* rule 118 can match eol */
2423 #line 598 "ppl.l"
2424 newline(0);
2425  YY_BREAK
2426 case 119:
2428 #line 599 "ppl.l"
2429 yy_pop_state();
2430  YY_BREAK
2431 /*
2432  * Remove C++ style comment (almost all start-conditions)
2433  */
2434 case 120:
2436 #line 604 "ppl.l"
2437 {
2438  if(ppy_text[ppy_leng-1] == '\\')
2439  ppy_warning("C++ style comment ends with an escaped newline (escape ignored)");
2440  }
2441  YY_BREAK
2442 /*
2443  * Single, double and <> quoted constants
2444  */
2445 case 121:
2447 #line 612 "ppl.l"
2449  YY_BREAK
2450 case 122:
2452 #line 613 "ppl.l"
2454  YY_BREAK
2455 case 123:
2457 #line 614 "ppl.l"
2459  YY_BREAK
2460 case 124:
2462 #line 615 "ppl.l"
2463 {
2465  yy_pop_state();
2466  switch(yy_current_state())
2467  {
2468  case pp_pp:
2469  case pp_define:
2470  case pp_mbody:
2471  case pp_inc:
2472  case RCINCL:
2474  ppy_lval.cptr = get_string();
2475  return tDQSTRING;
2476  case pp_line:
2477  ppy_lval.cptr = get_string();
2478  return tDQSTRING;
2479  default:
2480  put_string();
2481  }
2482  }
2483  YY_BREAK
2484 case 125:
2486 #line 635 "ppl.l"
2488  YY_BREAK
2489 case 126:
2491 #line 636 "ppl.l"
2492 {
2494  yy_pop_state();
2495  switch(yy_current_state())
2496  {
2497  case pp_if:
2498  case pp_define:
2499  case pp_mbody:
2500  ppy_lval.cptr = get_string();
2501  return tSQSTRING;
2502  default:
2503  put_string();
2504  }
2505  }
2506  YY_BREAK
2507 case 127:
2509 #line 650 "ppl.l"
2511  YY_BREAK
2512 case 128:
2514 #line 651 "ppl.l"
2515 {
2517  yy_pop_state();
2518  ppy_lval.cptr = get_string();
2519  return tIQSTRING;
2520  }
2521  YY_BREAK
2522 case 129:
2523 /* rule 129 can match eol */
2525 #line 657 "ppl.l"
2526 {
2527  /*
2528  * This is tricky; we need to remove the line-continuation
2529  * from preprocessor strings, but OTOH retain them in all
2530  * other strings. This is because the resource grammar is
2531  * even more braindead than initially analysed and line-
2532  * continuations in strings introduce, sigh, newlines in
2533  * the output. There goes the concept of non-breaking, non-
2534  * spacing whitespace.
2535  */
2536  switch(yy_top_state())
2537  {
2538  case pp_pp:
2539  case pp_define:
2540  case pp_mbody:
2541  case pp_inc:
2542  case pp_line:
2543  newline(0);
2544  break;
2545  default:
2547  newline(-1);
2548  }
2549  }
2550  YY_BREAK
2551 case 130:
2553 #line 681 "ppl.l"
2555  YY_BREAK
2556 case 131:
2557 /* rule 131 can match eol */
2559 #line 682 "ppl.l"
2560 {
2561  newline(1);
2563  ppy_warning("Newline in string constant encountered (started line %d)", string_start());
2564  }
2565  YY_BREAK
2566 /*
2567  * Identifier scanning
2568  */
2569 case 132:
2571 #line 691 "ppl.l"
2572 {
2573  pp_entry_t *ppp;
2575  if(!(ppp = pplookup(ppy_text)))
2576  {
2577  if(yy_current_state() == pp_inc)
2578  ppy_error("Expected include filename");
2579 
2580  else if(yy_current_state() == pp_if)
2581  {
2583  return tIDENT;
2584  }
2585  else {
2586  if((yy_current_state()==INITIAL) && (strcasecmp(ppy_text,"RCINCLUDE")==0)){
2588  return tRCINCLUDE;
2589  }
2590  else put_buffer(ppy_text, ppy_leng);
2591  }
2592  }
2593  else if(!ppp->expanding)
2594  {
2595  switch(ppp->type)
2596  {
2597  case def_special:
2598  expand_special(ppp);
2599  break;
2600  case def_define:
2601  expand_define(ppp);
2602  break;
2603  case def_macro:
2605  push_macro(ppp);
2606  break;
2607  default:
2608  pp_internal_error(__FILE__, __LINE__, "Invalid define type %d\n", ppp->type);
2609  }
2610  }
2611  else put_buffer(ppy_text, ppy_leng);
2612  }
2613  YY_BREAK
2614 /*
2615  * Everything else that needs to be passed and
2616  * newline and continuation handling
2617  */
2618 case 133:
2620 #line 737 "ppl.l"
2622  YY_BREAK
2623 case 134:
2625 #line 738 "ppl.l"
2627  YY_BREAK
2628 case 135:
2629 /* rule 135 can match eol */
2631 #line 739 "ppl.l"
2632 newline(1);
2633  YY_BREAK
2634 case 136:
2635 /* rule 136 can match eol */
2637 #line 740 "ppl.l"
2638 newline(0);
2639  YY_BREAK
2640 case 137:
2642 #line 741 "ppl.l"
2644  YY_BREAK
2645 /*
2646  * Special catcher for macro argmument expansion to prevent
2647  * newlines to propagate to the output or admin.
2648  */
2649 case 138:
2650 /* rule 138 can match eol */
2652 #line 747 "ppl.l"
2654  YY_BREAK
2655 case 139:
2657 #line 749 "ppl.l"
2658 {
2660  yy_pop_state();
2661  return tRCINCLUDEPATH;
2662  }
2663  YY_BREAK
2664 case 140:
2666 #line 755 "ppl.l"
2667 ;
2668  YY_BREAK
2669 case 141:
2671 #line 757 "ppl.l"
2672 {
2674  }
2675  YY_BREAK
2676 /*
2677  * This is a 'catch-all' rule to discover errors in the scanner
2678  * in an orderly manner.
2679  */
2680 case 142:
2682 #line 765 "ppl.l"
2683 pp_incl_state.seen_junk++; ppy_warning("Unmatched text '%c' (0x%02x); please report\n", isprint(*ppy_text & 0xff) ? *ppy_text : ' ', *ppy_text);
2684  YY_BREAK
2685 case YY_STATE_EOF(INITIAL):
2686 case YY_STATE_EOF(pp_pp):
2687 case YY_STATE_EOF(pp_eol):
2688 case YY_STATE_EOF(pp_inc):
2689 case YY_STATE_EOF(pp_dqs):
2690 case YY_STATE_EOF(pp_sqs):
2691 case YY_STATE_EOF(pp_iqs):
2692 case YY_STATE_EOF(pp_comment):
2693 case YY_STATE_EOF(pp_def):
2694 case YY_STATE_EOF(pp_define):
2695 case YY_STATE_EOF(pp_macro):
2696 case YY_STATE_EOF(pp_mbody):
2697 case YY_STATE_EOF(pp_macign):
2698 case YY_STATE_EOF(pp_macscan):
2699 case YY_STATE_EOF(pp_macexp):
2700 case YY_STATE_EOF(pp_if):
2701 case YY_STATE_EOF(pp_ifd):
2702 case YY_STATE_EOF(pp_endif):
2703 case YY_STATE_EOF(pp_line):
2704 case YY_STATE_EOF(pp_defined):
2705 case YY_STATE_EOF(pp_ignore):
2706 case YY_STATE_EOF(RCINCL):
2707 #line 767 "ppl.l"
2708 {
2710  bufferstackentry_t *bep = pop_buffer();
2711 
2712  if((!bep && pp_get_if_depth()) || (bep && pp_get_if_depth() != bep->if_depth))
2713  ppy_warning("Unmatched #if/#endif at end of file");
2714 
2715  if(!bep)
2716  {
2717  if(YY_START != INITIAL)
2718  {
2719  ppy_error("Unexpected end of file during preprocessing");
2720  BEGIN(INITIAL);
2721  }
2722  yyterminate();
2723  }
2724  else if(bep->should_pop == 2)
2725  {
2726  macexpstackentry_t *mac;
2727  mac = pop_macro();
2728  expand_macro(mac);
2729  }
2731  }
2732  YY_BREAK
2733 case 143:
2735 #line 792 "ppl.l"
2736 ECHO;
2737  YY_BREAK
2738 #line 2739 "ppl.yy.c"
2739 
2740  case YY_END_OF_BUFFER:
2741  {
2742  /* Amount of text matched not including the EOB char. */
2743  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
2744 
2745  /* Undo the effects of YY_DO_BEFORE_ACTION. */
2746  *yy_cp = (yy_hold_char);
2748 
2749  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2750  {
2751  /* We're scanning a new file or input source. It's
2752  * possible that this happened because the user
2753  * just pointed ppy_in at a new source and called
2754  * ppy_lex(). If so, then we have to assure
2755  * consistency between YY_CURRENT_BUFFER and our
2756  * globals. Here is the right place to do so, because
2757  * this is the first action (other than possibly a
2758  * back-up) that will match for the new input source.
2759  */
2760  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2761  YY_CURRENT_BUFFER_LVALUE->yy_input_file = ppy_in;
2762  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2763  }
2764 
2765  /* Note that here we test for yy_c_buf_p "<=" to the position
2766  * of the first EOB in the buffer, since yy_c_buf_p will
2767  * already have been incremented past the NUL character
2768  * (since all states make transitions on EOB to the
2769  * end-of-buffer state). Contrast this with the test
2770  * in input().
2771  */
2772  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2773  { /* This was really a NUL. */
2774  yy_state_type yy_next_state;
2775 
2776  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
2777 
2779 
2780  /* Okay, we're now positioned to make the NUL
2781  * transition. We couldn't have
2782  * yy_get_previous_state() go ahead and do it
2783  * for us because it doesn't know how to deal
2784  * with the possibility of jamming (and we don't
2785  * want to build jamming into it because then it
2786  * will run more slowly).
2787  */
2788 
2789  yy_next_state = yy_try_NUL_trans( yy_current_state );
2790 
2792 
2793  if ( yy_next_state )
2794  {
2795  /* Consume the NUL. */
2796  yy_cp = ++(yy_c_buf_p);
2797  yy_current_state = yy_next_state;
2798  goto yy_match;
2799  }
2800 
2801  else
2802  {
2805  goto yy_find_action;
2806  }
2807  }
2808 
2809  else switch ( yy_get_next_buffer( ) )
2810  {
2811  case EOB_ACT_END_OF_FILE:
2812  {
2814 
2815  if ( ppy_wrap( ) )
2816  {
2817  /* Note: because we've taken care in
2818  * yy_get_next_buffer() to have set up
2819  * ppy_text, we can now set up
2820  * yy_c_buf_p so that if some total
2821  * hoser (like flex itself) wants to
2822  * call the scanner after we return the
2823  * YY_NULL, it'll still work - another
2824  * YY_NULL will get returned.
2825  */
2827 
2829  goto do_action;
2830  }
2831 
2832  else
2833  {
2834  if ( ! (yy_did_buffer_switch_on_eof) )
2835  YY_NEW_FILE;
2836  }
2837  break;
2838  }
2839 
2840  case EOB_ACT_CONTINUE_SCAN:
2841  (yy_c_buf_p) =
2842  (yytext_ptr) + yy_amount_of_matched_text;
2843 
2845 
2846  yy_cp = (yy_c_buf_p);
2848  goto yy_match;
2849 
2850  case EOB_ACT_LAST_MATCH:
2851  (yy_c_buf_p) =
2852  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
2853 
2855 
2856  yy_cp = (yy_c_buf_p);
2858  goto yy_find_action;
2859  }
2860  break;
2861  }
2862 
2863  default:
2865  "fatal flex scanner internal error--no action found" );
2866  } /* end of action switch */
2867  } /* end of scanning one token */
pp_entry_t * pplookup(const char *ident)
Definition: preproc.c:221
#define YY_SC_TO_UI(c)
Definition: ppl.yy.c:144
static int yy_get_next_buffer(void)
Definition: ppl.yy.c:2877
static void free_macro(macexpstackentry_t *mep)
Definition: ppl.yy.c:4401
static void expand_macro(macexpstackentry_t *mep)
Definition: ppl.yy.c:4101
static void push_macro(pp_entry_t *ppp)
Definition: ppl.yy.c:4373
static yyconst flex_int16_t yy_base[460]
Definition: ppl.yy.c:496
#define YY_END_OF_BUFFER
Definition: ppl.yy.c:397
#define YY_AT_BOL()
Definition: ppl.yy.c:364
static yyconst flex_int16_t yy_chk[1936]
Definition: ppl.yy.c:821
#define YY_STATE_EOF(state)
Definition: ppl.yy.c:160
void ppy__delete_buffer(YY_BUFFER_STATE b)
Definition: ppl.yy.c:3238
#define MACROPARENTHESES()
Definition: ppl.yy.c:1285
#define strcasecmp
Definition: fake.h:9
#define pp_macexp
Definition: ppl.yy.c:1417
static void put_string(void)
Definition: ppl.yy.c:4227
static yyconst flex_int16_t yy_def[460]
Definition: ppl.yy.c:550
unsigned char YY_CHAR
Definition: macro.lex.yy.c:336
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define RCINCL
Definition: ppl.yy.c:1424
int ppy_leng
Definition: ppl.yy.c:308
static void add_text_to_macro(const char *text, int len)
Definition: ppl.yy.c:4413
#define pp_sqs
Definition: ppl.yy.c:1408
void pp_internal_error(const char *file, int line, const char *s,...)
Definition: preproc.c:754
#define pp_iqs
Definition: ppl.yy.c:1409
static int string_start(void)
Definition: ppl.yy.c:4235
int line_number
Definition: wpp_private.h:233
#define YY_BUFFER_NORMAL
Definition: ppl.yy.c:269
#define pp_ifd
Definition: ppl.yy.c:1419
static int yy_n_chars
Definition: ppl.yy.c:307
int pp_get_if_depth(void)
Definition: preproc.c:681
Definition: ppy.tab.c:211