* src/ltlparse/ltlparse.yy: Handle and diagnose mismatched parentheses.
* src/ltltest/parseerr.test: Add some examples.
This commit is contained in:
parent
1276abd290
commit
fb014cc35a
3 changed files with 24 additions and 5 deletions
|
|
@ -120,11 +120,19 @@ subformula: ATOMIC_PROP
|
|||
"treating this parenthetical block as false"));
|
||||
$$ = constant::false_instance();
|
||||
}
|
||||
| PAR_OPEN subformula many_errors PAR_CLOSE
|
||||
{ error_list.push_back(parse_error(@3,
|
||||
"unexpected input ignored"));
|
||||
| PAR_OPEN subformula many_errors_diagnosed PAR_CLOSE
|
||||
{ $$ = $2; }
|
||||
| PAR_OPEN subformula many_errors_diagnosed END_OF_INPUT
|
||||
{ error_list.push_back(parse_error(@1 + @2,
|
||||
"missing closing parenthesis"));
|
||||
$$ = $2;
|
||||
}
|
||||
| PAR_OPEN many_errors_diagnosed END_OF_INPUT
|
||||
{ error_list.push_back(parse_error(@$,
|
||||
"missing closing parenthesis, "
|
||||
"treating this parenthetical block as false"));
|
||||
$$ = constant::false_instance();
|
||||
}
|
||||
| OP_NOT subformula
|
||||
{ $$ = unop::instance(unop::Not, $2); }
|
||||
| subformula OP_AND subformula
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue