package p.studio.compiler.pbs.semantics;

import p.studio.compiler.messages.FESurfaceContext;
import p.studio.compiler.pbs.ast.PbsAst;
import p.studio.compiler.services.PbsInlineHintSurface;
import p.studio.compiler.source.diagnostics.DiagnosticSink;
import p.studio.utilities.structures.ReadOnlyList;

public final class PbsFlowSemanticsValidator {
    private final PbsFlowBodyAnalyzer flowBodyAnalyzer = new PbsFlowBodyAnalyzer();

    public void validate(final PbsAst.File ast, final DiagnosticSink diagnostics) {
        flowBodyAnalyzer.validate(ast, ReadOnlyList.empty(), FESurfaceContext.empty(), diagnostics);
    }

    public void validate(
            final PbsAst.File ast,
            final ReadOnlyList<PbsAst.TopDecl> supplementalTopDecls,
            final FESurfaceContext feSurfaceContext,
            final DiagnosticSink diagnostics) {
        flowBodyAnalyzer.validate(ast, supplementalTopDecls, feSurfaceContext, diagnostics);
    }

    public ReadOnlyList<PbsInlineHintSurface> collectInlineHints(
            final PbsAst.File ast,
            final ReadOnlyList<PbsAst.TopDecl> supplementalTopDecls,
            final FESurfaceContext feSurfaceContext,
            final DiagnosticSink diagnostics) {
        return flowBodyAnalyzer.collectInlineHints(ast, supplementalTopDecls, feSurfaceContext, diagnostics);
    }
}
