diff --git a/modules/preprocs/yapp/yapp-preproc.c b/modules/preprocs/yapp/yapp-preproc.c index e3c86f68..323b2a5c 100644 --- a/modules/preprocs/yapp/yapp-preproc.c +++ b/modules/preprocs/yapp/yapp-preproc.c @@ -41,7 +41,21 @@ YAPP_Output current_output; YYSTYPE yapp_preproc_lval; int isatty(int); -void yapp_lex_initialize(FILE *f); + +/* Build source and macro representations */ +static SLIST_HEAD(source_head, source_s) source_head, macro_head, param_head, *current_head; +static struct source_s { + SLIST_ENTRY(source_s) next; + YAPP_Token token; +} *src, *source_tail, *macro_tail, *param_tail, **current_tail; +typedef struct source_s source; + +/* don't forget what the nesting level says */ +static SLIST_HEAD(output_head, output_s) output_head; +static struct output_s { + SLIST_ENTRY(output_s) next; + YAPP_Output out; +} output, *out; /*****************************************************************************/ /* macro support - to be moved to a separate file later (?) */ diff --git a/modules/preprocs/yapp/yapp-preproc.h b/modules/preprocs/yapp/yapp-preproc.h index 6458453e..33ffd681 100644 --- a/modules/preprocs/yapp/yapp-preproc.h +++ b/modules/preprocs/yapp/yapp-preproc.h @@ -32,14 +32,6 @@ typedef struct YAPP_Token_s { } val; } YAPP_Token; -/* Build source and macro representations */ -static SLIST_HEAD(source_head, source_s) source_head, macro_head, param_head, *current_head; -static struct source_s { - SLIST_ENTRY(source_s) next; - YAPP_Token token; -} *src, *source_tail, *macro_tail, *param_tail, **current_tail; -typedef struct source_s source; - /* internal state of preprocessor's parser */ typedef enum { YAPP_STATE_INITIAL = 0, @@ -58,9 +50,4 @@ typedef enum { YAPP_BLOCKED_OUTPUT /* the surrounding level is not outputting */ } YAPP_Output; -/* don't forget what the nesting level says */ -static SLIST_HEAD(output_head, output_s) output_head; -static struct output_s { - SLIST_ENTRY(output_s) next; - YAPP_Output out; -} output, *out; +void yapp_lex_initialize(FILE *f); diff --git a/modules/preprocs/yapp/yapp-token.l b/modules/preprocs/yapp/yapp-token.l index 9218a80d..636a7f24 100644 --- a/modules/preprocs/yapp/yapp-token.l +++ b/modules/preprocs/yapp/yapp-token.l @@ -29,6 +29,7 @@ #include "bytecode.h" +#include "src/preprocs/yapp/yapp-preproc.h" #include "src/preprocs/yapp/yapp-token.h" diff --git a/src/preprocs/yapp/yapp-preproc.c b/src/preprocs/yapp/yapp-preproc.c index e3c86f68..323b2a5c 100644 --- a/src/preprocs/yapp/yapp-preproc.c +++ b/src/preprocs/yapp/yapp-preproc.c @@ -41,7 +41,21 @@ YAPP_Output current_output; YYSTYPE yapp_preproc_lval; int isatty(int); -void yapp_lex_initialize(FILE *f); + +/* Build source and macro representations */ +static SLIST_HEAD(source_head, source_s) source_head, macro_head, param_head, *current_head; +static struct source_s { + SLIST_ENTRY(source_s) next; + YAPP_Token token; +} *src, *source_tail, *macro_tail, *param_tail, **current_tail; +typedef struct source_s source; + +/* don't forget what the nesting level says */ +static SLIST_HEAD(output_head, output_s) output_head; +static struct output_s { + SLIST_ENTRY(output_s) next; + YAPP_Output out; +} output, *out; /*****************************************************************************/ /* macro support - to be moved to a separate file later (?) */ diff --git a/src/preprocs/yapp/yapp-preproc.h b/src/preprocs/yapp/yapp-preproc.h index 6458453e..33ffd681 100644 --- a/src/preprocs/yapp/yapp-preproc.h +++ b/src/preprocs/yapp/yapp-preproc.h @@ -32,14 +32,6 @@ typedef struct YAPP_Token_s { } val; } YAPP_Token; -/* Build source and macro representations */ -static SLIST_HEAD(source_head, source_s) source_head, macro_head, param_head, *current_head; -static struct source_s { - SLIST_ENTRY(source_s) next; - YAPP_Token token; -} *src, *source_tail, *macro_tail, *param_tail, **current_tail; -typedef struct source_s source; - /* internal state of preprocessor's parser */ typedef enum { YAPP_STATE_INITIAL = 0, @@ -58,9 +50,4 @@ typedef enum { YAPP_BLOCKED_OUTPUT /* the surrounding level is not outputting */ } YAPP_Output; -/* don't forget what the nesting level says */ -static SLIST_HEAD(output_head, output_s) output_head; -static struct output_s { - SLIST_ENTRY(output_s) next; - YAPP_Output out; -} output, *out; +void yapp_lex_initialize(FILE *f); diff --git a/src/preprocs/yapp/yapp-token.l b/src/preprocs/yapp/yapp-token.l index 9218a80d..636a7f24 100644 --- a/src/preprocs/yapp/yapp-token.l +++ b/src/preprocs/yapp/yapp-token.l @@ -29,6 +29,7 @@ #include "bytecode.h" +#include "src/preprocs/yapp/yapp-preproc.h" #include "src/preprocs/yapp/yapp-token.h"