| 
									
										
										
										
											2009-02-25 09:15:00 +01:00
										 |  |  | /**************************************************************************
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | ** | 
					
						
							|  |  |  | ** This file is part of Qt Creator | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2010-03-05 11:25:49 +01:00
										 |  |  | ** Copyright (c) 2010 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.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef CPLUSPLUS_SYMBOL_H
 | 
					
						
							|  |  |  | #define CPLUSPLUS_SYMBOL_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "CPlusPlusForwardDeclarations.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-20 11:21:25 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace CPlusPlus { | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | class CPLUSPLUS_EXPORT Symbol | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     Symbol(const Symbol &other); | 
					
						
							|  |  |  |     void operator =(const Symbol &other); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     /// Storage class specifier
 | 
					
						
							|  |  |  |     enum Storage { | 
					
						
							|  |  |  |         NoStorage = 0, | 
					
						
							|  |  |  |         Friend, | 
					
						
							| 
									
										
										
										
											2010-03-24 15:02:46 +01:00
										 |  |  |         Auto, | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |         Register, | 
					
						
							|  |  |  |         Static, | 
					
						
							|  |  |  |         Extern, | 
					
						
							|  |  |  |         Mutable, | 
					
						
							|  |  |  |         Typedef | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Access specifier.
 | 
					
						
							|  |  |  |     enum Visibility { | 
					
						
							|  |  |  |         Public, | 
					
						
							|  |  |  |         Protected, | 
					
						
							| 
									
										
										
										
											2009-07-28 16:34:15 +02:00
										 |  |  |         Private, | 
					
						
							|  |  |  |         Package | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     /// Constructs a Symbol with the given source location, name and translation unit.
 | 
					
						
							| 
									
										
										
										
											2009-12-01 12:46:15 +01:00
										 |  |  |     Symbol(TranslationUnit *translationUnit, unsigned sourceLocation, const Name *name); | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /// Destroy this Symbol.
 | 
					
						
							|  |  |  |     virtual ~Symbol(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns this Symbol's source location.
 | 
					
						
							|  |  |  |     unsigned sourceLocation() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-23 09:49:53 +02:00
										 |  |  |     /// \returns this Symbol's line number. The line number is 1-based.
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     unsigned line() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-23 09:49:53 +02:00
										 |  |  |     /// \returns this Symbol's column number. The column number is 1-based.
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     unsigned column() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns this Symbol's file name.
 | 
					
						
							| 
									
										
										
										
											2009-12-01 11:33:13 +01:00
										 |  |  |     const StringLiteral *fileId() const; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /// Returns this Symbol's file name.
 | 
					
						
							|  |  |  |     const char *fileName() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns this Symbol's file name length.
 | 
					
						
							|  |  |  |     unsigned fileNameLength() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns this Symbol's name.
 | 
					
						
							| 
									
										
										
										
											2009-12-01 12:46:15 +01:00
										 |  |  |     const Name *name() const; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /// Sets this Symbol's name.
 | 
					
						
							| 
									
										
										
										
											2009-12-01 12:46:15 +01:00
										 |  |  |     void setName(const Name *name); // ### dangerous
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-05-28 11:49:59 +02:00
										 |  |  |     /// Returns this Symbol's (optional) identifier
 | 
					
						
							| 
									
										
										
										
											2009-12-01 11:33:13 +01:00
										 |  |  |     const Identifier *identifier() const; | 
					
						
							| 
									
										
										
										
											2009-05-28 11:49:59 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     /// Returns this Symbol's storage class specifier.
 | 
					
						
							|  |  |  |     int storage() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Sets this Symbol's storage class specifier.
 | 
					
						
							|  |  |  |     void setStorage(int storage); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns this Symbol's visibility.
 | 
					
						
							|  |  |  |     int visibility() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Sets this Symbol's visibility.
 | 
					
						
							|  |  |  |     void setVisibility(int visibility); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns the next chained Symbol.
 | 
					
						
							|  |  |  |     Symbol *next() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol has friend storage specifier.
 | 
					
						
							|  |  |  |     bool isFriend() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol has register storage specifier.
 | 
					
						
							|  |  |  |     bool isRegister() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol has static storage specifier.
 | 
					
						
							|  |  |  |     bool isStatic() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol has extern storage specifier.
 | 
					
						
							|  |  |  |     bool isExtern() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol has mutable storage specifier.
 | 
					
						
							|  |  |  |     bool isMutable() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol has typedef storage specifier.
 | 
					
						
							|  |  |  |     bool isTypedef() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol's visibility is public.
 | 
					
						
							|  |  |  |     bool isPublic() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol's visibility is protected.
 | 
					
						
							|  |  |  |     bool isProtected() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol's visibility is private.
 | 
					
						
							|  |  |  |     bool isPrivate() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol is a ScopedSymbol.
 | 
					
						
							|  |  |  |     bool isScopedSymbol() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol is an Enum.
 | 
					
						
							|  |  |  |     bool isEnum() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol is an Function.
 | 
					
						
							|  |  |  |     bool isFunction() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol is a Namespace.
 | 
					
						
							|  |  |  |     bool isNamespace() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol is a Class.
 | 
					
						
							|  |  |  |     bool isClass() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol is a Block.
 | 
					
						
							|  |  |  |     bool isBlock() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol is a UsingNamespaceDirective.
 | 
					
						
							|  |  |  |     bool isUsingNamespaceDirective() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol is a UsingDeclaration.
 | 
					
						
							|  |  |  |     bool isUsingDeclaration() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol is a Declaration.
 | 
					
						
							|  |  |  |     bool isDeclaration() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns true if this Symbol is an Argument.
 | 
					
						
							|  |  |  |     bool isArgument() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-08 11:58:27 +01:00
										 |  |  |     /// Returns true if this Symbol is a Typename argument.
 | 
					
						
							|  |  |  |     bool isTypenameArgument() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     /// Returns true if this Symbol is a BaseClass.
 | 
					
						
							|  |  |  |     bool isBaseClass() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-02-16 15:43:24 +01:00
										 |  |  |     /// Returns true if this Symbol is a ForwardClassDeclaration.
 | 
					
						
							|  |  |  |     bool isForwardClassDeclaration() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-05 18:02:01 +02:00
										 |  |  |     bool isObjCBaseClass() const; | 
					
						
							|  |  |  |     bool isObjCBaseProtocol() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-08-05 18:30:18 +02:00
										 |  |  |     /// Returns true if this Symbol is an Objective-C Class declaration.
 | 
					
						
							| 
									
										
										
										
											2009-07-28 16:34:15 +02:00
										 |  |  |     bool isObjCClass() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-08-05 18:30:18 +02:00
										 |  |  |     /// Returns true if this Symbol is an Objective-C Class forward declaration.
 | 
					
						
							| 
									
										
										
										
											2009-07-28 16:34:15 +02:00
										 |  |  |     bool isObjCForwardClassDeclaration() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-08-05 18:30:18 +02:00
										 |  |  |     /// Returns true if this Symbol is an Objective-C Protocol declaration.
 | 
					
						
							| 
									
										
										
										
											2009-07-28 16:34:15 +02:00
										 |  |  |     bool isObjCProtocol() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-08-05 18:30:18 +02:00
										 |  |  |     /// Returns true if this Symbol is an Objective-C Protocol forward declaration.
 | 
					
						
							| 
									
										
										
										
											2009-07-28 16:34:15 +02:00
										 |  |  |     bool isObjCForwardProtocolDeclaration() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-08-05 18:30:18 +02:00
										 |  |  |     /// Returns true if this Symbol is an Objective-C method declaration.
 | 
					
						
							|  |  |  |     bool isObjCMethod() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-11 09:32:05 +01:00
										 |  |  |     /// Returns true if this Symbol is an Objective-C @property declaration.
 | 
					
						
							|  |  |  |     bool isObjCPropertyDeclaration() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-11 12:26:02 +02:00
										 |  |  |     virtual const Scope *asScope() const { return 0; } | 
					
						
							| 
									
										
										
										
											2009-02-09 16:15:02 +01:00
										 |  |  |     virtual const Enum *asEnum() const { return 0; } | 
					
						
							|  |  |  |     virtual const Function *asFunction() const { return 0; } | 
					
						
							|  |  |  |     virtual const Namespace *asNamespace() const { return 0; } | 
					
						
							| 
									
										
										
										
											2010-05-05 10:18:11 +02:00
										 |  |  |     virtual const NamespaceAlias *asNamespaceAlias() const { return 0; } | 
					
						
							| 
									
										
										
										
											2009-02-09 16:15:02 +01:00
										 |  |  |     virtual const Class *asClass() const { return 0; } | 
					
						
							|  |  |  |     virtual const Block *asBlock() const { return 0; } | 
					
						
							|  |  |  |     virtual const UsingNamespaceDirective *asUsingNamespaceDirective() const { return 0; } | 
					
						
							|  |  |  |     virtual const UsingDeclaration *asUsingDeclaration() const { return 0; } | 
					
						
							|  |  |  |     virtual const Declaration *asDeclaration() const { return 0; } | 
					
						
							|  |  |  |     virtual const Argument *asArgument() const { return 0; } | 
					
						
							| 
									
										
										
										
											2009-12-08 11:58:27 +01:00
										 |  |  |     virtual const TypenameArgument *asTypenameArgument() const { return 0; } | 
					
						
							| 
									
										
										
										
											2009-02-09 16:15:02 +01:00
										 |  |  |     virtual const BaseClass *asBaseClass() const { return 0; } | 
					
						
							| 
									
										
										
										
											2009-02-16 15:43:24 +01:00
										 |  |  |     virtual const ForwardClassDeclaration *asForwardClassDeclaration() const { return 0; } | 
					
						
							| 
									
										
										
										
											2009-10-05 18:02:01 +02:00
										 |  |  |     virtual const ObjCBaseClass *asObjCBaseClass() const { return 0; } | 
					
						
							|  |  |  |     virtual const ObjCBaseProtocol *asObjCBaseProtocol() const { return 0; } | 
					
						
							| 
									
										
										
										
											2009-07-28 16:34:15 +02:00
										 |  |  |     virtual const ObjCClass *asObjCClass() const { return 0; } | 
					
						
							|  |  |  |     virtual const ObjCForwardClassDeclaration *asObjCForwardClassDeclaration() const { return 0; } | 
					
						
							|  |  |  |     virtual const ObjCProtocol *asObjCProtocol() const { return 0; } | 
					
						
							|  |  |  |     virtual const ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclaration() const { return 0; } | 
					
						
							| 
									
										
										
										
											2009-08-05 18:30:18 +02:00
										 |  |  |     virtual const ObjCMethod *asObjCMethod() const { return 0; } | 
					
						
							| 
									
										
										
										
											2009-11-11 09:32:05 +01:00
										 |  |  |     virtual const ObjCPropertyDeclaration *asObjCPropertyDeclaration() const { return 0; } | 
					
						
							| 
									
										
										
										
											2009-02-09 16:15:02 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-11 12:26:02 +02:00
										 |  |  |     virtual Scope *asScope() { return 0; } | 
					
						
							| 
									
										
										
										
											2009-02-09 16:15:02 +01:00
										 |  |  |     virtual Enum *asEnum() { return 0; } | 
					
						
							|  |  |  |     virtual Function *asFunction() { return 0; } | 
					
						
							|  |  |  |     virtual Namespace *asNamespace() { return 0; } | 
					
						
							| 
									
										
										
										
											2010-05-05 10:18:11 +02:00
										 |  |  |     virtual NamespaceAlias *asNamespaceAlias() { return 0; } | 
					
						
							| 
									
										
										
										
											2009-02-09 16:15:02 +01:00
										 |  |  |     virtual Class *asClass() { return 0; } | 
					
						
							|  |  |  |     virtual Block *asBlock() { return 0; } | 
					
						
							|  |  |  |     virtual UsingNamespaceDirective *asUsingNamespaceDirective() { return 0; } | 
					
						
							|  |  |  |     virtual UsingDeclaration *asUsingDeclaration() { return 0; } | 
					
						
							|  |  |  |     virtual Declaration *asDeclaration() { return 0; } | 
					
						
							|  |  |  |     virtual Argument *asArgument() { return 0; } | 
					
						
							| 
									
										
										
										
											2009-12-08 11:58:27 +01:00
										 |  |  |     virtual TypenameArgument *asTypenameArgument() { return 0; } | 
					
						
							| 
									
										
										
										
											2009-02-09 16:15:02 +01:00
										 |  |  |     virtual BaseClass *asBaseClass() { return 0; } | 
					
						
							| 
									
										
										
										
											2009-02-16 15:43:24 +01:00
										 |  |  |     virtual ForwardClassDeclaration *asForwardClassDeclaration() { return 0; } | 
					
						
							| 
									
										
										
										
											2009-10-05 18:02:01 +02:00
										 |  |  |     virtual ObjCBaseClass *asObjCBaseClass() { return 0; } | 
					
						
							|  |  |  |     virtual ObjCBaseProtocol *asObjCBaseProtocol() { return 0; } | 
					
						
							| 
									
										
										
										
											2009-07-28 16:34:15 +02:00
										 |  |  |     virtual ObjCClass *asObjCClass() { return 0; } | 
					
						
							|  |  |  |     virtual ObjCForwardClassDeclaration *asObjCForwardClassDeclaration() { return 0; } | 
					
						
							|  |  |  |     virtual ObjCProtocol *asObjCProtocol() { return 0; } | 
					
						
							|  |  |  |     virtual ObjCForwardProtocolDeclaration *asObjCForwardProtocolDeclaration() { return 0; } | 
					
						
							| 
									
										
										
										
											2009-08-05 18:30:18 +02:00
										 |  |  |     virtual ObjCMethod *asObjCMethod() { return 0; } | 
					
						
							| 
									
										
										
										
											2009-11-11 09:32:05 +01:00
										 |  |  |     virtual ObjCPropertyDeclaration *asObjCPropertyDeclaration() { return 0; } | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /// Returns this Symbol's type.
 | 
					
						
							|  |  |  |     virtual FullySpecifiedType type() const = 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns this Symbol's hash value.
 | 
					
						
							|  |  |  |     unsigned hashCode() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /// Returns this Symbol's index.
 | 
					
						
							|  |  |  |     unsigned index() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-01 12:46:15 +01:00
										 |  |  |     const Name *identity() const; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-03-04 15:45:38 +01:00
										 |  |  |     bool isGenerated() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-23 12:04:44 +01:00
										 |  |  |     bool isDeprecated() const; | 
					
						
							|  |  |  |     void setDeprecated(bool isDeprecated); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-26 13:56:25 +02:00
										 |  |  |     bool isUnavailable() const; | 
					
						
							|  |  |  |     void setUnavailable(bool isUnavailable); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-11 12:26:02 +02:00
										 |  |  |     /// Returns this Symbol's eclosing scope.
 | 
					
						
							|  |  |  |     Scope *scope() const; | 
					
						
							| 
									
										
										
										
											2009-10-13 12:20:21 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-06-03 14:15:49 +02:00
										 |  |  |     /// Returns the eclosing namespace scope.
 | 
					
						
							| 
									
										
										
										
											2010-08-11 12:26:02 +02:00
										 |  |  |     Namespace *enclosingNamespace() const; | 
					
						
							| 
									
										
										
										
											2009-06-03 14:15:49 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /// Returns the enclosing class scope.
 | 
					
						
							| 
									
										
										
										
											2010-08-11 12:26:02 +02:00
										 |  |  |     Class *enclosingClass() const; | 
					
						
							| 
									
										
										
										
											2009-06-03 14:15:49 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /// Returns the enclosing enum scope.
 | 
					
						
							| 
									
										
										
										
											2010-08-11 12:26:02 +02:00
										 |  |  |     Enum *enclosingEnum() const; | 
					
						
							| 
									
										
										
										
											2009-06-03 14:15:49 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-05 17:06:16 +02:00
										 |  |  |     /// Returns the enclosing prototype scope.
 | 
					
						
							| 
									
										
										
										
											2010-08-11 12:26:02 +02:00
										 |  |  |     Function *enclosingFunction() const; | 
					
						
							| 
									
										
										
										
											2009-06-03 14:15:49 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /// Returns the enclosing Block scope.
 | 
					
						
							| 
									
										
										
										
											2010-08-11 12:26:02 +02:00
										 |  |  |     Block *enclosingBlock() const; | 
					
						
							| 
									
										
										
										
											2009-06-03 14:15:49 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     void setScope(Scope *scope); // ### make me private
 | 
					
						
							| 
									
										
										
										
											2010-05-10 13:45:27 +02:00
										 |  |  |     void setSourceLocation(unsigned sourceLocation, TranslationUnit *translationUnit); // ### make me private
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     void visitSymbol(SymbolVisitor *visitor); | 
					
						
							|  |  |  |     static void visitSymbol(Symbol *symbol, SymbolVisitor *visitor); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-10 12:19:13 +02:00
										 |  |  |     virtual void copy(Symbol *other); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | protected: | 
					
						
							|  |  |  |     virtual void visitSymbol0(SymbolVisitor *visitor) = 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     unsigned _sourceLocation; | 
					
						
							| 
									
										
										
										
											2009-12-01 12:46:15 +01:00
										 |  |  |     const Name *_name; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     unsigned _hashCode; | 
					
						
							|  |  |  |     int _storage; | 
					
						
							|  |  |  |     int _visibility; | 
					
						
							|  |  |  |     Scope *_scope; | 
					
						
							|  |  |  |     unsigned _index; | 
					
						
							|  |  |  |     Symbol *_next; | 
					
						
							| 
									
										
										
										
											2010-05-10 13:45:27 +02:00
										 |  |  |     const StringLiteral *_fileId; | 
					
						
							|  |  |  |     unsigned _line; | 
					
						
							|  |  |  |     unsigned _column; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-03-04 15:45:38 +01:00
										 |  |  |     bool _isGenerated: 1; | 
					
						
							| 
									
										
										
										
											2010-03-23 12:04:44 +01:00
										 |  |  |     bool _isDeprecated: 1; | 
					
						
							| 
									
										
										
										
											2010-05-26 13:56:25 +02:00
										 |  |  |     bool _isUnavailable: 1; | 
					
						
							| 
									
										
										
										
											2009-03-04 15:45:38 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  |     class HashCode; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-11 12:26:02 +02:00
										 |  |  |     friend class SymbolTable; | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-20 11:21:25 +02:00
										 |  |  | } // end of namespace CPlusPlus
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-12-02 12:01:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #endif // CPLUSPLUS_SYMBOL_H
 |