10 #include <unordered_map>
15 class NamespaceRegistry;
25 const std::shared_ptr<SymbolFactory>& symbolFactory,
26 const std::shared_ptr<TypeDescriptorFactory>& typeDescriptorFactory,
27 const std::shared_ptr<StringPool>& stringPool,
28 const std::shared_ptr<NamespaceRegistry>& namespaceRegistry);
35 void Resolve(std::shared_ptr<SyntaxNode> node);
40 std::vector<std::string_view> namespacePaths;
41 std::unordered_map<std::string_view, std::string_view> symbolAliases;
44 static size_t CalcArgumentCount(
const size_t count,
const std::shared_ptr<const SyntaxNode>& node);
45 [[nodiscard]] std::string_view JoinQualifiedName(
const std::string_view& left,
const std::string_view& right)
const;
46 [[nodiscard]] std::string_view GetCurrentNamespace()
const;
47 [[nodiscard]]
bool IsQualifiedName(
const std::string_view& name)
const;
48 [[nodiscard]] std::string_view GetLastSegment(
const std::string_view& name)
const;
49 [[nodiscard]]
bool IsActorSymbol(
const std::string_view& name)
const;
50 [[nodiscard]]
bool IsTypeSymbol(
const std::string_view& name)
const;
51 [[nodiscard]] std::string_view ResolveAlias(
const std::string_view& name)
const;
52 std::string_view QualifyName(
const std::string_view& name);
53 std::string_view QualifyNameIfUnqualified(
const std::string_view& name);
54 std::string_view ResolveTypeName(
const std::string_view& name);
55 std::string_view ResolveExtendName(
const std::string_view& name)
const;
56 void ResolveTypeDescriptionScoped(
const std::shared_ptr<SyntaxNode>& node);
57 void RejectActorTypeName(
const std::shared_ptr<SyntaxNode>& node);
58 void ResolveVariableDescription(
const std::shared_ptr<SyntaxNode>& node,
const Symbol::MemoryTypeId memoryTypeId,
const bool isStaticVariable);
59 std::string_view ResolveConstSymbolName(
const std::string_view& name)
const;
60 void ResolveConstExpressionSymbols(
const std::shared_ptr<SyntaxNode>& node);
61 void EnterNamespace(
const std::string_view& name);
63 void RegisterNamespaceHierarchy(
const std::string_view& fullName);
64 void ResolveUsingDeclaration(
const std::shared_ptr<SyntaxNode>& node);
67 bool mStaticBlockOpened =
false;
68 std::vector<std::string_view> mNamespaceStack;
69 std::vector<UsingScope> mUsingScopes;
70 std::shared_ptr<NamespaceRegistry> mNamespaceRegistry;
Definition: GlobalSemanticAnalyzer.h:22
void Resolve(std::shared_ptr< SyntaxNode > node)
Definition: GlobalSemanticAnalyzer.cpp:568
GlobalSemanticAnalyzer(const std::shared_ptr< SymbolFactory > &symbolFactory, const std::shared_ptr< TypeDescriptorFactory > &typeDescriptorFactory, const std::shared_ptr< StringPool > &stringPool, const std::shared_ptr< NamespaceRegistry > &namespaceRegistry)
Definition: GlobalSemanticAnalyzer.cpp:18
~GlobalSemanticAnalyzer() override=default
Definition: SemanticAnalyzer.h:20
MemoryTypeId
Definition: Symbol.h:62
Definition: CodeBuffer.cpp:12