Util: Implement GenericLexer in Json::Lexer

This commit is contained in:
Riyyi
2022-07-20 22:49:41 +02:00
parent 4ce026ec78
commit e3041bfdc7
2 changed files with 14 additions and 48 deletions
+3 -10
View File
@@ -11,10 +11,11 @@
// https://www.rfc-editor.org/rfc/pdfrfc/rfc8259.txt.pdf
#include <cstddef> // size_t
#include <memory> // shared_ptr
#include <string>
#include <vector>
#include "util/genericlexer.h"
namespace Json {
class Job;
@@ -40,7 +41,7 @@ struct Token {
};
// Lexical analyzer
class Lexer {
class Lexer final : public Util::GenericLexer {
public:
Lexer(Job* job);
virtual ~Lexer();
@@ -48,13 +49,6 @@ public:
void analyze();
private:
char peek();
char peekNext();
void increment();
void decrement();
char consume();
bool getString();
bool getNumberOrLiteral(Token::Type type);
bool getNumber();
@@ -62,7 +56,6 @@ private:
Job* m_job { nullptr };
size_t m_index { 0 };
size_t m_column { 0 };
size_t m_line { 0 };