10 real [-0-9][0-9]*\.[0-9]+
13 identifier [a-zA-Z][-.a-zA-Z0-9]*
14 bool ([tT][rR][uU][eE]|[fF][aA][lL][sS][eE]|[yY][eE][sS]|[nN][oO]|[oO][nN]|[oO][fF][fF])
18 ^[ \t]*#.*\n /* comment */ { ++yylineno; }
19 ^[ \t]*#.* /* comment */
20 ^[ \t]*\n /* empty lines */ { ++yylineno; }
21 [ \t] /* whitespace */
22 {real} { yylval.real = atof(yytext); return REAL; }
23 {integer} { yylval.integer = atoi(yytext); return INTEGER; }
24 {string} { yylval.string = g_strdup(yytext+1); /* drop the left quote */
25 if (yylval.string[yyleng-2] != '"')
26 yyerror("improperly terminated string on line %d");
28 yylval.string[yyleng-2] = '\0';
31 {bool} { yylval.bool = (!g_ascii_strcasecmp("true", yytext) ||
32 !g_ascii_strcasecmp("yes", yytext) ||
33 !g_ascii_strcasecmp("on", yytext));
36 {identifier} { yylval.identifier = g_strdup(yytext); return IDENTIFIER; }
37 [{}()\[\]=,] { yylval.character = *yytext; return *yytext; }
38 \n { yylval.character = *yytext; return *yytext; }