michael@0: // michael@0: // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: // michael@0: // SearchSymbol is an AST traverser to detect the use of a given symbol name michael@0: // michael@0: michael@0: #ifndef COMPILER_SEARCHSYMBOL_H_ michael@0: #define COMPILER_SEARCHSYMBOL_H_ michael@0: michael@0: #include "compiler/intermediate.h" michael@0: #include "compiler/ParseHelper.h" michael@0: michael@0: namespace sh michael@0: { michael@0: class SearchSymbol : public TIntermTraverser michael@0: { michael@0: public: michael@0: SearchSymbol(const TString &symbol); michael@0: michael@0: void traverse(TIntermNode *node); michael@0: void visitSymbol(TIntermSymbol *symbolNode); michael@0: michael@0: bool foundMatch() const; michael@0: michael@0: protected: michael@0: const TString &mSymbol; michael@0: bool match; michael@0: }; michael@0: } michael@0: michael@0: #endif // COMPILER_SEARCHSYMBOL_H_