diff options
author | Roberto Raggi <[email protected]> | 2010-11-25 14:15:59 +0100 |
---|---|---|
committer | Roberto Raggi <[email protected]> | 2010-11-25 14:17:58 +0100 |
commit | 58ab00203d4b5490fa4cd86afa3768c11b8f41b7 (patch) | |
tree | 6b65468e35b8f09b5f33884fb6b868f48fabf81d /src/libs/glsl/glslsymbols.h | |
parent | 2960c735df99a35d49c7cc6f39e9b6c11c271bd9 (diff) |
Initial work on the GLSL symbols.
Diffstat (limited to 'src/libs/glsl/glslsymbols.h')
-rw-r--r-- | src/libs/glsl/glslsymbols.h | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/src/libs/glsl/glslsymbols.h b/src/libs/glsl/glslsymbols.h new file mode 100644 index 00000000000..47d175a711d --- /dev/null +++ b/src/libs/glsl/glslsymbols.h @@ -0,0 +1,94 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation ([email protected]) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ +#ifndef GLSLSYMBOLS_H +#define GLSLSYMBOLS_H + +#include "glsltype.h" +#include "glslsymbol.h" +#include <QtCore/QVector> +#include <QtCore/QString> +#include <QtCore/QHash> + +namespace GLSL { + +class GLSL_EXPORT Argument: public Symbol +{ +public: + Argument(Function *scope); + + QString name() const; + void setName(const QString &name); + + virtual const Type *type() const; + void setType(const Type *type); + + virtual Argument *asArgument() { return this; } + +private: + QString _name; + const Type *_type; +}; + +class GLSL_EXPORT Variable: public Symbol +{ +public: + Variable(Scope *scope); + + QString name() const; + void setName(const QString &name); + + virtual const Type *type() const; + void setType(const Type *type); + + virtual Variable *asVariable() { return this; } + +private: + QString _name; + const Type *_type; +}; + +class GLSL_EXPORT Block: public Scope +{ +public: + Block(Scope *enclosingScope = 0); + + void addMember(const QString &name, Symbol *symbol); + + virtual Block *asBlock() { return this; } + + virtual const Type *type() const; + virtual Symbol *find(const QString &name) const; + +private: + QHash<QString, Symbol *> _members; +}; + +} // end of namespace GLSL + +#endif // GLSLSYMBOLS_H |