Skip to main content
summaryrefslogtreecommitdiffstats
blob: 7555c1a218579f8dcb8e9f615bbcab283acb9881 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
/*******************************************************************************
 * Copyright (c) 2003,2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v0.5 
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v05.html
 * 
 * Contributors:
 *     IBM Corp. - Rational Software - initial implementation
 ******************************************************************************/
/*
 * Created on Nov 4, 2003
 */
 
package org.eclipse.cdt.internal.core.parser.pst;

import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.TreeMap;

import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.ParserMode;
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
import org.eclipse.cdt.core.parser.ast.IASTMember;
import org.eclipse.cdt.core.parser.ast.IASTNode;
import org.eclipse.cdt.internal.core.parser.pst.ParserSymbolTable.LookupData;

/**
 * @author aniefer
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class ContainerSymbol extends BasicSymbol implements IContainerSymbol {

	protected ContainerSymbol( ParserSymbolTable table, String name ){
		super( table, name );
	}
	
	protected ContainerSymbol( ParserSymbolTable table, String name, ISymbolASTExtension obj ){
		super( table, name, obj );
	}
	
	protected ContainerSymbol( ParserSymbolTable table, String name, TypeInfo.eType typeInfo ){
		super( table, name, typeInfo );
	}
	
	public Object clone(){
		ContainerSymbol copy = (ContainerSymbol)super.clone();
			
		copy._usingDirectives  =  (_usingDirectives != Collections.EMPTY_LIST) ? (List) ((ArrayList)_usingDirectives).clone() : _usingDirectives;
		
		if( getSymbolTable().getParserMode() == ParserMode.COMPLETION_PARSE )
			copy._containedSymbols = ( _containedSymbols != Collections.EMPTY_MAP )? (Map)((TreeMap) _containedSymbols).clone() : _containedSymbols;
		else 
			copy._containedSymbols = ( _containedSymbols != Collections.EMPTY_MAP )? (Map)((HashMap) _containedSymbols).clone() : _containedSymbols;
		
		copy._contents = (_contents != Collections.EMPTY_LIST) ? (List) ((ArrayList)_contents).clone() : _contents;
		
		return copy;	
	}
	
	public ISymbol instantiate( ITemplateSymbol template, Map argMap ) throws ParserSymbolTableException{
		if( !isTemplateMember() || template == null ){
			return null;
		}
		
		ContainerSymbol newContainer = (ContainerSymbol) super.instantiate( template, argMap );

		Iterator iter = getContentsIterator();
	
		newContainer.getContainedSymbols().clear();
		if( !newContainer._contents.isEmpty()  ){
			newContainer._contents.clear();
			
			IExtensibleSymbol containedSymbol = null;
			ISymbol newSymbol = null;
			
			while( iter.hasNext() ){
				containedSymbol = (IExtensibleSymbol) iter.next();
				
				if( containedSymbol instanceof IUsingDirectiveSymbol ){
					newContainer._contents.add( containedSymbol );
				} else {
					ISymbol symbol = (ISymbol) containedSymbol;
					if( symbol.isForwardDeclaration() && symbol.getTypeSymbol() != null ){
						continue;
					}
					
					if( !template.getExplicitSpecializations().isEmpty() ){
						List params = template.getParameterList();
						int size = template.getParameterList().size();
						List argList = new ArrayList( size );
						boolean hasAllParams = true;
						for( int i = 0; i < size; i++ ){
							Object obj = argMap.get( params.get( i ) );
							if( obj == null ){
								hasAllParams = false;
								break;
							}
							argList.add( obj );
						}
						if( hasAllParams){
							ISymbol temp = TemplateEngine.checkForTemplateExplicitSpecialization( template, symbol, argList );
							if( temp != null )
								containedSymbol = temp;
						}
					}
					
					Map instanceMap = argMap;
					if( !template.getDefinitionParameterMap().isEmpty() && 
						template.getDefinitionParameterMap().containsKey( containedSymbol ) )
					{
						Map defMap = (Map) template.getDefinitionParameterMap().get( containedSymbol );
						instanceMap = new HashMap();
						Iterator i = defMap.keySet().iterator();
						while( i.hasNext() ){
							ISymbol p = (ISymbol) i.next();
							instanceMap.put( p, argMap.get( defMap.get( p ) ) );
						}
					}
					
					newSymbol = ((ISymbol)containedSymbol).instantiate( template, instanceMap );
					newSymbol.setContainingSymbol( newContainer );
					newContainer._contents.add( newSymbol );
					
					if( newSymbol instanceof IParameterizedSymbol && newSymbol.isType( TypeInfo.t_constructor ) ){
						collectInstantiatedConstructor( (IParameterizedSymbol) containedSymbol );	
					} else {
						if( newContainer.getContainedSymbols().containsKey( newSymbol.getName() ) ){
							Object obj = newContainer.getContainedSymbols().get( newSymbol.getName() );
							if( obj instanceof List ){
								((List) obj).add( newSymbol );
							} else {
								List list = new ArrayList(4);
								list.add( obj );
								list.add( newSymbol );
								newContainer.putInContainedSymbols( newSymbol.getName(), list );
							}
						} else {
							newContainer.putInContainedSymbols( newSymbol.getName(), newSymbol );
						}
					}
				}
			}
		}
		
		return newContainer;	
	}
	
	protected void collectInstantiatedConstructor( IParameterizedSymbol constructor ){
		throw new ParserSymbolTableError();
	}
	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#addSymbol(org.eclipse.cdt.internal.core.parser.pst.ISymbol)
	 */
	public void addSymbol( ISymbol obj ) throws ParserSymbolTableException{
		IContainerSymbol containing = this;
		
		//handle enumerators
		if( obj.getType() == TypeInfo.t_enumerator ){
			//a using declaration of an enumerator will not be contained in a
			//enumeration.
			if( containing.getType() == TypeInfo.t_enumeration ){
				//Following the closing brace of an enum-specifier, each enumerator has the type of its 
				//enumeration
				obj.setTypeSymbol( containing );
				//Each enumerator is declared in the scope that immediately contains the enum-specifier	
				containing = containing.getContainingSymbol();
			}
		}
	
		if( obj.isType( TypeInfo.t_template ) ){
			if( ! TemplateEngine.canAddTemplate( containing, (ITemplateSymbol) obj ) ) {
				throw new ParserSymbolTableException( ParserSymbolTableException.r_BadTemplate );
			}
		}
		
		//in C, structs, unions, enums don't nest
		if( getSymbolTable().getLanguage() == ParserLanguage.C ){
			if( obj.isType( TypeInfo.t_struct, TypeInfo.t_enumeration ) ){
				containing = getScopeForCTag( containing );
			}
		}
		
		//14.6.1-4 A Template parameter shall not be redeclared within its scope.
		if( isTemplateMember() || isType( TypeInfo.t_template ) ){
			if( TemplateEngine.alreadyHasTemplateParameter( this, obj.getName() ) ){
				throw new ParserSymbolTableException( ParserSymbolTableException.r_RedeclaredTemplateParam );	
			}
		}
	
		boolean unnamed = obj.getName().equals( ParserSymbolTable.EMPTY_NAME );
	
		Object origObj = null;
	
		obj.setContainingSymbol( containing );

		//does this name exist already?
		origObj = containing.getContainedSymbols().get( obj.getName() );
	
		if( origObj != null )
		{
			ISymbol origDecl = null;
			ArrayList  origList = null;
	
			if( origObj instanceof ISymbol ){
				origDecl = (ISymbol)origObj;
			} else if( origObj.getClass() == ArrayList.class ){
				origList = (ArrayList)origObj;
			} else {
				throw new ParserSymbolTableError( ParserSymbolTableError.r_InternalError );
			}
		
			boolean validOverride =  ( !unnamed ? ( (origList == null) ? ParserSymbolTable.isValidOverload( origDecl, obj ) 
																	   : ParserSymbolTable.isValidOverload( origList, obj ) )
											    : true );
			
			if( unnamed || validOverride )
			{	
				if( origList == null ){
					origList = new ArrayList(4);
					origList.add( origDecl );
					origList.add( obj );
			
					((ContainerSymbol)containing).putInContainedSymbols( obj.getName(), origList );
				} else	{
					origList.add( obj );
					//origList is already in _containedDeclarations
				}
			} else {
				throw new ParserSymbolTableException( ParserSymbolTableException.r_InvalidOverload );
			}
		} else {
			((ContainerSymbol)containing).putInContainedSymbols( obj.getName(), obj );
		}
	
		obj.setIsTemplateMember( isTemplateMember() || getType() == TypeInfo.t_template );
		
		addToContents( obj );
		
//		Command command = new AddSymbolCommand( obj, containing );
//		getSymbolTable().pushCommand( command );
	}

	public boolean removeSymbol( ISymbol symbol ){
		boolean removed = false;
		
		Map contained = getContainedSymbols();
		
		if( symbol != null && contained.containsKey( symbol.getName() ) ){
			Object obj = contained.get( symbol.getName() );
			if( obj instanceof ISymbol ){
				if( obj == symbol ){
					contained.remove( symbol.getName() );
					removed = true;
				}
			} else if ( obj instanceof List ){
				List list = (List) obj;
				if( list.remove( symbol ) ){
					if( list.size() == 1 ){
						contained.put( symbol.getName(), list.get( 0 ) );
					}
					removed = true;
				}
			}
		}
		
		if( removed ){
			ListIterator iter = getContents().listIterator( getContents().size() );
			while( iter.hasPrevious() ){
				if( iter.previous() == symbol ){
					iter.remove();
					break;
				}
			}
		}
		
		return removed;
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#hasUsingDirectives()
	 */
	public boolean hasUsingDirectives(){
		return !_usingDirectives.isEmpty();
	}

	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#getUsingDirectives()
	 */
	public List getUsingDirectives(){
		return _usingDirectives;
	}
	
	protected void addToUsingDirectives( IExtensibleSymbol symbol ){
		if( _usingDirectives == Collections.EMPTY_LIST )
			_usingDirectives = new ArrayList(4);
		_usingDirectives.add( symbol );
	}
	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#addUsingDirective(org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol)
	 */
	public IUsingDirectiveSymbol addUsingDirective( IContainerSymbol namespace ) throws ParserSymbolTableException{
		if( namespace.getType() != TypeInfo.t_namespace ){
			throw new ParserSymbolTableException( ParserSymbolTableException.r_InvalidUsing );
		}
		//7.3.4 A using-directive shall not appear in class scope
		if( isType( TypeInfo.t_class, TypeInfo.t_union ) ){
			throw new ParserSymbolTableException( ParserSymbolTableException.r_InvalidUsing );
		}
		
		//handle namespace aliasing
		ISymbol alias = namespace.getTypeSymbol();
		if( alias != null && alias.isType( TypeInfo.t_namespace ) ){
			namespace = (IContainerSymbol) alias;
		}
		
		IUsingDirectiveSymbol usingDirective = new UsingDirectiveSymbol( getSymbolTable(), namespace );
		
		addToUsingDirectives( usingDirective );
		addToContents( usingDirective );
		
//		Command command = new AddUsingDirectiveCommand( this, usingDirective );
//		getSymbolTable().pushCommand( command );
		
		return usingDirective;
	}

	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#addUsingDeclaration(java.lang.String)
	 */
	/**
	 * addUsingDeclaration
	 * @param obj
	 * @throws ParserSymbolTableException
	 * 
	 * 7.3.3-9  The entity declared by a using-declaration shall be known in the
	 * context using it according to its definition at the point of the using-
	 * declaration.  Definitions added to the namespace after the using-
	 * declaration are not considered when a use of the name is made.
	 * 
	 * 7.3.3-4 A using-declaration used as a member-declaration shall refer to a
	 * member of a base class of the class being defined, shall refer to a
	 * member of an anonymous union that is a member of a base class of the
	 * class being defined, or shall refer to an enumerator for an enumeration
	 * type that is a member of a base class of the class being defined.
	 */
	public IUsingDeclarationSymbol addUsingDeclaration( String name ) throws ParserSymbolTableException {
		return addUsingDeclaration( name, null );
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#addUsingDeclaration(java.lang.String, org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol)
	 */
	public IUsingDeclarationSymbol addUsingDeclaration( String name, IContainerSymbol declContext ) throws ParserSymbolTableException{
		LookupData data = new LookupData( name );

		if( declContext != null ){				
			data.qualified = true;
			ParserSymbolTable.lookup( data, declContext );
		} else {
			ParserSymbolTable.lookup( data, this );
		}

		//figure out which declaration we are talking about, if it is a set of functions,
		//then they will be in data.foundItems (since we provided no parameter info);
		ISymbol symbol = null;
		ISymbol clone = null;
		int objListSize = 0;
		List objList = null;
		
		try{
			symbol = ParserSymbolTable.resolveAmbiguities( data );
		} catch ( ParserSymbolTableException e ) {
			if( e.reason != ParserSymbolTableException.r_UnableToResolveFunction ){
				throw e;
			}
		}

		if( symbol == null && (data.foundItems == null || data.foundItems.isEmpty()) ){
			throw new ParserSymbolTableException( ParserSymbolTableException.r_InvalidUsing );				
		}

		if( symbol == null ){
			Object object = data.foundItems.get( data.name );
			objList = ( object instanceof List ) ? (List) object : null;
			objListSize = ( objList != null ) ? objList.size() : 0;
			symbol = ( objListSize > 0 ) ? (ISymbol)objList.get(0) : null;
		}

		List usingDecs = new ArrayList( ( objListSize > 0 ) ? objListSize : 1 );
		List usingRefs = new ArrayList( ( objListSize > 0 ) ? objListSize : 1 );
		
		UsingDeclarationSymbol usingDeclaration = new UsingDeclarationSymbol( getSymbolTable(), usingRefs, usingDecs );
		boolean addedUsingToContained = false;
		int idx = 1;
		while( symbol != null ){
			if( ParserSymbolTable.okToAddUsingDeclaration( symbol, this ) ){
				if( ! addedUsingToContained ){
					addToContents( usingDeclaration );
					addedUsingToContained = true;
				}
				clone = (ISymbol) symbol.clone(); //7.3.3-9
				addSymbol( clone );
			} else {
				throw new ParserSymbolTableException( ParserSymbolTableException.r_InvalidUsing );
			}
			
			usingDecs.add( clone );
			usingRefs.add( symbol );
			
			if( objList != null && idx < objListSize ){
				symbol = (ISymbol) objList.get( idx++ );
			} else {
				symbol = null;
			}
		}
		
		return usingDeclaration;
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#getContainedSymbols()
	 */
	public Map getContainedSymbols(){
		return _containedSymbols;
	}
	
	protected void putInContainedSymbols( String key, Object obj ){
		if( _containedSymbols == Collections.EMPTY_MAP ){
			if( getSymbolTable().getParserMode() == ParserMode.COMPLETION_PARSE ){
				_containedSymbols = new TreeMap( new SymbolTableComparator() );
			} else {
				_containedSymbols = new HashMap( );
			}
		}
		_containedSymbols.put( key, obj );
	}
	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#elaboratedLookup(org.eclipse.cdt.internal.core.parser.pst.TypeInfo.eType, java.lang.String)
	 */
	public ISymbol elaboratedLookup( final TypeInfo.eType type, String name ) throws ParserSymbolTableException{
		LookupData data = new LookupData( name ){
			public TypeFilter getFilter() {
				if( t == TypeInfo.t_any ) return ANY_FILTER;
				if( filter == null ) filter = new TypeFilter( t );
				return filter;
			}
			private TypeFilter filter = null;
			private final TypeInfo.eType t = type;
		};
	
		ParserSymbolTable.lookup( data, this );
	
		ISymbol found = ParserSymbolTable.resolveAmbiguities( data );
		
		if( isTemplateMember() && found instanceof ITemplateSymbol ) {
			boolean areWithinTemplate = false;
			IContainerSymbol container = getContainingSymbol();
			while( container != null ){
				if( container == found ){
					areWithinTemplate = true;
					break;
				}
				container = container.getContainingSymbol();
			}
			if( areWithinTemplate )
				return TemplateEngine.instantiateWithinTemplateScope( this, (ITemplateSymbol) found );
		}
		
		return found;
	}

	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#lookup(java.lang.String)
	 */
	public ISymbol lookup( String name ) throws ParserSymbolTableException {
		LookupData data = new LookupData( name );
	
		ParserSymbolTable.lookup( data, this );
	
		ISymbol found = ParserSymbolTable.resolveAmbiguities( data );
		
		if( isTemplateMember() && found instanceof ITemplateSymbol ) {
			return TemplateEngine.instantiateWithinTemplateScope( this, (ITemplateSymbol) found );
		}
		
		return found;
	}

	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#lookupMemberForDefinition(java.lang.String)
	 */
	/**
	 * LookupMemberForDefinition
	 * @param name
	 * @return Declaration
	 * @throws ParserSymbolTableException
	 * 
	 * In a definition for a namespace member in which the declarator-id is a
	 * qualified-id, given that the qualified-id for the namespace member has
	 * the form "nested-name-specifier unqualified-id", the unqualified-id shall
	 * name a member of the namespace designated by the nested-name-specifier.
	 * 
	 * ie:
	 * you have this:
	 * namespace A{    
	 *    namespace B{       
	 *       void  f1(int);    
	 *    }  
	 *    using  namespace B; 
	 * }
	 * 
	 * if you then do this 
	 * void A::f1(int) { ... } //ill-formed, f1 is not a member of A
	 * but, you can do this (Assuming f1 has been defined elsewhere)
	 * A::f1( 1 );  //ok, finds B::f1
	 * 
	 * ie, We need a seperate lookup function for looking up the member names
	 * for a definition.
	 */
	public ISymbol lookupMemberForDefinition( String name ) throws ParserSymbolTableException{
		LookupData data = new LookupData( name );
		data.qualified = true;
		
		IContainerSymbol container = this;
		
		//handle namespace aliases
		if( container.isType( TypeInfo.t_namespace ) ){
			ISymbol symbol = container.getTypeSymbol();
			if( symbol != null && symbol.isType( TypeInfo.t_namespace ) ){
				container = (IContainerSymbol) symbol;
			}
		}
		
		data.foundItems = ParserSymbolTable.lookupInContained( data, container );
		if( data.foundItems != null )
			return ParserSymbolTable.resolveAmbiguities( data );
		return null;
	}

	public IParameterizedSymbol lookupMethodForDefinition( String name, final List parameters ) throws ParserSymbolTableException{
		LookupData data = new LookupData( name ){
			public List getParameters() { return params; }
			final private List params = ( parameters == null ) ? Collections.EMPTY_LIST : parameters;
		};
		data.qualified = true;
		data.exactFunctionsOnly = true;
		
		IContainerSymbol container = this;
		
		//handle namespace aliases
		if( container.isType( TypeInfo.t_namespace ) ){
			ISymbol symbol = container.getTypeSymbol();
			if( symbol != null && symbol.isType( TypeInfo.t_namespace ) ){
				container = (IContainerSymbol) symbol;
			}
		}
		
		data.foundItems = ParserSymbolTable.lookupInContained( data, container );
		
		if( data.foundItems != null ){
			ISymbol symbol = ParserSymbolTable.resolveAmbiguities( data ); 
			return (IParameterizedSymbol) (( symbol instanceof IParameterizedSymbol ) ? symbol : null);
		} 
		
		return null;
	}
	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#lookupNestedNameSpecifier(java.lang.String)
	 */
	/**
	 * Method LookupNestedNameSpecifier.
	 * @param name
	 * @return Declaration
	 * The name of a class or namespace member can be referred to after the ::
	 * scope resolution operator applied to a nested-name-specifier that
	 * nominates its class or namespace.  During the lookup for a name preceding
	 * the ::, object, function and enumerator names are ignored.  If the name
	 * is not a class-name or namespace-name, the program is ill-formed
	 */
	public IContainerSymbol lookupNestedNameSpecifier( String name ) throws ParserSymbolTableException {
		return lookupNestedNameSpecifier( name, this );
	}
	private IContainerSymbol lookupNestedNameSpecifier(String name, IContainerSymbol inSymbol ) throws ParserSymbolTableException{		
		ISymbol foundSymbol = null;
	
		final TypeFilter filter = new TypeFilter( TypeInfo.t_namespace );
		filter.addAcceptedType( TypeInfo.t_class );
		filter.addAcceptedType( TypeInfo.t_struct );
		filter.addAcceptedType( TypeInfo.t_union );
		
		LookupData data = new LookupData( name ){
			public TypeFilter getFilter() { return typeFilter; }
			final private TypeFilter typeFilter = filter; 
		};
		
		data.foundItems = ParserSymbolTable.lookupInContained( data, inSymbol );
	
		if( data.foundItems != null ){
			foundSymbol = ParserSymbolTable.resolveAmbiguities( data );
		}
			
		if( foundSymbol == null && inSymbol.getContainingSymbol() != null ){
			foundSymbol = lookupNestedNameSpecifier( name, inSymbol.getContainingSymbol() );
		}
		
		if( foundSymbol instanceof IContainerSymbol )
			return (IContainerSymbol) foundSymbol;
 
		return null;
	}

	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#qualifiedLookup(java.lang.String)
	 */
	public ISymbol qualifiedLookup( String name ) throws ParserSymbolTableException{
		LookupData data = new LookupData( name );
		data.qualified = true;
		ParserSymbolTable.lookup( data, this );
	
		return ParserSymbolTable.resolveAmbiguities( data );	
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#qualifiedLookup(java.lang.String, org.eclipse.cdt.internal.core.parser.pst.TypeInfo.eType)
	 */
	public ISymbol qualifiedLookup( String name, final TypeInfo.eType t ) throws ParserSymbolTableException{
		LookupData data = new LookupData( name ){
			public TypeFilter getFilter() { 
				if( t == TypeInfo.t_any ) return ANY_FILTER;
				
				if( filter == null )
					filter = new TypeFilter( t );
				return filter;
				
			}
			private TypeFilter filter = null;
		};
		data.qualified = true;
		ParserSymbolTable.lookup( data, this );
	
		return ParserSymbolTable.resolveAmbiguities( data ); 
	}

	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#unqualifiedFunctionLookup(java.lang.String, java.util.List)
	 */
	/**
	 * UnqualifiedFunctionLookup
	 * @param name
	 * @param parameters
	 * @return Declaration
	 * @throws ParserSymbolTableException
	 * 
	 * 3.4.2-1 When an unqualified name is used as the post-fix expression in a
	 * function call, other namespaces not consdiered during the usual
	 * unqualified lookup may be searched.
	 * 
	 * 3.4.2-2 For each argument type T in the function call, there is a set of
	 * zero or more associated namespaces and a set of zero or more associated
	 * classes to be considered.
	 * 
	 * If the ordinary unqualified lookup of the name find the declaration of a
	 * class member function, the associated namespaces and classes are not
	 * considered.  Otherwise, the set of declarations found by the lookup of
	 * the function name is the union of the set of declarations found using
	 * ordinary unqualified lookup and the set of declarations found in the
	 * namespaces and classes associated with the argument types.
	 */
	public IParameterizedSymbol unqualifiedFunctionLookup( String name, final List parameters ) throws ParserSymbolTableException{
		//figure out the set of associated scopes first, so we can remove those that are searched
		//during the normal lookup to avoid doing them twice
		final HashSet associated = new HashSet();
	
		//collect associated namespaces & classes.
		int size = ( parameters == null ) ? 0 : parameters.size();
		Iterator iter = ( parameters == null ) ? null : parameters.iterator();
	
		TypeInfo param = null;
		ISymbol paramType = null;
		for( int i = size; i > 0; i-- ){
			param = (TypeInfo) iter.next();
			paramType = ParserSymbolTable.getFlatTypeInfo( param ).getTypeSymbol();
		
			if( paramType == null ){
				continue;
			}
				
			ParserSymbolTable.getAssociatedScopes( paramType, associated );
		
			//if T is a pointer to a data member of class X, its associated namespaces and classes
			//are those associated with the member type together with those associated with X
			if( param.hasPtrOperators() && param.getPtrOperators().size() == 1 ){
				TypeInfo.PtrOp op = (TypeInfo.PtrOp)param.getPtrOperators().iterator().next();
				if( op.getType() == TypeInfo.PtrOp.t_pointer && 
					paramType.getContainingSymbol().isType( TypeInfo.t_class, TypeInfo.t_union ) )
				{
					ParserSymbolTable.getAssociatedScopes( paramType.getContainingSymbol(), associated );	
				}
			}
		}
	
		LookupData data = new LookupData( name ){
			public HashSet getAssociated() { return assoc; }
			public List    getParameters() { return params; }
			public TypeFilter getFilter()  { return FUNCTION_FILTER; }
			
			final private HashSet assoc = associated;
			final private List params = ( parameters == null ) ? Collections.EMPTY_LIST : parameters;
		};
		
		ParserSymbolTable.lookup( data, this );
	
		ISymbol found = ParserSymbolTable.resolveAmbiguities( data );
	
		//if we haven't found anything, or what we found is not a class member, consider the 
		//associated scopes
		if( found == null || found.getContainingSymbol().getType() != TypeInfo.t_class ){
//			if( found != null ){
//				data.foundItems.add( found );
//			}
								
			IContainerSymbol associatedScope;
			//dump the hash to an array and iterate over the array because we
			//could be removing items from the collection as we go and we don't
			//want to get ConcurrentModificationExceptions			
			Object [] scopes = associated.toArray();
		
			size = associated.size();

			for( int i = 0; i < size; i++ ){
				associatedScope  = (IContainerSymbol) scopes[ i ];
				if( associated.contains( associatedScope ) ){
					data.qualified = true;
					data.ignoreUsingDirectives = true;
					data.usingDirectivesOnly = false;
					ParserSymbolTable.lookup( data, associatedScope );
				}
			}
		
			found = ParserSymbolTable.resolveAmbiguities( data );
		}
	
		if( found instanceof IParameterizedSymbol )
			return (IParameterizedSymbol) found;
		return null;
	}

	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#memberFunctionLookup(java.lang.String, java.util.List)
	 */
	/**
	 * MemberFunctionLookup
	 * @param name
	 * @param parameters
	 * @return Declaration
	 * @throws ParserSymbolTableException
	 * 
	 * Member lookup really proceeds as an unqualified lookup, but doesn't
	 * include argument dependant scopes
	 */
	public IParameterizedSymbol memberFunctionLookup( String name, final List parameters ) throws ParserSymbolTableException{
		LookupData data = new LookupData( name ){
			public List getParameters() { return params; }
			final private List params = ( parameters == null ) ? Collections.EMPTY_LIST : parameters;
			public TypeFilter getFilter() { return FUNCTION_FILTER; }
		};
		ParserSymbolTable.lookup( data, this );
		return (IParameterizedSymbol) ParserSymbolTable.resolveAmbiguities( data ); 
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#qualifiedFunctionLookup(java.lang.String, java.util.List)
	 */
	public IParameterizedSymbol qualifiedFunctionLookup( String name, final List parameters ) throws ParserSymbolTableException{
		LookupData data = new LookupData( name ){
			public List getParameters() { return params; }
			final private List params = ( parameters == null ) ? Collections.EMPTY_LIST : parameters;
			public TypeFilter getFilter() { return FUNCTION_FILTER; }
		};
		data.qualified = true;
	
		ParserSymbolTable.lookup( data, this );
	
		return (IParameterizedSymbol) ParserSymbolTable.resolveAmbiguities( data ); 
	}

	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#templateLookup(java.lang.String, java.util.List)
	 */
	public ISymbol lookupTemplateId( String name, List arguments ) throws ParserSymbolTableException
	{
		LookupData data = new LookupData( name );
		
		ParserSymbolTable.lookup( data, this );
		ISymbol found = ParserSymbolTable.resolveAmbiguities( data );
		if( found != null ){
			if( (found.isType( TypeInfo.t_templateParameter ) && found.getTypeInfo().getTemplateParameterType() == TypeInfo.t_template) ||
				     found.isType( TypeInfo.t_template ) )
			{
				found = ((ITemplateSymbol) found).instantiate( arguments );
			} else if( found.getContainingSymbol().isType( TypeInfo.t_template ) ){
				found = ((ITemplateSymbol) found.getContainingSymbol()).instantiate( arguments );
			}	
		}
		
		return found;
	}

	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#lookupFunctionTemplateId(java.lang.String, java.util.List, java.util.List)
	 */
	public ISymbol lookupFunctionTemplateId(String name, final List parameters, final List arguments, boolean forDefinition) throws ParserSymbolTableException {
		LookupData data = new LookupData( name ){
			public List getParameters() { return params; }
			public List getTemplateParameters() { return templateParams; }
			public TypeFilter getFilter() { return FUNCTION_FILTER; }
			final private List params = ( parameters == null ) ? Collections.EMPTY_LIST : parameters;
			final private List templateParams = arguments;
		};
		data.exactFunctionsOnly = forDefinition;
		
		ParserSymbolTable.lookup( data, this );
		ISymbol found = ParserSymbolTable.resolveAmbiguities( data );

		return found;
	}


	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#lookupTemplateIdForDefinition(java.lang.String, java.util.List)
	 */
	public IContainerSymbol lookupTemplateIdForDefinition(String name, List arguments){
		// TODO Auto-generated method stub
		return null;
	}
	
	public List prefixLookup( final TypeFilter filter, String prefix, boolean qualified, final List paramList ) throws ParserSymbolTableException{
		LookupData data = new LookupData( prefix ){
			public List 	getParameters() { return params;      }
			public boolean 	isPrefixLookup(){ return true;        }
			public Set 		getAmbiguities(){ return ambiguities; }
			public TypeFilter getFilter() { return typeFilter; }
			
			public void addAmbiguity( String n ){
				if( ambiguities == Collections.EMPTY_SET ){
					ambiguities = new HashSet();
				}
				ambiguities.add( n );
			}
			
			final private List params = paramList;
			private Set ambiguities = Collections.EMPTY_SET;	
			final private TypeFilter typeFilter = filter;
		};
		
		data.qualified = qualified;
		
		ParserSymbolTable.lookup( data, this );
		
		List constructors = null;
		if( filter != null && filter.willAccept( TypeInfo.t_constructor ) && (this instanceof IDerivableContainerSymbol) ){
			if( getName().startsWith( prefix ) ){
				List temp = ((IDerivableContainerSymbol)this).getConstructors();
				int size = temp.size();
				constructors = new ArrayList( size );
				for( int i = 0; i < size; i++ )
					constructors.add( temp.get( i ) );
			}
		}
		
		if( data.foundItems == null || data.foundItems.isEmpty() ){
			if( constructors != null ){
				if( paramList != null ){
					ParserSymbolTable.resolveFunction( data, constructors );
					return constructors;
				} 
				return constructors;
			} 
			return null;
		}
		//remove any ambiguous symbols
		if( data.getAmbiguities() != null && !data.getAmbiguities().isEmpty() ){
			Iterator iter = data.getAmbiguities().iterator();
			while( iter.hasNext() ){
				data.foundItems.remove( iter.next() );
			}
		}
		
		List list = new ArrayList();
		
		Iterator iter = data.foundItems.keySet().iterator();
		Object obj = null;
		List tempList = null;
		while( iter.hasNext() ){
			obj = data.foundItems.get( iter.next() );
			
			if( obj instanceof List ){
				//a list must be all functions?
				if( paramList != null )
					ParserSymbolTable.resolveFunction( data, (List) obj );
				list.addAll( (List) obj );
			} else{
				if( paramList != null && ((ISymbol)obj).isType( TypeInfo.t_function ) )
				{
					if( tempList == null )
						tempList = new ArrayList(1);
					else 
						tempList.clear();
					tempList.add( obj );
					ParserSymbolTable.resolveFunction( data, tempList );
					list.addAll( tempList );
				} else {
					list.add( obj );
				}
			}
		}

		if( constructors != null )
			list.addAll( constructors );
		
		return list;
		
	}
	
	public boolean isVisible( ISymbol symbol, IContainerSymbol qualifyingSymbol ){
		ISymbolASTExtension extension = symbol.getASTExtension();
		if(extension == null)
			return true;
		IASTNode node = extension.getPrimaryDeclaration();
		if(node == null)
			return true;
		
		if( node instanceof IASTMember ){
			ASTAccessVisibility visibility;
			
			visibility = ParserSymbolTable.getVisibility( symbol, qualifyingSymbol );
			if( visibility == null )
				return false;
			
			if( visibility == ASTAccessVisibility.PUBLIC ){
				return true;
			}
			
			IContainerSymbol container = getContainingSymbol();
			IContainerSymbol symbolContainer = symbol.getContainingSymbol();
			
			if( !symbolContainer.isType( TypeInfo.t_class, TypeInfo.t_union ) ||
				symbolContainer.equals( container ) )
			{
				return true;
			}

			//if this is a friend of the symbolContainer, then we are good
			if( isFriendOf( ( qualifyingSymbol != null ) ? qualifyingSymbol : symbolContainer ) ){
				return true;
			}
			
			if( visibility == ASTAccessVisibility.PROTECTED )
			{
				try {
					return ( ParserSymbolTable.hasBaseClass( container, symbolContainer ) >= 0 );
				} catch (ParserSymbolTableException e) {
					return false;
				}
			}
			return false; 
		}
		return true;
	}
	
	protected boolean isFriendOf( IContainerSymbol symbol ){
		if( symbol instanceof IDerivableContainerSymbol ){
			IContainerSymbol container = this.getContainingSymbol();
			
			while( container != null && container.isType( TypeInfo.t_block ) ){
				container = container.getContainingSymbol();
			}
			if( container != null && !container.isType( TypeInfo.t_class, TypeInfo.t_union ) ){
				container = null;
			}
			
			IDerivableContainerSymbol derivable = (IDerivableContainerSymbol) symbol;
			
			Iterator iter = derivable.getFriends().iterator();
			while( iter.hasNext() ){
				ISymbol friend = (ISymbol) iter.next();
				ISymbol typeSymbol = friend.getTypeSymbol();
				if( friend == this      || typeSymbol == this ||
					friend == container || ( container != null && typeSymbol == container ) )
				{
					return true;
				}
			}
		}
		return false;
	}
	
	private IContainerSymbol getScopeForCTag( IContainerSymbol container ){
		while( !container.isType( TypeInfo.t_namespace ) && 
			   !container.isType( TypeInfo.t_function )  &&
			   !container.isType( TypeInfo.t_block ) )
		{
			container = container.getContainingSymbol();
		} 
		return container;
	}
	
	protected void addToContents( IExtensibleSymbol symbol ){
		if( _contents == Collections.EMPTY_LIST ){
			if( isType( TypeInfo.t_namespace ) )
				_contents = new ArrayList( 64 );
			else if( isType( TypeInfo.t_class ) || isType( TypeInfo.t_struct ) )
				_contents = new ArrayList( 32 );
			else if( isType( TypeInfo.t_function ) )
				_contents = new ArrayList( 16 );
			else
				_contents = new ArrayList( 8 );
		}
		_contents.add( symbol );
	}
	
	protected List getContents(){
		return _contents;
	}
	
	public Iterator getContentsIterator(){
		return new ContentsIterator( getContents().iterator() );
	}
	
	protected class ContentsIterator implements Iterator {
		final Iterator internalIterator;
	
		Set alreadyReturned = new HashSet();
		
		public ContentsIterator( Iterator iter ){
			internalIterator = iter;
		}
		
		IExtensibleSymbol next = null;
		public boolean hasNext() {
			if( next != null ){
				return true;
			}
			if( !internalIterator.hasNext() )
				return false;
			while( internalIterator.hasNext() ){
				IExtensibleSymbol extensible = (IExtensibleSymbol) internalIterator.next();
				if( !alreadyReturned.contains( extensible ) ){
					if( extensible instanceof ISymbol ){
						ISymbol symbol = (ISymbol) extensible;
						if( symbol.isForwardDeclaration() && symbol.getTypeSymbol() != null &&
							symbol.getTypeSymbol().getContainingSymbol() == ContainerSymbol.this )
						{
							alreadyReturned.add( symbol.getTypeSymbol() );
							next = symbol.getTypeSymbol();
							return true;
						}
					} else if( extensible instanceof IUsingDeclarationSymbol ){
						IUsingDeclarationSymbol using = (IUsingDeclarationSymbol) extensible;
						alreadyReturned.addAll( using.getDeclaredSymbols() );
					}
					next = extensible;
					return true;
				}
			}
			return false;
		}

		public Object next() {
			IExtensibleSymbol extensible = next;
			if( next != null ){
				next = null;
				return extensible;
			}
			
			while( internalIterator.hasNext() ){
				extensible = (IExtensibleSymbol) internalIterator.next();
				if( !alreadyReturned.contains( extensible ) ){
					if( extensible instanceof ISymbol ){
						ISymbol symbol = (ISymbol) extensible;
						if( symbol.isForwardDeclaration() && symbol.getTypeSymbol() != null &&
							symbol.getTypeSymbol().getContainingSymbol() == ContainerSymbol.this )
						{
							alreadyReturned.add( symbol.getTypeSymbol() );
							return symbol.getTypeSymbol();
						}
					} else if( extensible instanceof IUsingDeclarationSymbol ){
						IUsingDeclarationSymbol using = (IUsingDeclarationSymbol) extensible;
						alreadyReturned.addAll( using.getDeclaredSymbols() );
					}
					return extensible;
				}
			}
			throw new NoSuchElementException();
		}

		public void remove() {
			throw new UnsupportedOperationException();
		}
		
		protected void removeSymbol(){
			internalIterator.remove();
		}
		
	}
//	static private class AddSymbolCommand extends Command{
//		AddSymbolCommand( ISymbol newDecl, IContainerSymbol context ){
//			_symbol = newDecl;
//			_context = context;
//		}
//		
//		public void undoIt(){
//			Object obj = _context.getContainedSymbols().get( _symbol.getName() );
//			
//			if( obj instanceof ArrayList ){
//				ArrayList list = (ArrayList)obj;
//				ListIterator iter = list.listIterator();
//				int size = list.size();
//				ISymbol item = null;
//				for( int i = 0; i < size; i++ ){
//					item = (ISymbol)iter.next();
//					if( item == _symbol ){
//						iter.remove();
//						break;
//					}
//				}
//				if( list.size() == 1 ){
//					_context.getContainedSymbols().put( _symbol.getName(), list.get(0) );
//				}
//			} else if( obj instanceof BasicSymbol ){
//				_context.getContainedSymbols().remove( _symbol.getName() );
//			}
//			
//			//this is an inefficient way of doing this, we can modify the interfaces if the undo starts
//			//being used often.
//			ContentsIterator iter = (ContentsIterator) _context.getContentsIterator();
//			while( iter.hasNext() ){
//				IExtensibleSymbol ext = (IExtensibleSymbol) iter.next();
//				if( ext == _symbol ){
//					iter.removeSymbol();
//					break;
//				}
//			}
//		}
//		
//		private final ISymbol          _symbol;
//		private final IContainerSymbol _context; 
//	}
	
//	static private class AddUsingDirectiveCommand extends Command{
//		public AddUsingDirectiveCommand( IContainerSymbol container, IUsingDirectiveSymbol directive ){
//			_decl = container;
//			_directive = directive;
//		}
//		public void undoIt(){
//			_decl.getUsingDirectives().remove( _directive );
//			
//			//this is an inefficient way of doing this, we can modify the interfaces if the undo starts
//			//being used often.
//			ContentsIterator iter = (ContentsIterator) _decl.getContentsIterator();
//			while( iter.hasNext() ){
//				IExtensibleSymbol ext = (IExtensibleSymbol) iter.next();
//				if( ext == _directive ){
//					iter.removeSymbol();
//					break;
//				}
//			}
//		}
//		private final IContainerSymbol _decl;
//		private final IUsingDirectiveSymbol _directive;
//	}

	static protected class SymbolTableComparator implements Comparator{
		static final private Collator collator = Collator.getInstance();
		static { collator.setStrength( Collator.PRIMARY ); }
		public int compare( Object o1, Object o2 ){
			int result = collator.compare( o1, o2 );
			if( result == 0 ){
				collator.setStrength( Collator.IDENTICAL );
				result = collator.compare( o1, o2 );
				collator.setStrength( Collator.PRIMARY );
			}
			return result;
		}
		
		public boolean equals( Object obj ){
			return ( obj instanceof SymbolTableComparator );
		}
	}

	private 	List _contents = Collections.EMPTY_LIST;				//ordered list of all contents of this symbol
	private		List _usingDirectives = Collections.EMPTY_LIST;		//collection of nominated namespaces
	private		Map  _containedSymbols = Collections.EMPTY_MAP;		//declarations contained by us.
	/* (non-Javadoc)
	 * @see org.eclipse.cdt.internal.core.parser.pst.IContainerSymbol#addTemplateId(org.eclipse.cdt.internal.core.parser.pst.ISymbol, java.util.List)
	 */
	public void addTemplateId(ISymbol symbol, List args) throws ParserSymbolTableException {
		throw new ParserSymbolTableException( ParserSymbolTableException.r_BadTemplate );
	}
}

Back to the top