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
4#ifndef QSSG_GLSLSEMANTIC_H
5#define QSSG_GLSLSEMANTIC_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuick3DGlslParser/private/glslastvisitor_p.h>
19#include <QtQuick3DGlslParser/private/glsltype_p.h>
20
21QT_BEGIN_NAMESPACE
22
23namespace GLSL {
24
25class Q_QUICK3DGLSLPARSER_EXPORT Semantic: protected Visitor
26{
27public:
28 Semantic();
30
31 struct ExprResult {
32 ExprResult(const Type *type_ = nullptr, bool isConstant_ = false)
34
36
37 bool isValid() const {
38 if (! type)
39 return false;
40 else if (type->asUndefinedType() != nullptr)
41 return false;
42 return true;
43 }
44
45 explicit operator bool() const { return isValid(); }
46
47 const Type *type;
49 };
50
53
54protected:
57
58 bool implicitCast(const Type *type, const Type *target) const;
59
62 const Type *type(TypeAST *ast);
67
71
72 // expressions
82
83 // statements
95
96 // types
103
104 // declarations
113
114private:
116 Scope *_scope;
117 const Type *_type;
119};
120
121} // namespace GLSL
122
123QT_END_NAMESPACE
124
125#endif // QSSG_GLSLSEMANTIC_H