#include "compiler/preprocessor/MacroExpander.h"
#include <GLSLANG/ShaderLang.h>
#include <algorithm>
#include "common/debug.h"
#include "compiler/preprocessor/DiagnosticsBase.h"
#include "compiler/preprocessor/Token.h"
namespace angle
{
namespace pp
{
namespace
{
const size_t kMaxContextTokens = …;
class TokenLexer : public Lexer
{ … };
}
class [[nodiscard]] MacroExpander::ScopedMacroReenabler final : angle::NonCopyable
{ … };
MacroExpander::ScopedMacroReenabler::ScopedMacroReenabler(MacroExpander *expander)
: … { … }
MacroExpander::ScopedMacroReenabler::~ScopedMacroReenabler()
{ … }
MacroExpander::MacroExpander(Lexer *lexer,
MacroSet *macroSet,
Diagnostics *diagnostics,
const PreprocessorSettings &settings,
bool parseDefined)
: … { … }
MacroExpander::~MacroExpander()
{ … }
void MacroExpander::lex(Token *token)
{ … }
void MacroExpander::getToken(Token *token)
{ … }
void MacroExpander::ungetToken(const Token &token)
{ … }
bool MacroExpander::isNextTokenLeftParen()
{ … }
bool MacroExpander::pushMacro(std::shared_ptr<Macro> macro, const Token &identifier)
{ … }
void MacroExpander::popMacro()
{ … }
bool MacroExpander::expandMacro(const Macro ¯o,
const Token &identifier,
std::vector<Token> *replacements)
{ … }
bool MacroExpander::collectMacroArgs(const Macro ¯o,
const Token &identifier,
std::vector<MacroArg> *args,
SourceLocation *closingParenthesisLocation)
{ … }
void MacroExpander::replaceMacroParams(const Macro ¯o,
const std::vector<MacroArg> &args,
std::vector<Token> *replacements)
{ … }
bool MacroExpander::MacroContext::empty() const
{ … }
const Token &MacroExpander::MacroContext::get()
{ … }
void MacroExpander::MacroContext::unget()
{ … }
}
}