feat(domain-and-input-skeleton): step 2 — abaqus-scoped-syntax-parser

This commit is contained in:
KOKO\Mimi
2026-07-30 18:01:05 +09:00
parent ceaf92f2a9
commit abbc408aec
9 changed files with 807 additions and 1 deletions
+46
View File
@@ -0,0 +1,46 @@
#pragma once
#include <functional>
#include <map>
#include <optional>
#include <string>
#include <vector>
#include <fesa/core/source_location.hpp>
namespace fesa {
struct DeckRecord final {
std::string keyword;
std::map<std::string, std::string, std::less<>> parameters;
std::vector<std::vector<std::string>> data;
SourceLocation source;
};
struct ParsedPart final {
std::string name;
std::vector<DeckRecord> records;
SourceLocation source;
};
struct ParsedInstance final {
std::string name;
std::string part_name;
std::vector<std::vector<std::string>> transform_data;
SourceLocation source;
};
struct ParsedAssembly final {
std::string name;
std::vector<ParsedInstance> instances;
std::vector<DeckRecord> records;
SourceLocation source;
};
struct ParsedDeck final {
std::vector<DeckRecord> global_records;
std::vector<ParsedPart> parts;
std::optional<ParsedAssembly> assembly;
};
} // namespace fesa
+20
View File
@@ -0,0 +1,20 @@
#pragma once
#include <filesystem>
#include <optional>
#include <vector>
#include <fesa/core/diagnostic.hpp>
#include <fesa/io/abaqus/deck_record.hpp>
namespace fesa {
struct ParseDeckResult final {
std::optional<ParsedDeck> deck;
std::vector<Diagnostic> diagnostics;
};
[[nodiscard]] ParseDeckResult parse_deck(
const std::filesystem::path& path);
} // namespace fesa