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:
Alexandre Duret-Lutz 2015-04-14 20:28:37 +02:00
parent c65bf731fd
commit dfd080e005
4 changed files with 174 additions and 0 deletions

View file

@ -968,6 +968,25 @@ namespace spot
bool uses_fin_acceptance_ = false;
};
/// \brief Parse a string into an acc_code
///
/// The string should follow the following grammar:
///
/// <pre>
/// acc ::= "t"
/// | "f"
/// | "Inf" "(" num ")"
/// | "Fin" "(" num ")"
/// | "(" acc ")"
/// | acc "&" acc
/// | acc "|" acc
/// </pre>
///
/// Where num is an integer and "&" has priority over "|". Note that
/// "Fin(!x)" and "Inf(!x)" are not supported by this parser.
///
/// A spot::parse_error is thrown on syntax error.
SPOT_API acc_cond::acc_code parse_acc_code(const char* input);
}
namespace std