Structure¶
Instructions¶
Control Instructions¶
The set of recognised instructions is extended with the following:
The instructions \(\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{try}}\) and \(\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{rethrow}}\), are concerned with exceptions. The \(\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{try}}\) instruction installs an exception handler, and may either handle exceptions in the case of \(\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{catch}}\) and \(\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{catch\_all}}\), or rethrow them in an outer block in the case of \(\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{delegate}}\).
The \(\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{rethrow}}\) instruction is only allowed inside a \(\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{catch}}\) or \(\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{catch\_all}}\) clause and allows rethrowing the caught exception by lexically referring to a the corresponding \(\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{try}}\).
When \(\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{try}}\)-\(\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{delegate}}\) handles an exception, it also behaves similar to a forward jump, effectively rethrowing the caught exception right before the matching \(\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{end}}\).