All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jbase.controlflow.JbaseSureReturnComputer.xtend Maven / Gradle / Ivy

There is a newer version: 0.12.2
Show newest version
package jbase.controlflow

import java.util.Collection
import org.eclipse.xtext.xbase.XExpression
import org.eclipse.xtext.xbase.XSwitchExpression

/**
 * Checks whether there is a sure return statement.
 * 
 * @author Lorenzo Bettini
 */
class JbaseSureReturnComputer extends JbaseSemicolonStatementAwareEarlyExitComputer {

	def boolean isSureReturn(XExpression expression) {
		return isEarlyExit(expression)
	}

	/**
	 * For switch, a sure return must be in the default case.
	 */
	override protected Collection _exitPoints(XSwitchExpression expression) {
		return getExitPoints(expression.getDefault())
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy