You are on page 1of 1

/*calculadora.jlex */ import java.lang.System; class Analex { public static void main(String argv[]) throws java.io.IOException { Yylex yy = new Yylex(System.

in); while (yy.yylex() != null) {} } } class Yytoken{ Yytoken () } %% %eofval{ {System.exit(0);} %eofval} NUMBER=[1-9][0-9]* %% {NUMBER} {System.out.printf("Numero");} "+" {System.out.printf("MAS");} "-" {System.out.printf("MENOS");} "*" {System.out.printf("POR");} "/" {System.out.printf("DIV");} "(" {System.out.printf("PARI");} ")" {System.out.printf("PARD");} ";" {System.out.print("FIN");} [.|\n] {System.out.printf("\n"); } {}

You might also like