org.eclipse.xtext.xbase.controlflow
Class DefaultEarlyExitComputer

java.lang.Object
  extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.xtext.xbase.controlflow.IEarlyExitComputer
IEarlyExitComputer.ExitPoint
 
Constructor Summary
DefaultEarlyExitComputer()
           
 
Method Summary
protected  java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XAbstractFeatureCall expression)
           
protected  java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XBlockExpression expression)
           
protected  java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XConstructorCall expression)
           
protected  java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XDoWhileExpression expression)
           
protected  java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XExpression expression)
           
protected  java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XForLoopExpression expression)
           
protected  java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XIfExpression expression)
           
protected  java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XReturnExpression expression)
           
protected  java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XSwitchExpression expression)
           
protected  java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XThrowExpression expression)
           
protected  java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XTryCatchFinallyExpression expression)
           
protected  java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XVariableDeclaration expression)
           
protected  java.util.Collection<IEarlyExitComputer.ExitPoint> _exitPoints(XWhileExpression expression)
           
 java.util.Collection<IEarlyExitComputer.ExitPoint> getExitPoints(XExpression expression)
           
 boolean isEarlyExit(XExpression expression)
          An expression is considered to be left early if all branches end with an explicit termination, e.g.
protected  boolean isNotEmpty(java.util.Collection<IEarlyExitComputer.ExitPoint> exitPoints)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEarlyExitComputer

public DefaultEarlyExitComputer()
Method Detail

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)
Parameters:
expression - unused in this context but required in dispatch signature

_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)