import java_cup.runtime.Symbol; %% %char %line %type Symbol %{ private Symbol token(int id, Object value) { return new Symbol(id, yychar, yyline, value); } private Symbol token(int id) { return token(id, yytext()); } %} %eofval{ return token(sym.EOF); %eofval} %% "+" { return token(sym.MAIS); } "-" { return token(sym.MENOS); } [0-9]+ { return token(sym.INTEIRO, yytext()); } [\ \n\t] { /* ignora brancos */ } . { System.err.println("** Carácter inválido: `" + yytext() + "'"); return token(sym.ERRO); }