]> git.draconx.ca Git - gob-dx.git/blobdiff - src/lexer.l
Release 2.0.7
[gob-dx.git] / src / lexer.l
index aa9b6d28d3bde86b015f1f593699ba70cc68716e..56f86ada52aa2186740e99b3dc31a97faddd0a85 100644 (file)
 %{
 
 #include "config.h"
-#include <glib.h>
+#include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
+#include <glib.h>
 
 #include "treefuncs.h"
 #include "parse.h"
 #include "util.h"
 
 static int parenth_depth = 0;
-static int before_comment = INITIAL;
+static int before_comment
+/* New flex is on drugs */
+#if defined(FLEX_SCANNER) && ! defined(INITIAL)
+       = 0;
+#else
+       = INITIAL;
+#endif
 static gboolean class_after_c = FALSE;
 static int code_type = CCODE;
 static int before_string;
@@ -230,7 +237,7 @@ REJECT;
                        BEGIN(CLASS_CODE_I);
                        add_gtk_doc_func();
                }
-<GTK_DOC>^[ \t]*\*\    {
+<GTK_DOC>^[ \t]*\*[ \t]        {
                        fflush(stdout);
                        add_to_cbuf(" * ");
                        BEGIN(GTK_DOC_LINE);
@@ -532,6 +539,15 @@ flags              { return FLAGS; }
                        yylval.id = g_strdup(yytext);
                        return NUMBER;
                }
+<CLASS_CODE,CLASS_CODE_I,PROPERTY_CODE,PROPERTY_CODE_I,INITIAL>[A-Za-z_][A-Za-z0-9_]*(::[A-Za-z0-9_]*)+        {
+                       /* This is cpp kind of token thingie */
+                       if (for_cpp) {
+                               yylval.id = g_strdup(yytext);
+                               return TOKEN;
+                       } else {
+                               REJECT;
+                       }
+               }
 <CLASS_CODE,CLASS_CODE_I,PROPERTY_CODE,PROPERTY_CODE_I,INITIAL>[A-Za-z_][A-Za-z0-9_]*(:[A-Za-z0-9_]*)+ {
                        /* this one is for a classname with a namespace */
                        yylval.id = g_strdup(yytext);
@@ -584,14 +600,3 @@ flags              { return FLAGS; }
 <*>[\n\r]      ;  /*ignore*/
 
 %%
-
-/* Ugly warning avoiding */
-#ifdef FLEX_SCANNER
-static void warning_avoider(void) G_GNUC_UNUSED;
-static void warning_avoider(void) {
-       yy_flex_realloc(NULL, 0);
-       yyunput(0, NULL);
-       warning_avoider();
-}
-#endif
-