gsc-tool/include/xsk/arc/lexer.hpp
2024-01-14 12:14:01 +01:00

34 lines
651 B
C++

// Copyright 2024 xensik. All rights reserved.
//
// Use of this source code is governed by a GNU GPLv3 license
// that can be found in the LICENSE file.
#pragma once
#include "xsk/arc/common/types.hpp"
namespace xsk::arc
{
class lexer
{
context const* ctx_;
lookahead reader_;
location loc_;
usize buflen_;
spacing spacing_;
bool indev_;
std::array<char, 0x1000> buffer_;
public:
lexer(context const* ctx, std::string const& name, char const* data, usize size);
auto lex() -> token;
private:
auto push(char c) -> void;
auto advance() -> void;
auto linewrap() -> void;
};
} // namespace xsk::arc