KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > rice > cs > drjava > model > repl > DebugEvaluationVisitor


1 /*BEGIN_COPYRIGHT_BLOCK
2  *
3  * This file is part of DrJava. Download the current version of this project from http://www.drjava.org/
4  * or http://sourceforge.net/projects/drjava/
5  *
6  * DrJava Open Source License
7  *
8  * Copyright (C) 2001-2005 JavaPLT group at Rice University (javaplt@rice.edu). All rights reserved.
9  *
10  * Developed by: Java Programming Languages Team, Rice University, http://www.cs.rice.edu/~javaplt/
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
13  * documentation files (the "Software"), to deal with the Software without restriction, including without limitation
14  * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
15  * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
16  *
17  * - Redistributions of source code must retain the above copyright notice, this list of conditions and the
18  * following disclaimers.
19  * - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
20  * following disclaimers in the documentation and/or other materials provided with the distribution.
21  * - Neither the names of DrJava, the JavaPLT, Rice University, nor the names of its contributors may be used to
22  * endorse or promote products derived from this Software without specific prior written permission.
23  * - Products derived from this software may not be called "DrJava" nor use the term "DrJava" as part of their
24  * names without prior written permission from the JavaPLT group. For permission, write to javaplt@rice.edu.
25  *
26  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
27  * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28  * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
29  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
30  * WITH THE SOFTWARE.
31  *
32  *END_COPYRIGHT_BLOCK*/

33
34 package edu.rice.cs.drjava.model.repl;
35
36 import koala.dynamicjava.interpreter.context.*;
37
38 /** Extension of EvaluationVisitorExtension that notifies InterpreterJVM every time a variable assignment is made.
39  * (But this functionality has been commented out.)
40  * This class is loaded in the Interpreter JVM, not the Main JVM.
41  * (Do not use DrJava's config framework here.)
42  *
43  * @version $Id: DebugEvaluationVisitor.java 3553 2006-02-20 21:22:09Z rcartwright $
44  */

45 public class DebugEvaluationVisitor extends EvaluationVisitorExtension {
46   
47   /** The context associated with this visitor. */
48   protected Context _context;
49
50   /** The name of the interpreter enclosing this visitor. */
51   protected final String JavaDoc _name;
52
53   /** Creates a new debug visitor.
54    * @param ctx the context
55    * @param name the name of the enclosing interpreter
56    */

57   public DebugEvaluationVisitor(Context ctx, String JavaDoc name) {
58     super(ctx);
59     _context = ctx;
60     _name = name;
61   }
62
63 // /** Visits the node, as per the superclass, then notifies the interpreter that something has been assigned.
64
// * Not currently necessary, since variables aren't copied back until the thread is resumed.
65
// *
66
// * @param node the node to visit
67
// */
68
// protected void _notifyAssigned(Expression e) {
69
// InterpreterJVM.ONLY.notifyInterpreterAssignment(_name);
70
// }
71

72 // /** Notifies the InterpreterJVM that an assignment has been made and delegates to the superclass.
73
// * Not currently necessary, since variables aren't copied back until the thread is resumed.
74
// *
75
// * @param node the node to visit
76
// * @return the result of calling this method on the superclass
77
// */
78
// public Object visit(SimpleAssignExpression node) {
79
// Object result = super.visit(node);
80
// _notifyAssigned(node.getLeftExpression());
81
// return result;
82
// }
83

84 // /** Notifies the InterpreterJVM that an assignment has been made and delegates to the superclass.
85
// * Not currently necessary, since variables aren't copied back until the thread is resumed.
86
// *
87
// * @param node the node to visit
88
// * @return the result of calling this method on the superclass
89
// */
90
// public Object visit(AddAssignExpression node) {
91
// Object result = super.visit(node);
92
// _notifyAssigned(node.getLeftExpression());
93
// return result;
94
// }
95

96 // /** Notifies the InterpreterJVM that an assignment has been made and delegates to the superclass.
97
// * Not currently necessary, since variables aren't copied back until the thread is resumed.
98
// *
99
// * @param node the node to visit
100
// * @return the result of calling this method on the superclass
101
// */
102
// public Object visit(SubtractAssignExpression node) {
103
// Object result = super.visit(node);
104
// _notifyAssigned(node.getLeftExpression());
105
// return result;
106
// }
107

108 // /** Notifies the InterpreterJVM that an assignment has been made and delegates to the superclass.
109
// * Not currently necessary, since variables aren't copied back until the thread is resumed.
110
// *
111
// * @param node the node to visit
112
// * @return the result of calling this method on the superclass
113
// */
114
// public Object visit(MultiplyAssignExpression node) {
115
// Object result = super.visit(node);
116
// _notifyAssigned(node.getLeftExpression());
117
// return result;
118
// }
119

120 // /** Notifies the InterpreterJVM that an assignment has been made and delegates to the superclass.
121
// * Not currently necessary, since variables aren't copied bac until the thread is resumed.
122
// *
123
// * @param node the node to visit
124
// * @return the result of calling this method on the superclass
125
// */
126
// public Object visit(DivideAssignExpression node) {
127
// Object result = super.visit(node);
128
// _notifyAssigned(node.getLeftExpression());
129
// return result;
130
// }
131

132 // /** Notifies the InterpreterJVM that an assignment has been made and delegates to the superclass.
133
// * Not currently necessary, since variables aren't copied back until the thread is resumed.
134
// *
135
// * @param node the node to visit
136
// * @return the result of calling this method on the superclass
137
// */
138
// public Object visit(RemainderAssignExpression node) {
139
// Object result = super.visit(node);
140
// _notifyAssigned(node.getLeftExpression());
141
// return result;
142
// }
143

144 // /** Notifies the InterpreterJVM that an assignment has been made and delegates to the superclass.
145
// * Not currently necessary, since variables aren't copied back until the thread is resumed.
146
// *
147
// * @param node the node to visit
148
// * @return the result of calling this method on the superclass
149
// */
150
// public Object visit(BitAndAssignExpression node) {
151
// Object result = super.visit(node);
152
// _notifyAssigned(node.getLeftExpression());
153
// return result;
154
// }
155

156 // /** Notifies the InterpreterJVM that an assignment has been made and delegates to the superclass.
157
// * Not currently necessary, since variables aren't copied back until the thread is resumed.
158
// *
159
// * @param node the node to visit
160
// * @return the result of calling this method on the superclass
161
// */
162
// public Object visit(ExclusiveOrAssignExpression node) {
163
// Object result = super.visit(node);
164
// _notifyAssigned(node.getLeftExpression());
165
// return result;
166
// }
167

168 // /** Notifies the InterpreterJVM that an assignment has been made and delegates to the superclass.
169
// * Not currently necessary, since variables aren't copied back until the thread is resumed.
170
// *
171
// * @param node the node to visit
172
// * @return the result of calling this method on the superclass
173
// */
174
// public Object visit(BitOrAssignExpression node) {
175
// Object result = super.visit(node);
176
// _notifyAssigned(node.getLeftExpression());
177
// return result;
178
// }
179

180 // /** Notifies the InterpreterJVM that an assignment has been made and delegates to the superclass.
181
// * Not currently necessary, since variables aren't copied back until the thread is resumed.
182
// *
183
// * @param node the node to visit
184
// * @return the result of calling this method on the superclass
185
// */
186
// public Object visit(ShiftLeftAssignExpression node) {
187
// Object result = super.visit(node);
188
// _notifyAssigned(node.getLeftExpression());
189
// return result;
190
// }
191

192 // /** Notifies the InterpreterJVM that an assignment has been made and delegates to the superclass.
193
// * Not currently necessary, since variables aren't copied back until the thread is resumed.
194
// *
195
// * @param node the node to visit
196
// * @return the result of calling this method on the superclass
197
// */
198
// public Object visit(ShiftRightAssignExpression node) {
199
// Object result = super.visit(node);
200
// _notifyAssigned(node.getLeftExpression());
201
// return result;
202
// }
203

204 // /** Notifies the InterpreterJVM that an assignment has been made and delegates to the superclass.
205
// * Not currently necessary, since variables aren't copied back until the thread is resumed.
206
// *
207
// * @param node the node to visit
208
// * @return the result of calling this method on the superclass
209
// */
210
// public Object visit(UnsignedShiftRightAssignExpression node) {
211
// Object result = super.visit(node);
212
// _notifyAssigned(node.getLeftExpression());
213
// return result;
214
// }
215
}
Popular Tags