1 | // Copyright (C) 2021 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #include "glslsymbol_p.h" |
5 | #include <QStringList> |
6 | |
7 | QT_BEGIN_NAMESPACE |
8 | |
9 | using namespace GLSL; |
10 | |
11 | Symbol::Symbol(Scope *scope) |
12 | : _scope(scope) |
13 | { |
14 | } |
15 | |
16 | Symbol::~Symbol() |
17 | { |
18 | } |
19 | |
20 | Scope *Symbol::scope() const |
21 | { |
22 | return _scope; |
23 | } |
24 | |
25 | void Symbol::setScope(Scope *scope) |
26 | { |
27 | _scope = scope; |
28 | } |
29 | |
30 | QString Symbol::name() const |
31 | { |
32 | return _name; |
33 | } |
34 | |
35 | void Symbol::setName(const QString &name) |
36 | { |
37 | _name = name; |
38 | } |
39 | |
40 | Scope::Scope(Scope *enclosingScope) |
41 | : Symbol(enclosingScope) |
42 | { |
43 | } |
44 | |
45 | Symbol *Scope::lookup(const QString &name) const |
46 | { |
47 | if (Symbol *s = find(name)) |
48 | return s; |
49 | if (Scope *s = scope()) |
50 | return s->lookup(name); |
51 | |
52 | return nullptr; |
53 | } |
54 | |
55 | QList<Symbol *> Scope::members() const |
56 | { |
57 | return QList<Symbol *>(); |
58 | } |
59 | |
60 | QT_END_NAMESPACE |
61 |