Bash++
Bash++ compiler internal documentation
resolve_entity.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2025 Andrew S. Rightenburg
3 * Bash++: Bash with classes
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6#pragma once
7
8#include <memory>
9#include <string>
10#include <cstdint>
11
12#include <lsp/ProgramPool.h>
13#include <AST/ASTNode.h>
15
16std::shared_ptr<AST::ASTNode> find_node_at_position(std::shared_ptr<AST::ASTNode> node, uint32_t line, uint32_t column);
17
37std::shared_ptr<bpp::bpp_entity> resolve_entity_at(
38 const std::string& file,
39 uint32_t line,
40 uint32_t column,
41 std::shared_ptr<bpp::bpp_program> program
42);
43
53std::vector<std::shared_ptr<bpp::bpp_entity>> find_all_entities_for(
54 const std::string& file,
55 uint32_t line,
56 uint32_t column,
57 const std::vector<std::shared_ptr<bpp::bpp_program>>& programs
58);
59
70std::string find_comments_for_entity(std::shared_ptr<bpp::bpp_entity> entity, ProgramPool* program_pool);
Manages a pool of bpp_program objects for efficient reuse and access.
Definition ProgramPool.h:36
std::shared_ptr< AST::ASTNode > find_node_at_position(std::shared_ptr< AST::ASTNode > node, uint32_t line, uint32_t column)
Definition resolve_entity.cpp:19
std::shared_ptr< bpp::bpp_entity > resolve_entity_at(const std::string &file, uint32_t line, uint32_t column, std::shared_ptr< bpp::bpp_program > program)
Resolves the entity referenced at the given line and column in the specified file.
Definition resolve_entity.cpp:47
std::string find_comments_for_entity(std::shared_ptr< bpp::bpp_entity > entity, ProgramPool *program_pool)
Finds comments ostensibly associated with the given entity's definition.
Definition resolve_entity.cpp:393
std::vector< std::shared_ptr< bpp::bpp_entity > > find_all_entities_for(const std::string &file, uint32_t line, uint32_t column, const std::vector< std::shared_ptr< bpp::bpp_program > > &programs)
Calls resolve_entity_at for all programs passed in, and returns a vector of all entities found.
Definition resolve_entity.cpp:379