%{ #include "../build/commonlisp2transpilerstr.tab.h" %} DIGIT [0-9] LEFTBRACKET \( RIGHTBRACKET \) /* STR \"([^\"]|\\\")*([^\\]|\\\\)\" */ INTEGER (\+|-)?{DIGIT} FLOAT {INTEGER}(\.{DIGIT}+(e{DIGIT}+|d{DIGIT}+|e-{DIGIT}+)?|\/{DIGIT}+)? COMMENT ;.*$ FUNCTION "+ "|"- "|"* "|\/|defun|defvar|if|=|>|>=|<|<= %% {LEFTBRACKET} { return LBRACKET; } {RIGHTBRACKET} { return RBRACKET; } /* {STR} { yylval = strdup(yytext); return STR; } */ {INTEGER} { yylval = strdup(yytext); return INTEGER; } {FLOAT} { yylval = strdup(yytext); return FLOAT;} {FUNCTION} { yylval = strdup(yytext); return FUNCTION; } /* flex catches the longest possibility, so if some variable name contains a known word (function, macro, etc.), this will prevent it from highlighting */ [A-z!-'*-@]+|" "|\t { yylval = strdup(yytext); return NAME; } %%