mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-09-09 15:37:05 +00:00
chore: update ZoneCodeGenerator code style
This commit is contained in:
@@ -5,9 +5,9 @@
|
||||
|
||||
class CommandsLexer final : public AbstractLexer<CommandsParserValue>
|
||||
{
|
||||
protected:
|
||||
CommandsParserValue GetNextToken() override;
|
||||
|
||||
public:
|
||||
explicit CommandsLexer(IParserLineStream* stream);
|
||||
|
||||
protected:
|
||||
CommandsParserValue GetNextToken() override;
|
||||
};
|
||||
|
||||
@@ -8,11 +8,12 @@
|
||||
|
||||
class CommandsParser final : public AbstractParser<CommandsParserValue, CommandsParserState>
|
||||
{
|
||||
IDataRepository* m_repository;
|
||||
public:
|
||||
CommandsParser(CommandsLexer* lexer, IDataRepository* targetRepository);
|
||||
|
||||
protected:
|
||||
const std::vector<sequence_t*>& GetTestsForState() override;
|
||||
|
||||
public:
|
||||
CommandsParser(CommandsLexer* lexer, IDataRepository* targetRepository);
|
||||
private:
|
||||
IDataRepository* m_repository;
|
||||
};
|
||||
|
||||
@@ -1,16 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include "Persistence/IDataRepository.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
class CommandsParserState
|
||||
{
|
||||
IDataRepository* m_repository;
|
||||
StructureInformation* m_in_use;
|
||||
public:
|
||||
explicit CommandsParserState(IDataRepository* repository);
|
||||
|
||||
[[nodiscard]] const IDataRepository* GetRepository() const;
|
||||
|
||||
void AddBlock(std::unique_ptr<FastFileBlock> block) const;
|
||||
void SetArchitecture(Architecture architecture) const;
|
||||
void SetGame(std::string gameName) const;
|
||||
|
||||
[[nodiscard]] StructureInformation* GetInUse() const;
|
||||
void SetInUse(StructureInformation* structure);
|
||||
|
||||
bool GetMembersFromTypename(const std::string& typeNameValue, StructureInformation* baseType, std::vector<MemberInformation*>& members) const;
|
||||
bool GetTypenameAndMembersFromTypename(const std::string& typeNameValue, StructureInformation*& structure, std::vector<MemberInformation*>& members) const;
|
||||
|
||||
private:
|
||||
static MemberInformation* GetMemberWithName(const std::string& memberName, StructureInformation* type);
|
||||
static bool GetNextTypenameSeparatorPos(const std::string& typeNameValue, unsigned startPos, unsigned& separatorPos);
|
||||
static bool ExtractMembersFromTypenameInternal(const std::string& typeNameValue,
|
||||
@@ -18,18 +30,6 @@ class CommandsParserState
|
||||
StructureInformation* type,
|
||||
std::vector<MemberInformation*>& members);
|
||||
|
||||
public:
|
||||
explicit CommandsParserState(IDataRepository* repository);
|
||||
|
||||
_NODISCARD const IDataRepository* GetRepository() const;
|
||||
|
||||
void AddBlock(std::unique_ptr<FastFileBlock> block) const;
|
||||
void SetArchitecture(Architecture architecture) const;
|
||||
void SetGame(std::string gameName) const;
|
||||
|
||||
_NODISCARD StructureInformation* GetInUse() const;
|
||||
void SetInUse(StructureInformation* structure);
|
||||
|
||||
bool GetMembersFromTypename(const std::string& typeNameValue, StructureInformation* baseType, std::vector<MemberInformation*>& members) const;
|
||||
bool GetTypenameAndMembersFromTypename(const std::string& typeNameValue, StructureInformation*& structure, std::vector<MemberInformation*>& members) const;
|
||||
IDataRepository* m_repository;
|
||||
StructureInformation* m_in_use;
|
||||
};
|
||||
|
||||
@@ -52,10 +52,6 @@ enum class CommandsParserValueType
|
||||
class CommandsParserValue final : public IParserValue
|
||||
{
|
||||
public:
|
||||
TokenPos m_pos;
|
||||
CommandsParserValueType m_type;
|
||||
size_t m_hash;
|
||||
|
||||
union ValueType
|
||||
{
|
||||
char char_value;
|
||||
@@ -83,25 +79,28 @@ public:
|
||||
static CommandsParserValue TypeName(TokenPos pos, std::string* typeName);
|
||||
static CommandsParserValue OpType(TokenPos pos, const OperationType* operationType);
|
||||
|
||||
private:
|
||||
CommandsParserValue(TokenPos pos, CommandsParserValueType type);
|
||||
|
||||
public:
|
||||
~CommandsParserValue() override;
|
||||
CommandsParserValue(const CommandsParserValue& other) = delete;
|
||||
~CommandsParserValue() override;
|
||||
CommandsParserValue(CommandsParserValue&& other) noexcept;
|
||||
CommandsParserValue& operator=(const CommandsParserValue& other) = delete;
|
||||
CommandsParserValue& operator=(CommandsParserValue&& other) noexcept;
|
||||
|
||||
_NODISCARD bool IsEof() const override;
|
||||
_NODISCARD const TokenPos& GetPos() const override;
|
||||
[[nodiscard]] bool IsEof() const override;
|
||||
[[nodiscard]] const TokenPos& GetPos() const override;
|
||||
|
||||
_NODISCARD char CharacterValue() const;
|
||||
_NODISCARD int IntegerValue() const;
|
||||
_NODISCARD double FloatingPointValue() const;
|
||||
_NODISCARD std::string& StringValue() const;
|
||||
_NODISCARD std::string& IdentifierValue() const;
|
||||
_NODISCARD size_t IdentifierHash() const;
|
||||
_NODISCARD std::string& TypeNameValue() const;
|
||||
_NODISCARD const OperationType* OpTypeValue() const;
|
||||
[[nodiscard]] char CharacterValue() const;
|
||||
[[nodiscard]] int IntegerValue() const;
|
||||
[[nodiscard]] double FloatingPointValue() const;
|
||||
[[nodiscard]] std::string& StringValue() const;
|
||||
[[nodiscard]] std::string& IdentifierValue() const;
|
||||
[[nodiscard]] size_t IdentifierHash() const;
|
||||
[[nodiscard]] std::string& TypeNameValue() const;
|
||||
[[nodiscard]] const OperationType* OpTypeValue() const;
|
||||
|
||||
TokenPos m_pos;
|
||||
CommandsParserValueType m_type;
|
||||
size_t m_hash;
|
||||
|
||||
private:
|
||||
CommandsParserValue(TokenPos pos, CommandsParserValueType type);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user