Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
glslsemantic_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5
6#ifndef QSSG_GLSLSEMANTIC_H
7#define QSSG_GLSLSEMANTIC_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtQuick3DGlslParser/private/glslastvisitor_p.h>
21#include <QtQuick3DGlslParser/private/glsltype_p.h>
22
23QT_BEGIN_NAMESPACE
24
25namespace GLSL {
26
27class Q_QUICK3DGLSLPARSER_EXPORT Semantic: protected Visitor
28{
29public:
30 Semantic();
32
33 struct ExprResult {
34 ExprResult(const Type *type_ = nullptr, bool isConstant_ = false)
36
38
39 bool isValid() const {
40 if (! type)
41 return false;
42 else if (type->asUndefinedType() != nullptr)
43 return false;
44 return true;
45 }
46
47 explicit operator bool() const { return isValid(); }
48
49 const Type *type;
51 };
52
55
56protected:
59
60 bool implicitCast(const Type *type, const Type *target) const;
61
64 const Type *type(TypeAST *ast);
69
73
74 // expressions
84
85 // statements
97
98 // types
105
106 // declarations
115
116private:
118 Scope *_scope;
119 const Type *_type;
121};
122
123} // namespace GLSL
124
125QT_END_NAMESPACE
126
127#endif // QSSG_GLSLSEMANTIC_H