%{ /* * GThumb * * Copyright (C) 2003 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. */ #include %} number [0-9]+ name [a-zA-Z_][0-9a-zA-Z_:@]* %x TAG STAG %% "" { BEGIN (INITIAL); return TEXT_END; } "{number} { yylval.ivalue = atoi (yytext); return NUMBER; } {name} { yylval.text = g_strdup (yytext); return NAME; } "=" { return '='; } "<" { yylval.ivalue = GTH_OP_CMP_LT; return COMPARE; } ">" { yylval.ivalue = GTH_OP_CMP_GT; return COMPARE; } ">" { BEGIN (INITIAL); return END_TAG; } "+" { return '+'; } "-" { return '-'; } "*" { return '*'; } "/" { return '/'; } "!" { return '!'; } "(" { return '('; } ")" { return ')'; } \" { return '"'; } "&&" { yylval.ivalue = GTH_OP_AND; return BOOL_OP; } "||" { yylval.ivalue = GTH_OP_OR; return BOOL_OP; } "==" { yylval.ivalue = GTH_OP_CMP_EQ; return COMPARE; } "!=" { yylval.ivalue = GTH_OP_CMP_NE; return COMPARE; } "<=" { yylval.ivalue = GTH_OP_CMP_LE; return COMPARE; } ">=" { yylval.ivalue = GTH_OP_CMP_GE; return COMPARE; } [ \t\n] { /* Eat spaces inside tag. */ } "/>" { BEGIN (INITIAL); return END_TAG; } "<" { yylval.text = g_strdup (yytext); return HTML; } [^<]{1,100} { yylval.text = g_strdup (yytext); return HTML; } <> { return 0; } %%