Started to Implement the Parser
This commit is contained in:
16
MathPad/MPMath.lm
Normal file
16
MathPad/MPMath.lm
Normal file
@@ -0,0 +1,16 @@
|
||||
%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; }
|
||||
%%
|
||||
Reference in New Issue
Block a user