| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | /**************************************************************************
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | ** | 
					
						
							|  |  |  | ** This file is part of Qt Creator | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-06-17 00:01:27 +10:00
										 |  |  | ** Contact: Nokia Corporation (qt-info@nokia.com) | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | ** Commercial Usage | 
					
						
							| 
									
										
										
										
											2008-12-02 14:17:16 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | ** 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. | 
					
						
							| 
									
										
										
										
											2008-12-02 14:17:16 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | ** GNU Lesser General Public License Usage | 
					
						
							| 
									
										
										
										
											2008-12-02 14:17:16 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | ** 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.
 | 
					
						
							| 
									
										
										
										
											2008-12-02 14:17:16 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | ** If you are unsure which license is appropriate for your use, please | 
					
						
							| 
									
										
										
										
											2009-08-14 09:30:56 +02:00
										 |  |  | ** contact the sales department at http://qt.nokia.com/contact.
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | **************************************************************************/ | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | // Copyright (c) 2008 Roberto Raggi <roberto.raggi@gmail.com>
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
					
						
							|  |  |  | // of this software and associated documentation files (the "Software"), to deal
 | 
					
						
							|  |  |  | // in the Software without restriction, including without limitation the rights
 | 
					
						
							|  |  |  | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 | 
					
						
							|  |  |  | // copies of the Software, and to permit persons to whom the Software is
 | 
					
						
							|  |  |  | // furnished to do so, subject to the following conditions:
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // The above copyright notice and this permission notice shall be included in
 | 
					
						
							|  |  |  | // all copies or substantial portions of the Software.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
					
						
							|  |  |  | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | 
					
						
							|  |  |  | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 | 
					
						
							|  |  |  | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 | 
					
						
							|  |  |  | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 | 
					
						
							|  |  |  | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 | 
					
						
							|  |  |  | // THE SOFTWARE.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "Scope.h"
 | 
					
						
							|  |  |  | #include "Symbols.h"
 | 
					
						
							|  |  |  | #include "Names.h"
 | 
					
						
							|  |  |  | #include "Literals.h"
 | 
					
						
							|  |  |  | #include <cassert>
 | 
					
						
							|  |  |  | #include <cstring>
 | 
					
						
							| 
									
										
										
										
											2009-07-27 21:47:03 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-20 11:21:25 +02:00
										 |  |  | using namespace CPlusPlus; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | Scope::Scope(ScopedSymbol *owner) | 
					
						
							|  |  |  |     : _owner(owner), | 
					
						
							|  |  |  |       _symbols(0), | 
					
						
							|  |  |  |       _allocatedSymbols(0), | 
					
						
							|  |  |  |       _symbolCount(-1), | 
					
						
							|  |  |  |       _hash(0), | 
					
						
							| 
									
										
										
										
											2009-07-09 12:14:00 +02:00
										 |  |  |       _hashSize(0) | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | { } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Scope::~Scope() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     if (_symbols) | 
					
						
							|  |  |  |         free(_symbols); | 
					
						
							|  |  |  |     if (_hash) | 
					
						
							|  |  |  |         free(_hash); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ScopedSymbol *Scope::owner() const | 
					
						
							|  |  |  | { return _owner; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Scope::setOwner(ScopedSymbol *owner) | 
					
						
							|  |  |  | { _owner = owner; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Scope *Scope::enclosingScope() const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     if (! _owner) | 
					
						
							|  |  |  |         return 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return _owner->scope(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Scope *Scope::enclosingNamespaceScope() const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     Scope *scope = enclosingScope(); | 
					
						
							|  |  |  |     for (; scope; scope = scope->enclosingScope()) { | 
					
						
							|  |  |  |         if (scope->owner()->isNamespace()) | 
					
						
							|  |  |  |             break; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return scope; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Scope *Scope::enclosingClassScope() const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     Scope *scope = enclosingScope(); | 
					
						
							|  |  |  |     for (; scope; scope = scope->enclosingScope()) { | 
					
						
							|  |  |  |         if (scope->owner()->isClass()) | 
					
						
							|  |  |  |             break; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return scope; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Scope *Scope::enclosingEnumScope() const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     Scope *scope = enclosingScope(); | 
					
						
							|  |  |  |     for (; scope; scope = scope->enclosingScope()) { | 
					
						
							|  |  |  |         if (scope->owner()->isEnum()) | 
					
						
							|  |  |  |             break; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return scope; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Scope *Scope::enclosingFunctionScope() const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     Scope *scope = enclosingScope(); | 
					
						
							|  |  |  |     for (; scope; scope = scope->enclosingScope()) { | 
					
						
							|  |  |  |         if (scope->owner()->isFunction()) | 
					
						
							|  |  |  |             break; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return scope; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Scope *Scope::enclosingBlockScope() const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     Scope *scope = enclosingScope(); | 
					
						
							|  |  |  |     for (; scope; scope = scope->enclosingScope()) { | 
					
						
							|  |  |  |         if (scope->owner()->isBlock()) | 
					
						
							|  |  |  |             break; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return scope; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | bool Scope::isNamespaceScope() const | 
					
						
							| 
									
										
										
										
											2009-02-09 21:00:03 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     if (_owner) | 
					
						
							|  |  |  |         return _owner->isNamespace(); | 
					
						
							|  |  |  |     return false; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | bool Scope::isClassScope() const | 
					
						
							| 
									
										
										
										
											2009-02-09 21:00:03 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     if (_owner) | 
					
						
							|  |  |  |         return _owner->isClass(); | 
					
						
							|  |  |  |     return false; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | bool Scope::isEnumScope() const | 
					
						
							| 
									
										
										
										
											2009-02-09 21:00:03 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     if (_owner) | 
					
						
							|  |  |  |         return _owner->isEnum(); | 
					
						
							|  |  |  |     return false; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | bool Scope::isBlockScope() const | 
					
						
							| 
									
										
										
										
											2009-02-09 21:00:03 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     if (_owner) | 
					
						
							|  |  |  |         return _owner->isBlock(); | 
					
						
							|  |  |  |     return false; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | bool Scope::isPrototypeScope() const | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2009-02-09 21:00:03 +01:00
										 |  |  |     Function *f = 0; | 
					
						
							|  |  |  |     if (_owner && 0 != (f = _owner->asFunction())) | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |         return f->arguments() == this; | 
					
						
							|  |  |  |     return false; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-18 16:58:14 +01:00
										 |  |  | bool Scope::isObjCClassScope() const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     if (_owner) | 
					
						
							|  |  |  |         return _owner->isObjCClass(); | 
					
						
							|  |  |  |     return false; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | bool Scope::isFunctionScope() const | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2009-02-09 21:00:03 +01:00
										 |  |  |     Function *f = 0; | 
					
						
							|  |  |  |     if (_owner && 0 != (f = _owner->asFunction())) | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |         return f->arguments() != this; | 
					
						
							|  |  |  |     return false; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-29 18:19:35 +01:00
										 |  |  | bool Scope::isObjCMethodScope() const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     ObjCMethod *m = 0; | 
					
						
							|  |  |  |     if (_owner && 0 != (m = _owner->asObjCMethod())) | 
					
						
							|  |  |  |         return m->arguments() != this; | 
					
						
							|  |  |  |     return false; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | void Scope::enterSymbol(Symbol *symbol) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     if (++_symbolCount == _allocatedSymbols) { | 
					
						
							|  |  |  |         _allocatedSymbols <<= 1; | 
					
						
							|  |  |  |         if (! _allocatedSymbols) | 
					
						
							|  |  |  |             _allocatedSymbols = DefaultInitialSize; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         _symbols = reinterpret_cast<Symbol **>(realloc(_symbols, sizeof(Symbol *) * _allocatedSymbols)); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     assert(! symbol->_scope || symbol->scope() == this); | 
					
						
							|  |  |  |     symbol->_index = _symbolCount; | 
					
						
							|  |  |  |     symbol->_scope = this; | 
					
						
							|  |  |  |     _symbols[_symbolCount] = symbol; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (_symbolCount >= _hashSize * 0.6) | 
					
						
							|  |  |  |         rehash(); | 
					
						
							|  |  |  |     else { | 
					
						
							|  |  |  |         const unsigned h = hashValue(symbol); | 
					
						
							|  |  |  |         symbol->_next = _hash[h]; | 
					
						
							|  |  |  |         _hash[h] = symbol; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-01 12:46:15 +01:00
										 |  |  | Symbol *Scope::lookat(const Name *name) const | 
					
						
							| 
									
										
										
										
											2009-10-12 12:00:40 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     if (! name) | 
					
						
							|  |  |  |         return 0; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-01 12:46:15 +01:00
										 |  |  |     else if (const OperatorNameId *opId = name->asOperatorNameId()) | 
					
						
							| 
									
										
										
										
											2009-10-12 12:00:40 +02:00
										 |  |  |         return lookat(opId->kind()); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-01 11:33:13 +01:00
										 |  |  |     else if (const Identifier *id = name->identifier()) | 
					
						
							| 
									
										
										
										
											2009-10-12 12:00:40 +02:00
										 |  |  |         return lookat(id); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     else | 
					
						
							|  |  |  |         return 0; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-01 11:33:13 +01:00
										 |  |  | Symbol *Scope::lookat(const Identifier *id) const | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2009-02-10 13:45:19 +01:00
										 |  |  |     if (! _hash || ! id) | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |         return 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     const unsigned h = id->hashCode() % _hashSize; | 
					
						
							|  |  |  |     Symbol *symbol = _hash[h]; | 
					
						
							|  |  |  |     for (; symbol; symbol = symbol->_next) { | 
					
						
							| 
									
										
										
										
											2009-12-01 12:46:15 +01:00
										 |  |  |         const Name *identity = symbol->identity(); | 
					
						
							| 
									
										
										
										
											2009-02-09 20:22:00 +01:00
										 |  |  |         if (! identity) { | 
					
						
							|  |  |  |             continue; | 
					
						
							| 
									
										
										
										
											2009-12-01 12:46:15 +01:00
										 |  |  |         } else if (const NameId *nameId = identity->asNameId()) { | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |             if (nameId->identifier()->isEqualTo(id)) | 
					
						
							|  |  |  |                 break; | 
					
						
							| 
									
										
										
										
											2009-12-01 12:46:15 +01:00
										 |  |  |         } else if (const TemplateNameId *t = identity->asTemplateNameId()) { | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |             if (t->identifier()->isEqualTo(id)) | 
					
						
							|  |  |  |                 break; | 
					
						
							| 
									
										
										
										
											2009-12-01 12:46:15 +01:00
										 |  |  |         } else if (const DestructorNameId *d = identity->asDestructorNameId()) { | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |             if (d->identifier()->isEqualTo(id)) | 
					
						
							|  |  |  |                 break; | 
					
						
							|  |  |  |         } else if (identity->isQualifiedNameId()) { | 
					
						
							| 
									
										
										
										
											2009-12-01 12:46:15 +01:00
										 |  |  |             return 0; | 
					
						
							|  |  |  |         } else if (const SelectorNameId *selectorNameId = identity->asSelectorNameId()) { | 
					
						
							| 
									
										
										
										
											2009-11-11 09:21:06 +01:00
										 |  |  |             if (selectorNameId->identifier()->isEqualTo(id)) | 
					
						
							|  |  |  |                 break; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return symbol; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Symbol *Scope::lookat(int operatorId) const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     if (! _hash) | 
					
						
							|  |  |  |         return 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     const unsigned h = operatorId % _hashSize; | 
					
						
							|  |  |  |     Symbol *symbol = _hash[h]; | 
					
						
							|  |  |  |     for (; symbol; symbol = symbol->_next) { | 
					
						
							| 
									
										
										
										
											2009-12-01 12:46:15 +01:00
										 |  |  |         const Name *identity = symbol->identity(); | 
					
						
							|  |  |  |         if (const OperatorNameId *op = identity->asOperatorNameId()) { | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |             if (op->kind() == operatorId) | 
					
						
							|  |  |  |                 break; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return symbol; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Scope::rehash() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     _hashSize <<= 1; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (! _hashSize) | 
					
						
							|  |  |  |         _hashSize = DefaultInitialSize; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     _hash = reinterpret_cast<Symbol **>(realloc(_hash, sizeof(Symbol *) * _hashSize)); | 
					
						
							| 
									
										
										
										
											2009-11-23 11:56:44 +01:00
										 |  |  |     std::memset(_hash, 0, sizeof(Symbol *) * _hashSize); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     for (int index = 0; index < _symbolCount + 1; ++index) { | 
					
						
							|  |  |  |         Symbol *symbol = _symbols[index]; | 
					
						
							|  |  |  |         const unsigned h = hashValue(symbol); | 
					
						
							|  |  |  |         symbol->_next = _hash[h]; | 
					
						
							|  |  |  |         _hash[h] = symbol; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | unsigned Scope::hashValue(Symbol *symbol) const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     if (! symbol) | 
					
						
							|  |  |  |         return 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return symbol->hashCode() % _hashSize; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | bool Scope::isEmpty() const | 
					
						
							|  |  |  | { return _symbolCount == -1; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | unsigned Scope::symbolCount() const | 
					
						
							|  |  |  | { return _symbolCount + 1; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Symbol *Scope::symbolAt(unsigned index) const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     if (! _symbols) | 
					
						
							|  |  |  |         return 0; | 
					
						
							|  |  |  |     return _symbols[index]; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Scope::iterator Scope::firstSymbol() const | 
					
						
							|  |  |  | { return _symbols; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Scope::iterator Scope::lastSymbol() const | 
					
						
							|  |  |  | { return _symbols + _symbolCount + 1; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-20 11:21:25 +02:00
										 |  |  | 
 |