Path: blob/main_old/src/compiler/translator/Declarator.h
1693 views
//1// Copyright 2017 The ANGLE Project Authors. All rights reserved.2// Use of this source code is governed by a BSD-style license that can be3// found in the LICENSE file.4//5// Declarator.h:6// Declarator type for parsing structure field declarators.78#ifndef COMPILER_TRANSLATOR_DECLARATOR_H_9#define COMPILER_TRANSLATOR_DECLARATOR_H_1011#include "compiler/translator/Common.h"12#include "compiler/translator/ImmutableString.h"1314namespace sh15{1617// Declarator like "a[2][4]". Only used for parsing structure field declarators.18class TDeclarator : angle::NonCopyable19{20public:21POOL_ALLOCATOR_NEW_DELETE22TDeclarator(const ImmutableString &name, const TSourceLoc &line);2324TDeclarator(const ImmutableString &name,25const TVector<unsigned int> *arraySizes,26const TSourceLoc &line);2728const ImmutableString &name() const { return mName; }2930bool isArray() const;31const TVector<unsigned int> *arraySizes() const { return mArraySizes; }3233const TSourceLoc &line() const { return mLine; }3435private:36const ImmutableString mName;3738// Outermost array size is stored at the end of the vector.39const TVector<unsigned int> *const mArraySizes;4041const TSourceLoc mLine;42};4344using TDeclaratorList = TVector<TDeclarator *>;4546} // namespace sh4748#endif // COMPILER_TRANSLATOR_DECLARATOR_H_495051