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

View File

@ -17,4 +17,14 @@ SequenceUse::SequenceUse()
void SequenceUse::ProcessMatch(CommandsParserState* state, SequenceResult<CommandsParserValue>& result) const
{
const auto& typeNameToken = result.NextCapture(CAPTURE_TYPE);
auto* definition = state->GetRepository()->GetDataDefinitionByName(typeNameToken.TypeNameValue());
if (definition == nullptr)
throw ParsingException(typeNameToken.GetPos(), "Unknown type");
auto* definitionWithMembers = dynamic_cast<DefinitionWithMembers*>(definition);
if (definitionWithMembers == nullptr)
throw ParsingException(typeNameToken.GetPos(), "Type must be able to have members");
state->SetInUse(state->GetRepository()->GetInformationFor(definitionWithMembers));
}