// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com) // This file is part of the "Nazara Engine - Shader module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_SHADER_SHADERLANGLEXER_HPP #define NAZARA_SHADER_SHADERLANGLEXER_HPP #include #include #include #include #include #include #include #include namespace Nz::ShaderLang { enum class TokenType { #define NAZARA_SHADERLANG_TOKEN(X) X, #include }; struct Token { SourceLocation location; TokenType type; std::variant data; }; NAZARA_SHADER_API std::vector Tokenize(const std::string_view& str, const std::string& filePath = std::string{}); NAZARA_SHADER_API const char* ToString(TokenType tokenType); NAZARA_SHADER_API std::string ToString(const std::vector& tokens, bool pretty = true); } #include #endif // NAZARA_SHADER_SHADERLANGLEXER_HPP