Package org.somox.gast2seff.visitors
Class AbstractFunctionClassificationStrategy
java.lang.Object
org.somox.gast2seff.visitors.AbstractFunctionClassificationStrategy
- All Implemented Interfaces:
IFunctionClassificationStrategy
- Direct Known Subclasses:
AbstractLibraryCallFunctionClassificationStrategy
,EJBFunctionClassificationStrategy
public abstract class AbstractFunctionClassificationStrategy
extends Object
implements IFunctionClassificationStrategy
Base implementation of
IFunctionClassificationStrategy
. Delagates the decisions on the
function call types to subclasses-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclassifySimpleStatement
(org.emftext.language.java.statements.Statement object) Given a simple statement there are four options what it could mean: an internal calculation, an internal method call, an external call or a call to a library function.protected boolean
isEmitEventCall
(org.emftext.language.java.members.Method method) Decide whether the given method, which is called method, is an emit event call, i.e., a call which results in a emit event action in the SEFF For backwards compatibility, we provide an empty implemention here that returns false, i.e., emit event call actions are not created per default.protected abstract boolean
isExternalCall
(org.emftext.language.java.members.Method method) Decide whether the given simple statement which is the given function access is an external call, i.e., a call which results in a external call action in the SEFFprotected abstract boolean
isLibraryCall
(org.emftext.language.java.members.Method method) Decide whether the given simple statement which is the given function access is a library call, i.e., a call to an internal method which should be inlined into the SEFFvoid
mergeFunctionCallType
(BitSet myType, Collection<BitSet> functionCallTypes) Update the passed type with the type info to be merged into the existing type.
-
Constructor Details
-
AbstractFunctionClassificationStrategy
-
-
Method Details
-
classifySimpleStatement
Description copied from interface:IFunctionClassificationStrategy
Given a simple statement there are four options what it could mean: an internal calculation, an internal method call, an external call or a call to a library function. This method is used to decide on the type of the simple statement- Specified by:
classifySimpleStatement
in interfaceIFunctionClassificationStrategy
- Parameters:
object
- The simple statement to be classified- Returns:
- A BitSet where the flags indicate the type of the statement. See
FunctionCallClassificationVisitor
for details on this.
-
mergeFunctionCallType
Description copied from interface:IFunctionClassificationStrategy
Update the passed type with the type info to be merged into the existing type. This method is used to calculate the annotations of control flow nodes which have child elements like loops and branches. For example, if a loop has a child statement which is an external call the loops annotation should be updated to indicate that itself should be treated as containing an external call- Specified by:
mergeFunctionCallType
in interfaceIFunctionClassificationStrategy
- Parameters:
myType
- The type flags into which the new type flags should be merged intofunctionCallTypes
- The type flags of one of the child nodes in the GAST to be merged into the parent node
-
isExternalCall
protected abstract boolean isExternalCall(org.emftext.language.java.members.Method method) Decide whether the given simple statement which is the given function access is an external call, i.e., a call which results in a external call action in the SEFF- Parameters:
method
- The function access to test- Returns:
- true if the function access is an external call
-
isEmitEventCall
protected boolean isEmitEventCall(org.emftext.language.java.members.Method method) Decide whether the given method, which is called method, is an emit event call, i.e., a call which results in a emit event action in the SEFF For backwards compatibility, we provide an empty implemention here that returns false, i.e., emit event call actions are not created per default.- Parameters:
method
- The method to test- Returns:
- true if the method is an external call
-
isLibraryCall
protected abstract boolean isLibraryCall(org.emftext.language.java.members.Method method) Decide whether the given simple statement which is the given function access is a library call, i.e., a call to an internal method which should be inlined into the SEFF- Parameters:
method
- The function access to test- Returns:
- true if the function access is
-