%{ /* * This is a plug-in for the GIMP. * * Split up images according to a given formula. * * Copyright (C) 1999 Maurits Rijk lpeek.mrijk@consunet.nl * * 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 Place - Suite 330, Boston, MA 02111-1307, USA. * */ #include #include #include "expression.h" #include "parse.h" #ifdef FLEX_SCANNER #define YY_NO_UNPUT #endif %} %option noyywrap DIGIT [0-9] %% {DIGIT}+ {yylval.ival = atoi(yytext); return INT;} {DIGIT}*"."?{DIGIT}*([Ee][-+]?{DIGIT}+)? { yylval.dval = atof(yytext); return DOUBLE;} X {return X;} Y {return Y;} W {return WIDTH;} H {return HEIGHT;} ABS {return ABS;} ACOS {return ACOS;} ASIN {return ASIN;} ATAN {return ATAN;} ATAN2 {return ATAN2;} CEIL {return CEIL;} COS {return COS;} COSH {return COSH;} E {return E_TOKEN;} EXP {return EXP;} FABS {return ABS;} FLOOR {return FLOOR;} FMOD {return MOD;} LDEXP {return LDEXP;} LOG {return LOG;} LOG10 {return LOG10;} MAX {return MAX;} MIN {return MIN;} MOD {return MOD;} PI {return PI_TOKEN;} POW {return POW;} RAND {return RAND;} RINT {return RINT;} SIN {return SIN;} SINH {return SINH;} SQRT {return SQRT;} TAN {return TAN;} TANH {return TANH;} [ \t\n]+ /* eat up whitespace */ . {return *yytext;} %%