acc: add a parser for string -> acc_code
* src/tgba/acc.cc, src/tgba/acc.hh (parse_acc_code): New function. * src/tgbatest/acc.cc, src/tgbatest/acc.test: Test it.
This commit is contained in:
parent
c65bf731fd
commit
dfd080e005
4 changed files with 174 additions and 0 deletions
|
|
@ -127,4 +127,18 @@ int main()
|
|||
auto code3 = ac.inf({0, 1});
|
||||
code3.append_and(ac.fin({2, 3}));
|
||||
std::cout << code3.size() << ' ' << code3 << ' ' << code3.is_dnf() << '\n';
|
||||
|
||||
|
||||
std::cout << spot::parse_acc_code("t") << '\n';
|
||||
std::cout << spot::parse_acc_code("f") << '\n';
|
||||
std::cout << spot::parse_acc_code("Fin(2)") << '\n';
|
||||
std::cout << spot::parse_acc_code("Inf(2)") << '\n';
|
||||
std::cout << spot::parse_acc_code("Fin(2) | Inf(2)") << '\n';
|
||||
std::cout << spot::parse_acc_code("Inf(2) & Fin(2)") << '\n';
|
||||
auto c1 = spot::parse_acc_code("Fin(0)|Inf(1)&Fin(2)|Fin(3)");
|
||||
auto c2 = spot::parse_acc_code
|
||||
("( Fin ( 0 )) | (Inf ( 1) & Fin(2 ))| Fin (3) ");
|
||||
std::cout << c1 << '\n';
|
||||
std::cout << c2 << '\n';
|
||||
assert(c1 == c2);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue