X-Git-Url: https://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/3e833eea9cb9822f04c639e143212c4b6f7940d4..d52e64e92557f0b6d7704077ec175c88fa7ca243:/src/lexer.l diff --git a/src/lexer.l b/src/lexer.l index 0c8ef11..0dc3cda 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -1,7 +1,7 @@ /* GOB C Preprocessor * Copyright (C) 1999-2000 the Free Software Foundation. * Copyright (C) 2000 Eazel, Inc. - * Copyright (C) 2001-2009 George (Jiri) Lebl + * Copyright (C) 2001-2011 George (Jiri) Lebl * * Author: George Lebl * @@ -95,9 +95,10 @@ add_gtk_doc_func(void) gtk_doc_func = NULL; } -/* Ugly warning avoiding */ +/* Ugly warning / error avoidings */ #ifdef FLEX_SCANNER int yylex(void); +int yywrap(void) { return 1; } #endif %} @@ -189,7 +190,7 @@ REJECT; g_free(str); } -^#[ \t]*include[ \t][<"][^\n">]*[>"] { +^#[ \t]*include[ \t][<"][^\n\r">]*[>"] { if(look_for_includes==1) { char *p; char *file; @@ -346,6 +347,16 @@ REJECT; if(look_for_includes==0) look_for_includes=1; } +^\%(ct|ctop)\{ { + BEGIN(C_CODE); + parenth_depth = 1; + class_after_c = FALSE; + code_type = CTCODE; + clear_cbuf(); + ccode_line = line_no; + if(look_for_includes==0) + look_for_includes=1; + } ^\%(ad|afterdecls)\{ { BEGIN(C_CODE); parenth_depth = 1; @@ -625,13 +636,14 @@ flags { return FLAGS; } [\f\t ] ; /*ignore*/ +<*>[\n\r] ; /*ignore*/ + + <*>. { yylval.line = line_no; return yytext[0]; } -<*>[\n\r] ; /*ignore*/ - ^[ \t]*prealloc[ \t]+[0-9]+[ \t]*$ { char *p; int t;