gtk_doc_func = NULL;
}
+/* Ugly warning avoiding */
+#ifdef FLEX_SCANNER
+int yylex(void);
+#endif
%}
BEGIN(CLASS_CODE);
if(++found_classes > 1) {
- print_error(FALSE,
- "Only one class per file allowed",
- line_no);
+ error_print(GOB_ERROR, line_no,
+ "Only one class per file allowed");
}
return CLASS;
^[ \t]*requires[ \t]+[0-9]+\.[0-9]+\.[0-9]+[\t ]*$ {
int maj = 0,min = 0,pl = 0;
int rmaj = 0,rmin = 0,rpl = 0;
+ int effective_maj = 0;
+ int effective_rmaj = 0;
char *p;
sscanf(VERSION,"%d.%d.%d",&rmaj,&rmin,&rpl);
+ effective_rmaj = rmaj;
+ if (rmin >= 90)
+ effective_rmaj = rmaj + 1;
+
p = strchr(yytext,'r');
g_assert(p); /* we MUST have found it */
sscanf(p,"requires %d.%d.%d",&maj,&min,&pl);
+ effective_maj = maj;
+ if (min >= 90)
+ effective_maj = maj + 1;
+
if(rmaj < maj ||
(rmaj == maj && rmin < min) ||
(rmaj == maj && rmin == min && rpl < pl)) {
- char *s;
- s = g_strdup_printf(
- "GOB version %d.%d.%d required "
- "(this is %s)\n"
- "To upgrade your gob, see: "
- "http://www.5z.com/jirka/gob.html",
- maj,min,pl,VERSION);
- print_error(FALSE, s, line_no);
- g_free(s);
+ error_printf(GOB_ERROR, line_no,
+ "GOB version at least %d.%d.%d required "
+ "(this is %s)\n"
+ "To upgrade your gob, see: "
+ "http://www.5z.com/jirka/gob.html",
+ maj, min, pl, VERSION);
+ }
+
+ if(effective_rmaj != effective_maj) {
+ error_printf(GOB_ERROR, line_no,
+ "GOB major version %d required "
+ "(this is %s)\n"
+ "To upgrade your gob, see: "
+ "http://www.5z.com/jirka/gob.html",
+ maj, VERSION);
}
}
<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);
+ error_printf(GOB_WARN, line_no,
+ "'%s' keyword should not "
+ "be used when generating "
+ "C++ code", yytext);
}
REJECT;
}
<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;
}
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;
}
}
<*>[\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
+