/
dgrigorev
/
gw-basic-cpp
Обзор
Документация
Войти
/
dgrigorev
/
gw-basic-cpp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
include/gwbasic/lexer.hpp
26 строк
660 B
Дмитрий Григорьев
Advance GW-BASIC compatibility and tooling
16 май 2026, 20:04
16 май 2026, 20:04
8e3f79b
Код
Авторство
О чём код?
#pragma once #include "gwbasic/token.hpp" #include <string> #include <vector> namespace gwbasic { /** * Converts one physical BASIC source line into a token stream. * * The lexer is intentionally stateless: callers can reuse one instance for * stored program lines, immediate statements, syntax checking, and fuzz tests. */ class Lexer { public: /** * Tokenize a single line of BASIC source. * @throws std::runtime_error when the input contains an invalid character * or an unterminated string literal. */ [[nodiscard]] auto tokenize(const std::string& line) const -> std::vector<Token>; }; } // namespace gwbasic