Package org.eclipse.m2m.atl.emftvm.impl

# Class CodeBlockImpl

java.lang.Object
org.eclipse.emf.common.notify.impl.BasicNotifierImpl
org.eclipse.emf.ecore.impl.BasicEObjectImpl
org.eclipse.emf.ecore.impl.EObjectImpl
org.eclipse.m2m.atl.emftvm.impl.CodeBlockImpl

All Implemented Interfaces:
  `org.eclipse.emf.common.notify.Notifier`, `org.eclipse.emf.ecore.EObject`, `org.eclipse.emf.ecore.InternalEObject`, `CodeBlock`

Direct Known Subclasses:
  `NativeCodeBlock`

public class CodeBlockImpl extends org.eclipse.emf.ecore.impl.EObjectImpl implements CodeBlock
An implementation of the model object 'Code Block'.

## Nested Class Summary

## Nested classes/interfaces inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl

`org.eclipse.emf.ecore.impl.BasicEObjectImpl.EPropertiesHolder, org.eclipse.emf.ecore.impl.BasicEObjectImpl.EPropertiesHolderBaseImpl, org.eclipse.emf.ecore.impl.BasicEObjectImpl.EPropertiesHolderImpl`

## Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl

`org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList<E extends Object & org.eclipse.emf.common.notify.Adapter>, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EObservableAdapterList, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EScannableAdapterList`

## Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.InternalEObject

`org.eclipse.emf.ecore.InternalEObject.EStore`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected org.eclipse.emf.common.util.EList<Instruction>`
`code`
The cached value of the '`Code`' containment reference list.
`protected static final org.eclipse.emf.ecore.EClass`
`EXEC_ENV`
Singleton instance of the `ExecEnv` `EClass`.
`protected org.eclipse.emf.common.util.EList<LineNumber>`
`lineNumbers`
The cached value of the '`Line Numbers`' containment reference list.
`protected org.eclipse.emf.common.util.EList<LocalVariable>`
`localVariables`
The cached value of the '`Local Variables`' containment reference list.
`protected static final int`
`MAX_LOCALS_EDEFAULT`
The default value of the '`Max Locals`' attribute.
`protected static final int`
`MAX_STACK_EDEFAULT`
The default value of the '`Max Stack`' attribute.
`protected int`
`maxLocals`
The cached value of the '`Max Locals`' attribute.
`protected int`
`maxStack`
The cached value of the '`Max Stack`' attribute.
`protected org.eclipse.emf.common.util.EList<CodeBlock>`
`nested`
The cached value of the '`Nested`' containment reference list.
`protected static final StackFrame`
`PARENT_FRAME_EDEFAULT`
The default value of the '`Parent Frame`' attribute.
`protected ThreadLocal<StackFrame>`
`parentFrame`
The cached value of the '`Parent Frame`' attribute.

### Fields inherited from class org.eclipse.emf.ecore.impl.EObjectImpl

`eAdapters, eContainer, eContainerFeatureID, EDELIVER, EDYNAMIC_CLASS, eFlags, ELAST_EOBJECT_FLAG, ELAST_NOTIFIER_FLAG, eProperties, EPROXY`

### Fields inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl

`EVIRTUAL_GET, EVIRTUAL_IS_SET, EVIRTUAL_NO_VALUE, EVIRTUAL_SET, EVIRTUAL_UNSET`

### Fields inherited from interface org.eclipse.emf.ecore.InternalEObject

`EOPPOSITE_FEATURE_BASE`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`CodeBlockImpl()`
Creates a new `CodeBlockImpl`.

## Method Summary

Modifier and Type
Method
Description
`org.eclipse.emf.common.notify.NotificationChain`
`basicSetApplierFor(Rule newApplierFor, org.eclipse.emf.common.notify.NotificationChain msgs)`
`org.eclipse.emf.common.notify.NotificationChain`
`basicSetBindingFor(InputRuleElement newBindingFor, org.eclipse.emf.common.notify.NotificationChain msgs)`
`org.eclipse.emf.common.notify.NotificationChain`
`basicSetBodyFor(Operation newBodyFor, org.eclipse.emf.common.notify.NotificationChain msgs)`
`org.eclipse.emf.common.notify.NotificationChain`
`basicSetInitialiserFor(Field newInitialiserFor, org.eclipse.emf.common.notify.NotificationChain msgs)`
`org.eclipse.emf.common.notify.NotificationChain`
`basicSetMatcherFor(Rule newMatcherFor, org.eclipse.emf.common.notify.NotificationChain msgs)`
`org.eclipse.emf.common.notify.NotificationChain`
`basicSetNestedFor(CodeBlock newNestedFor, org.eclipse.emf.common.notify.NotificationChain msgs)`
`org.eclipse.emf.common.notify.NotificationChain`
`basicSetPostApplyFor(Rule newPostApplyFor, org.eclipse.emf.common.notify.NotificationChain msgs)`
`org.eclipse.emf.common.notify.NotificationChain`
`eBasicRemoveFromContainerFeature(org.eclipse.emf.common.notify.NotificationChain msgs)`
`Object`
`eGet(int featureID, boolean resolve, boolean coreType)`
`org.eclipse.emf.common.notify.NotificationChain`
`eInverseAdd(org.eclipse.emf.ecore.InternalEObject otherEnd, int featureID, org.eclipse.emf.common.notify.NotificationChain msgs)`
`org.eclipse.emf.common.notify.NotificationChain`
`eInverseRemove(org.eclipse.emf.ecore.InternalEObject otherEnd, int featureID, org.eclipse.emf.common.notify.NotificationChain msgs)`
`boolean`
`eIsSet(int featureID)`
`boolean`
`eNotificationRequired()`
`void`
`eNotify(org.eclipse.emf.common.notify.Notification notification)`
`void`
`eSet(int featureID, Object newValue)`
`protected org.eclipse.emf.ecore.EClass`
`eStaticClass()`
Returns the `EClass` that correspond to this metaclass.
`void`
`eUnset(int featureID)`
`Object`
`execute(StackFrame frame)`
Executes the instructions in this `CodeBlock`, using the parameters stored in `frame`.
`org.eclipse.emf.common.util.EList<Instruction>`
`getAllPredecessors(Instruction i)`
Collects the transitive closure of predecessor instructions for `i`.
`Rule`
`getApplierFor()`
Returns the value of the 'Applier For' container reference.
`Module`
`getASM()`
Returns the `Module` (for debugger).
`InputRuleElement`
`getBindingFor()`
Returns the value of the 'Binding For' container reference.
`Operation`
`getBodyFor()`
Returns the value of the 'Body For' container reference.
`org.eclipse.emf.common.util.EList<Instruction>`
`getCode()`
Returns the value of the 'Code' containment reference list.
`Field`
`getField()`
Returns the `Field` that (indirectly) contains this `CodeBlock`, if any.
`Field`
`getInitialiserFor()`
Returns the value of the 'Initialiser For' container reference.
`JITCodeBlock`
`getJITCodeBlock()`
Returns the compiled `JITCodeBlock`, if any.
`org.eclipse.emf.common.util.EList<LineNumber>`
`getLineNumbers()`
Returns the value of the 'Line Numbers' containment reference list.
`org.eclipse.emf.common.util.EList<LocalVariable>`
`getLocalVariables()`
Returns the value of the 'Local Variables' containment reference list.
`Rule`
`getMatcherFor()`
Returns the value of the 'Matcher For' container reference.
`int`
`getMaxLocals()`
Returns the value of the 'Max Locals' attribute.
`int`
`getMaxStack()`
Returns the value of the 'Max Stack' attribute.
`Module`
`getModule()`
Returns the `Module` that (indirectly) contains this `CodeBlock`.
`org.eclipse.emf.common.util.EList<CodeBlock>`
`getNested()`
Returns the value of the 'Nested' containment reference list.
`CodeBlock`
`getNestedFor()`
Returns the value of the 'Nested For' container reference.
`org.eclipse.emf.common.util.EList<Instruction>`
`getNonLoopingPredecessors(Instruction i)`
Collects the direct predecessor instructions for `i` that do not contain `i` in their transitive closure of predecessors.
`Operation`
`getOperation()`
Returns the `Operation` that (indirectly) contains this `CodeBlock`, if any.
`StackFrame`
`getParentFrame()`
Returns the value of the 'Parent Frame' attribute.
`Rule`
`getPostApplyFor()`
Returns the value of the 'Post Apply For' container reference.
`org.eclipse.emf.common.util.EList<Instruction>`
`getPredecessors(Instruction i)`
Collects the direct predecessor instructions for `i`.
`Rule`
`getRule()`
Finds the the `Rule` that contains this codeblock.
`int`
`getStackLevel()`
Calculates the amount of elements on the stack after executing this `CodeBlock`.
`void`
`setApplierFor(Rule newApplierFor)`
Sets the value of the '`Applier For`' container reference.
`void`
`setBindingFor(InputRuleElement newBindingFor)`
Sets the value of the '`Binding For`' container reference.
`void`
`setBodyFor(Operation newBodyFor)`
Sets the value of the '`Body For`' container reference.
`void`
`setInitialiserFor(Field newInitialiserFor)`
Sets the value of the '`Initialiser For`' container reference.
`void`
`setJITCodeBlock(JITCodeBlock jcb)`
Sets the compiled `JITCodeBlock`.
`void`
`setMatcherFor(Rule newMatcherFor)`
Sets the value of the '`Matcher For`' container reference.
`void`
`setMaxLocals(int newMaxLocals)`
Sets the value of the '`Max Locals`' attribute.
`void`
`setMaxStack(int newMaxStack)`
Sets the value of the '`Max Stack`' attribute.
`void`
`setNestedFor(CodeBlock newNestedFor)`
Sets the value of the '`Nested For`' container reference.
`void`
`setParentFrame(StackFrame newParentFrame)`
Sets the value of the '`Parent Frame`' attribute.
`void`
`setPostApplyFor(Rule newPostApplyFor)`
Sets the value of the '`Post Apply For`' container reference.
`String`
`toString()`

### Methods inherited from class org.eclipse.emf.ecore.impl.EObjectImpl

`eAdapters, eBasicAdapters, eBasicProperties, eBasicSetContainer, eClass, eContainerFeatureID, eDeliver, eInternalContainer, eInvoke, eIsProxy, eProperties, eSetClass, eSetDeliver, eSetProxyURI`

### Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl

`eAddVirtualValue, eAllContents, eBaseStructuralFeatureID, eBasicRemoveFromContainer, eBasicSetContainer, eComputeVirtualValuesCapacity, eContainer, eContainerAdapterArray, eContainingFeature, eContainmentFeature, eContainmentFeature, eContains, eContents, eCrossReferences, eDerivedOperationID, eDerivedOperationID, eDerivedStructuralFeatureID, eDerivedStructuralFeatureID, eDirectResource, eDynamicBasicRemoveFromContainer, eDynamicClass, eDynamicFeature, eDynamicFeatureID, eDynamicGet, eDynamicGet, eDynamicGet, eDynamicInverseAdd, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicInverseRemove, eDynamicInvoke, eDynamicInvoke, eDynamicIsSet, eDynamicIsSet, eDynamicIsSet, eDynamicSet, eDynamicSet, eDynamicSet, eDynamicUnset, eDynamicUnset, eDynamicUnset, eGet, eGet, eGet, eHasSettings, eInternalResource, eInverseAdd, eInverseRemove, eInvocationDelegate, eInvoke, eIsSet, eObjectForURIFragmentSegment, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eProxyURI, eRemoveVirtualValue, eResolveProxy, eResource, eSet, eSetDirectResource, eSetResource, eSetStore, eSetting, eSettingDelegate, eSettings, eSetVirtualIndexBits, eSetVirtualValue, eSetVirtualValues, eStaticFeatureCount, eStaticOperationCount, eStore, eUnset, eURIFragmentSegment, eVirtualBitCount, eVirtualGet, eVirtualGet, eVirtualIndex, eVirtualIndexBits, eVirtualIsSet, eVirtualSet, eVirtualUnset, eVirtualValue, eVirtualValues`

### Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl

`eBasicAdapterArray, eBasicHasAdapters`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.eclipse.emf.ecore.EObject

`eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset`

### Methods inherited from interface org.eclipse.emf.common.notify.Notifier

`eAdapters, eDeliver, eSetDeliver`

## Field Details

### MAX_LOCALS_EDEFAULT

protected static final int MAX_LOCALS_EDEFAULT
The default value of the '`Max Locals`' attribute.

See Also:
  - `getMaxLocals()`
  - Constant Field Values

### MAX_STACK_EDEFAULT

protected static final int MAX_STACK_EDEFAULT
The default value of the '`Max Stack`' attribute.

See Also:
  - `getMaxStack()`
  - Constant Field Values

### maxLocals

protected int maxLocals
The cached value of the '`Max Locals`' attribute.

See Also:
  - `getMaxLocals()`

### maxStack

protected int maxStack
The cached value of the '`Max Stack`' attribute.

See Also:
  - `getMaxStack()`

### code

protected org.eclipse.emf.common.util.EList<Instruction> code
The cached value of the '`Code`' containment reference list.

See Also:
  - `getCode()`

### lineNumbers

protected org.eclipse.emf.common.util.EList<LineNumber> lineNumbers
The cached value of the '`Line Numbers`' containment reference list.

See Also:
  - `getLineNumbers()`

### localVariables

protected org.eclipse.emf.common.util.EList<LocalVariable> localVariables
The cached value of the '`Local Variables`' containment reference list.

See Also:
  - `getLocalVariables()`

### nested

protected org.eclipse.emf.common.util.EList<CodeBlock> nested
The cached value of the '`Nested`' containment reference list.

See Also:
  - `getNested()`

### PARENT_FRAME_EDEFAULT

protected static final StackFrame PARENT_FRAME_EDEFAULT
The default value of the '`Parent Frame`' attribute.

See Also:
  - `getParentFrame()`

### parentFrame

protected ThreadLocal<StackFrame> parentFrame
The cached value of the '`Parent Frame`' attribute.

See Also:
  - `getParentFrame()`

### EXEC_ENV

protected static final org.eclipse.emf.ecore.EClass EXEC_ENV
Singleton instance of the `ExecEnv` `EClass`.

## Constructor Details

### CodeBlockImpl

protected CodeBlockImpl()
Creates a new `CodeBlockImpl`.

## Method Details

### eStaticClass

protected org.eclipse.emf.ecore.EClass eStaticClass()
Returns the `EClass` that correspond to this metaclass.

Overrides:
  `eStaticClass` in class `org.eclipse.emf.ecore.impl.EObjectImpl`
Returns:
  the `EClass` that correspond to this metaclass.

### getMaxLocals

public int getMaxLocals()
Returns the value of the 'Max Locals' attribute. The default value is `"-1"`.

Represents the amount of local variables slots required. This value is derived automatically from the list of instructions.

Specified by:
  `getMaxLocals` in interface `CodeBlock`
Returns:
  the value of the 'Max Locals' attribute.
See Also:
  - `CodeBlock.setMaxLocals(int)`
  - `EmftvmPackage.getCodeBlock_MaxLocals()`

### setMaxLocals

public void setMaxLocals(int newMaxLocals)
Sets the value of the '`Max Locals`' attribute.

Represents the amount of local variables slots required. This value is derived automatically from the list of instructions.

Specified by:
  `setMaxLocals` in interface `CodeBlock`
Parameters:
  `newMaxLocals` - the new value of the 'Max Locals' attribute.
See Also:
  - `CodeBlock.getMaxLocals()`

### getMaxStack

public int getMaxStack()
Returns the value of the 'Max Stack' attribute. The default value is `"-1"`.

Represents the amount of stack slots required. This value is derived automatically from the list of instructions.

Specified by:
  `getMaxStack` in interface `CodeBlock`
Returns:
  the value of the 'Max Stack' attribute.
See Also:
  - `CodeBlock.setMaxStack(int)`
  - `EmftvmPackage.getCodeBlock_MaxStack()`

### setMaxStack

public void setMaxStack(int newMaxStack)
Sets the value of the '`Max Stack`' attribute.

Represents the amount of stack slots required. This value is derived automatically from the list of instructions.

Specified by:
  `setMaxStack` in interface `CodeBlock`
Parameters:
  `newMaxStack` - the new value of the 'Max Stack' attribute.
See Also:
  - `CodeBlock.getMaxStack()`

### getCode

public org.eclipse.emf.common.util.EList<Instruction> getCode()
Returns the value of the 'Code' containment reference list. The list contents are of type `Instruction`. It is bidirectional and its opposite is '`Owning Block`'.

Represents the list of instructions to execute.

Specified by:
  `getCode` in interface `CodeBlock`
Returns:
  the value of the 'Code' containment reference list.
See Also:
  - `EmftvmPackage.getCodeBlock_Code()`
  - `Instruction.getOwningBlock()`

### getLineNumbers

public org.eclipse.emf.common.util.EList<LineNumber> getLineNumbers()
Returns the value of the 'Line Numbers' containment reference list. The list contents are of type `LineNumber`. It is bidirectional and its opposite is '`Owning Block`'.

Represents the line number information elements for this code block's instructions.

Specified by:
  `getLineNumbers` in interface `CodeBlock`
Returns:
  the value of the 'Line Numbers' containment reference list.
See Also:
  - `EmftvmPackage.getCodeBlock_LineNumbers()`
  - `LineNumber.getOwningBlock()`

### getLocalVariables

public org.eclipse.emf.common.util.EList<LocalVariable> getLocalVariables()
Returns the value of the 'Local Variables' containment reference list. The list contents are of type `LocalVariable`. It is bidirectional and its opposite is '`Owning Block`'.

Represents the local variable information elements for this code block. This information is used to calculate '`Max Locals`' and local variable slot assignment for the instructions of this code block. The actual local variables are stored in `StackFrame`s.

Specified by:
  `getLocalVariables` in interface `CodeBlock`
Returns:
  the value of the 'Local Variables' containment reference list.
See Also:
  - `EmftvmPackage.getCodeBlock_LocalVariables()`
  - `LocalVariable.getOwningBlock()`

### getMatcherFor

public Rule getMatcherFor()
Returns the value of the 'Matcher For' container reference. It is bidirectional and its opposite is '`Matcher`'.

This reference is set if this code block serves as a '`Matcher`' code block for a `Rule`.

Specified by:
  `getMatcherFor` in interface `CodeBlock`
Returns:
  the value of the 'Matcher For' container reference.
See Also:
  - `CodeBlock.setMatcherFor(Rule)`
  - `EmftvmPackage.getCodeBlock_MatcherFor()`
  - `Rule.getMatcher()`

### basicSetMatcherFor

public org.eclipse.emf.common.notify.NotificationChain basicSetMatcherFor(Rule newMatcherFor, org.eclipse.emf.common.notify.NotificationChain msgs)

See Also:
  - ``

### setMatcherFor

public void setMatcherFor(Rule newMatcherFor)
Sets the value of the '`Matcher For`' container reference. This reference is set if this code block serves as a '`Matcher`' code block for a `Rule`.

Specified by:
  `setMatcherFor` in interface `CodeBlock`
Parameters:
  `newMatcherFor` - the new value of the 'Matcher For' container reference.
See Also:
  - `CodeBlock.getMatcherFor()`

### getApplierFor

public Rule getApplierFor()
Returns the value of the 'Applier For' container reference. It is bidirectional and its opposite is '`Applier`'.

This reference is set if this code block serves as an '`Applier`' code block for a `Rule`.

Specified by:
  `getApplierFor` in interface `CodeBlock`
Returns:
  the value of the 'Applier For' container reference.
See Also:
  - `CodeBlock.setApplierFor(Rule)`
  - `EmftvmPackage.getCodeBlock_ApplierFor()`
  - `Rule.getApplier()`

### basicSetApplierFor

public org.eclipse.emf.common.notify.NotificationChain basicSetApplierFor(Rule newApplierFor, org.eclipse.emf.common.notify.NotificationChain msgs)

See Also:
  - ``

### setApplierFor

public void setApplierFor(Rule newApplierFor)
Sets the value of the '`Applier For`' container reference.

This reference is set if this code block serves as an '`Applier`' code block for a `Rule`.

Specified by:
  `setApplierFor` in interface `CodeBlock`
Parameters:
  `newApplierFor` - the new value of the 'Applier For' container reference.
See Also:
  - `CodeBlock.getApplierFor()`

### getPostApplyFor

public Rule getPostApplyFor()
Returns the value of the 'Post Apply For' container reference. It is bidirectional and its opposite is '`Post Apply`'.

This reference is set if this code block serves as a '`Post Apply`' code block for a `Rule`.

Specified by:
  `getPostApplyFor` in interface `CodeBlock`
Returns:
  the value of the 'Post Apply For' container reference.
See Also:
  - `CodeBlock.setPostApplyFor(Rule)`
  - `EmftvmPackage.getCodeBlock_PostApplyFor()`
  - `Rule.getPostApply()`

### basicSetPostApplyFor

public org.eclipse.emf.common.notify.NotificationChain basicSetPostApplyFor(Rule newPostApplyFor, org.eclipse.emf.common.notify.NotificationChain msgs)

See Also:
  - ``

### setPostApplyFor

public void setPostApplyFor(Rule newPostApplyFor)
Sets the value of the '`Post Apply For`' container reference.

This reference is set if this code block serves as a '`Post Apply`' code block for a `Rule`.

Specified by:
  `setPostApplyFor` in interface `CodeBlock`
Parameters:
  `newPostApplyFor` - the new value of the 'Post Apply For' container reference.
See Also:
  - `CodeBlock.getPostApplyFor()`

### getBodyFor

public Operation getBodyFor()
Returns the value of the 'Body For' container reference. It is bidirectional and its opposite is '`Body`'.

This reference is set if this code block serves as a '`Body`' code block for an `Operation`.

Specified by:
  `getBodyFor` in interface `CodeBlock`
Returns:
  the value of the 'Body For' container reference.
See Also:
  - `CodeBlock.setBodyFor(Operation)`
  - `EmftvmPackage.getCodeBlock_BodyFor()`
  - `Operation.getBody()`

### basicSetBodyFor

public org.eclipse.emf.common.notify.NotificationChain basicSetBodyFor(Operation newBodyFor, org.eclipse.emf.common.notify.NotificationChain msgs)

See Also:
  - ``

### setBodyFor

public void setBodyFor(Operation newBodyFor)
Sets the value of the '`Body For`' container reference.

This reference is set if this code block serves as a '`Body`' code block for an `Operation`.

Specified by:
  `setBodyFor` in interface `CodeBlock`
Parameters:
  `newBodyFor` - the new value of the 'Body For' container reference.
See Also:
  - `CodeBlock.getBodyFor()`

### getInitialiserFor

public Field getInitialiserFor()
Returns the value of the 'Initialiser For' container reference. It is bidirectional and its opposite is '`Initialiser`'.

This reference is set if this code block serves as an '`Initialiser`' code block for a `Field`.

Specified by:
  `getInitialiserFor` in interface `CodeBlock`
Returns:
  the value of the 'Initialiser For' container reference.
See Also:
  - `CodeBlock.setInitialiserFor(Field)`
  - `EmftvmPackage.getCodeBlock_InitialiserFor()`
  - `Field.getInitialiser()`

### basicSetInitialiserFor

public org.eclipse.emf.common.notify.NotificationChain basicSetInitialiserFor(Field newInitialiserFor, org.eclipse.emf.common.notify.NotificationChain msgs)

See Also:
  - ``

### setInitialiserFor

public void setInitialiserFor(Field newInitialiserFor)
Sets the value of the '`Initialiser For`' container reference.

This reference is set if this code block serves as an '`Initialiser`' code block for a `Field`.

Specified by:
  `setInitialiserFor` in interface `CodeBlock`
Parameters:
  `newInitialiserFor` - the new value of the 'Initialiser For' container reference.
See Also:
  - `CodeBlock.getInitialiserFor()`

### getNested

public org.eclipse.emf.common.util.EList<CodeBlock> getNested()
Returns the value of the 'Nested' containment reference list. The list contents are of type `CodeBlock`. It is bidirectional and its opposite is '`Nested For`'.

Represents the list of nested code blocks (i.e. closures).

Specified by:
  `getNested` in interface `CodeBlock`
Returns:
  the value of the 'Nested' containment reference list.
See Also:
  - `EmftvmPackage.getCodeBlock_Nested()`
  - `CodeBlock.getNestedFor()`

### getNestedFor

public CodeBlock getNestedFor()
Returns the value of the 'Nested For' container reference. It is bidirectional and its opposite is '`Nested`'.

This reference is set if this code block serves as a '`Nested`' code block (i.e. closure) for a parent `CodeBlock`.

Specified by:
  `getNestedFor` in interface `CodeBlock`
Returns:
  the value of the 'Nested For' container reference.
See Also:
  - `CodeBlock.setNestedFor(CodeBlock)`
  - `EmftvmPackage.getCodeBlock_NestedFor()`
  - `CodeBlock.getNested()`

### basicSetNestedFor

public org.eclipse.emf.common.notify.NotificationChain basicSetNestedFor(CodeBlock newNestedFor, org.eclipse.emf.common.notify.NotificationChain msgs)

See Also:
  - ``

### setNestedFor

public void setNestedFor(CodeBlock newNestedFor)
Sets the value of the '`Nested For`' container reference.

This reference is set if this code block serves as a '`Nested`' code block (i.e. closure) for a parent `CodeBlock`.

Specified by:
  `setNestedFor` in interface `CodeBlock`
Parameters:
  `newNestedFor` - the new value of the 'Nested For' container reference.
See Also:
  - `CodeBlock.getNestedFor()`

### getParentFrame

public StackFrame getParentFrame()
Returns the value of the 'Parent Frame' attribute.

Represents a placeholder for the `StackFrame` of the invoking native Java method, and allows re-entry into the EMFTVM (with access to lexically scoped local variables, etc.).

Stack frames are stored per thread, which enables the concurrent execution of code blocks.

Specified by:
  `getParentFrame` in interface `CodeBlock`
Returns:
  the value of the 'Parent Frame' attribute.
See Also:
  - `CodeBlock.setParentFrame(StackFrame)`
  - `EmftvmPackage.getCodeBlock_ParentFrame()`

### setParentFrame

public void setParentFrame(StackFrame newParentFrame)
Sets the value of the '`Parent Frame`' attribute.

Represents a placeholder for the `StackFrame` of the invoking native Java method, and allows re-entry into the EMFTVM (with access to lexically scoped local variables, etc.).

Stack frames are stored per thread, which enables the concurrent execution of code blocks.

Specified by:
  `setParentFrame` in interface `CodeBlock`
Parameters:
  `newParentFrame` - the new value of the 'Parent Frame' attribute.
See Also:
  - `CodeBlock.getParentFrame()`

### getBindingFor

public InputRuleElement getBindingFor()
Returns the value of the 'Binding For' container reference. It is bidirectional and its opposite is '`Binding`'.

This reference is set if this code block serves as a '`Binding`' code block for a rule's `InputRuleElement`. Bindings allow for the EMFTVM `Matcher` to implement a search plan strategy.

Specified by:
  `getBindingFor` in interface `CodeBlock`
Returns:
  the value of the 'Binding For' container reference.
See Also:
  - `CodeBlock.setBindingFor(InputRuleElement)`
  - `EmftvmPackage.getCodeBlock_BindingFor()`
  - `InputRuleElement.getBinding()`

### basicSetBindingFor

public org.eclipse.emf.common.notify.NotificationChain basicSetBindingFor(InputRuleElement newBindingFor, org.eclipse.emf.common.notify.NotificationChain msgs)

See Also:
  - ``

### setBindingFor

public void setBindingFor(InputRuleElement newBindingFor)
Sets the value of the '`Binding For`' container reference.

This reference is set if this code block serves as a '`Binding`' code block for a rule's `InputRuleElement`. Bindings allow for the EMFTVM `Matcher` to implement a search plan strategy.

Specified by:
  `setBindingFor` in interface `CodeBlock`
Parameters:
  `newBindingFor` - the new value of the 'Binding For' container reference.
See Also:
  - `CodeBlock.getBindingFor()`

### execute

public Object execute(StackFrame frame)
Executes the instructions in this `CodeBlock`, using the parameters stored in `frame`.

Specified by:
  `execute` in interface `CodeBlock`
Parameters:
  `frame` - the `StackFrame` to use during execution.
Returns:
  the return value.
See Also:
  - ``

### getStackLevel

public int getStackLevel()
Calculates the amount of elements on the stack after executing this `CodeBlock`.

Specified by:
  `getStackLevel` in interface `CodeBlock`
Returns:
  the amount of elements on the stack after executing this `CodeBlock`.

### getModule

public Module getModule()
Returns the `Module` that (indirectly) contains this `CodeBlock`.

Specified by:
  `getModule` in interface `CodeBlock`
Returns:
  the `Module` that (indirectly) contains this `CodeBlock`.

### getOperation

public Operation getOperation()
Returns the `Operation` that (indirectly) contains this `CodeBlock`, if any.

Specified by:
  `getOperation` in interface `CodeBlock`
Returns:
  the `Operation` that (indirectly) contains this `CodeBlock`, or `null`

### getField

public Field getField()
Returns the `Field` that (indirectly) contains this `CodeBlock`, if any.

Specified by:
  `getField` in interface `CodeBlock`
Returns:
  the `Field` that (indirectly) contains this `CodeBlock`, or `null`

### getPredecessors

public org.eclipse.emf.common.util.EList<Instruction> getPredecessors(Instruction i)
Collects the direct predecessor instructions for `i`.

Specified by:
  `getPredecessors` in interface `CodeBlock`
Parameters:
  `i` - the instruction to collect the predecessors for.
Returns:
  the direct predecessor instructions for `i`.

### getAllPredecessors

public org.eclipse.emf.common.util.EList<Instruction> getAllPredecessors(Instruction i)
Collects the transitive closure of predecessor instructions for `i`.

Specified by:
  `getAllPredecessors` in interface `CodeBlock`
Parameters:
  `i` - the instruction to collect the predecessors for.
Returns:
  the transitive closure of predecessor instructions for `i`.

### getNonLoopingPredecessors

public org.eclipse.emf.common.util.EList<Instruction> getNonLoopingPredecessors(Instruction i)
Collects the direct predecessor instructions for `i` that do not contain `i` in their transitive closure of predecessors.

Specified by:
  `getNonLoopingPredecessors` in interface `CodeBlock`
Parameters:
  `i` - the instruction to collect the predecessors for.
Returns:
  the non-looping predecessor instructions for `i`.

### eInverseAdd

public org.eclipse.emf.common.notify.NotificationChain eInverseAdd(org.eclipse.emf.ecore.InternalEObject otherEnd, int featureID, org.eclipse.emf.common.notify.NotificationChain msgs)

Overrides:
  `eInverseAdd` in class `org.eclipse.emf.ecore.impl.BasicEObjectImpl`

### eInverseRemove

public org.eclipse.emf.common.notify.NotificationChain eInverseRemove(org.eclipse.emf.ecore.InternalEObject otherEnd, int featureID, org.eclipse.emf.common.notify.NotificationChain msgs)

Overrides:
  `eInverseRemove` in class `org.eclipse.emf.ecore.impl.BasicEObjectImpl`

### eBasicRemoveFromContainerFeature

public org.eclipse.emf.common.notify.NotificationChain eBasicRemoveFromContainerFeature(org.eclipse.emf.common.notify.NotificationChain msgs)

Overrides:
  `eBasicRemoveFromContainerFeature` in class `org.eclipse.emf.ecore.impl.BasicEObjectImpl`

### eGet

public Object eGet(int featureID, boolean resolve, boolean coreType)

Specified by:
  `eGet` in interface `org.eclipse.emf.ecore.InternalEObject`
Overrides:
  `eGet` in class `org.eclipse.emf.ecore.impl.BasicEObjectImpl`

### eSet

public void eSet(int featureID, Object newValue)

Specified by:
  `eSet` in interface `org.eclipse.emf.ecore.InternalEObject`
Overrides:
  `eSet` in class `org.eclipse.emf.ecore.impl.BasicEObjectImpl`

### eUnset

public void eUnset(int featureID)

Specified by:
  `eUnset` in interface `org.eclipse.emf.ecore.InternalEObject`
Overrides:
  `eUnset` in class `org.eclipse.emf.ecore.impl.BasicEObjectImpl`

### eIsSet

public boolean eIsSet(int featureID)

Specified by:
  `eIsSet` in interface `org.eclipse.emf.ecore.InternalEObject`
Overrides:
  `eIsSet` in class `org.eclipse.emf.ecore.impl.BasicEObjectImpl`

### eNotify

public void eNotify(org.eclipse.emf.common.notify.Notification notification)

Specified by:
  `eNotify` in interface `org.eclipse.emf.common.notify.Notifier`
Overrides:
  `eNotify` in class `org.eclipse.emf.common.notify.impl.BasicNotifierImpl`

### eNotificationRequired

public boolean eNotificationRequired()

Specified by:
  `eNotificationRequired` in interface `org.eclipse.emf.ecore.InternalEObject`
Overrides:
  `eNotificationRequired` in class `org.eclipse.emf.common.notify.impl.BasicNotifierImpl`

### toString

public String toString()

Overrides:
  `toString` in class `org.eclipse.emf.ecore.impl.BasicEObjectImpl`

### getJITCodeBlock

public JITCodeBlock getJITCodeBlock()
Returns the compiled `JITCodeBlock`, if any.

Specified by:
  `getJITCodeBlock` in interface `CodeBlock`
Returns:
  the compiled `JITCodeBlock`, or `null`

### setJITCodeBlock

public void setJITCodeBlock(JITCodeBlock jcb)
Sets the compiled `JITCodeBlock`.

Specified by:
  `setJITCodeBlock` in interface `CodeBlock`
Parameters:
  `jcb` - the compiled `JITCodeBlock`

### getASM

public Module getASM()
Returns the `Module` (for debugger).

Returns:
  the `Module`
See Also:
  - `getModule()`

### getRule

public Rule getRule()
Finds the the `Rule` that contains this codeblock.

Specified by:
  `getRule` in interface `CodeBlock`
Returns:
  the `Rule` that contains this codeblock, or `null` if not contained by a `Rule`.