#include "compiler/preprocessor/DirectiveParser.h"
#include <algorithm>
#include <cstdlib>
#include <sstream>
#include "GLSLANG/ShaderLang.h"
#include "common/debug.h"
#include "compiler/preprocessor/DiagnosticsBase.h"
#include "compiler/preprocessor/DirectiveHandlerBase.h"
#include "compiler/preprocessor/ExpressionParser.h"
#include "compiler/preprocessor/MacroExpander.h"
#include "compiler/preprocessor/Token.h"
#include "compiler/preprocessor/Tokenizer.h"
namespace angle
{
namespace
{
enum DirectiveType
{ … };
DirectiveType getDirective(const pp::Token *token)
{ … }
bool isConditionalDirective(DirectiveType directive)
{ … }
bool isEOD(const pp::Token *token)
{ … }
void skipUntilEOD(pp::Lexer *lexer, pp::Token *token)
{ … }
bool isMacroNameReserved(const std::string &name)
{ … }
bool hasDoubleUnderscores(const std::string &name)
{ … }
bool isMacroPredefined(const std::string &name, const pp::MacroSet ¯oSet)
{ … }
}
namespace pp
{
DirectiveParser::DirectiveParser(Tokenizer *tokenizer,
MacroSet *macroSet,
Diagnostics *diagnostics,
DirectiveHandler *directiveHandler,
const PreprocessorSettings &settings)
: … { … }
DirectiveParser::~DirectiveParser() { … }
void DirectiveParser::lex(Token *token)
{ … }
void DirectiveParser::parseDirective(Token *token)
{ … }
void DirectiveParser::parseDefine(Token *token)
{ … }
void DirectiveParser::parseUndef(Token *token)
{ … }
void DirectiveParser::parseIf(Token *token)
{ … }
void DirectiveParser::parseIfdef(Token *token)
{ … }
void DirectiveParser::parseIfndef(Token *token)
{ … }
void DirectiveParser::parseElse(Token *token)
{ … }
void DirectiveParser::parseElif(Token *token)
{ … }
void DirectiveParser::parseEndif(Token *token)
{ … }
void DirectiveParser::parseError(Token *token)
{ … }
void DirectiveParser::parsePragma(Token *token)
{ … }
void DirectiveParser::parseExtension(Token *token)
{ … }
void DirectiveParser::parseVersion(Token *token)
{ … }
void DirectiveParser::parseLine(Token *token)
{ … }
bool DirectiveParser::skipping() const
{ … }
void DirectiveParser::parseConditionalIf(Token *token)
{ … }
int DirectiveParser::parseExpressionIf(Token *token)
{ … }
int DirectiveParser::parseExpressionIfdef(Token *token)
{ … }
void DirectiveParser::handleVersion(const SourceLocation &location)
{ … }
}
}