Skip to content

Commit

Permalink
Generated files on OSX.
Browse files Browse the repository at this point in the history
  • Loading branch information
WardF committed Feb 22, 2017
1 parent fa1c96a commit 169866d
Show file tree
Hide file tree
Showing 3 changed files with 349 additions and 529 deletions.
76 changes: 31 additions & 45 deletions ncgen/ncgenl.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
typedef uint64_t flex_uint64_t;
#else
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;
#endif /* ! C99 */

/* Limits of integral types. */
#ifndef INT8_MIN
Expand Down Expand Up @@ -102,8 +104,6 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif

#endif /* ! C99 */

#endif /* ! FLEXINT_H */

#ifdef __cplusplus
Expand Down Expand Up @@ -160,15 +160,7 @@ typedef unsigned int flex_uint32_t;

/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif

/* The state buf must be large enough to hold one state per character in the main buffer.
Expand All @@ -180,7 +172,12 @@ typedef unsigned int flex_uint32_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif

extern int ncgleng;
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif

extern yy_size_t ncgleng;

extern FILE *ncgin, *ncgout;

Expand All @@ -206,11 +203,6 @@ extern FILE *ncgin, *ncgout;

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

#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif

#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
Expand All @@ -228,7 +220,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;
yy_size_t yy_n_chars;

/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
Expand Down Expand Up @@ -298,8 +290,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */

/* yy_hold_char holds the character lost when ncgtext is formed. */
static char yy_hold_char;
static int yy_n_chars; /* number of characters read into yy_ch_buf */
int ncgleng;
static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
yy_size_t ncgleng;

/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
Expand Down Expand Up @@ -327,7 +319,7 @@ static void ncg_init_buffer (YY_BUFFER_STATE b,FILE *file );

YY_BUFFER_STATE ncg_scan_buffer (char *base,yy_size_t size );
YY_BUFFER_STATE ncg_scan_string (yyconst char *yy_str );
YY_BUFFER_STATE ncg_scan_bytes (yyconst char *bytes,int len );
YY_BUFFER_STATE ncg_scan_bytes (yyconst char *bytes,yy_size_t len );

void *ncgalloc (yy_size_t );
void *ncgrealloc (void *,yy_size_t );
Expand Down Expand Up @@ -382,7 +374,7 @@ static void yy_fatal_error (yyconst char msg[] );
*/
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
ncgleng = (size_t) (yy_cp - yy_bp); \
ncgleng = (yy_size_t) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
Expand Down Expand Up @@ -1328,7 +1320,7 @@ ID ([A-Za-z_]|{UTF8})([A-Z.@#\[\]a-z_0-9+-]|{UTF8})*
/* Note: this definition of string will work for utf8 as well,
although it is a very relaxed definition
*/
#line 1332 "lex.ncg.c"
#line 1324 "lex.ncg.c"

#define INITIAL 0
#define ST_C_COMMENT 1
Expand Down Expand Up @@ -1369,7 +1361,7 @@ FILE *ncgget_out (void );

void ncgset_out (FILE * out_str );

int ncgget_leng (void );
yy_size_t ncgget_leng (void );

char *ncgget_text (void );

Expand Down Expand Up @@ -1411,20 +1403,15 @@ static int input (void );

/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif

/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
#define ECHO do { if (fwrite( ncgtext, ncgleng, 1, ncgout )) {} } while (0)
#define ECHO fwrite( ncgtext, ncgleng, 1, ncgout )
#endif

/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
Expand All @@ -1435,7 +1422,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
size_t n; \
yy_size_t n; \
for ( n = 0; n < max_size && \
(c = getc( ncgin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
Expand Down Expand Up @@ -1519,7 +1506,7 @@ YY_DECL

#line 217 "ncgen.l"

#line 1523 "lex.ncg.c"
#line 1510 "lex.ncg.c"

if ( !(yy_init) )
{
Expand Down Expand Up @@ -2132,7 +2119,7 @@ YY_RULE_SETUP
#line 570 "ncgen.l"
ECHO;
YY_BREAK
#line 2136 "lex.ncg.c"
#line 2123 "lex.ncg.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(TEXT):
yyterminate();
Expand Down Expand Up @@ -2319,7 +2306,7 @@ static int yy_get_next_buffer (void)

else
{
int num_to_read =
yy_size_t num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;

while ( num_to_read <= 0 )
Expand All @@ -2333,7 +2320,7 @@ static int yy_get_next_buffer (void)

if ( b->yy_is_our_buffer )
{
int new_size = b->yy_buf_size * 2;
yy_size_t new_size = b->yy_buf_size * 2;

if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
Expand Down Expand Up @@ -2364,7 +2351,7 @@ static int yy_get_next_buffer (void)

/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
(yy_n_chars), (size_t) num_to_read );
(yy_n_chars), num_to_read );

YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
Expand Down Expand Up @@ -2474,7 +2461,7 @@ static int yy_get_next_buffer (void)
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
register int number_to_move = (yy_n_chars) + 2;
register yy_size_t number_to_move = (yy_n_chars) + 2;
register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
register char *source =
Expand Down Expand Up @@ -2523,7 +2510,7 @@ static int yy_get_next_buffer (void)

else
{ /* need more input */
int offset = (yy_c_buf_p) - (yytext_ptr);
yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
++(yy_c_buf_p);

switch ( yy_get_next_buffer( ) )
Expand All @@ -2547,7 +2534,7 @@ static int yy_get_next_buffer (void)
case EOB_ACT_END_OF_FILE:
{
if ( ncgwrap( ) )
return EOF;
return 0;

if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
Expand Down Expand Up @@ -2799,7 +2786,7 @@ void ncgpop_buffer_state (void)
*/
static void ncgensure_buffer_stack (void)
{
int num_to_alloc;
yy_size_t num_to_alloc;

if (!(yy_buffer_stack)) {

Expand Down Expand Up @@ -2891,17 +2878,16 @@ YY_BUFFER_STATE ncg_scan_string (yyconst char * yystr )

/** Setup the input buffer state to scan the given bytes. The next call to ncglex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE ncg_scan_bytes (yyconst char * yybytes, int _yybytes_len )
YY_BUFFER_STATE ncg_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
int i;
yy_size_t n, i;

/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
Expand Down Expand Up @@ -2983,7 +2969,7 @@ FILE *ncgget_out (void)
/** Get the length of the current token.
*
*/
int ncgget_leng (void)
yy_size_t ncgget_leng (void)
{
return ncgleng;
}
Expand Down
Loading

0 comments on commit 169866d

Please sign in to comment.