From 86c78db45fad37209663bf87547a50a880760051 Mon Sep 17 00:00:00 2001 From: Checkmate50 Date: Tue, 19 Jul 2016 16:39:54 -0600 Subject: fixed an issue with parsing floating points --- Source/Core/BoogiePL.atg | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Source/Core/BoogiePL.atg') diff --git a/Source/Core/BoogiePL.atg b/Source/Core/BoogiePL.atg index 31823110..f74f8bff 100644 --- a/Source/Core/BoogiePL.atg +++ b/Source/Core/BoogiePL.atg @@ -145,7 +145,11 @@ TOKENS decimal = digit {digit} 'e' [ '-' ] digit {digit} . dec_float = digit {digit} '.' digit {digit} [ 'e' [ '-' ] digit {digit} ] . - float = digit {digit} 'e' digit {digit} 'f' digit {digit} 'e' digit {digit} . + float = [ '-' ] digit {digit} 'e' [ '-' ] digit {digit} 'f' digit {digit} 'e' digit {digit} + | '0' 'N' 'a' 'N' digit {digit} 'e' digit {digit} + | '0' 'n' 'a' 'n' digit {digit} 'e' digit {digit} + | '0' '+' 'o' 'o' digit {digit} 'e' digit {digit} + | '0' '-' 'o' 'o' digit {digit} 'e' digit {digit} . COMMENTS FROM "/*" TO "*/" NESTED COMMENTS FROM "//" TO lf @@ -1292,7 +1296,7 @@ AtomExpression Expression ")" (. e = new NAryExpr(x, new ArithmeticCoercion(x, ArithmeticCoercion.CoercionType.ToReal), new List{ e }); .) - | "(" ( Expression (. if (e is BvBounds) + | "(" ( Expression (. if (e is BvBounds) this.SemErr("parentheses around bitvector bounds " + "are not allowed"); .) | Forall (. x = t; .) @@ -1518,8 +1522,8 @@ Float ) (. try { n = BigFloat.FromString(s); - } catch (FormatException) { - this.SemErr("incorrectly formatted number"); + } catch (FormatException e) { + this.SemErr("incorrectly formatted floating point, " + e.Message); n = BigFloat.ZERO; } .) -- cgit v1.2.3