From 04ca8c0df36db846ec67c53ef57746d4ac545145 Mon Sep 17 00:00:00 2001 From: romildo Date: Sat, 8 Oct 2016 21:24:10 -0300 Subject: [PATCH] Rename numeric literal terminal symbol --- src/main/cup/parser.cup | 2 +- src/main/jflex/lexer.jflex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/cup/parser.cup b/src/main/cup/parser.cup index ea6f1b5..0dc1eaa 100644 --- a/src/main/cup/parser.cup +++ b/src/main/cup/parser.cup @@ -1,6 +1,6 @@ package parse; -terminal LITINT; +terminal LITNUM; terminal PLUS, MINUS, TIMES, DIV; terminal LPAREN, RPAREN; diff --git a/src/main/jflex/lexer.jflex b/src/main/jflex/lexer.jflex index c79771e..295259e 100644 --- a/src/main/jflex/lexer.jflex +++ b/src/main/jflex/lexer.jflex @@ -47,7 +47,7 @@ import java_cup.runtime.ComplexSymbolFactory; [ \t\f\n\r]+ { /* skip */ } -[0-9]+ ("." [0-9]+)? { return tok(LITINT, yytext()); } +[0-9]+ ("." [0-9]+)? { return tok(LITNUM, new Double(yytext())); } "+" { return tok(PLUS); } "-" { return tok(MINUS); }