X-Git-Url: https://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/d52e64e92557f0b6d7704077ec175c88fa7ca243..bb6822c219eb531a497d0829626ac3b29af198fa:/src/lexer.l diff --git a/src/lexer.l b/src/lexer.l index 0dc3cda..11d79eb 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -1,4 +1,6 @@ -/* GOB C Preprocessor +%top{ +/* + * GOB C Preprocessor * Copyright (C) 1999-2000 the Free Software Foundation. * Copyright (C) 2000 Eazel, Inc. * Copyright (C) 2001-2011 George (Jiri) Lebl @@ -20,9 +22,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ -%{ +#include +} -#include "config.h" +%{ #include #include #include @@ -132,22 +135,22 @@ yy_current_state = 0; ^(I(S.RI).E\(([1-9][0-9]+|[2-9]))/(\)) { /* Thy evil easter egg */ #define QQ(x) long x -#define KK(x) =atoi(__(&,,x,)) +#define KK(x) =atoi(oo(&,,x,)) #define MM(x,a) {QQ(i);for(i=2;i. { add_to_cbuf(yytext); } \n { add_to_cbuf(yytext); } +\" { + BEGIN(CLASS_STRING); + before_string = CLASS_CODE_I; + add_to_cbuf(yytext); + } + void {return VOID;} struct {return STRUCT;} union {return UNION;} @@ -544,6 +553,7 @@ flags { return FLAGS; } return PROPERTY; } nick { yylval.line = line_no; return NICK; } +name { yylval.line = line_no; return NAME; } blurb { yylval.line = line_no; return BLURB; } maximum { yylval.line = line_no; return MAXIMUM; } minimum { yylval.line = line_no; return MINIMUM; } @@ -650,7 +660,7 @@ flags { return FLAGS; } p = strchr (yytext,'p'); g_assert (p); /* we MUST have found it */ sscanf (p, "prealloc %d", &t); - prealloc=t; + npreallocs=t; } %%