// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "uLang/Toolchain/ModularFeature.h" #include "uLang/CompilerPasses/SemanticAnalyzerPassUtils.h" #include "uLang/Common/Containers/SharedPointer.h" #include "uLang/Semantics/SemanticProgram.h" namespace Verse { namespace Vst { struct Node; struct Snippet; struct Package; struct Project; } } namespace uLang { // Forward declarations struct SBuildContext; struct SProgramContext; class CUTF8StringView; class CSemanticProgram; struct SIntraSemInjectArgs { SIntraSemInjectArgs(const TSRef& Program) : _Program(Program) {} const TSRef& _Program; ESemanticPass _InjectionPass = ESemanticPass::SemanticPass_Invalid; }; template class TApiLayerInjection : public TModularFeature { public: /** @return True to halt the toolchain from continuing to build -- NOTE: could be ignored (depending on current build settings). */ virtual bool Ingest(InjectionArgsType... Args, const SBuildContext& BuildContext) = 0; }; class IPreParseInjection : public TApiLayerInjection { ULANG_FEATURE_ID_DECL(IPreParseInjection); }; class IPostParseInjection : public TApiLayerInjection&> { ULANG_FEATURE_ID_DECL(IPostParseInjection); }; class IPreSemAnalysisInjection : public TApiLayerInjection&, const SProgramContext&> { ULANG_FEATURE_ID_DECL(IPreSemAnalysisInjection); }; class IIntraSemAnalysisInjection : public TApiLayerInjection { ULANG_FEATURE_ID_DECL(IIntraSemAnalysisInjection); }; class IPostSemAnalysisInjection : public TApiLayerInjection&, const SProgramContext&> { ULANG_FEATURE_ID_DECL(IPostSemAnalysisInjection); }; class IPreTranslateInjection : public TApiLayerInjection&, const SProgramContext&> { ULANG_FEATURE_ID_DECL(IPreTranslateInjection); }; class IPreLinkInjection : public TApiLayerInjection { ULANG_FEATURE_ID_DECL(IPreLinkInjection); }; }