Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
%option noyywrap
%option yylineno
%{
#include <stdio.h>
#define YY_DECL int yylex()
#include "floc.tab.hpp"
%}
%%
[ \t] ; // ignore all whitespace
[0-9]+ { yylval.val = atoi(yytext); return T_INT;}
\n+ {return T_NEWLINE;}
"+" {return '+';}
"-" {return '-';}
"*" {return '*';}
"/" {return '/';}
"(" {return '(';}
")" {return ')';}
"{" {return '{';}
"}" {return '}';}
"|" {return '|';}
":" {return ':';}
"?" {return '?';}
"&" {return '&';}
"<" {return '<';}
">" {return '>';}
"=" {return '=';}
">=" {return T_GE;}
"<=" {return T_LE;}
"==" {return T_EQ;}
"!=" {return T_NE;}
"def" {return T_DEF;}
[a-zA-Z]+ { yylval.name = yytext; return T_ID;}
%%