org.eclipse.xtext.xbase.controlflow
Class DefaultEarlyExitComputer
java.lang.Object
org.eclipse.xtext.xbase.controlflow.DefaultEarlyExitComputer
- All Implemented Interfaces:
- IEarlyExitComputer
public class DefaultEarlyExitComputer
- extends java.lang.Object
- implements IEarlyExitComputer
- Author:
- Sebastian Zarnekow - Initial contribution and API
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultEarlyExitComputer
public DefaultEarlyExitComputer()
isEarlyExit
public boolean isEarlyExit(XExpression expression)
- Description copied from interface:
IEarlyExitComputer
- An expression is considered to be left early if all branches end with an explicit
termination, e.g. a return or throw expression.
- Specified by:
isEarlyExit
in interface IEarlyExitComputer
- Returns:
true
if the given expression will definitely exit early.
isNotEmpty
protected boolean isNotEmpty(java.util.Collection<IEarlyExitComputer.ExitPoint> exitPoints)
getExitPoints
public java.util.Collection<IEarlyExitComputer.ExitPoint> getExitPoints(XExpression expression)
- Specified by:
getExitPoints
in interface IEarlyExitComputer
_exitPoints
protected java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XExpression expression)
_exitPoints
protected java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XReturnExpression expression)
_exitPoints
protected java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XThrowExpression expression)
_exitPoints
protected java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XBlockExpression expression)
_exitPoints
protected java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XForLoopExpression expression)
_exitPoints
protected java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XWhileExpression expression)
_exitPoints
protected java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XDoWhileExpression expression)
_exitPoints
protected java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XVariableDeclaration expression)
_exitPoints
protected java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XIfExpression expression)
_exitPoints
protected java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XSwitchExpression expression)
_exitPoints
protected java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XAbstractFeatureCall expression)
_exitPoints
protected java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XConstructorCall expression)
_exitPoints
protected java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XTryCatchFinallyExpression expression)