Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
glslsymbols.cpp
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
#
include
"glslsymbols_p.h"
7
#
include
"glsltypes_p.h"
8
#
include
<
QDebug
>
9
10
QT_BEGIN_NAMESPACE
11
12
using
namespace
GLSL;
13
14
Argument::Argument(Function *scope)
15
: Symbol(scope)
16
, _type(
nullptr
)
17
{
18
}
19
20
const
Type *Argument::type()
const
21
{
22
return
_type;
23
}
24
25
void
Argument::setType(
const
Type *type)
26
{
27
_type = type;
28
}
29
30
Block::Block(Scope *enclosingScope)
31
: Scope(enclosingScope)
32
{
33
}
34
35
QList<Symbol *> Block::members()
const
36
{
37
return
_members.values();
38
}
39
40
void
Block::add(Symbol *symbol)
41
{
42
_members.insert(symbol->name(), symbol);
43
}
44
45
const
Type *Block::type()
const
46
{
47
// ### assert?
48
return
nullptr
;
49
}
50
51
Symbol *Block::find(
const
QString &name)
const
52
{
53
return
_members.value(name);
54
}
55
56
Variable::Variable(Scope *scope)
57
: Symbol(scope)
58
, _type(
nullptr
)
59
, _qualifiers(0)
60
{
61
}
62
63
const
Type *Variable::type()
const
64
{
65
return
_type;
66
}
67
68
void
Variable::setType(
const
Type *type)
69
{
70
_type = type;
71
}
72
73
Namespace::Namespace()
74
{
75
}
76
77
Namespace::~Namespace()
78
{
79
qDeleteAll(_overloadSets);
80
}
81
82
QList<Symbol *> Namespace::members()
const
83
{
84
return
_members.values();
85
}
86
87
void
Namespace::add(Symbol *symbol)
88
{
89
Symbol *&sym = _members[symbol->name()];
90
if
(! sym) {
91
sym = symbol;
92
}
else
if
(Function *fun = symbol->asFunction()) {
93
if
(OverloadSet *o = sym->asOverloadSet()) {
94
o->addFunction(fun);
95
}
else
if
(Function *firstFunction = sym->asFunction()) {
96
o =
new
OverloadSet(
this
);
97
_overloadSets.append(o);
98
o->setName(symbol->name());
99
o->addFunction(firstFunction);
100
o->addFunction(fun);
101
sym = o;
102
}
else
{
103
// ### warning? return false?
104
}
105
}
else
{
106
// ### warning? return false?
107
}
108
}
109
110
const
Type *Namespace::type()
const
111
{
112
return
nullptr
;
113
}
114
115
Symbol *Namespace::find(
const
QString &name)
const
116
{
117
return
_members.value(name);
118
}
119
120
QT_END_NAMESPACE
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtquick3d
src
glslparser
glslsymbols.cpp
Generated on
for Qt by
1.18.0