Archived
1

Started to Implement the Parser

This commit is contained in:
Kim Wittenburg
2014-09-06 01:54:15 +02:00
parent 6aafbf9d2e
commit 8df8317413
10 changed files with 570 additions and 16 deletions

16
MathPad/MPMath.lm Normal file
View 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; }
%%