本文整理汇总了Java中com.sun.tools.example.debug.expr.ExpressionParser类的典型用法代码示例。如果您正苦于以下问题:Java ExpressionParser类的具体用法?Java ExpressionParser怎么用?Java ExpressionParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExpressionParser类属于com.sun.tools.example.debug.expr包,在下文中一共展示了ExpressionParser类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: evaluate
import com.sun.tools.example.debug.expr.ExpressionParser; //导入依赖的package包/类
public Value evaluate(final StackFrame f, String expr)
throws ParseException,
InvocationException,
InvalidTypeException,
ClassNotLoadedException,
NoSessionException,
IncompatibleThreadStateException {
ExpressionParser.GetFrame frameGetter = null;
ensureActiveSession();
if (f != null) {
frameGetter = new ExpressionParser.GetFrame() {
@Override
public StackFrame get() /* throws IncompatibleThreadStateException */ {
return f;
}
};
}
return ExpressionParser.evaluate(expr, vm(), frameGetter);
}
示例2: getStringValue
import com.sun.tools.example.debug.expr.ExpressionParser; //导入依赖的package包/类
private String getStringValue() {
Value val = null;
String valStr = null;
try {
val = ExpressionParser.getMassagedValue();
valStr = val.toString();
} catch (ParseException e) {
String msg = e.getMessage();
if (msg == null) {
MessageOutput.printException(msg, e);
} else {
String s;
try {
s = MessageOutput.format(msg);
} catch (MissingResourceException mex) {
s = e.toString();
}
MessageOutput.printDirectln(s);
}
}
return valStr;
}
示例3: evaluate
import com.sun.tools.example.debug.expr.ExpressionParser; //导入依赖的package包/类
private Value evaluate(String expr) throws ParseException,
InvocationException,
InvalidTypeException,
ClassNotLoadedException,
IncompatibleThreadStateException {
ExpressionParser.GetFrame frameGetter =
new ExpressionParser.GetFrame() {
@Override
public StackFrame get()
throws IncompatibleThreadStateException
{
try {
return context.getCurrentFrame();
} catch (VMNotInterruptedException exc) {
throw new IncompatibleThreadStateException();
}
}
};
return ExpressionParser.evaluate(expr, runtime.vm(), frameGetter);
}
示例4: evaluate
import com.sun.tools.example.debug.expr.ExpressionParser; //导入依赖的package包/类
private Value evaluate(String expr) {
Value result = null;
ExpressionParser.GetFrame frameGetter = null;
try {
final ThreadInfo threadInfo = ThreadInfo.getCurrentThreadInfo();
if ((threadInfo != null) && (threadInfo.getCurrentFrame() != null)) {
frameGetter = new ExpressionParser.GetFrame() {
@Override
public StackFrame get() throws IncompatibleThreadStateException {
return threadInfo.getCurrentFrame();
}
};
}
result = ExpressionParser.evaluate(expr, Env.vm(), frameGetter);
} catch (InvocationException ie) {
MessageOutput.println("Exception in expression:",
ie.exception().referenceType().name());
} catch (Exception ex) {
String exMessage = ex.getMessage();
if (exMessage == null) {
MessageOutput.printException(exMessage, ex);
} else {
String s;
try {
s = MessageOutput.format(exMessage);
} catch (MissingResourceException mex) {
s = ex.toString();
}
MessageOutput.printDirectln(s);// Special case: use printDirectln()
}
}
return result;
}