summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-05-18 15:16:30 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-05-26 15:11:40 +0200
commit752497910b67b2a1a80560840ca44548d8893434 (patch)
tree541501c9abfd97c3d2fa450d2e6abb60582c4420 /src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l
parent7db527dbdd911c79f31425d099d1fc9c63e42453 (diff)
Remove ANGLE
This marks the end of EGL and OpenGL ES support on Windows. The concepts of -opengl dynamic, -opengl desktop, QT_OPENGL=software, etc. remain unchanged, with the exception of the disapperance of everything ANGLE related. CMake builds now work identically to qmake on Windows: they default to 'dynamic' OpenGL on Windows, unless -DINPUT_opengl=desktop is specified. On Windows, Qt 6 is expected to default to the "dynamic" OpenGL model by default, just like Qt 5.15. This can be changed by switching to "desktop" OpenGL, which will link to opengl32 (publicly, so other libs and applications will do so as well) and disallows using another OpenGL DLL. The "dynamic" mode is essential still because the fallback to a software rasterizer, such as the opengl32sw.dll we ship with the Qt packages, has to to work exactly like in Qt 5, the removal of ANGLE does not change this concept in any way (except of course that the middle option of using ANGLE is now gone) When it comes to the windows plugin's OpenGL blacklist feature, it works like before and accepts the ANGLE/D3D related keywords. They will then be ignored. Similarly, requesting QT_OPENGL=angle is ignored (but will show a warning). The D3D11 and DXGI configure time tests are removed: Qt 5.14 already depends on D3D 11.1 and DXGI 1.3 headers being available unconditionally on Win32 (in QRhi's D3D11 backend). No need to test for these. [ChangeLog][Windows] ANGLE is no longer included with Qt. Dynamic OpenGL builds work like before but ANGLE is no longer an option. OpenGL proper or an alternative opengl32 implementation are the two remaining options now. Attempting to set QT_OPENGL=angle or Qt::AA_UseOpenGLES will have no effect on Windows. Fixes: QTBUG-79103 Change-Id: Ia404e0d07f3fe191b27434d863c81180112ecb3b Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l')
-rw-r--r--src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l384
1 files changed, 0 insertions, 384 deletions
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l b/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l
deleted file mode 100644
index 096812d45f..0000000000
--- a/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l
+++ /dev/null
@@ -1,384 +0,0 @@
-/*
-//
-// Copyright (c) 2002-2014 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-This file contains the Lex specification for GLSL ES preprocessor.
-Based on Microsoft Visual Studio 2010 Preprocessor Grammar:
-http://msdn.microsoft.com/en-us/library/2scxys89.aspx
-
-IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh.
-*/
-
-%top{
-//
-// Copyright (c) 2011-2014 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
-}
-
-%{
-#if defined(_MSC_VER)
-#pragma warning(disable: 4005)
-#endif
-
-#include "compiler/preprocessor/Tokenizer.h"
-
-#include "compiler/preprocessor/DiagnosticsBase.h"
-#include "compiler/preprocessor/Token.h"
-
-#if defined(__GNUC__)
-// Triggered by the auto-generated yy_fatal_error function.
-#pragma GCC diagnostic ignored "-Wmissing-noreturn"
-#elif defined(_MSC_VER)
-#pragma warning(disable: 4244)
-#endif
-
-// Workaround for flex using the register keyword, deprecated in C++11.
-#ifdef __cplusplus
-#if __cplusplus > 199711L
-#define register
-#endif
-#endif
-
-typedef std::string YYSTYPE;
-typedef pp::SourceLocation YYLTYPE;
-
-// Use the unused yycolumn variable to track file (string) number.
-#define yyfileno yycolumn
-
-#define YY_USER_INIT \
- do { \
- yyfileno = 0; \
- yylineno = 1; \
- yyextra->leadingSpace = false; \
- yyextra->lineStart = true; \
- } while(0);
-
-#define YY_USER_ACTION \
- do \
- { \
- pp::Input* input = &yyextra->input; \
- pp::Input::Location* scanLoc = &yyextra->scanLoc; \
- while ((scanLoc->sIndex < input->count()) && \
- (scanLoc->cIndex >= input->length(scanLoc->sIndex))) \
- { \
- scanLoc->cIndex -= input->length(scanLoc->sIndex++); \
- ++yyfileno; yylineno = 1; \
- } \
- yylloc->file = yyfileno; \
- yylloc->line = yylineno; \
- scanLoc->cIndex += yyleng; \
- } while(0);
-
-#define YY_INPUT(buf, result, maxSize) \
- result = yyextra->input.read(buf, maxSize, &yylineno);
-
-%}
-
-%option noyywrap nounput never-interactive
-%option reentrant bison-bridge bison-locations
-%option prefix="pp"
-%option extra-type="pp::Tokenizer::Context*"
-%x COMMENT
-
-NEWLINE \n|\r|\r\n
-IDENTIFIER [_a-zA-Z][_a-zA-Z0-9]*
-PUNCTUATOR [][<>(){}.+-/*%^|&~=!:;,?]
-
-DECIMAL_CONSTANT [1-9][0-9]*[uU]?
-OCTAL_CONSTANT 0[0-7]*[uU]?
-HEXADECIMAL_CONSTANT 0[xX][0-9a-fA-F]+[uU]?
-
-DIGIT [0-9]
-EXPONENT_PART [eE][+-]?{DIGIT}+
-FRACTIONAL_CONSTANT ({DIGIT}*"."{DIGIT}+)|({DIGIT}+".")
-
-%%
-
- /* Line comment */
-"//"[^\r\n]*
-
- /* Block comment */
- /* Line breaks are just counted - not returned. */
- /* The comment is replaced by a single space. */
-"/*" { BEGIN(COMMENT); }
-<COMMENT>[^*\r\n]+
-<COMMENT>"*"
-<COMMENT>{NEWLINE} {
- if (yylineno == INT_MAX)
- {
- *yylval = "Integer overflow on line number";
- return pp::Token::GOT_ERROR;
- }
- ++yylineno;
-}
-<COMMENT>"*/" {
- yyextra->leadingSpace = true;
- BEGIN(INITIAL);
-}
-
-# {
- // # is only valid at start of line for preprocessor directives.
- yylval->assign(1, yytext[0]);
- return yyextra->lineStart ? pp::Token::PP_HASH : pp::Token::PP_OTHER;
-}
-
-{IDENTIFIER} {
- yylval->assign(yytext, yyleng);
- return pp::Token::IDENTIFIER;
-}
-
-({DECIMAL_CONSTANT}[uU]?)|({OCTAL_CONSTANT}[uU]?)|({HEXADECIMAL_CONSTANT}[uU]?) {
- yylval->assign(yytext, yyleng);
- return pp::Token::CONST_INT;
-}
-
-({DIGIT}+{EXPONENT_PART}[fF]?)|({FRACTIONAL_CONSTANT}{EXPONENT_PART}?[fF]?) {
- yylval->assign(yytext, yyleng);
- return pp::Token::CONST_FLOAT;
-}
-
- /* Anything that starts with a {DIGIT} or .{DIGIT} must be a number. */
- /* Rule to catch all invalid integers and floats. */
-({DIGIT}+[_a-zA-Z0-9.]*)|("."{DIGIT}+[_a-zA-Z0-9.]*) {
- yylval->assign(yytext, yyleng);
- return pp::Token::PP_NUMBER;
-}
-
-"++" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_INC;
-}
-"--" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_DEC;
-}
-"<<" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_LEFT;
-}
-">>" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_RIGHT;
-}
-"<=" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_LE;
-}
-">=" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_GE;
-}
-"==" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_EQ;
-}
-"!=" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_NE;
-}
-"&&" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_AND;
-}
-"^^" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_XOR;
-}
-"||" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_OR;
-}
-"+=" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_ADD_ASSIGN;
-}
-"-=" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_SUB_ASSIGN;
-}
-"*=" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_MUL_ASSIGN;
-}
-"/=" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_DIV_ASSIGN;
-}
-"%=" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_MOD_ASSIGN;
-}
-"<<=" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_LEFT_ASSIGN;
-}
-">>=" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_RIGHT_ASSIGN;
-}
-"&=" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_AND_ASSIGN;
-}
-"^=" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_XOR_ASSIGN;
-}
-"|=" {
- yylval->assign(yytext, yyleng);
- return pp::Token::OP_OR_ASSIGN;
-}
-
-{PUNCTUATOR} {
- yylval->assign(1, yytext[0]);
- return yytext[0];
-}
-
-[ \t\v\f]+ { yyextra->leadingSpace = true; }
-
-{NEWLINE} {
- if (yylineno == INT_MAX)
- {
- *yylval = "Integer overflow on line number";
- return pp::Token::GOT_ERROR;
- }
- ++yylineno;
- yylval->assign(1, '\n');
- return '\n';
-}
-
-. {
- yylval->assign(1, yytext[0]);
- return pp::Token::PP_OTHER;
-}
-
-<*><<EOF>> {
- // YY_USER_ACTION is not invoked for handling EOF.
- // Set the location for EOF token manually.
- pp::Input* input = &yyextra->input;
- pp::Input::Location* scanLoc = &yyextra->scanLoc;
- yy_size_t sIndexMax = input->count() ? input->count() - 1 : 0;
- if (scanLoc->sIndex != sIndexMax)
- {
- // We can only reach here if there are empty strings at the
- // end of the input.
- scanLoc->sIndex = sIndexMax; scanLoc->cIndex = 0;
- // FIXME: this is not 64-bit clean.
- yyfileno = static_cast<int>(sIndexMax); yylineno = 1;
- }
- yylloc->file = yyfileno;
- yylloc->line = yylineno;
- yylval->clear();
-
- // Line number overflows fake EOFs to exit early, check for this case.
- if (yylineno == INT_MAX) {
- yyextra->diagnostics->report(pp::Diagnostics::PP_TOKENIZER_ERROR,
- pp::SourceLocation(yyfileno, yylineno),
- "Integer overflow on line number");
- }
- else if (YY_START == COMMENT)
- {
- yyextra->diagnostics->report(pp::Diagnostics::PP_EOF_IN_COMMENT,
- pp::SourceLocation(yyfileno, yylineno),
- "EOF while in a comment");
- }
- yyterminate();
-}
-
-%%
-
-namespace pp {
-
-Tokenizer::Tokenizer(Diagnostics *diagnostics) : mHandle(nullptr), mMaxTokenSize(256)
-{
- mContext.diagnostics = diagnostics;
-}
-
-Tokenizer::~Tokenizer()
-{
- destroyScanner();
-}
-
-bool Tokenizer::init(size_t count, const char * const string[], const int length[])
-{
- if ((count > 0) && (string == 0))
- return false;
-
- mContext.input = Input(count, string, length);
- return initScanner();
-}
-
-void Tokenizer::setFileNumber(int file)
-{
- // We use column number as file number.
- // See macro yyfileno.
- yyset_column(file, mHandle);
-}
-
-void Tokenizer::setLineNumber(int line)
-{
- yyset_lineno(line, mHandle);
-}
-
-void Tokenizer::setMaxTokenSize(size_t maxTokenSize)
-{
- mMaxTokenSize = maxTokenSize;
-}
-
-void Tokenizer::lex(Token *token)
-{
- int tokenType = yylex(&token->text, &token->location, mHandle);
-
- if (tokenType == Token::GOT_ERROR)
- {
- mContext.diagnostics->report(Diagnostics::PP_TOKENIZER_ERROR, token->location, token->text);
- token->type = Token::LAST;
- }
- else
- {
- token->type = tokenType;
- }
-
- if (token->text.size() > mMaxTokenSize)
- {
- mContext.diagnostics->report(Diagnostics::PP_TOKEN_TOO_LONG,
- token->location, token->text);
- token->text.erase(mMaxTokenSize);
- }
-
- token->flags = 0;
-
- token->setAtStartOfLine(mContext.lineStart);
- mContext.lineStart = token->type == '\n';
-
- token->setHasLeadingSpace(mContext.leadingSpace);
- mContext.leadingSpace = false;
-}
-
-bool Tokenizer::initScanner()
-{
- if ((mHandle == nullptr) && yylex_init_extra(&mContext, &mHandle))
- return false;
-
- yyrestart(0, mHandle);
- return true;
-}
-
-void Tokenizer::destroyScanner()
-{
- if (mHandle == nullptr)
- return;
-
- yylex_destroy(mHandle);
- mHandle = nullptr;
-}
-
-} // namespace pp
-