Class AbstractFunctionClassificationStrategy

java.lang.Object
org.somox.gast2seff.visitors.AbstractFunctionClassificationStrategy
All Implemented Interfaces:
IFunctionClassificationStrategy
Direct Known Subclasses:
AbstractLibraryCallFunctionClassificationStrategy

public abstract class AbstractFunctionClassificationStrategy extends Object implements IFunctionClassificationStrategy
Base implementation of IFunctionClassificationStrategy. Delagates the decisions on the function call types to subclasses
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    classifySimpleStatement(tools.mdsd.jamopp.model.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(tools.mdsd.jamopp.model.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(tools.mdsd.jamopp.model.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
    protected abstract boolean
    isLibraryCall(tools.mdsd.jamopp.model.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
    void
    mergeFunctionCallType(BitSet myType, Collection<BitSet> functionCallTypes)
    Update the passed type with the type info to be merged into the existing type.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AbstractFunctionClassificationStrategy

      public AbstractFunctionClassificationStrategy(MethodCallFinder methodCallFinder)
  • Method Details

    • classifySimpleStatement

      public List<BitSet> classifySimpleStatement(tools.mdsd.jamopp.model.java.statements.Statement object)
      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 interface IFunctionClassificationStrategy
      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

      public void mergeFunctionCallType(BitSet myType, Collection<BitSet> functionCallTypes)
      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 interface IFunctionClassificationStrategy
      Parameters:
      myType - The type flags into which the new type flags should be merged into
      functionCallTypes - The type flags of one of the child nodes in the GAST to be merged into the parent node
    • isExternalCall

      protected abstract boolean isExternalCall(tools.mdsd.jamopp.model.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(tools.mdsd.jamopp.model.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(tools.mdsd.jamopp.model.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