]> git.draconx.ca Git - gob-dx.git/blobdiff - src/lexer.l
Release 0.90.4
[gob-dx.git] / src / lexer.l
index 0037b85181537998dce2b3ebe8401a4b7e0b3b95..aabc7ade293994f01028835795228ce5b36cb5cc 100644 (file)
@@ -24,6 +24,9 @@
 #include <glib.h>
 
 #include "parse.h"
+#include "main.h"
+
+extern gboolean for_cpp;
 
 static int parenth_depth = 0;
 static int before_comment = INITIAL;
@@ -165,6 +168,18 @@ class              {
                        return CLASS;
                }
 
+<CLASS_CODE,CLASS_CODE_I>class|this    {
+                       if(for_cpp) {
+                               char *s;
+                               s = g_strdup_printf("'%s' keyword should not "
+                                                   "be used when generating "
+                                                   "C++ code",yytext);
+                               print_error(TRUE,s, line_no);
+                               g_free(s);
+                       }
+                       REJECT;
+               }
+
 <CLASS_CODE>from       {return FROM;}
 
 <CLASS_CODE_I>void     {return VOID;}