io.sarl.lang.typesystem
Interface ISideEffectContext
All Known Implementing Classes:
SideEffectContext
interface ISideEffectContext
Context for side effect detection.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
compiler
Since:
0.6
Property Summary
Modifier and type Property and description
java.util.List<E> calledOperations
Replies the operation that are being called.
java.lang.Iterable<T> sideEffectExpressions
Replies the detected side effect expressions.
Action Summary
Modifier and type Action and description
abstract void assignVariable(String,XExpression)
Assign a local variable.
default ISideEffectContext branch
Create a context that enables multiple assignments to a variable.
abstract ISideEffectContext branch(Map<K,V>)
Create a context that enables multiple assignments to a variable.
abstract void close
Close a declaration context.
abstract java.util.Map<K,V> createVariableAssignmentBufferForBranch
Create a buffer for storing the variable assignments.
abstract void declareVariable(String,XExpression)
Declare a local variable.
abstract java.util.List<E> getCalledOperations
Replies the operation that are being called.
abstract java.lang.Iterable<T> getSideEffectExpressions
Replies the detected side effect expressions.
abstract java.util.List<E> getVariableValues(String)
Replies the values of the variable with the given nbame.
abstract boolean isStoppingAtFirstSideEffect
Replies if the side-effect exploration should stop at the first discovered side effect.
abstract void mergeBranchVariableAssignments(List<E>)
Merge the given variable assignment.
abstract void open
Open a declaration context.
abstract void registerSideEffect(XExpression)
Register the given call to have a side effect.
Property Details
calledOperations
val calledOperations : java.util.List<E>
Replies the operation that are being called.

This property is an alias for the action: getCalledOperations

Returns:
the called operations.
sideEffectExpressions
val sideEffectExpressions : java.lang.Iterable<T>
Replies the detected side effect expressions.

This property is an alias for the action: getSideEffectExpressions

Returns:
the side-effect expressions.
Since:
0.12
Action Details
assignVariable(String,XExpression)
def assignVariable(String,XExpression)
Assign a local variable.
Parameters:
id - the identifier of the variable.
expression - the new value.
branch
def branch : ISideEffectContext
Create a context that enables multiple assignments to a variable.
Returns:
the context.
branch(Map<K,V>)
def branch(Map<K,V>) : ISideEffectContext
Create a context that enables multiple assignments to a variable.
Parameters:
buffer - the variable assignment buffer.
Returns:
the context.
close
def close
Close a declaration context.
createVariableAssignmentBufferForBranch
def createVariableAssignmentBufferForBranch : java.util.Map<K,V>
Create a buffer for storing the variable assignments.

The replied buffer may be passed to branch(Map).
Returns:
the buffer.
declareVariable(String,XExpression)
def declareVariable(String,XExpression)
Declare a local variable.
Parameters:
id - the identifier of the variable.
expression - initialization expression.
getCalledOperations
def getCalledOperations : java.util.List<E>
Replies the operation that are being called.
Returns:
the called operations.
getSideEffectExpressions
def getSideEffectExpressions : java.lang.Iterable<T>
Replies the detected side effect expressions.
Returns:
the side-effect expressions.
Since:
0.12
getVariableValues(String)
def getVariableValues(String) : java.util.List<E>
Replies the values of the variable with the given nbame.
Parameters:
name - the name of the variable.
Returns:
the values.
isStoppingAtFirstSideEffect
def isStoppingAtFirstSideEffect : boolean
Replies if the side-effect exploration should stop at the first discovered side effect.
Returns:
true if the algorithm stops at first side-effect occurrence.
Since:
0.12
mergeBranchVariableAssignments(List<E>)
def mergeBranchVariableAssignments(List<E>)
Merge the given variable assignment.

This function assumes that any previously defined value is the default value. If one of the given buffer does not redefine the variable, this default value stay in the list of the possible values for the variable.
Parameters:
buffers - the buffers.
open
def open
Open a declaration context.
registerSideEffect(XExpression)
def registerSideEffect(XExpression)
Register the given call to have a side effect.
Parameters:
expression - the side-effect expression.
Since:
0.12