13 #include <unordered_map>
18 class NamespaceRegistry;
27 const std::shared_ptr<SymbolFactory>& symbolFactory,
28 const std::shared_ptr<TypeDescriptorFactory>& typeDescriptorFactory,
29 const std::shared_ptr<StringPool>& stringPool,
30 const std::shared_ptr<NamespaceRegistry>& namespaceRegistry
42 std::vector<std::string_view> namespacePaths;
43 std::unordered_map<std::string_view, std::string_view> symbolAliases;
46 [[nodiscard]] std::string_view JoinQualifiedName(
const std::string_view& left,
const std::string_view& right)
const;
47 [[nodiscard]] std::string_view GetCurrentNamespace()
const;
48 [[nodiscard]]
bool IsQualifiedName(
const std::string_view& name)
const;
49 [[nodiscard]] std::string_view GetLastSegment(
const std::string_view& name)
const;
50 [[nodiscard]]
bool IsActorSymbol(
const std::string_view& name)
const;
51 [[nodiscard]]
bool IsTypeSymbol(
const std::string_view& name)
const;
52 [[nodiscard]] std::string_view ResolveAlias(
const std::string_view& name)
const;
53 [[nodiscard]] std::string_view ResolveTypeName(
const std::string_view& name)
const;
54 [[nodiscard]] std::string_view ResolveSymbolName(
const std::string_view& name)
const;
55 void ResolveTypeDescriptionScoped(
const std::shared_ptr<SyntaxNode>& node);
56 void RejectActorTypeName(
const std::shared_ptr<SyntaxNode>& node);
57 void ResolveVariableDescription(
const std::shared_ptr<SyntaxNode>& node,
const Symbol::MemoryTypeId memoryTypeId,
const bool isStaticVariable);
58 std::string_view ResolveConstSymbolName(
const std::string_view& name)
const;
59 void ResolveConstExpressionSymbols(
const std::shared_ptr<SyntaxNode>& node);
61 void EnterNamespace(
const std::string_view& name);
63 void ResolveUsingDeclaration(
const std::shared_ptr<SyntaxNode>& node);
64 void ResolveActionReference(
const std::shared_ptr<SyntaxNode>& node,
const std::string_view& actionName);
65 static bool HasAction(
const std::shared_ptr<Symbol>& actorSymbol,
const std::string_view& actionName);
68 void AutoCast(
const std::shared_ptr<SyntaxNode>& node);
70 std::vector<std::string_view> mNamespaceStack;
71 std::vector<UsingScope> mUsingScopes;
72 std::shared_ptr<NamespaceRegistry> mNamespaceRegistry;
Definition: LocalSemanticAnalyzer.h:24
void EndNamespaceScope()
Definition: LocalSemanticAnalyzer.cpp:35
void PostResolverResolve(std::shared_ptr< SyntaxNode > node)
Definition: LocalSemanticAnalyzer.cpp:582
LocalSemanticAnalyzer(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: LocalSemanticAnalyzer.cpp:19
~LocalSemanticAnalyzer() override=default
void BeginNamespaceScope(const std::string_view &name)
Definition: LocalSemanticAnalyzer.cpp:30
Definition: SemanticAnalyzer.h:20
MemoryTypeId
Definition: Symbol.h:62
Id
type identifier
Definition: TypeDescriptor.h:31
Definition: CodeBuffer.cpp:12