KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > aspectj > compiler > base > cst > UnresolvedNameTypeD


1 /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2  *
3  * This file is part of the compiler and core tools for the AspectJ(tm)
4  * programming language; see http://aspectj.org
5  *
6  * The contents of this file are subject to the Mozilla Public License
7  * Version 1.1 (the "License"); you may not use this file except in
8  * compliance with the License. You may obtain a copy of the License at
9  * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/.
10  *
11  * Software distributed under the License is distributed on an "AS IS" basis,
12  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13  * for the specific language governing rights and limitations under the
14  * License.
15  *
16  * The Original Code is AspectJ.
17  *
18  * The Initial Developer of the Original Code is Xerox Corporation. Portions
19  * created by Xerox Corporation are Copyright (C) 1999-2002 Xerox Corporation.
20  * All Rights Reserved.
21  *
22  * Contributor(s):
23  */

24
25 package org.aspectj.compiler.base.cst;
26
27 import java.util.*;
28 import org.aspectj.compiler.base.ast.*;
29 import org.aspectj.compiler.base.*;
30 import org.aspectj.compiler.base.cst.*;
31
32 import org.aspectj.compiler.base.CodeWriter;
33
34
35 /**
36   * @grammar packageName.name ?qualified
37   * @child Name name
38   */

39
40 public class UnresolvedNameTypeD extends TypeD {
41     public Type getType() {
42         return getTypeManager().TYPE_NOT_FOUND;
43     }
44     
45
46     //INTRO from ScopeWalker
47
public ASTObject postScope(ScopeWalker walker) {
48         Type resolvedType = name.resolveType(walker.getScope());
49         return new ResolvedTypeD(getSourceLocation(), resolvedType);
50     }
51     
52     //BEGIN: Generated from @child and @property
53
protected Name name;
54     public Name getName() { return name; }
55     public void setName(Name _name) {
56         if (_name != null) _name.setParent(this);
57         name = _name;
58     }
59     
60     public UnresolvedNameTypeD(SourceLocation location, Name _name) {
61         super(location);
62         setName(_name);
63     }
64     protected UnresolvedNameTypeD(SourceLocation source) {
65         super(source);
66     }
67     
68     public ASTObject copyWalk(CopyWalker walker) {
69         UnresolvedNameTypeD ret = new UnresolvedNameTypeD(getSourceLocation());
70         ret.preCopy(walker, this);
71         if (name != null) ret.setName( (Name)walker.process(name) );
72         return ret;
73     }
74     
75     public ASTObject getChildAt(int childIndex) {
76         switch(childIndex) {
77         case 0: return name;
78         default: return super.getChildAt(childIndex);
79         }
80     }
81      public String JavaDoc getChildNameAt(int childIndex) {
82         switch(childIndex) {
83         case 0: return "name";
84         default: return super.getChildNameAt(childIndex);
85         }
86     }
87      public void setChildAt(int childIndex, ASTObject child) {
88         switch(childIndex) {
89         case 0: setName((Name)child); return;
90         default: super.setChildAt(childIndex, child); return;
91         }
92     }
93      public int getChildCount() {
94         return 1;
95     }
96     
97     public String JavaDoc getDefaultDisplayName() {
98         return "UnresolvedNameTypeD()";
99     }
100     
101     //END: Generated from @child and @property
102
}
103
Popular Tags