- Added malloc wrappers for OSX builds.

This commit is contained in:
ccremers 2006-09-12 16:17:49 +00:00
parent c0f87ce87d
commit 31f1753e4e
4 changed files with 1143 additions and 1158 deletions

View File

@ -11,9 +11,11 @@
#include <limits.h> #include <limits.h>
#include <float.h> #include <float.h>
#include <string.h> #include <string.h>
#ifndef OSXHOST
#ifdef DEBUG #ifdef DEBUG
#include <malloc.h> #include <malloc.h>
#endif #endif
#endif
#include "term.h" #include "term.h"
#include "termlist.h" #include "termlist.h"

View File

@ -14,7 +14,9 @@
#include "arachne.h" #include "arachne.h"
#include "switches.h" #include "switches.h"
#include "depend.h" #include "depend.h"
#ifndef OSXHOST
#include <malloc.h> #include <malloc.h>
#endif
static System sys; //!< local storage of system pointer static System sys; //!< local storage of system pointer

View File

@ -6,7 +6,9 @@
*/ */
#include "list.h" #include "list.h"
#ifndef OSXHOST
#include <malloc.h> #include <malloc.h>
#endif
#include <stdlib.h> #include <stdlib.h>
//! Make a node //! Make a node

View File

@ -373,7 +373,8 @@ struct yy_trans_info
flex_int32_t yy_verify; flex_int32_t yy_verify;
flex_int32_t yy_nxt; flex_int32_t yy_nxt;
}; };
static yyconst flex_int16_t yy_accept[148] = { 0, static yyconst flex_int16_t yy_accept[148] =
{ 0,
0, 0, 0, 0, 0, 0, 31, 29, 7, 6, 0, 0, 0, 0, 0, 0, 31, 29, 7, 6,
28, 9, 29, 29, 28, 28, 28, 28, 28, 28, 28, 9, 29, 29, 28, 28, 28, 28, 28, 28,
28, 28, 28, 28, 28, 3, 3, 2, 30, 4, 28, 28, 28, 28, 28, 3, 3, 2, 30, 4,
@ -392,7 +393,8 @@ static yyconst flex_int16_t yy_accept[148] = { 0,
28, 28, 21, 28, 19, 25, 0 28, 28, 21, 28, 19, 25, 0
} ; } ;
static yyconst flex_int32_t yy_ec[256] = { 0, static yyconst flex_int32_t yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@ -423,14 +425,16 @@ static yyconst flex_int32_t yy_ec[256] = { 0,
1, 1, 1, 1, 1 1, 1, 1, 1, 1
} ; } ;
static yyconst flex_int32_t yy_meta[36] = { 0, static yyconst flex_int32_t yy_meta[36] =
{ 0,
1, 1, 2, 1, 3, 4, 1, 1, 1, 3, 1, 1, 2, 1, 3, 4, 1, 1, 1, 3,
1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3 3, 3, 3, 3, 3
} ; } ;
static yyconst flex_int16_t yy_base[154] = { 0, static yyconst flex_int16_t yy_base[154] =
{ 0,
0, 0, 34, 35, 176, 175, 180, 183, 40, 43, 0, 0, 34, 35, 176, 175, 180, 183, 40, 43,
0, 0, 30, 0, 24, 147, 164, 151, 150, 146, 0, 0, 30, 0, 24, 147, 164, 151, 150, 146,
31, 32, 145, 26, 159, 0, 51, 183, 183, 161, 31, 32, 145, 26, 159, 0, 51, 183, 183, 161,
@ -450,7 +454,8 @@ static yyconst flex_int16_t yy_base[154] = { 0,
84, 88, 91 84, 88, 91
} ; } ;
static yyconst flex_int16_t yy_def[154] = { 0, static yyconst flex_int16_t yy_def[154] =
{ 0,
147, 1, 148, 148, 149, 149, 147, 147, 147, 147, 147, 1, 148, 148, 149, 149, 147, 147, 147, 147,
150, 151, 147, 150, 150, 150, 150, 150, 150, 150, 150, 151, 147, 150, 150, 150, 150, 150, 150, 150,
150, 150, 150, 150, 150, 152, 152, 147, 147, 147, 150, 150, 150, 150, 150, 152, 152, 147, 147, 147,
@ -470,7 +475,8 @@ static yyconst flex_int16_t yy_def[154] = { 0,
147, 147, 147 147, 147, 147
} ; } ;
static yyconst flex_int16_t yy_nxt[219] = { 0, static yyconst flex_int16_t yy_nxt[219] =
{ 0,
8, 9, 10, 9, 11, 8, 12, 8, 13, 11, 8, 9, 10, 9, 11, 8, 12, 8, 13, 11,
8, 14, 11, 11, 11, 15, 11, 11, 16, 11, 8, 14, 11, 11, 11, 15, 11, 11, 16, 11,
17, 18, 19, 11, 11, 11, 11, 20, 21, 22, 17, 18, 19, 11, 11, 11, 11, 20, 21, 22,
@ -497,7 +503,8 @@ static yyconst flex_int16_t yy_nxt[219] = { 0,
147, 147, 147, 147, 147, 147, 147, 147 147, 147, 147, 147, 147, 147, 147, 147
} ; } ;
static yyconst flex_int16_t yy_chk[219] = { 0, static yyconst flex_int16_t yy_chk[219] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@ -525,10 +532,10 @@ static yyconst flex_int16_t yy_chk[219] = { 0,
} ; } ;
/* Table of booleans, true if rule could match eol. */ /* Table of booleans, true if rule could match eol. */
static yyconst flex_int32_t yy_rule_can_match_eol[31] = { 0, static yyconst flex_int32_t yy_rule_can_match_eol[31] =
{ 0,
0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
};
static yy_state_type yy_last_accepting_state; static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos; static char *yy_last_accepting_cpos;
@ -565,8 +572,7 @@ int yyerror (char *s);
Symbol mkstring(char *name); Symbol mkstring(char *name);
struct stringlist struct stringlist {
{
char* string; char* string;
struct stringlist* next; struct stringlist* next;
}; };
@ -759,10 +765,10 @@ YY_DECL
if ( ! yyout ) if ( ! yyout )
yyout = stdout; yyout = stdout;
if (!YY_CURRENT_BUFFER) if ( ! YY_CURRENT_BUFFER ) {
{
yyensure_buffer_stack (); yyensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE = yy_create_buffer (yyin, YY_BUF_SIZE); YY_CURRENT_BUFFER_LVALUE =
yy_create_buffer(yyin,YY_BUF_SIZE );
} }
yy_load_buffer_state( ); yy_load_buffer_state( );
@ -796,8 +802,7 @@ YY_DECL
if ( yy_current_state >= 148 ) if ( yy_current_state >= 148 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp; ++yy_cp;
} }
while ( yy_base[yy_current_state] != 183 ); while ( yy_base[yy_current_state] != 183 );
@ -838,10 +843,13 @@ YY_DECL
YY_RULE_SETUP YY_RULE_SETUP
#line 62 "scanner.l" #line 62 "scanner.l"
BEGIN(incl); BEGIN(incl);
YY_BREAK case 2:YY_RULE_SETUP YY_BREAK
case 2:
YY_RULE_SETUP
#line 63 "scanner.l" #line 63 "scanner.l"
/* eat the whitespace */ /* eat the whitespace */
YY_BREAK case 3: YY_BREAK
case 3:
/* rule 3 can match eol */ /* rule 3 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 64 "scanner.l" #line 64 "scanner.l"
@ -852,7 +860,8 @@ YY_DECL
exit( 1 ); exit( 1 );
} }
include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER; include_stack[include_stack_ptr++] =
YY_CURRENT_BUFFER;
/* try to open, using scytherdirs environment variable as well. */ /* try to open, using scytherdirs environment variable as well. */
yyin = openFileSearch (yytext, NULL); yyin = openFileSearch (yytext, NULL);
@ -866,12 +875,15 @@ YY_DECL
BEGIN(INITIAL); BEGIN(INITIAL);
} }
YY_BREAK case 4:YY_RULE_SETUP YY_BREAK
case 4:
YY_RULE_SETUP
#line 88 "scanner.l" #line 88 "scanner.l"
{ /* eat the closing things */ { /* eat the closing things */
BEGIN(INITIAL); BEGIN(INITIAL);
} }
YY_BREAK case YY_STATE_EOF (INITIAL): YY_BREAK
case YY_STATE_EOF(INITIAL):
#line 92 "scanner.l" #line 92 "scanner.l"
{ {
if ( --include_stack_ptr < 0 ) if ( --include_stack_ptr < 0 )
@ -886,7 +898,9 @@ YY_DECL
BEGIN(inclend); BEGIN(inclend);
} }
} }
YY_BREAK case 5:YY_RULE_SETUP YY_BREAK
case 5:
YY_RULE_SETUP
#line 107 "scanner.l" #line 107 "scanner.l"
{ {
register int c; register int c;
@ -914,129 +928,134 @@ YY_DECL
} }
} }
} }
YY_BREAK case 6: YY_BREAK
case 6:
/* rule 6 can match eol */ /* rule 6 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 134 "scanner.l" #line 134 "scanner.l"
{ { mylineno++; }
mylineno++; YY_BREAK
} case 7:
YY_BREAK case 7:
/* rule 7 can match eol */ /* rule 7 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 135 "scanner.l" #line 135 "scanner.l"
{ { }
} YY_BREAK
YY_BREAK case 8:YY_RULE_SETUP case 8:
YY_RULE_SETUP
#line 136 "scanner.l" #line 136 "scanner.l"
{ { }
} YY_BREAK
YY_BREAK case 9:YY_RULE_SETUP case 9:
YY_RULE_SETUP
#line 137 "scanner.l" #line 137 "scanner.l"
{ { }
} YY_BREAK
YY_BREAK case 10:YY_RULE_SETUP case 10:
YY_RULE_SETUP
#line 139 "scanner.l" #line 139 "scanner.l"
{ { return PROTOCOL; }
return PROTOCOL; YY_BREAK
} case 11:
YY_BREAK case 11:YY_RULE_SETUP YY_RULE_SETUP
#line 140 "scanner.l" #line 140 "scanner.l"
{ { return ROLE; }
return ROLE; YY_BREAK
} case 12:
YY_BREAK case 12:YY_RULE_SETUP YY_RULE_SETUP
#line 141 "scanner.l" #line 141 "scanner.l"
{ { return READT; }
return READT; YY_BREAK
} case 13:
YY_BREAK case 13:YY_RULE_SETUP YY_RULE_SETUP
#line 142 "scanner.l" #line 142 "scanner.l"
{ { return SENDT; }
return SENDT; YY_BREAK
} case 14:
YY_BREAK case 14:YY_RULE_SETUP YY_RULE_SETUP
#line 143 "scanner.l" #line 143 "scanner.l"
{ { return VAR; }
return VAR; YY_BREAK
} case 15:
YY_BREAK case 15:YY_RULE_SETUP YY_RULE_SETUP
#line 144 "scanner.l" #line 144 "scanner.l"
{ { return CONST; }
return CONST; YY_BREAK
} case 16:
YY_BREAK case 16:YY_RULE_SETUP YY_RULE_SETUP
#line 145 "scanner.l" #line 145 "scanner.l"
{ { return CLAIMT; }
return CLAIMT; YY_BREAK
} case 17:
YY_BREAK case 17:YY_RULE_SETUP YY_RULE_SETUP
#line 146 "scanner.l" #line 146 "scanner.l"
{ { return RUN; }
return RUN; YY_BREAK
} case 18:
YY_BREAK case 18:YY_RULE_SETUP YY_RULE_SETUP
#line 147 "scanner.l" #line 147 "scanner.l"
{ { return SECRET; }
return SECRET; YY_BREAK
} case 19:
YY_BREAK case 19:YY_RULE_SETUP YY_RULE_SETUP
#line 148 "scanner.l" #line 148 "scanner.l"
{ { return INVERSEKEYS; }
return INVERSEKEYS; YY_BREAK
} case 20:
YY_BREAK case 20:YY_RULE_SETUP YY_RULE_SETUP
#line 149 "scanner.l" #line 149 "scanner.l"
{ { return UNTRUSTED; }
return UNTRUSTED; YY_BREAK
} case 21:
YY_BREAK case 21:YY_RULE_SETUP YY_RULE_SETUP
#line 150 "scanner.l" #line 150 "scanner.l"
{ { return COMPROMISED; }
return COMPROMISED; YY_BREAK
} case 22:
YY_BREAK case 22:YY_RULE_SETUP YY_RULE_SETUP
#line 151 "scanner.l" #line 151 "scanner.l"
{ { return USERTYPE; }
return USERTYPE; YY_BREAK
} case 23:
YY_BREAK case 23:YY_RULE_SETUP YY_RULE_SETUP
#line 152 "scanner.l" #line 152 "scanner.l"
{ { return SINGULAR; }
return SINGULAR; YY_BREAK
} case 24:
YY_BREAK case 24:YY_RULE_SETUP YY_RULE_SETUP
#line 153 "scanner.l" #line 153 "scanner.l"
{ { return FUNCTION; }
return FUNCTION; YY_BREAK
} case 25:
YY_BREAK case 25:YY_RULE_SETUP YY_RULE_SETUP
#line 154 "scanner.l" #line 154 "scanner.l"
{ { return HASHFUNCTION; }
return HASHFUNCTION; YY_BREAK
} case 26:
YY_BREAK case 26:YY_RULE_SETUP YY_RULE_SETUP
#line 155 "scanner.l" #line 155 "scanner.l"
{ { return KNOWS; }
return KNOWS; YY_BREAK
} case 27:
YY_BREAK case 27:YY_RULE_SETUP YY_RULE_SETUP
#line 156 "scanner.l" #line 156 "scanner.l"
{ { return TRUSTED; }
return TRUSTED; YY_BREAK
} case 28:
YY_BREAK case 28:YY_RULE_SETUP YY_RULE_SETUP
#line 157 "scanner.l" #line 157 "scanner.l"
{ {
yylval.symb = mkstring(yytext); yylval.symb = mkstring(yytext);
return ID; return ID;
} }
YY_BREAK case 29:YY_RULE_SETUP YY_BREAK
case 29:
YY_RULE_SETUP
#line 161 "scanner.l" #line 161 "scanner.l"
{ { return yytext[0]; }
return yytext[0]; YY_BREAK
} case 30:
YY_BREAK case 30:YY_RULE_SETUP YY_RULE_SETUP
#line 165 "scanner.l" #line 165 "scanner.l"
ECHO; ECHO;
YY_BREAK YY_BREAK
@ -1053,6 +1072,7 @@ YY_DECL
/* Undo the effects of YY_DO_BEFORE_ACTION. */ /* Undo the effects of YY_DO_BEFORE_ACTION. */
*yy_cp = (yy_hold_char); *yy_cp = (yy_hold_char);
YY_RESTORE_YY_MORE_OFFSET YY_RESTORE_YY_MORE_OFFSET
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
{ {
/* We're scanning a new file or input source. It's /* We're scanning a new file or input source. It's
@ -1076,8 +1096,7 @@ YY_DECL
* end-of-buffer state). Contrast this with the test * end-of-buffer state). Contrast this with the test
* in input(). * in input().
*/ */
if ((yy_c_buf_p) <= if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)])
{ /* This was really a NUL. */ { /* This was really a NUL. */
yy_state_type yy_next_state; yy_state_type yy_next_state;
@ -1113,8 +1132,7 @@ YY_DECL
} }
} }
else else switch ( yy_get_next_buffer( ) )
switch (yy_get_next_buffer ())
{ {
case EOB_ACT_END_OF_FILE: case EOB_ACT_END_OF_FILE:
{ {
@ -1146,7 +1164,8 @@ YY_DECL
} }
case EOB_ACT_CONTINUE_SCAN: case EOB_ACT_CONTINUE_SCAN:
(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; (yy_c_buf_p) =
(yytext_ptr) + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state( ); yy_current_state = yy_get_previous_state( );
@ -1168,8 +1187,8 @@ YY_DECL
} }
default: default:
YY_FATAL_ERROR YY_FATAL_ERROR(
("fatal flex scanner internal error--no action found"); "fatal flex scanner internal error--no action found" );
} /* end of action switch */ } /* end of action switch */
} /* end of scanning one token */ } /* end of scanning one token */
} /* end of yylex */ } /* end of yylex */
@ -1181,8 +1200,7 @@ YY_DECL
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
* EOB_ACT_END_OF_FILE - end of file * EOB_ACT_END_OF_FILE - end of file
*/ */
static int static int yy_get_next_buffer (void)
yy_get_next_buffer (void)
{ {
register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
register char *source = (yytext_ptr); register char *source = (yytext_ptr);
@ -1190,8 +1208,8 @@ yy_get_next_buffer (void)
int ret_val; int ret_val;
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
YY_FATAL_ERROR YY_FATAL_ERROR(
("fatal flex scanner internal error--end of buffer missed"); "fatal flex scanner internal error--end of buffer missed" );
if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
{ /* Don't try to fill the buffer, so this is an EOF. */ { /* Don't try to fill the buffer, so this is an EOF. */
@ -1237,7 +1255,8 @@ yy_get_next_buffer (void)
/* just a shorter name for the current buffer */ /* just a shorter name for the current buffer */
YY_BUFFER_STATE b = YY_CURRENT_BUFFER; YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); int yy_c_buf_p_offset =
(int) ((yy_c_buf_p) - b->yy_ch_buf);
if ( b->yy_is_our_buffer ) if ( b->yy_is_our_buffer )
{ {
@ -1257,7 +1276,8 @@ yy_get_next_buffer (void)
b->yy_ch_buf = 0; b->yy_ch_buf = 0;
if ( ! b->yy_ch_buf ) if ( ! b->yy_ch_buf )
YY_FATAL_ERROR ("fatal error - scanner input buffer overflow"); YY_FATAL_ERROR(
"fatal error - scanner input buffer overflow" );
(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
@ -1287,7 +1307,8 @@ yy_get_next_buffer (void)
else else
{ {
ret_val = EOB_ACT_LAST_MATCH; ret_val = EOB_ACT_LAST_MATCH;
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
YY_BUFFER_EOF_PENDING;
} }
} }
@ -1296,8 +1317,7 @@ yy_get_next_buffer (void)
(yy_n_chars) += number_to_move; (yy_n_chars) += number_to_move;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
YY_END_OF_BUFFER_CHAR;
(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
@ -1306,8 +1326,7 @@ yy_get_next_buffer (void)
/* yy_get_previous_state - get the state just before the EOB char was reached */ /* yy_get_previous_state - get the state just before the EOB char was reached */
static yy_state_type static yy_state_type yy_get_previous_state (void)
yy_get_previous_state (void)
{ {
register yy_state_type yy_current_state; register yy_state_type yy_current_state;
register char *yy_cp; register char *yy_cp;
@ -1328,8 +1347,7 @@ yy_get_previous_state (void)
if ( yy_current_state >= 148 ) if ( yy_current_state >= 148 )
yy_c = yy_meta[(unsigned int) yy_c]; yy_c = yy_meta[(unsigned int) yy_c];
} }
yy_current_state = yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
} }
return yy_current_state; return yy_current_state;
@ -1340,8 +1358,7 @@ yy_get_previous_state (void)
* synopsis * synopsis
* next_state = yy_try_NUL_trans( current_state ); * next_state = yy_try_NUL_trans( current_state );
*/ */
static yy_state_type static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
yy_try_NUL_trans (yy_state_type yy_current_state)
{ {
register int yy_is_jam; register int yy_is_jam;
register char *yy_cp = (yy_c_buf_p); register char *yy_cp = (yy_c_buf_p);
@ -1364,8 +1381,7 @@ yy_try_NUL_trans (yy_state_type yy_current_state)
return yy_is_jam ? 0 : yy_current_state; return yy_is_jam ? 0 : yy_current_state;
} }
static void static void yyunput (int c, register char * yy_bp )
yyunput (int c, register char *yy_bp)
{ {
register char *yy_cp; register char *yy_cp;
@ -1378,9 +1394,8 @@ yyunput (int c, register char *yy_bp)
{ /* need to shift things up to make room */ { /* need to shift things up to make room */
/* +2 for EOB chars. */ /* +2 for EOB chars. */
register int number_to_move = (yy_n_chars) + 2; register int number_to_move = (yy_n_chars) + 2;
register char *dest = register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_CURRENT_BUFFER_LVALUE-> YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
yy_buf_size + 2];
register char *source = register char *source =
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
@ -1398,8 +1413,7 @@ yyunput (int c, register char *yy_bp)
*--yy_cp = (char) c; *--yy_cp = (char) c;
if (c == '\n') if ( c == '\n' ){
{
--yylineno; --yylineno;
} }
@ -1410,12 +1424,11 @@ yyunput (int c, register char *yy_bp)
#ifndef YY_NO_INPUT #ifndef YY_NO_INPUT
#ifdef __cplusplus #ifdef __cplusplus
static int static int yyinput (void)
yyinput (void)
#else #else
static int static int input (void)
input (void)
#endif #endif
{ {
int c; int c;
@ -1452,7 +1465,9 @@ input (void)
/* Reset buffer status. */ /* Reset buffer status. */
yyrestart(yyin ); yyrestart(yyin );
/*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: /*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{ {
if ( yywrap( ) ) if ( yywrap( ) )
return EOF; return EOF;
@ -1491,14 +1506,13 @@ input (void)
* *
* @note This function does not reset the start condition to @c INITIAL . * @note This function does not reset the start condition to @c INITIAL .
*/ */
void void yyrestart (FILE * input_file )
yyrestart (FILE * input_file)
{ {
if (!YY_CURRENT_BUFFER) if ( ! YY_CURRENT_BUFFER ){
{
yyensure_buffer_stack (); yyensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE = yy_create_buffer (yyin, YY_BUF_SIZE); YY_CURRENT_BUFFER_LVALUE =
yy_create_buffer(yyin,YY_BUF_SIZE );
} }
yy_init_buffer(YY_CURRENT_BUFFER,input_file ); yy_init_buffer(YY_CURRENT_BUFFER,input_file );
@ -1509,8 +1523,7 @@ yyrestart (FILE * input_file)
* @param new_buffer The new input buffer. * @param new_buffer The new input buffer.
* *
*/ */
void void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
yy_switch_to_buffer (YY_BUFFER_STATE new_buffer)
{ {
/* TODO. We should be able to replace this entire function body /* TODO. We should be able to replace this entire function body
@ -1541,8 +1554,7 @@ yy_switch_to_buffer (YY_BUFFER_STATE new_buffer)
(yy_did_buffer_switch_on_eof) = 1; (yy_did_buffer_switch_on_eof) = 1;
} }
static void static void yy_load_buffer_state (void)
yy_load_buffer_state (void)
{ {
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
@ -1556,8 +1568,7 @@ yy_load_buffer_state (void)
* *
* @return the allocated buffer state. * @return the allocated buffer state.
*/ */
YY_BUFFER_STATE YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
yy_create_buffer (FILE * file, int size)
{ {
YY_BUFFER_STATE b; YY_BUFFER_STATE b;
@ -1585,8 +1596,7 @@ yy_create_buffer (FILE * file, int size)
* @param b a buffer created with yy_create_buffer() * @param b a buffer created with yy_create_buffer()
* *
*/ */
void void yy_delete_buffer (YY_BUFFER_STATE b )
yy_delete_buffer (YY_BUFFER_STATE b)
{ {
if ( ! b ) if ( ! b )
@ -1609,8 +1619,8 @@ extern int isatty (int);
* This function is sometimes called more than once on the same buffer, * This function is sometimes called more than once on the same buffer,
* such as during a yyrestart() or at EOF. * such as during a yyrestart() or at EOF.
*/ */
static void static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
yy_init_buffer (YY_BUFFER_STATE b, FILE * file)
{ {
int oerrno = errno; int oerrno = errno;
@ -1623,8 +1633,7 @@ yy_init_buffer (YY_BUFFER_STATE b, FILE * file)
* called from yyrestart() or through yy_get_next_buffer. * called from yyrestart() or through yy_get_next_buffer.
* In that case, we don't want to reset the lineno or column. * In that case, we don't want to reset the lineno or column.
*/ */
if (b != YY_CURRENT_BUFFER) if (b != YY_CURRENT_BUFFER){
{
b->yy_bs_lineno = 1; b->yy_bs_lineno = 1;
b->yy_bs_column = 0; b->yy_bs_column = 0;
} }
@ -1638,8 +1647,7 @@ yy_init_buffer (YY_BUFFER_STATE b, FILE * file)
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
* *
*/ */
void void yy_flush_buffer (YY_BUFFER_STATE b )
yy_flush_buffer (YY_BUFFER_STATE b)
{ {
if ( ! b ) if ( ! b )
return; return;
@ -1668,8 +1676,7 @@ yy_flush_buffer (YY_BUFFER_STATE b)
* @param new_buffer The new state. * @param new_buffer The new state.
* *
*/ */
void void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
yypush_buffer_state (YY_BUFFER_STATE new_buffer)
{ {
if (new_buffer == NULL) if (new_buffer == NULL)
return; return;
@ -1699,8 +1706,7 @@ yypush_buffer_state (YY_BUFFER_STATE new_buffer)
* The next element becomes the new top. * The next element becomes the new top.
* *
*/ */
void void yypop_buffer_state (void)
yypop_buffer_state (void)
{ {
if (!YY_CURRENT_BUFFER) if (!YY_CURRENT_BUFFER)
return; return;
@ -1710,8 +1716,7 @@ yypop_buffer_state (void)
if ((yy_buffer_stack_top) > 0) if ((yy_buffer_stack_top) > 0)
--(yy_buffer_stack_top); --(yy_buffer_stack_top);
if (YY_CURRENT_BUFFER) if (YY_CURRENT_BUFFER) {
{
yy_load_buffer_state( ); yy_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1; (yy_did_buffer_switch_on_eof) = 1;
} }
@ -1720,13 +1725,11 @@ yypop_buffer_state (void)
/* Allocates the stack if it does not exist. /* Allocates the stack if it does not exist.
* Guarantees space for at least one push. * Guarantees space for at least one push.
*/ */
static void static void yyensure_buffer_stack (void)
yyensure_buffer_stack (void)
{ {
int num_to_alloc; int num_to_alloc;
if (!(yy_buffer_stack)) if (!(yy_buffer_stack)) {
{
/* First allocation is just for 2 elements, since we don't know if this /* First allocation is just for 2 elements, since we don't know if this
* scanner will even need a stack. We use 2 instead of 1 to avoid an * scanner will even need a stack. We use 2 instead of 1 to avoid an
@ -1734,29 +1737,29 @@ yyensure_buffer_stack (void)
*/ */
num_to_alloc = 1; num_to_alloc = 1;
(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
(num_to_alloc * sizeof (struct yy_buffer_state *)); (num_to_alloc * sizeof(struct yy_buffer_state*)
);
memset ((yy_buffer_stack), 0, memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
num_to_alloc * sizeof (struct yy_buffer_state *));
(yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_max) = num_to_alloc;
(yy_buffer_stack_top) = 0; (yy_buffer_stack_top) = 0;
return; return;
} }
if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
{
/* Increase the buffer to prepare for a possible push. */ /* Increase the buffer to prepare for a possible push. */
int grow_size = 8 /* arbitrary grow size */; int grow_size = 8 /* arbitrary grow size */;
num_to_alloc = (yy_buffer_stack_max) + grow_size; num_to_alloc = (yy_buffer_stack_max) + grow_size;
(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
((yy_buffer_stack), num_to_alloc * sizeof (struct yy_buffer_state *)); ((yy_buffer_stack),
num_to_alloc * sizeof(struct yy_buffer_state*)
);
/* zero only the new slots.*/ /* zero only the new slots.*/
memset ((yy_buffer_stack) + (yy_buffer_stack_max), 0, memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
grow_size * sizeof (struct yy_buffer_state *));
(yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_max) = num_to_alloc;
} }
} }
@ -1767,8 +1770,7 @@ yyensure_buffer_stack (void)
* *
* @return the newly allocated buffer state object. * @return the newly allocated buffer state object.
*/ */
YY_BUFFER_STATE YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
yy_scan_buffer (char *base, yy_size_t size)
{ {
YY_BUFFER_STATE b; YY_BUFFER_STATE b;
@ -1805,8 +1807,7 @@ yy_scan_buffer (char *base, yy_size_t size)
* @note If you want to scan bytes that may contain NUL values, then use * @note If you want to scan bytes that may contain NUL values, then use
* yy_scan_bytes() instead. * yy_scan_bytes() instead.
*/ */
YY_BUFFER_STATE YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str )
yy_scan_string (yyconst char *yy_str)
{ {
return yy_scan_bytes(yy_str,strlen(yy_str) ); return yy_scan_bytes(yy_str,strlen(yy_str) );
@ -1819,8 +1820,7 @@ yy_scan_string (yyconst char *yy_str)
* *
* @return the newly allocated buffer state object. * @return the newly allocated buffer state object.
*/ */
YY_BUFFER_STATE YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len )
yy_scan_bytes (yyconst char *bytes, int len)
{ {
YY_BUFFER_STATE b; YY_BUFFER_STATE b;
char *buf; char *buf;
@ -1854,8 +1854,7 @@ yy_scan_bytes (yyconst char *bytes, int len)
#define YY_EXIT_FAILURE 2 #define YY_EXIT_FAILURE 2
#endif #endif
static void static void yy_fatal_error (yyconst char* msg )
yy_fatal_error (yyconst char *msg)
{ {
(void) fprintf( stderr, "%s\n", msg ); (void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE ); exit( YY_EXIT_FAILURE );
@ -1883,8 +1882,7 @@ yy_fatal_error (yyconst char *msg)
/** Get the current line number. /** Get the current line number.
* *
*/ */
int int yyget_lineno (void)
yyget_lineno (void)
{ {
return yylineno; return yylineno;
@ -1893,8 +1891,7 @@ yyget_lineno (void)
/** Get the input stream. /** Get the input stream.
* *
*/ */
FILE * FILE *yyget_in (void)
yyget_in (void)
{ {
return yyin; return yyin;
} }
@ -1902,8 +1899,7 @@ yyget_in (void)
/** Get the output stream. /** Get the output stream.
* *
*/ */
FILE * FILE *yyget_out (void)
yyget_out (void)
{ {
return yyout; return yyout;
} }
@ -1911,8 +1907,7 @@ yyget_out (void)
/** Get the length of the current token. /** Get the length of the current token.
* *
*/ */
int int yyget_leng (void)
yyget_leng (void)
{ {
return yyleng; return yyleng;
} }
@ -1921,8 +1916,7 @@ yyget_leng (void)
* *
*/ */
char * char *yyget_text (void)
yyget_text (void)
{ {
return yytext; return yytext;
} }
@ -1931,8 +1925,7 @@ yyget_text (void)
* @param line_number * @param line_number
* *
*/ */
void void yyset_lineno (int line_number )
yyset_lineno (int line_number)
{ {
yylineno = line_number; yylineno = line_number;
@ -1944,38 +1937,32 @@ yyset_lineno (int line_number)
* *
* @see yy_switch_to_buffer * @see yy_switch_to_buffer
*/ */
void void yyset_in (FILE * in_str )
yyset_in (FILE * in_str)
{ {
yyin = in_str ; yyin = in_str ;
} }
void void yyset_out (FILE * out_str )
yyset_out (FILE * out_str)
{ {
yyout = out_str ; yyout = out_str ;
} }
int int yyget_debug (void)
yyget_debug (void)
{ {
return yy_flex_debug; return yy_flex_debug;
} }
void void yyset_debug (int bdebug )
yyset_debug (int bdebug)
{ {
yy_flex_debug = bdebug ; yy_flex_debug = bdebug ;
} }
/* yylex_destroy is for both reentrant and non-reentrant scanners. */ /* yylex_destroy is for both reentrant and non-reentrant scanners. */
int int yylex_destroy (void)
yylex_destroy (void)
{ {
/* Pop the buffer stack, destroying each element. */ /* Pop the buffer stack, destroying each element. */
while (YY_CURRENT_BUFFER) while(YY_CURRENT_BUFFER){
{
yy_delete_buffer(YY_CURRENT_BUFFER ); yy_delete_buffer(YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL; YY_CURRENT_BUFFER_LVALUE = NULL;
yypop_buffer_state(); yypop_buffer_state();
@ -1993,8 +1980,7 @@ yylex_destroy (void)
*/ */
#ifndef yytext_ptr #ifndef yytext_ptr
static void static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
yy_flex_strncpy (char *s1, yyconst char *s2, int n)
{ {
register int i; register int i;
for ( i = 0; i < n; ++i ) for ( i = 0; i < n; ++i )
@ -2003,8 +1989,7 @@ yy_flex_strncpy (char *s1, yyconst char *s2, int n)
#endif #endif
#ifdef YY_NEED_STRLEN #ifdef YY_NEED_STRLEN
static int static int yy_flex_strlen (yyconst char * s )
yy_flex_strlen (yyconst char *s)
{ {
register int n; register int n;
for ( n = 0; s[n]; ++n ) for ( n = 0; s[n]; ++n )
@ -2014,14 +1999,12 @@ yy_flex_strlen (yyconst char *s)
} }
#endif #endif
void * void *yyalloc (yy_size_t size )
yyalloc (yy_size_t size)
{ {
return (void *) malloc( size ); return (void *) malloc( size );
} }
void * void *yyrealloc (void * ptr, yy_size_t size )
yyrealloc (void *ptr, yy_size_t size)
{ {
/* The cast to (char *) in the following accommodates both /* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those * implementations that use char* generic pointers, and those
@ -2033,8 +2016,7 @@ yyrealloc (void *ptr, yy_size_t size)
return (void *) realloc( (char *) ptr, size ); return (void *) realloc( (char *) ptr, size );
} }
void void yyfree (void * ptr )
yyfree (void *ptr)
{ {
free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
} }
@ -2057,8 +2039,7 @@ yyfree (void *ptr)
Symbol Symbol mkstring(char *name)
mkstring (char *name)
{ {
Symbol t; Symbol t;
char* s; char* s;
@ -2088,14 +2069,12 @@ mkstring (char *name)
return t; return t;
} }
void void scanner_cleanup(void)
scanner_cleanup (void)
{ {
yy_delete_buffer (YY_CURRENT_BUFFER); yy_delete_buffer (YY_CURRENT_BUFFER);
} }
void void strings_cleanup(void)
strings_cleanup (void)
{ {
Stringlist sl; Stringlist sl;
while (allocatedStrings != NULL) while (allocatedStrings != NULL)
@ -2107,8 +2086,7 @@ strings_cleanup (void)
} }
} }
int int yywrap (void)
yywrap (void)
{ {
/* signal true to let lex know that nothing else is coming */ /* signal true to let lex know that nothing else is coming */
return 1; return 1;
@ -2122,3 +2100,4 @@ void mktext(void);
// vim:ft=lex: // vim:ft=lex: