You are on page 1of 1

package fes.

aragon;
import static fes aragon.Tokens.*;
%%
%class Lexico
%type Tokens
L = [a-zA-Z_]
D =[0-9]
WHITE=[ \t\r\n]
%{
public String lexema;
%}
%%
{WHITE} {/*Ignore*/}
"=" {return ASSIGN;}
"+" {return SUMA;}
"*" {return MULT;}
"-" {return RESTA;}
"/" {return DIV;}
{L}({L} | {D})* {lexema=yytext(); return ID;}
("(-"{D}+")")|{D}+ {lexena =yytext(); return INT;}
. {return ERROR;}

You might also like