/******************************************************************************* * Copyright (c) 2011 Vrije Universiteit Brussel. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Dennis Wagelaar, Vrije Universiteit Brussel - initial API and * implementation and/or initial documentation *******************************************************************************/ package org.eclipse.m2m.atl.emftvm; import java.util.regex.Matcher; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; import org.eclipse.m2m.atl.emftvm.jit.JITCodeBlock; import org.eclipse.m2m.atl.emftvm.util.StackFrame; /** * * A representation of the model object 'Code Block'. * @author Dennis Wagelaar * * *
* The following features are supported: *
*"-1"
.
*
* * Represents the amount of local variables slots required. * This value is derived automatically from the list of instructions. *
* * @return the value of the 'Max Locals' attribute. * @see #setMaxLocals(int) * @see org.eclipse.m2m.atl.emftvm.EmftvmPackage#getCodeBlock_MaxLocals() * @model default="-1" required="true" volatile="true" derived="true" * @generated */ int getMaxLocals(); /** * Sets the value of the '{@link org.eclipse.m2m.atl.emftvm.CodeBlock#getMaxLocals Max Locals}' attribute. * ** Represents the amount of local variables slots required. * This value is derived automatically from the list of instructions. *
* * @param value the new value of the 'Max Locals' attribute. * @see #getMaxLocals() * @generated */ void setMaxLocals(int value); /** * 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. *
* * @return the value of the 'Max Stack' attribute. * @see #setMaxStack(int) * @see org.eclipse.m2m.atl.emftvm.EmftvmPackage#getCodeBlock_MaxStack() * @model default="-1" required="true" volatile="true" derived="true" * @generated */ int getMaxStack(); /** * Sets the value of the '{@link org.eclipse.m2m.atl.emftvm.CodeBlock#getMaxStack Max Stack}' attribute. * ** Represents the amount of stack slots required. * This value is derived automatically from the list of instructions. *
* * @param value the new value of the 'Max Stack' attribute. * @see #getMaxStack() * @generated */ void setMaxStack(int value); /** * Returns the value of the 'Code' containment reference list. * The list contents are of type {@link org.eclipse.m2m.atl.emftvm.Instruction}. * It is bidirectional and its opposite is '{@link org.eclipse.m2m.atl.emftvm.Instruction#getOwningBlock Owning Block}'. * ** Represents the list of instructions to execute. *
* * @return the value of the 'Code' containment reference list. * @see org.eclipse.m2m.atl.emftvm.EmftvmPackage#getCodeBlock_Code() * @see org.eclipse.m2m.atl.emftvm.Instruction#getOwningBlock * @model opposite="owningBlock" containment="true" * @generated */ EList* Represents the line number information elements for this code block's instructions. *
* * @return the value of the 'Line Numbers' containment reference list. * @see org.eclipse.m2m.atl.emftvm.EmftvmPackage#getCodeBlock_LineNumbers() * @see org.eclipse.m2m.atl.emftvm.LineNumber#getOwningBlock * @model opposite="owningBlock" containment="true" * @generated */ EList* Represents the local variable information elements for this code block. * This information is used to calculate '{@link #getMaxLocals() Max Locals}' and local variable slot * assignment for the instructions of this code block. * The actual local variables are stored in {@link StackFrame}s. *
* * @return the value of the 'Local Variables' containment reference list. * @see org.eclipse.m2m.atl.emftvm.EmftvmPackage#getCodeBlock_LocalVariables() * @see org.eclipse.m2m.atl.emftvm.LocalVariable#getOwningBlock * @model opposite="owningBlock" containment="true" * @generated */ EList* This reference is set if this code block serves as a * '{@link Rule#getMatcher() Matcher}' code block for a {@link Rule}. *
* * @return the value of the 'Matcher For' container reference. * @see #setMatcherFor(Rule) * @see org.eclipse.m2m.atl.emftvm.EmftvmPackage#getCodeBlock_MatcherFor() * @see org.eclipse.m2m.atl.emftvm.Rule#getMatcher * @model opposite="matcher" transient="false" * @generated */ Rule getMatcherFor(); /** * Sets the value of the '{@link org.eclipse.m2m.atl.emftvm.CodeBlock#getMatcherFor Matcher For}' container reference. * * This reference is set if this code block serves as a * '{@link Rule#getMatcher() Matcher}' code block for a {@link Rule}. * * @param value the new value of the 'Matcher For' container reference. * @see #getMatcherFor() * @generated */ void setMatcherFor(Rule value); /** * Returns the value of the 'Applier For' container reference. * It is bidirectional and its opposite is '{@link org.eclipse.m2m.atl.emftvm.Rule#getApplier Applier}'. * ** This reference is set if this code block serves as an * '{@link Rule#getApplier() Applier}' code block for a {@link Rule}. *
* * @return the value of the 'Applier For' container reference. * @see #setApplierFor(Rule) * @see org.eclipse.m2m.atl.emftvm.EmftvmPackage#getCodeBlock_ApplierFor() * @see org.eclipse.m2m.atl.emftvm.Rule#getApplier * @model opposite="applier" transient="false" * @generated */ Rule getApplierFor(); /** * Sets the value of the '{@link org.eclipse.m2m.atl.emftvm.CodeBlock#getApplierFor Applier For}' container reference. * ** This reference is set if this code block serves as an * '{@link Rule#getApplier() Applier}' code block for a {@link Rule}. *
* * @param value the new value of the 'Applier For' container reference. * @see #getApplierFor() * @generated */ void setApplierFor(Rule value); /** * Returns the value of the 'Post Apply For' container reference. * It is bidirectional and its opposite is '{@link org.eclipse.m2m.atl.emftvm.Rule#getPostApply Post Apply}'. * ** This reference is set if this code block serves as a * '{@link Rule#getPostApply() Post Apply}' code block for a {@link Rule}. *
* * @return the value of the 'Post Apply For' container reference. * @see #setPostApplyFor(Rule) * @see org.eclipse.m2m.atl.emftvm.EmftvmPackage#getCodeBlock_PostApplyFor() * @see org.eclipse.m2m.atl.emftvm.Rule#getPostApply * @model opposite="postApply" transient="false" * @generated */ Rule getPostApplyFor(); /** * Sets the value of the '{@link org.eclipse.m2m.atl.emftvm.CodeBlock#getPostApplyFor Post Apply For}' container reference. * ** This reference is set if this code block serves as a * '{@link Rule#getPostApply() Post Apply}' code block for a {@link Rule}. *
* * @param value the new value of the 'Post Apply For' container reference. * @see #getPostApplyFor() * @generated */ void setPostApplyFor(Rule value); /** * Returns the value of the 'Body For' container reference. * It is bidirectional and its opposite is '{@link org.eclipse.m2m.atl.emftvm.Operation#getBody Body}'. * ** This reference is set if this code block serves as a * '{@link Operation#getBody() Body}' code block for an {@link Operation}. *
* * @return the value of the 'Body For' container reference. * @see #setBodyFor(Operation) * @see org.eclipse.m2m.atl.emftvm.EmftvmPackage#getCodeBlock_BodyFor() * @see org.eclipse.m2m.atl.emftvm.Operation#getBody * @model opposite="body" transient="false" * @generated */ Operation getBodyFor(); /** * Sets the value of the '{@link org.eclipse.m2m.atl.emftvm.CodeBlock#getBodyFor Body For}' container reference. * ** This reference is set if this code block serves as a * '{@link Operation#getBody() Body}' code block for an {@link Operation}. *
* * @param value the new value of the 'Body For' container reference. * @see #getBodyFor() * @generated */ void setBodyFor(Operation value); /** * Returns the value of the 'Initialiser For' container reference. * It is bidirectional and its opposite is '{@link org.eclipse.m2m.atl.emftvm.Field#getInitialiser Initialiser}'. * ** This reference is set if this code block serves as an * '{@link Field#getInitialiser() Initialiser}' code block for a {@link Field}. *
* * @return the value of the 'Initialiser For' container reference. * @see #setInitialiserFor(Field) * @see org.eclipse.m2m.atl.emftvm.EmftvmPackage#getCodeBlock_InitialiserFor() * @see org.eclipse.m2m.atl.emftvm.Field#getInitialiser * @model opposite="initialiser" transient="false" * @generated */ Field getInitialiserFor(); /** * Sets the value of the '{@link org.eclipse.m2m.atl.emftvm.CodeBlock#getInitialiserFor Initialiser For}' container reference. * ** This reference is set if this code block serves as an * '{@link Field#getInitialiser() Initialiser}' code block for a {@link Field}. *
* * @param value the new value of the 'Initialiser For' container reference. * @see #getInitialiserFor() * @generated */ void setInitialiserFor(Field value); /** * Returns the value of the 'Nested' containment reference list. * The list contents are of type {@link org.eclipse.m2m.atl.emftvm.CodeBlock}. * It is bidirectional and its opposite is '{@link org.eclipse.m2m.atl.emftvm.CodeBlock#getNestedFor Nested For}'. * ** Represents the list of nested code blocks (i.e. closures). *
* * @return the value of the 'Nested' containment reference list. * @see org.eclipse.m2m.atl.emftvm.EmftvmPackage#getCodeBlock_Nested() * @see org.eclipse.m2m.atl.emftvm.CodeBlock#getNestedFor * @model opposite="nestedFor" containment="true" * @generated */ EList* This reference is set if this code block serves as a * '{@link #getNested() Nested}' code block (i.e. closure) for a parent {@link CodeBlock}. *
* * @return the value of the 'Nested For' container reference. * @see #setNestedFor(CodeBlock) * @see org.eclipse.m2m.atl.emftvm.EmftvmPackage#getCodeBlock_NestedFor() * @see org.eclipse.m2m.atl.emftvm.CodeBlock#getNested * @model opposite="nested" transient="false" * @generated */ CodeBlock getNestedFor(); /** * Sets the value of the '{@link org.eclipse.m2m.atl.emftvm.CodeBlock#getNestedFor Nested For}' container reference. * ** This reference is set if this code block serves as a * '{@link #getNested() Nested}' code block (i.e. closure) for a parent {@link CodeBlock}. *
* * @param value the new value of the 'Nested For' container reference. * @see #getNestedFor() * @generated */ void setNestedFor(CodeBlock value); /** * Returns the value of the 'Parent Frame' attribute. * ** Represents a placeholder for the {@link 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. *
* * @return the value of the 'Parent Frame' attribute. * @see #setParentFrame(StackFrame) * @see org.eclipse.m2m.atl.emftvm.EmftvmPackage#getCodeBlock_ParentFrame() * @model dataType="org.eclipse.m2m.atl.emftvm.StackFrame" transient="true" * @generated */ StackFrame getParentFrame(); /** * Sets the value of the '{@link org.eclipse.m2m.atl.emftvm.CodeBlock#getParentFrame Parent Frame}' attribute. * ** Represents a placeholder for the {@link 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. *
* * @param value the new value of the 'Parent Frame' attribute. * @see #getParentFrame() * @generated */ void setParentFrame(StackFrame value); /** * Returns the value of the 'Binding For' container reference. * It is bidirectional and its opposite is '{@link org.eclipse.m2m.atl.emftvm.InputRuleElement#getBinding Binding}'. * ** This reference is set if this code block serves as a * '{@link InputRuleElement#getBinding() Binding}' code block for a rule's {@link InputRuleElement}. * Bindings allow for the EMFTVM {@link Matcher} to implement a search plan strategy. *
* * @return the value of the 'Binding For' container reference. * @see #setBindingFor(InputRuleElement) * @see org.eclipse.m2m.atl.emftvm.EmftvmPackage#getCodeBlock_BindingFor() * @see org.eclipse.m2m.atl.emftvm.InputRuleElement#getBinding * @model opposite="binding" transient="false" * @generated */ InputRuleElement getBindingFor(); /** * Sets the value of the '{@link org.eclipse.m2m.atl.emftvm.CodeBlock#getBindingFor Binding For}' container reference. * ** This reference is set if this code block serves as a * '{@link InputRuleElement#getBinding() Binding}' code block for a rule's {@link InputRuleElement}. * Bindings allow for the EMFTVM {@link Matcher} to implement a search plan strategy. *
* * @param value the new value of the 'Binding For' container reference. * @see #getBindingFor() * @generated */ void setBindingFor(InputRuleElement value); /** * * Executes the instructions in this {@link CodeBlock}, using the parameters stored inframe
.
* @param frame the {@link StackFrame} to use during execution.
* @return the return value.
*
* @model frameDataType="org.eclipse.m2m.atl.emftvm.StackFrame"
* @generated
*/
Object execute(StackFrame frame);
/**
*
* Calculates the amount of elements on the stack after executing this {@link CodeBlock}.
* @return the amount of elements on the stack after executing this {@link CodeBlock}.
*
* @model kind="operation"
* @generated
*/
int getStackLevel();
/**
*
* Returns the {@link Module} that (indirectly) contains this {@link CodeBlock}.
* @return the {@link Module} that (indirectly) contains this {@link CodeBlock}.
*
* @model kind="operation"
* @generated
*/
Module getModule();
/**
*
* Returns the {@link Operation} that (indirectly) contains this {@link CodeBlock}, if any.
* @return the {@link Operation} that (indirectly) contains this {@link CodeBlock}, or null
*
* @model kind="operation"
* @generated
*/
Operation getOperation();
/**
*
* Returns the {@link Field} that (indirectly) contains this {@link CodeBlock}, if any.
* @return the {@link Field} that (indirectly) contains this {@link CodeBlock}, or null
*
* @model kind="operation"
* @generated
*/
Field getField();
/**
*
* Collects the direct predecessor instructions for i
.
* @param i the instruction to collect the predecessors for.
* @return the direct predecessor instructions for i
.
*
* @model
* @generated
*/
EListi
.
* @param i the instruction to collect the predecessors for.
* @return the transitive closure of predecessor instructions for i
.
*
* @model
* @generated
*/
EListi
that do not
* contain i
in their transitive closure of predecessors.
* @param i the instruction to collect the predecessors for.
* @return the non-looping predecessor instructions for i
.
*
* @model
* @generated
*/
EListnull
* if not contained by a {@link Rule}.
*/
Rule getRule();
/**
* Returns the compiled {@link JITCodeBlock}, if any.
* @return the compiled {@link JITCodeBlock}, or null
*/
JITCodeBlock getJITCodeBlock();
/**
* Sets the compiled {@link JITCodeBlock}.
* @param jcb the compiled {@link JITCodeBlock}
*/
void setJITCodeBlock(JITCodeBlock jcb);
} // CodeBlock