2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-05-02 00:19:35 +00:00

Calculate size and alignment in post processor

This commit is contained in:
Jan
2021-02-19 16:23:16 +01:00
parent 1264be4274
commit 7c51c26255
48 changed files with 966 additions and 246 deletions
@@ -0,0 +1,35 @@
#include "SequenceArchitecture.h"
#include "Parsing/Commands/Matcher/CommandsMatcherFactory.h"
#include "Parsing/Commands/Matcher/CommandsCommonMatchers.h"
SequenceArchitecture::SequenceArchitecture()
{
const CommandsMatcherFactory create(this);
AddMatchers({
create.Keyword("architecture"),
create.Or({
create.Keyword("x86").Tag(TAG_X86),
create.Keyword("x64").Tag(TAG_X64)
}),
create.Char(';')
});
}
void SequenceArchitecture::ProcessMatch(CommandsParserState* state, SequenceResult<CommandsParserValue>& result) const
{
switch (result.NextTag())
{
case TAG_X86:
state->SetArchitecture(Architecture::X86);
break;
case TAG_X64:
state->SetArchitecture(Architecture::X64);
break;
default:
throw ParsingException(TokenPos(), "Unknown architecture!");
}
}