parseaut: support multiple dstar automata
* src/parseaut/parseaut.yy, src/parseaut/scanaut.ll: All multiple dstar automata to be chained. * src/bin/dstar2tgba.cc: Loop over multiple automata in a file. * src/tests/dstar.test: Test that.
This commit is contained in:
parent
209e89a94c
commit
c59e994a2c
4 changed files with 98 additions and 28 deletions
|
|
@ -228,6 +228,7 @@
|
|||
/**** LBTT tokens *****/
|
||||
// Also using INT, STRING
|
||||
%token ENDAUT "-1"
|
||||
%token ENDDSTAR "end of DSTAR automaton"
|
||||
%token <num> LBTT "LBTT header"
|
||||
%token <num> INT_S "state acceptance"
|
||||
%token <num> LBTT_EMPTY "acceptance sets for empty automaton"
|
||||
|
|
@ -261,10 +262,10 @@ aut: aut-1 { res.h->loc = @$; YYACCEPT; }
|
|||
| ENDOFFILE { YYABORT; }
|
||||
| error ENDOFFILE { YYABORT; }
|
||||
|
||||
aut-1: hoa { res.h->type = spot::parsed_aut_type::HOA; }
|
||||
| never { res.h->type = spot::parsed_aut_type::NeverClaim; }
|
||||
| lbtt { res.h->type = spot::parsed_aut_type::LBTT; }
|
||||
| dstar /* we will set type as DSA or DRA while parsing first line */
|
||||
aut-1: hoa { res.h->type = spot::parsed_aut_type::HOA; }
|
||||
| never { res.h->type = spot::parsed_aut_type::NeverClaim; }
|
||||
| lbtt { res.h->type = spot::parsed_aut_type::LBTT; }
|
||||
| dstar /* will set type as DSA or DRA while parsing first line */
|
||||
|
||||
/**********************************************************************/
|
||||
/* Rules for HOA */
|
||||
|
|
@ -1101,7 +1102,7 @@ incorrectly-labeled-edge: trans-label unlabeled-edge
|
|||
/* Rules for LTL2DSTAR's format */
|
||||
/**********************************************************************/
|
||||
|
||||
dstar: dstar_header "---" dstar_states
|
||||
dstar: dstar_header "---" dstar_states ENDDSTAR
|
||||
|
||||
dstar_type: "DRA"
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ static unsigned lbtt_states = 0;
|
|||
|
||||
eol \n+|\r+
|
||||
eol2 (\n\r)+|(\r\n)+
|
||||
eols ({eol}|{eol2})*
|
||||
identifier [[:alpha:]_][[:alnum:]_-]*
|
||||
|
||||
%x in_COMMENT in_STRING in_NEVER_PAR
|
||||
|
|
@ -150,6 +151,14 @@ identifier [[:alpha:]_][[:alnum:]_-]*
|
|||
"Acc-Sig:" return token::ACCSIG;
|
||||
"---" return token::ENDOFHEADER;
|
||||
[0-9]+ parse_int(); return token::INT;
|
||||
/* The start of any automaton is the end of this one.
|
||||
We do not try to detect LBTT automata, as that would
|
||||
be too hard to distinguish from state numbers. */
|
||||
""/{eols}("HOA:"|"never"|"DSA"|"DRA") {
|
||||
BEGIN(INITIAL);
|
||||
return token::ENDDSTAR;
|
||||
}
|
||||
<<EOF>> return token::ENDDSTAR;
|
||||
}
|
||||
|
||||
<in_NEVER>{
|
||||
|
|
@ -185,7 +194,7 @@ identifier [[:alpha:]_][[:alnum:]_-]*
|
|||
If we only tokenize it as a stream of INTs, the parser will have
|
||||
a very hard time recognizing what is a state from what is a
|
||||
transitions. As a consequence we abuse the start conditions to
|
||||
maintain a state an return integers with different sementic types
|
||||
maintain a state an return integers with different semantic types
|
||||
depending on the purpose of those integers. */
|
||||
<in_LBTT_HEADER>{
|
||||
[0-9]+[st]* {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue