aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/shedlang/compiler/patio/instructions/PatioTry.java
blob: 953681416155fc87cd8042408e7c055fd0a91c17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package org.shedlang.compiler.patio.instructions;

import org.shedlang.compiler.patio.operands.PatioLocalRef;
import org.shedlang.compiler.sources.Source;

import java.util.List;

/// Push an exception handler with the given catch clauses onto the control flow
/// stack, and then execute the instructions in its body.
///
/// If the exception handler catches an exception, the body of the corresponding
/// is executed instead.
///
/// Each block (that is, the body of the try and the body of each catch clause)
/// must have the same number of results as destinations. Each result is assigned to
/// the destination with the same index.
public record PatioTry(
    List<PatioLocalRef> destinations,
    List<PatioCatchClause> catchClauses,
    PatioBlock body,
    Source source
) implements PatioInstruction {
    @Override
    public boolean isBlockTerminator() {
        return false;
    }
}