diff -r d926ee71f228 -r 0b472e25eb16 stage1_2/iec.flex --- a/stage1_2/iec.flex Mon Feb 12 14:06:59 2007 +0100 +++ b/stage1_2/iec.flex Wed Feb 14 19:57:01 2007 +0100 @@ -117,11 +117,14 @@ */ #include "../absyntax/absyntax.hh" + /* generated by bison. * Contains the definition of the token constants, and the * token value type YYSTYPE (in our case, a 'const char *') */ #include "iec.y.hh" +#include "stage1_2_priv.hh" + /* Variable defined by the bison parser, * where the value of the tokens will be stored @@ -134,7 +137,11 @@ * apropriately whenever it comes across an (*#include *) * directive... */ +/* + NOTE: already defined in iec.y.hh extern const char *current_filename; +*/ + /* We will not be using unput() in our flex code... */ #define YY_NO_UNPUT @@ -183,19 +190,6 @@ %} -/*********************************************/ -/* Change parse state to body definitions... */ -/*********************************************/ - -%{ -static int goto_body_state__ = 0; - -void cmd_goto_body_state(void) {goto_body_state__ = 1;} -int get_goto_body_state(void) {return goto_body_state__;} -void rst_goto_body_state(void) {goto_body_state__ = 0;} -%} - - /***************************************************/ /* Forward Declaration of functions defined later. */ /***************************************************/ @@ -362,17 +356,6 @@ NULL /* must end with NULL!! */ }; - -/* - * Join two strings together. Allocate space with malloc(3). - */ -static char *strdup2(const char *a, const char *b) { - char *res = (char *)malloc(strlen(a) + strlen(b) + 1); - - if (!res) - return NULL; - return strcat(strcpy(res, a), b); /* safe, actually */ -} %} @@ -1413,12 +1396,12 @@ const char *current_filename; + + int get_identifier_token(const char *identifier_str) {return 0;} - - int main(int argc, char **argv) { FILE *in_file;