16 lines
384 B
Plaintext
16 lines
384 B
Plaintext
%option noyywrap
|
|
%{
|
|
@import Foundation;
|
|
#include "MPMath.tab.h"
|
|
%}
|
|
%%
|
|
/* Ignore Whitespaces */
|
|
[ \t\n] ;
|
|
/* Operators. Divisions are automatically transformed into fractions and dealt
|
|
with elsewhere. */
|
|
\+ { return PLUS; }
|
|
- { return MINUS; }
|
|
\* { return DOT; }
|
|
/* Numbers */
|
|
[0-9]+(\.[0-9]+)? { yylval.number = atof(yytext); return NUMBER; }
|
|
%% |