8 extern void yyerror(char *err);
13 real [-0-9][0-9]*\.[0-9]+
16 identifier [a-zA-Z][.a-zA-Z0-9]*
17 bool ([tT][rR][uU][eE]|[fF][aA][lL][sS][eE]|[yY][eE][sS]|[nN][oO]|[oO][nN]|[oO][fF][fF])
21 ^[ \t]*#.*\n /* comment */ { ++yylineno; }
22 ^[ \t]*#.* /* comment */
23 ^[ \t]*\n /* empty lines */ { ++yylineno; }
24 [ \t] /* whitespace */
25 {real} { yylval.real = atof(yytext); return REAL; }
26 {integer} { yylval.integer = atoi(yytext); return INTEGER; }
27 {string} { yylval.string = g_strdup(yytext+1); /* drop the left quote */
28 if (yylval.string[yyleng-2] != '"')
29 yyerror("improperly terminated string on line %d");
31 yylval.string[yyleng-2] = '\0';
34 {bool} { yylval.bool = (!g_ascii_strcasecmp("true", yytext) ||
35 !g_ascii_strcasecmp("yes", yytext) ||
36 !g_ascii_strcasecmp("on", yytext));
39 {identifier} { yylval.identifier = g_strdup(yytext); return IDENTIFIER; }
40 [{}()\[\]=,] { yylval.character = *yytext; return *yytext; }
41 \n { yylval.character = *yytext; ++yylineno; return *yytext; }