%interactive
%filenames scanner

digits  [0-9]+
e       [eE]
sign    [-+]

%%

[ \t]+

{digits}                                return Parser::INT;

{digits}"."                             |
{digits}"."{digits}                     |
{digits}{e}{sign}{digits}               |
{digits}"."{e}{sign}{digits}            |
{digits}"."{digits}{e}{sign}{digits}    |
"."{digits}                             |
"."{e}{sign}{digits}                    |
"."{digits}{e}{sign}{digits}            return Parser::DOUBLE;

"'"."'"                                 return Parser::CHAR;

"+="                                    return Parser::ADDA;
"-="                                    return Parser::SUBA;
"*="                                    return Parser::MULA;
"/="                                    return Parser::DIVA;
"%="                                    return Parser::MODA;
"&="                                    return Parser::ANDA;
"^="                                    return Parser::XORA;
"|="                                    return Parser::ORA;
"<<="                                   return Parser::LSHIFTA;
">>="                                   return Parser::RSHIFTA;

"<<"                                    return Parser::LEFTSHIFT;
">>"                                    return Parser::RIGHTSHIFT;

char                                    |
int                                     |
double                                  return Parser::DATATYPE;

help                                    return Parser::HELP;

rad                                     |
deg                                     |
grad                                    return Parser::ANGLETYPE;

list                                    return Parser::LIST;

stop                                    |
quit                                    |
exit                                    return Parser::QUIT;

PI                                      |
E                                       return Parser::MATHCONST;

[a-zA-Z_][a-zA-Z_0-9]*                  return Parser::IDENT;

\n|.                                    return matched()[0];

%%



