# include <stdlib.h>
#endif
-int yylineno = 1;
+extern int lineno;
%}
real [-0-9][0-9]*\.[0-9]+
integer [-0-9][0-9]*
string \"[^"\n]*\"
-identifier [a-zA-Z][.a-zA-Z0-9]*
+identifier [a-zA-Z][-.a-zA-Z0-9_]*
bool ([tT][rR][uU][eE]|[fF][aA][lL][sS][eE]|[yY][eE][sS]|[nN][oO]|[oO][nN]|[oO][fF][fF])
%%
-^[ \t]*#.*\n /* comment */ { ++yylineno; }
+^[ \t]*#.*\n /* comment */ { ++lineno; }
^[ \t]*#.* /* comment */
-^[ \t]*\n /* empty lines */ { ++yylineno; }
+^[ \t]*\n /* empty lines */ { ++lineno; }
[ \t] /* whitespace */
{real} { yylval.real = atof(yytext); return REAL; }
{integer} { yylval.integer = atoi(yytext); return INTEGER; }
{bool} { yylval.bool = (!g_ascii_strcasecmp("true", yytext) ||
!g_ascii_strcasecmp("yes", yytext) ||
!g_ascii_strcasecmp("on", yytext));
- return BOOL;
+ return BOOLEAN;
}
{identifier} { yylval.identifier = g_strdup(yytext); return IDENTIFIER; }
[{}()\[\]=,] { yylval.character = *yytext; return *yytext; }
-\n { yylval.character = *yytext; ++yylineno; return *yytext; }
+\n { yylval.character = *yytext; return *yytext; }
. { return INVALID; }
%%