neverpase: fix parsing of neverclaim produced by ltl2ba and ltl3ba

These translator may output guards such as (a) || (b), but with the
changes in Spot 1.1.3 it would only work with ((a) || (b)).

Furthermore when ltlcross would fail to parse a neverclaim containing
such a guard, it would fail to parse all later neverclaims, because
the lexer was not properly reset.

* src/neverparse/neverclaimscan.ll: Scan (a) || (b) as a single
token.
(neverclaimyyopen): Reset the lexer.
* src/tgbatest/neverclaimread.test: Add a test for (a) || (b).
* NEWS: Update.
This commit is contained in:
Alexandre Duret-Lutz 2013-07-20 19:38:14 +02:00
parent 365d0ead94
commit 84c9f03767
3 changed files with 45 additions and 1 deletions

View file

@ -74,6 +74,10 @@ eol \n|\r|\n\r|\r\n
++parent_level;
yylval->str->append(yytext, yyleng);
}
/* if we match ")&&(" or ")||(", stay in <in_par> mode */
")"[ \t]*("&&"|"||")[ \t]*"(" {
yylval->str->append(yytext, yyleng);
}
")" {
yylval->str->append(yytext, yyleng);
if (!--parent_level)
@ -128,6 +132,10 @@ namespace spot
if (!yyin)
return 1;
}
// Reset the lexer in case a previous parse
// ended badly.
BEGIN(0);
YY_NEW_FILE;
return 0;
}