KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > aspectj > compiler > crosscuts > ast > NotPcd


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.crosscuts.ast;
26
27 import org.aspectj.compiler.base.ast.*;
28 import org.aspectj.compiler.crosscuts.joinpoints.*;
29
30 import org.aspectj.util.InvertableSet;
31
32 import java.util.*;
33
34 import org.aspectj.compiler.base.JavaCompiler;
35
36 /**
37  * @grammar !pcd
38  * @child Pcd pcd
39  */

40
41 public class NotPcd extends Pcd {
42     public String JavaDoc toShortString() {
43         return "!" + getPcd().toShortString();
44     }
45     
46     public void checkStatic() { getPcd().checkStatic(); }
47
48     public JpPlanner makePlanner(PlanData planData) {
49         return getPcd().makePlanner(planData).not();
50     }
51     
52     //BEGIN: Generated from @child and @property
53
protected Pcd pcd;
54     public Pcd getPcd() { return pcd; }
55     public void setPcd(Pcd _pcd) {
56         if (_pcd != null) _pcd.setParent(this);
57         pcd = _pcd;
58     }
59     
60     public NotPcd(SourceLocation location, Pcd _pcd) {
61         super(location);
62         setPcd(_pcd);
63     }
64     protected NotPcd(SourceLocation source) {
65         super(source);
66     }
67     
68     public ASTObject copyWalk(CopyWalker walker) {
69         NotPcd ret = new NotPcd(getSourceLocation());
70         ret.preCopy(walker, this);
71         if (pcd != null) ret.setPcd( (Pcd)walker.process(pcd) );
72         return ret;
73     }
74     
75     public ASTObject getChildAt(int childIndex) {
76         switch(childIndex) {
77         case 0: return pcd;
78         default: return super.getChildAt(childIndex);
79         }
80     }
81      public String JavaDoc getChildNameAt(int childIndex) {
82         switch(childIndex) {
83         case 0: return "pcd";
84         default: return super.getChildNameAt(childIndex);
85         }
86     }
87      public void setChildAt(int childIndex, ASTObject child) {
88         switch(childIndex) {
89         case 0: setPcd((Pcd)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 "NotPcd()";
99     }
100     
101     //END: Generated from @child and @property
102
}
103
104
Popular Tags