Package org.eclipse.m2m.atl.engine.emfvm

# Class ASMOperation

java.lang.Object
org.eclipse.m2m.atl.engine.emfvm.lib.Operation
org.eclipse.m2m.atl.engine.emfvm.ASMOperation

public class ASMOperation extends Operation
ASM commands scheduler.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`MAX_STACK`
The max size of the Stack.

### Fields inherited from class org.eclipse.m2m.atl.engine.emfvm.lib.Operation

`maxLocals, name`

## Constructor Summary

Constructors
Constructor
Description
`ASMOperation(ASM asm, String name)`
ASMOperation constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`addLineNumberEntry(String id, int begin, int end)`
Adds a line number entry.
`void`
`addLocalVariableEntry(int slot, String variableName, int begin, int end)`
Adds a local variable entry with the given parameters.
`void`
`addParameter(String parameterName, String type)`
Adds a parameter.
`Object`
`exec(AbstractStackFrame frame)`
Executes an operation.
`Object`
`exec(AbstractStackFrame frame, org.eclipse.core.runtime.IProgressMonitor monitor)`
Executes an operation.
`protected static Method`
`findMethod(Class<?> caller, String name, Class<?>[] argumentTypes)`
Looks for a method into cache and metamodel.
`ASM`
`getASM()`
`Bytecode[]`
`getBytecodes()`
Returns the bytecodes.
`String`
`getContext()`
`List<?>`
`getInstructions()`
`List<org.eclipse.m2m.atl.engine.emfvm.ASMOperation.LineNumberEntry>`
`getLineNumberTable()`
`List<org.eclipse.m2m.atl.engine.emfvm.ASMOperation.LocalVariableEntry>`
`getLocalVariableTable()`
`int`
`getMaxLocals()`
`String`
`getName()`
`List<String>`
`getParameters()`
`String`
`resolveLineNumber(int l)`
Returns the line at the specified number.
`String`
`resolveVariableName(int slot, int l)`
Resolves a variable name by its slot number and its index.
`void`
`setBytecodes(Bytecode[] bytecodes)`
Sets the bytecodes for the operation.
`void`
`setContext(String context)`
`String`
`toString()`

### Methods inherited from class org.eclipse.m2m.atl.engine.emfvm.lib.Operation

`setName`

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

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

## Field Details

### MAX_STACK

public static final int MAX_STACK
The max size of the Stack.

See Also:
  - Constant Field Values

## Constructor Details

### ASMOperation

public ASMOperation(ASM asm, String name)
ASMOperation constructor.

Parameters:
  `asm` - the parent asm
  `name` - operation name

## Method Details

### getMaxLocals

public int getMaxLocals()

Overrides:
  `getMaxLocals` in class `Operation`
See Also:
  - `Operation.getMaxLocals()`

### getParameters

public List<String> getParameters()

### setContext

public void setContext(String context)

### getContext

public String getContext()

### addParameter

public void addParameter(String parameterName, String type)
Adds a parameter.

Parameters:
  `parameterName` - the parameter name
  `type` - the parameter type

### addLineNumberEntry

public void addLineNumberEntry(String id, int begin, int end)
Adds a line number entry.

Parameters:
  `id` - the parameter id
  `begin` - the begin index
  `end` - the end index

### getLineNumberTable

public List<org.eclipse.m2m.atl.engine.emfvm.ASMOperation.LineNumberEntry> getLineNumberTable()

### resolveLineNumber

public String resolveLineNumber(int l)
Returns the line at the specified number.

Overrides:
  `resolveLineNumber` in class `Operation`
Parameters:
  `l` - the line number
Returns:
  the line at the specified number
See Also:
  - `Operation.resolveLineNumber(int)`

### addLocalVariableEntry

public void addLocalVariableEntry(int slot, String variableName, int begin, int end)
Adds a local variable entry with the given parameters.

Parameters:
  `slot` - the slot number
  `variableName` - the variable name
  `begin` - the begin index
  `end` - the end index

### getLocalVariableTable

public List<org.eclipse.m2m.atl.engine.emfvm.ASMOperation.LocalVariableEntry> getLocalVariableTable()

### resolveVariableName

public String resolveVariableName(int slot, int l)
Resolves a variable name by its slot number and its index.

Overrides:
  `resolveVariableName` in class `Operation`
Parameters:
  `slot` - the slot number
  `l` - the variable index
Returns:
  the variable name
See Also:
  - `Operation.resolveVariableName(int, int)`

### setBytecodes

public void setBytecodes(Bytecode[] bytecodes)
Sets the bytecodes for the operation.

Parameters:
  `bytecodes` - the bytecodes to set

### getBytecodes

public Bytecode[] getBytecodes()
Returns the bytecodes.

Returns:
  The bytecodes, if any

### getName

public String getName()

Overrides:
  `getName` in class `Operation`
See Also:
  - `Operation.getName()`

### exec

public Object exec(AbstractStackFrame frame, org.eclipse.core.runtime.IProgressMonitor monitor)
Executes an operation.

Parameters:
  `frame` - the frame for execution
  `monitor` - the progress monitor
Returns:
  the result

### exec

public Object exec(AbstractStackFrame frame)
Executes an operation.

Specified by:
  `exec` in class `Operation`
Parameters:
  `frame` - the frame for execution
Returns:
  the result
See Also:
  - `Operation.exec(org.eclipse.m2m.atl.engine.emfvm.lib.AbstractStackFrame)`

### getASM

public ASM getASM()

### findMethod

protected static Method findMethod(Class<?> caller, String name, Class<?>[] argumentTypes)
Looks for a method into cache and metamodel.

Parameters:
  `caller` - The class of the method
  `name` - The method name
  `argumentTypes` - The types of all arguments
Returns:
  the method if found, null otherwise

### getInstructions

public List<?> getInstructions()

Overrides:
  `getInstructions` in class `Operation`
See Also:
  - `Operation.getInstructions()`

### toString

public String toString()

Overrides:
  `toString` in class `Object`
See Also:
  - `Object.toString()`