You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the invocation of a ctor throws an Exception, the type of which is declared in the throws clause, it is considered a semantic predicate failure; the corresponding production rule is considered to fail to match the input. But this is not fatal, the parser will try alternatives if there's any.
If a ctor throws any other Exception, it is a Fatal error that stops the parser immediately.
If a ctor throws an Error, we do not catch it or handle it, it will propagate out of our parser. It is more fatal than Fatal.
The text was updated successfully, but these errors were encountered:
zhong-j-yu
changed the title
Declared Exception as semantic predicate
Semantic predicate failures as declared Exceptions
Sep 4, 2021
Previously, whenever a ctor throws an IllegalArgumentException, it's considered a semantic predicate failure.
The new design requires that predicate failures be declared in method signature, thus the parser knows whether a ctor may contain semantic predicates. If a ctor contains semantic predicates, the ctor must be invoked to see if it satisfies the predicates; if not, move on to succeeding alternatives. But if a ctor does not contain predicates, it does not need to be invoked immediately; it could be invoked much later, e.g. at the end of the parsing process.
If the invocation of a ctor throws an
Exception
, the type of which is declared in thethrows
clause, it is considered a semantic predicate failure; the corresponding production rule is considered to fail to match the input. But this is not fatal, the parser will try alternatives if there's any.If a ctor throws any other
Exception
, it is a Fatal error that stops the parser immediately.If a ctor throws an
Error
, we do not catch it or handle it, it will propagate out of our parser. It is more fatal than Fatal.The text was updated successfully, but these errors were encountered: