2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-06-26 14:21:49 +00:00

Implement sequence matcher and parser magic

This commit is contained in:
Jan
2021-02-13 00:12:26 +01:00
parent fe1f391bcc
commit 0f70f9586c
48 changed files with 1061 additions and 141 deletions

View File

@ -0,0 +1,14 @@
#include "HeaderMatcherCharacter.h"
HeaderMatcherCharacter::HeaderMatcherCharacter(const char c)
: m_char(c)
{
}
MatcherResult<HeaderParserValue> HeaderMatcherCharacter::CanMatch(AbstractLexer<HeaderParserValue>* lexer, const unsigned tokenOffset)
{
const auto& token = lexer->GetToken(tokenOffset);
return token.m_type == HeaderParserValueType::CHARACTER && token.CharacterValue() == m_char
? MatcherResult<HeaderParserValue>::Match(1)
: MatcherResult<HeaderParserValue>::NoMatch();
}