26 lines
566 B
Plaintext
26 lines
566 B
Plaintext
|
%%
|
||
|
%jayscanner TschenrechnerScanner
|
||
|
%jayparser TschenrechnerParser
|
||
|
|
||
|
%class TaschenrechnerLexer
|
||
|
%eofval{
|
||
|
System.out.println("ENd of file: gut gemacht");
|
||
|
return new EOF();
|
||
|
%eofval}
|
||
|
|
||
|
ws = [ \t\r\n\b\015]+
|
||
|
%%
|
||
|
|
||
|
"+" { return new PLUS(); }
|
||
|
"*" { return new MAL(); }
|
||
|
"-" { return new MINUS(); }
|
||
|
"/" { return new GETEILT(); }
|
||
|
"(" { return new KLAMMERAUF(); }
|
||
|
")" { return new KLAMMERZU(); }
|
||
|
[+|-]?[0-9][0-9]*("."[0-9]+)? { return new ZAHL();}
|
||
|
[+|-]?[0-9][0-9]*("."[0-9]+)?"(" {return new KLAMMERAUF();}
|
||
|
{ws} { }
|
||
|
. {System.out.print("Fehler");}
|
||
|
|
||
|
|