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: #include "compiler/SearchSymbol.h" michael@0: michael@0: #include "compiler/InfoSink.h" michael@0: #include "compiler/OutputHLSL.h" michael@0: michael@0: namespace sh michael@0: { michael@0: SearchSymbol::SearchSymbol(const TString &symbol) : mSymbol(symbol) michael@0: { michael@0: match = false; michael@0: } michael@0: michael@0: void SearchSymbol::traverse(TIntermNode *node) michael@0: { michael@0: node->traverse(this); michael@0: } michael@0: michael@0: void SearchSymbol::visitSymbol(TIntermSymbol *symbolNode) michael@0: { michael@0: if (symbolNode->getSymbol() == mSymbol) michael@0: { michael@0: match = true; michael@0: } michael@0: } michael@0: michael@0: bool SearchSymbol::foundMatch() const michael@0: { michael@0: return match; michael@0: } michael@0: }