]> git.draconx.ca Git - gob-dx.git/blobdiff - src/lexer.l
Release 1.0.2
[gob-dx.git] / src / lexer.l
index 941a46022f67b10bf1d0f95686c76792e700d8f1..a33eed0a7720e3a7113830fbc7f8413499e0b49d 100644 (file)
@@ -81,6 +81,10 @@ add_gtk_doc_func(void)
        gtk_doc_func = NULL;
 }
 
+/* Ugly warning avoiding */
+#ifdef FLEX_SCANNER
+int yylex(void);
+#endif
 
 %}
 
@@ -367,7 +371,7 @@ class               {
                                char *s;
                                s = g_strdup_printf("'%s' keyword should not "
                                                    "be used when generating "
-                                                   "C++ code",yytext);
+                                                   "C++ code", yytext);
                                print_error(TRUE, s, line_no);
                                g_free(s);
                        }
@@ -395,11 +399,12 @@ class             {
 <CLASS_CODE_I>public   {yylval.line = line_no; return PUBLIC;}
 <CLASS_CODE_I>private  {yylval.line = line_no; return PRIVATE;}
 <CLASS_CODE_I>protected        {yylval.line = line_no; return PROTECTED;}
+<CLASS_CODE_I>classwide        {yylval.line = line_no; return CLASSWIDE;}
 <CLASS_CODE_I>argument {yylval.line = line_no; return ARGUMENT;}
 <CLASS_CODE_I>virtual  {yylval.line = line_no; return VIRTUAL;}
 <CLASS_CODE_I>signal   {yylval.line = line_no; return SIGNAL;}
 <CLASS_CODE_I>override {yylval.line = line_no; return OVERRIDE;}
-<CLASS_CODE_I>0|[1-9][0-9]*|0x[0-9a-fA-F]+|0[0-7]+|[0-9]*\.[0-9]+|\.[0-9][0-9]*        {
+<CLASS_CODE,CLASS_CODE_I>0|[1-9][0-9]*|0x[0-9a-fA-F]+|0[0-7]+|[0-9]*\.[0-9]+|\.[0-9][0-9]*     {
                        yylval.id = g_strdup(yytext);
                        return NUMBER;
                }
@@ -418,7 +423,7 @@ class               {
                        return TOKEN;
                }
 
-<CLASS_CODE_I>(\[[0-9]*\])+    {
+<CLASS_CODE_I>(\[[0-9]*\]|\[[A-Za-z_][A-Za-z0-9_]*\])+ {
                        yylval.id = g_strdup(yytext);
                        return ARRAY_DIM;
                }
@@ -449,3 +454,16 @@ class              {
                }
 
 <*>[\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
+