]> git.draconx.ca Git - gob-dx.git/blobdiff - src/lexer.l
Release 2.0.17
[gob-dx.git] / src / lexer.l
index b3b2d596c3fde0348f0ae55534c88e8bdab2d78f..1a58a9ccd6f929f8fddb7a79f5aa49f9b9a3ce97 100644 (file)
@@ -1,5 +1,7 @@
 /* GOB C Preprocessor
- * Copyright (C) 1999 the Free Software Foundation.
+ * Copyright (C) 1999-2000 the Free Software Foundation.
+ * Copyright (C) 2000 Eazel, Inc.
+ * Copyright (C) 2001-2009 George (Jiri) Lebl
  *
  * Author: George Lebl
  *
@@ -187,7 +189,7 @@ REJECT;
        g_free(str);
 }
 
-<C_CODE>^#[ \t]*include[ \t][<"][^\n">]*[>"] {
+<C_CODE>^#[ \t]*include[ \t][<"][^\n\r">]*[>"] {
        if(look_for_includes==1) {
                char *p;
                char *file;
@@ -344,6 +346,14 @@ REJECT;
                        if(look_for_includes==0)
                                look_for_includes=1;
                }
+^\%(ad|afterdecls)\{           {
+                       BEGIN(C_CODE);
+                       parenth_depth = 1;
+                       class_after_c = FALSE;
+                       code_type = ADCODE;
+                       clear_cbuf();
+                       ccode_line = line_no;
+               }
 <C_CODE>^\%\}  {
                        BEGIN(INITIAL);
                        yylval.cbuf = cbuf;
@@ -615,13 +625,14 @@ flags             { return FLAGS; }
 
 <CLASS_CODE,CLASS_CODE_I,INITIAL,PROPERTY_CODE,PROPERTY_CODE_I>[\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;