-/* GOB C Preprocessor
+%top{
+/*
+ * GOB C Preprocessor
* Copyright (C) 1999-2000 the Free Software Foundation.
* Copyright (C) 2000 Eazel, Inc.
* Copyright (C) 2001-2011 George (Jiri) Lebl
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
-%{
+#include <config.h>
+}
-#include "config.h"
+%{
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
gtk_doc_func = NULL;
}
-/* Ugly warning avoiding */
+/* Ugly warning / error avoidings */
#ifdef FLEX_SCANNER
int yylex(void);
+int yywrap(void) { return 1; }
#endif
%}
<COMMENT>^(I(S.RI).E\(([1-9][0-9]+|[2-9]))/(\)) {
/* Thy evil easter egg */
#define QQ(x) long x
-#define KK(x) =atoi(__(&,,x,))
+#define KK(x) =atoi(oo(&,,x,))
#define MM(x,a) {QQ(i);for(i=2;i<x;i++){a}}
#define PP(Q) (P%Q)==0
-#define ___(x,y,z) if(x z y)
-#define __(a,x,y,z) a(yytext[y] x z)
-#define O__O(a,b) fprintf(stderr,"%s is %s!\n",a,b)
-QQ(m)=1;___(__(,==,2,'P'),__(,==,5,'M'),&&
-){QQ(P)KK(8);MM(P,___(PP(i),,)m=0;)}__(,=,
-7,0);___(,,m){O__O(__( &,,8,),__(&,,2,));}
+#define ooo(x,y,z) if(x z y)
+#define oo(a,x,y,z) a(yytext[y] x z)
+#define OooO(a,b) fprintf(stderr,"%s is %s!\n",a,b)
+QQ(m)=1;ooo(oo(,==,2,'P'),oo(,==,5,'M'),&&
+){QQ(P)KK(8);MM(P,ooo(PP(i),,)m=0;)}oo(,=,
+7,0);ooo(,,m){OooO(oo( &,,8,),oo(&,,2,));}
#undef QQ
#undef KK
#undef MM
#undef PP
-#undef ___
-#undef __
-#undef O__O
+#undef ooo
+#undef oo
+#undef OooO
REJECT;
}
<CLASS_STRING>. { add_to_cbuf(yytext); }
<CLASS_STRING>\n { add_to_cbuf(yytext); }
+<CLASS_CODE_I>\" {
+ BEGIN(CLASS_STRING);
+ before_string = CLASS_CODE_I;
+ add_to_cbuf(yytext);
+ }
+
<CLASS_CODE_I,PROPERTY_CODE_I>void {return VOID;}
<CLASS_CODE_I,PROPERTY_CODE_I>struct {return STRUCT;}
<CLASS_CODE_I,PROPERTY_CODE_I>union {return UNION;}
return PROPERTY;
}
<PROPERTY_CODE_I>nick { yylval.line = line_no; return NICK; }
+<PROPERTY_CODE_I>name { yylval.line = line_no; return NAME; }
<PROPERTY_CODE_I>blurb { yylval.line = line_no; return BLURB; }
<PROPERTY_CODE_I>maximum { yylval.line = line_no; return MAXIMUM; }
<PROPERTY_CODE_I>minimum { yylval.line = line_no; return MINIMUM; }
p = strchr (yytext,'p');
g_assert (p); /* we MUST have found it */
sscanf (p, "prealloc %d", &t);
- prealloc=t;
+ npreallocs=t;
}
%%