Commit 9145515b authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

ltlscan: get rid of boost::lexical_cast

This is one less useless dependency on Boost.

* src/ltlparse/ltlscan.ll: Replace lexical_cast<unsigned>() by
strtoul().
* src/ltltest/parseerr.test: Add a test case.
parent 990ba837
......@@ -26,8 +26,9 @@
%option stack
%{
#include <cstdlib>
#include <string>
#include <boost/lexical_cast.hpp>
#include "ltlparse/parsedecl.hh"
#include "misc/escape.hh"
......@@ -197,13 +198,10 @@ BOXDARROW {BOX}{DARROWL}|"|"{DARROWL}|"⤇"
"["{ARROWL} BEGIN(sqbracket); return token::OP_GOTO_OPEN;
<sqbracket>"]" BEGIN(0); return token::OP_SQBKT_CLOSE;
<sqbracket>[0-9]+ {
unsigned num = 0;
try {
num = boost::lexical_cast<unsigned>(yytext);
yylval->num = num;
return token::OP_SQBKT_NUM;
}
catch (boost::bad_lexical_cast &)
errno = 0;
unsigned long n = strtoul(yytext, 0, 10);
yylval->num = n;
if (errno || yylval->num != n)
{
error_list.push_back(
spot::ltl::parse_error(*yylloc,
......@@ -211,6 +209,10 @@ BOXDARROW {BOX}{DARROWL}|"|"{DARROWL}|"⤇"
// Skip this number and read next token
yylloc->step();
}
else
{
return token::OP_SQBKT_NUM;
}
}
/* .. is from PSL and EDL
: is from Verilog and PSL
......
#! /bin/sh
# Copyright (C) 2009, 2010, 2011 Laboratoire de Recherche et
# Dveloppement de l'Epita (LRDE).
# -*- coding: utf-8 -*-
# Copyright (C) 2009, 2010, 2011, 2013 Laboratoire de Recherche et
# Développement de l'Epita (LRDE).
# Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
# dpartement Systmes Rpartis Coopratifs (SRC), Universit Pierre
# département Systèmes Répartis Coopératifs (SRC), Université Pierre
# et Marie Curie.
#
# This file is part of Spot, a model checking library.
......@@ -99,3 +100,9 @@ syntax error, unexpected $undefined
^^^
ignoring trailing garbage
'
check '{a[*9999999999]}' 'unop(Closure, bunop(Star, AP(a), 0, unbounded))' \
'>>> {a[*9999999999]}
^^^^^^^^^^
value too large ignored
'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment