Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: e0cd226520b403a71bd7996c59bf8a5671670202 (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
/*******************************************************************************
 * Copyright (c) 2000, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.debug.core.model;


/**
 * An expression is a snippet of code that can be evaluated
 * to produce a value. When and how an expression is evaluated
 * is implementation specific. The context/binding required to
 * evaluate an expression varies by debug model, and by
 * user intent. Furthermore, an expression may need to be evaluated
 * at a specific location in a program (for example, at a
 * breakpoint/line where certain variables referenced in the
 * expression are visible/allocated). A user may want to
 * evaluate an expression once to produce a value that can
 * be inspected iteratively, or they may wish to evaluate an
 * expression iteratively producing new values each time
 * (i.e. as in a watch list).
 * <p>
 * Clients are intended to implement this interface.
 * </p>
 * @since 2.0
 */
public interface IExpression extends IDebugElement {

	/**
	 * Returns this expression's snippet of code.
	 *
	 * @return the expression
	 */
	String getExpressionText();

	/**
	 * Returns the current value of this expression or
	 * <code>null</code> if this expression does not
	 * currently have a value.
	 *
	 * @return value or <code>null</code>
	 */
	IValue getValue();

	/**
	 * Returns the debug target this expression is associated
	 * with, or <code>null</code> if this expression is not
	 * associated with a debug target.
	 *
	 * @return debug target or <code>null</code>
	 * @see IDebugElement#getDebugTarget()
	 */
	@Override IDebugTarget getDebugTarget();

	/**
	 * Notifies this expression that it has been removed
	 * from the expression manager. Any required clean up
	 * is be performed such that this expression can be
	 * garbage collected.
	 */
	void dispose();
}

Back to the top