WS [ \n\t]+ LT [A-Za-z] KR [A-Za-z0-9_\[\]\{\}/.&#$%~'@^] DI [0-9] NM {DI}*\.?{DI}+([Ee][-+]?{DI}+)? VR {LT}{KR}*(<{KR}+>)? S_OP [-+ \t\n]+ LOG [<>]?=? %start COMMENT %% "/*" { BEGIN COMMENT; } /* begin skip comment */ "*/" { BEGIN INITIAL; } /* end skip comment */ . { } \n { } {WS} { } "," { return(COMMA); } [mM][iI][nN]":" { return(MINIMISE); } [mM][aA][xX]":" { return(MAXIMISE); } {NM} { f = atof((char *)yytext); return(CONS); } /* f contains the last float */ {S_OP} { Sign = 0; for(x = 0; x < yyleng; x++) if(yytext[x] == '-' || yytext[x] == '+') Sign = (Sign == (yytext[x] == '+')); return (SIGN); /* Sign is TRUE if the sign-string represents a '-'. Otherwise Sign is FALSE */ } [Ii][Nn][Tt] { Within_int_decl = TRUE; return(VAR); } {VR} { strcpy(Last_var, (char *)yytext); return(VAR); } ":" { return (COLON); } "*" { return(AR_M_OP); } {LOG} { return(RE_OP); } ";" { Within_int_decl = FALSE; return(END_C); } . { report(NULL, CRITICALSTOP,"LEX ERROR : %s lineno %d \n" ,yytext,yylineno); } %%