SILICON
Toggle main menu visibility
Loading...
Searching...
No Matches
isaArchitecture.hpp
Go to the documentation of this file.
1
/*
2
Copyright (c) 2026. Giulio Cocconi
3
4
This program is free software: you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation, either version 3 of the License, or
7
(at your option) any later version.
8
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
13
14
You should have received a copy of the GNU General Public License
15
along with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#pragma once
19
20
#include <optional>
21
#include <string>
22
#include <string_view>
23
#include <vector>
24
25
#include <sisl/sisl.hpp>
26
27
namespace
SILICON::project
{
28
30
[[nodiscard]]
bool
isArchitecturePathSlug
(std::string_view name);
32
[[nodiscard]]
bool
isValidArchitectureName
(std::string_view name);
34
[[nodiscard]] std::optional<std::string>
35
declaredArchitectureName
(std::string_view source);
37
[[nodiscard]] std::string
renameArchitectureDeclaration
(std::string_view source,
38
std::string_view oldName,
39
std::string_view newName);
41
void
validateArchitectureDeclaration
(std::string_view directoryName,
42
std::string_view source);
43
[[nodiscard]] std::string
architectureDirectory
(std::string_view name);
44
46
struct
ArchitectureBuildResult
{
48
std::optional<sisl::Isa>
isa
;
50
std::vector<sisl::Diagnostic>
diagnostics
;
52
std::optional<std::string>
error
;
53
54
[[nodiscard]]
bool
success
() const noexcept {
return
isa
.has_value(); }
55
explicit
operator
bool() const noexcept {
return
success
(); }
56
};
57
68
[[nodiscard]] ArchitectureBuildResult
69
buildArchitecture
(std::optional<std::string> expectedName, std::string_view source);
70
71
}
// namespace SILICON::project
SILICON::project
Definition
circuitDependencyGraph.cpp:30
SILICON::project::declaredArchitectureName
std::optional< std::string > declaredArchitectureName(const std::string_view source)
Definition
isaArchitecture.cpp:108
SILICON::project::renameArchitectureDeclaration
std::string renameArchitectureDeclaration(const std::string_view source, const std::string_view oldName, const std::string_view newName)
Definition
isaArchitecture.cpp:115
SILICON::project::validateArchitectureDeclaration
void validateArchitectureDeclaration(const std::string_view directoryName, const std::string_view source)
Definition
isaArchitecture.cpp:126
SILICON::project::buildArchitecture
ArchitectureBuildResult buildArchitecture(const std::optional< std::string > expectedName, const std::string_view source)
Definition
isaArchitecture.cpp:141
SILICON::project::isValidArchitectureName
bool isValidArchitectureName(const std::string_view name)
Definition
isaArchitecture.cpp:44
SILICON::project::isArchitecturePathSlug
bool isArchitecturePathSlug(const std::string_view name)
Definition
isaArchitecture.cpp:31
SILICON::project::architectureDirectory
std::string architectureDirectory(const std::string_view name)
Definition
isaArchitecture.cpp:136
SILICON::project::ArchitectureBuildResult
Definition
isaArchitecture.hpp:46
SILICON::project::ArchitectureBuildResult::diagnostics
std::vector< sisl::Diagnostic > diagnostics
Definition
isaArchitecture.hpp:50
SILICON::project::ArchitectureBuildResult::isa
std::optional< sisl::Isa > isa
Definition
isaArchitecture.hpp:48
SILICON::project::ArchitectureBuildResult::error
std::optional< std::string > error
Definition
isaArchitecture.hpp:52
SILICON::project::ArchitectureBuildResult::success
bool success() const noexcept
Definition
isaArchitecture.hpp:54
src
core
isaArchitecture.hpp
Generated by
1.17.0