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
23
QT_BEGIN_NAMESPACE
24
25
namespace
GLSL
{
26
27
class
Q_QUICK3DGLSLPARSER_EXPORT
Semantic
:
protected
Visitor
28
{
29
public
:
30
Semantic
();
31
~
Semantic
()
override
;
32
33
struct
ExprResult
{
34
ExprResult
(
const
Type
*
type_
=
nullptr
,
bool
isConstant_
=
false
)
35
:
type
(
type_
),
isConstant
(
isConstant_
) {}
36
37
~
ExprResult
() { }
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
;
50
bool
isConstant
;
51
};
52
53
void
translationUnit
(
TranslationUnitAST
*
ast
,
Scope
*
globalScope
,
Engine
*
engine
);
54
ExprResult
expression
(
ExpressionAST
*
ast
,
Scope
*
scope
,
Engine
*
engine
);
55
56
protected
:
57
Engine
*
switchEngine
(
Engine
*
engine
);
58
Scope
*
switchScope
(
Scope
*
scope
);
59
60
bool
implicitCast
(
const
Type
*
type
,
const
Type
*
target
)
const
;
61
62
ExprResult
expression
(
ExpressionAST
*
ast
);
63
void
statement
(
StatementAST
*
ast
);
64
const
Type
*
type
(
TypeAST
*
ast
);
65
void
declaration
(
DeclarationAST
*
ast
);
66
ExprResult
functionIdentifier
(
FunctionIdentifierAST
*
ast
);
67
Symbol
*
field
(
StructTypeAST
::
Field
*
ast
);
68
void
parameterDeclaration
(
ParameterDeclarationAST
*
ast
,
Function
*
fun
);
69
70
bool
visit
(
TranslationUnitAST
*
ast
)
override
;
71
bool
visit
(
FunctionIdentifierAST
*
ast
)
override
;
72
bool
visit
(
StructTypeAST
::
Field
*
ast
)
override
;
73
74
// expressions
75
bool
visit
(
IdentifierExpressionAST
*
ast
)
override
;
76
bool
visit
(
LiteralExpressionAST
*
ast
)
override
;
77
bool
visit
(
BinaryExpressionAST
*
ast
)
override
;
78
bool
visit
(
UnaryExpressionAST
*
ast
)
override
;
79
bool
visit
(
TernaryExpressionAST
*
ast
)
override
;
80
bool
visit
(
AssignmentExpressionAST
*
ast
)
override
;
81
bool
visit
(
MemberAccessExpressionAST
*
ast
)
override
;
82
bool
visit
(
FunctionCallExpressionAST
*
ast
)
override
;
83
bool
visit
(
DeclarationExpressionAST
*
ast
)
override
;
84
85
// statements
86
bool
visit
(
ExpressionStatementAST
*
ast
)
override
;
87
bool
visit
(
CompoundStatementAST
*
ast
)
override
;
88
bool
visit
(
IfStatementAST
*
ast
)
override
;
89
bool
visit
(
WhileStatementAST
*
ast
)
override
;
90
bool
visit
(
DoStatementAST
*
ast
)
override
;
91
bool
visit
(
ForStatementAST
*
ast
)
override
;
92
bool
visit
(
JumpStatementAST
*
ast
)
override
;
93
bool
visit
(
ReturnStatementAST
*
ast
)
override
;
94
bool
visit
(
SwitchStatementAST
*
ast
)
override
;
95
bool
visit
(
CaseLabelStatementAST
*
ast
)
override
;
96
bool
visit
(
DeclarationStatementAST
*
ast
)
override
;
97
98
// types
99
bool
visit
(
BasicTypeAST
*
ast
)
override
;
100
bool
visit
(
NamedTypeAST
*
ast
)
override
;
101
bool
visit
(
ArrayTypeAST
*
ast
)
override
;
102
bool
visit
(
StructTypeAST
*
ast
)
override
;
103
bool
visit
(
QualifiedTypeAST
*
ast
)
override
;
104
bool
visit
(
LayoutQualifierAST
*
ast
)
override
{
return
Visitor
::
visit
(
ast
); }
105
106
// declarations
107
bool
visit
(
PrecisionDeclarationAST
*
ast
)
override
;
108
bool
visit
(
ParameterDeclarationAST
*
ast
)
override
;
109
bool
visit
(
VariableDeclarationAST
*
ast
)
override
;
110
bool
visit
(
TypeDeclarationAST
*
ast
)
override
;
111
bool
visit
(
TypeAndVariableDeclarationAST
*
ast
)
override
;
112
bool
visit
(
InvariantDeclarationAST
*
ast
)
override
;
113
bool
visit
(
InitDeclarationAST
*
ast
)
override
;
114
bool
visit
(
FunctionDeclarationAST
*
ast
)
override
;
115
116
private
:
117
Engine
*
_engine
;
118
Scope
*
_scope
;
119
const
Type
*
_type
;
120
ExprResult
_expr
;
121
};
122
123
}
// namespace GLSL
124
125
QT_END_NAMESPACE
126
127
#
endif
// QSSG_GLSLSEMANTIC_H
GLSL::Semantic
Definition
glslsemantic_p.h:28
GLSL
Definition
glslast_p.h:26
qtquick3d
src
glslparser
glslsemantic_p.h
Generated on
for Qt by
1.16.1