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
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue