scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 86976ce9f6fdcb42678d18e61f9d64e615bc163c
parent 732ddd32abbd5cdd3bd7581c8be050871f44482f
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 29 May 2012 21:29:29 +0200

Moved definition of union yyval to tokens.h

This value will be used in others files, so it is necessary put it in a
place where it can be located by the others modules. The better place for
this issue is in tokens header.

Diffstat:
lex.c | 6------
tokens.h | 10++++++++++
2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/lex.c b/lex.c @@ -62,12 +62,6 @@ unsigned columnum; const char *filename; -union yyval { - struct symbol *sym; -} yyval; - - - static unsigned char hashfun(register const char *s) { register unsigned char h, ch; diff --git a/tokens.h b/tokens.h @@ -32,10 +32,20 @@ enum { CONTINUE, BREAK, RETURN, EOFTOK }; + + +union yyval { + struct symbol *sym; +} yyval; + + + extern char yytext[]; extern unsigned char yyhash; extern size_t yylen; extern unsigned char yytoken; +extern union yyval yyval; + extern unsigned char gettok(void); extern void init_lex(void);