jLexUndSo/browserlexer

23 lines
412 B
Plaintext
Raw Permalink Normal View History

2023-12-06 12:10:50 +00:00
%%
%jayscanner browserscanner
%jayparser browserparser
%class browserlexer
%eofval{
return new EOF();
%eofval}
ws = [ \t\r\n\b \015]+
%%
[0-9]+ { return new NUM(yytext()) ; }
"+" { return new PLS(); }
"-" { return new MIN(); }
"*" { return new MUL(); }
"/" { return new DIV(); }
"(" { return new BROP(); }
")" { return new BRCL(); }
{ws} { System.out.println(yytext()); }
. { System.out.println("Falsch"); }