org.jruby.compiler.impl
Class BaseBodyCompiler

java.lang.Object
  extended by org.jruby.compiler.impl.BaseBodyCompiler
All Implemented Interfaces:
BodyCompiler
Direct Known Subclasses:
ChildScopedBodyCompiler, RootScopedBodyCompiler

public abstract class BaseBodyCompiler
extends java.lang.Object
implements BodyCompiler

BaseBodyCompiler encapsulates all common behavior between BodyCompiler implementations.


Field Summary
protected  int argParamCount
           
protected  Label[] currentLoopLabels
           
protected  boolean inNestedMethod
           
protected  ASTInspector inspector
           
protected  InvocationCompiler invocationCompiler
           
protected  SkinnyMethodAdapter method
           
protected  java.lang.String methodName
           
protected  Label redoJump
           
protected  StaticScope scope
           
protected  Label scopeEnd
           
protected  Label scopeStart
           
protected  StandardASMCompiler script
           
protected  VariableCompiler variableCompiler
           
 
Constructor Summary
BaseBodyCompiler(StandardASMCompiler scriptCompiler, java.lang.String methodName, ASTInspector inspector, StaticScope scope)
           
 
Method Summary
 void aliasGlobal(java.lang.String newName, java.lang.String oldName)
           
 void appendToArray()
           
 void appendToObjectArray()
           
 void aprintln()
          For logging, println the object reference currently atop the stack
 void aryToAry()
           
 void assignClassVariable(java.lang.String name)
           
 void assignClassVariable(java.lang.String name, CompilerCallback value)
           
 void assignConstantInCurrent(java.lang.String name)
           
 void assignConstantInModule(java.lang.String name)
           
 void assignConstantInObject(java.lang.String name)
           
 void assignGlobalVariable(java.lang.String name)
          Assign the top of the stack to the global variable with the specified name.
 void assignGlobalVariable(java.lang.String name, CompilerCallback value)
          Assign the top of the stack to the global variable with the specified name.
 void assignInstanceVariable(java.lang.String name)
          Assign the value on top of the stack to the instance variable with the specified name on the current "self".
 void assignInstanceVariable(java.lang.String name, CompilerCallback value)
          Assign the value on top of the stack to the instance variable with the specified name on the current "self".
 void asString()
           
 void attached()
           
 void backref()
          Push the current back reference
 void backrefMethod(java.lang.String methodName)
          Call a static helper method on RubyRegexp with the current backref
 void beginChainedMethod()
           
abstract  void beginMethod(CompilerCallback args, StaticScope scope)
           
 void callZSuper(CompilerCallback closure)
           
 BodyCompiler chainToMethod(java.lang.String methodName)
           
 void checkIsExceptionHandled(ArgumentsCallback rescueArgs)
           
 void checkWhenWithSplat()
           
 void clearErrorInfo()
           
 void compileSequencedConditional(CompilerCallback inputValue, FastSwitchType fastSwitchType, java.util.Map<CompilerCallback,int[]> switchCases, java.util.List<ArgumentsCallback> conditionals, java.util.List<CompilerCallback> bodies, CompilerCallback fallback)
           
 void concatArrays()
           
 void concatObjectArrays()
           
 void consumeCurrentValue()
          As code executes, values are assumed to be "generated", often by being pushed on to some execution stack.
 void convertToJavaArray()
           
 void createEmptyArray()
          Create an empty Ruby array
 void createEmptyHash()
          Create an empty Ruby Hash object and put a reference on top of the stack.
 void createNewArray(boolean lightweight)
          Given an aggregated set of objects (likely created through a call to createObjectArray) create a Ruby array object.
 void createNewArray(java.lang.Object[] sourceArray, ArrayCallback callback, boolean lightweight)
          Given an aggregated set of objects (likely created through a call to createObjectArray) create a Ruby array object.
 void createNewBignum(java.math.BigInteger value)
          Generate a new "Bignum" value.
 void createNewClosure(int line, StaticScope scope, int arity, CompilerCallback body, CompilerCallback args, boolean hasMultipleArgsHead, NodeType argsNodeId, ASTInspector inspector)
          Create a new closure (block) using the given lexical scope information, call arity, and body generated by the body callback.
 void createNewClosure19(int line, StaticScope scope, int arity, CompilerCallback body, CompilerCallback args, boolean hasMultipleArgsHead, NodeType argsNodeId, ASTInspector inspector)
          Create a new closure (block) using the given lexical scope information, call arity, and body generated by the body callback.
 void createNewEndBlock(CompilerCallback body)
           
 void createNewFixnum(long value)
          Generate a new "Fixnum" value.
 void createNewFloat(double value)
          Generate a new "Float" value.
 void createNewForLoop(int arity, CompilerCallback body, CompilerCallback args, boolean hasMultipleArgsHead, NodeType argsNodeId, ASTInspector inspector)
          Create a new closure (block) for a for loop with the given call arity and body generated by the body callback.
 void createNewHash(java.lang.Object elements, ArrayCallback callback, int keyCount)
          Create a new hash by calling back to the specified ArrayCallback.
 void createNewLambda(CompilerCallback closure)
          Create a new literal lambda.
 void createNewRange(CompilerCallback beginEndCallback, boolean isExclusive)
          Create a new range.
 void createNewRegexp(ByteList value, int options)
           
 void createNewString(ArrayCallback callback, int count)
          Generate a new dynamic "String" value.
 void createNewString(ByteList value)
          Generate a new "String" value.
 void createNewSymbol(ArrayCallback callback, int count)
           
 void createNewSymbol(java.lang.String name)
          Generate a new "Symbol" value (or fetch the existing one).
 void createObjectArray(int elementCount)
          Combine the top
 void createObjectArray(java.lang.Object[] sourceArray, ArrayCallback callback)
           
protected abstract  void createVariableCompiler()
           
 void declareClassVariable(java.lang.String name)
           
 void declareClassVariable(java.lang.String name, CompilerCallback value)
           
 void defineAlias(java.lang.String newName, java.lang.String oldName)
          Define an alias for a new name to an existing oldName'd method.
 void defineClass(java.lang.String name, StaticScope staticScope, CompilerCallback superCallback, CompilerCallback pathCallback, CompilerCallback bodyCallback, CompilerCallback receiverCallback, ASTInspector inspector)
           
 void defineModule(java.lang.String name, StaticScope staticScope, CompilerCallback pathCallback, CompilerCallback bodyCallback, ASTInspector inspector)
           
 void defineNewMethod(java.lang.String name, int methodArity, StaticScope scope, CompilerCallback body, CompilerCallback args, CompilerCallback receiver, ASTInspector inspector, boolean root)
          Define a new method with the given name, arity, local variable count, and body callback.
 void duplicateCurrentValue()
          Push a copy the topmost value on the stack.
abstract  void endBody()
          End compilation for the method associated with the specified token.
 void ensureMultipleAssignableRubyArray(boolean masgnHasHead)
          Ensures that the present value is an IRubyObject[] by wrapping it with one or coercing it if it is not.
 void ensureRubyArray()
          Ensures that the present value is an IRubyObject[] by wrapping it with one if it is not.
 void forEachInValueArray(int start, int count, java.lang.Object source, ArrayCallback callback, CompilerCallback argsCallback)
          Given an IRubyObject[] on the stack (or otherwise available as the present object) call back to the provided ArrayCallback 'callback' for 'count' elements, starting with 'start'.
 void forEachInValueArray(int start, int preCount, java.lang.Object preSource, int postCount, java.lang.Object postSource, ArrayCallback callback, CompilerCallback argsCallback)
          Given an IRubyObject[] on the stack (or otherwise available as the present object) call back to the provided ArrayCallback 'callback' for 'count' elements, starting with 'start'.
protected  int getClosureIndex()
           
 void getCompiledClass()
           
protected  int getDynamicScopeIndex()
           
protected  int getExceptionIndex()
           
protected  int getFirstTempIndex()
           
 void getFrameKlazz()
           
 void getFrameName()
           
 void getInstanceVariable(java.lang.String name)
           
 InvocationCompiler getInvocationCompiler()
           
 java.lang.Object getNewEnding()
           
protected  java.lang.String getNewEnsureName()
           
protected  java.lang.String getNewRescueName()
           
protected  int getNilIndex()
           
protected  int getPreviousExceptionIndex()
           
protected  int getRuntimeIndex()
           
 StandardASMCompiler getScriptCompiler()
           
protected abstract  java.lang.String getSignature()
           
 VariableCompiler getVariableCompiler()
           
protected  int getVarsArrayIndex()
           
 void getVisibilityFor(java.lang.String name)
           
 void go(java.lang.Object gotoToken)
           
 void hasBlock(BranchCallback trueBranch, BranchCallback falseBranch)
           
 void ifNotNull(java.lang.Object gotoToken)
           
 void ifNotSuperMethodBound(java.lang.Object token)
           
 void ifNull(java.lang.Object gotoToken)
           
 void ifSingleton(java.lang.Object gotoToken)
           
 void inDefined()
           
 void invokeIRubyObject(java.lang.String methodName, java.lang.String signature)
           
 void invokeRuby(java.lang.String methodName, java.lang.String signature)
           
 void invokeThreadContext(java.lang.String methodName, java.lang.String signature)
           
 void invokeUtilityMethod(java.lang.String methodName, java.lang.String signature)
          This is for utility methods used by the compiler, to reduce the amount of code generation necessary.
 void isCaptured(int number, BranchCallback trueBranch, BranchCallback falseBranch)
           
 void isClassVarDefined(java.lang.String name, BranchCallback trueBranch, BranchCallback falseBranch)
           
 void isConstantBranch(BranchCallback setup, BranchCallback isConstant, BranchCallback isMethod, BranchCallback none, java.lang.String name)
           
 void isConstantDefined(java.lang.String name, BranchCallback trueBranch, BranchCallback falseBranch)
           
 void isGlobalDefined(java.lang.String name, BranchCallback trueBranch, BranchCallback falseBranch)
           
 void isInstanceOf(java.lang.Class clazz, BranchCallback trueBranch, BranchCallback falseBranch)
           
 void isInstanceVariableDefined(java.lang.String name, BranchCallback trueBranch, BranchCallback falseBranch)
           
 void isMethodBound(java.lang.String name, BranchCallback trueBranch, BranchCallback falseBranch)
           
 void isNil(BranchCallback trueBranch, BranchCallback falseBranch)
           
 void isNotProtected(java.lang.Object gotoToken, int toConsume)
           
 void isNull(BranchCallback trueBranch, BranchCallback falseBranch)
           
 void isPrivate(java.lang.Object gotoToken, int toConsume)
           
 void issueLoopBreak()
           
 void issueLoopNext()
           
 void issueLoopRedo()
           
 void issueRetryEvent()
           
 void lineNumber(ISourcePosition position)
          This method provides a way to specify a line number for the current piece of code being compiled.
 void literalSwitch(int[] cases, java.lang.Object[] bodies, ArrayCallback arrayCallback, CompilerCallback defaultCallback)
           
 void loadBlock()
           
 void loadClass(java.lang.String name)
           
 void loadCurrentModule()
           
 void loadException()
           
 void loadFalse()
          Load a Ruby "false" value on top of the stack.
 void loadFilename()
           
 void loadNil()
          Load a Ruby "nil" value on top of the stack.
 void loadNull()
           
 void loadObject()
          Load the Object class
 void loadRuntime()
           
 void loadSelf()
           
 void loadStandardError()
           
 void loadThis()
           
 void loadThreadContext()
           
 void loadTrue()
          Load a Ruby "true" value on top of the stack.
 void match()
           
 void match2(CompilerCallback value)
           
 void match3()
           
 void metaclass()
           
 void negateCurrentValue()
          Perform a logical Ruby "not" operation on the value on top of the stack, leaving the negated result.
 void notIsModuleAndClassVarDefined(java.lang.String name, java.lang.Object gotoToken)
           
 void nthRef(int match)
           
 void nullToNil()
           
 void outDefined()
           
abstract  BaseBodyCompiler outline(java.lang.String methodName)
           
 void performBackref(char type)
           
 void performBooleanBranch(BranchCallback trueBranch, BranchCallback falseBranch)
          Perform a boolean branch operation based on the Ruby "true" value of the top value on the stack.
 void performBooleanLoop(BranchCallback condition, BranchCallback body, boolean checkFirst)
          Perform a boolean loop using the given condition-calculating branch and body branch.
 void performBooleanLoopLight(BranchCallback condition, BranchCallback body, boolean checkFirst)
          Perform a boolean loop using the given condition-calculating branch and body branch.
 void performBooleanLoopSafe(BranchCallback condition, BranchCallback body, boolean checkFirst)
          Perform a boolean loop using the given condition-calculating branch and body branch.
 void performEnsure(BranchCallback regularCode, BranchCallback protectedCode)
           
 void performLogicalAnd(BranchCallback longBranch)
          Perform a logical short-circuited Ruby "and" operation, using Ruby notions of true and false.
 void performLogicalOr(BranchCallback longBranch)
          Perform a logical short-circuited Ruby "or" operation, using Ruby notions of true and false.
 void performRescue(BranchCallback regularCode, BranchCallback rubyCatchCode, boolean needsRetry)
           
 void performRescueLight(BranchCallback regularCode, BranchCallback rubyCatchCode, boolean needsRetry)
           
 void pollThreadEvents()
           
 void println()
           
 void protect(BranchCallback regularCode, BranchCallback protectedCode, java.lang.Class ret)
          Makes sure that the code in protectedCode will always run after regularCode.
 void pushNull()
           
 void pushString(java.lang.String str)
           
 void rescue(BranchCallback regularCode, java.lang.Class exception, BranchCallback catchCode, java.lang.Class ret)
           
 void rethrowException()
           
 void rethrowIfSystemExit()
           
 void retrieveClassVariable(java.lang.String name)
           
 void retrieveConstant(java.lang.String name)
          Retrieve the constant with the specified name available at the current point in the program's execution.
 void retrieveConstantFromModule(java.lang.String name)
          Retreive a named constant from the RubyModule/RubyClass that's just been pushed.
 void retrieveConstantFromObject(java.lang.String name)
          Retreive a named constant from the RubyModule/RubyClass that's just been pushed.
 void retrieveGlobalVariable(java.lang.String name)
          Retrieve the global variable with the specified name to the top of the stack.
 void retrieveInstanceVariable(java.lang.String name)
          Retrieve the instance variable with the given name, based on the current "self".
 void retrieveSelf()
          Retrieve the current "self" and put a reference on top of the stack.
 void retrieveSelfClass()
          Retrieve the current "self" object's metaclass and put a reference on top of the stack
 void reverseValues(int count)
          Reverse the top n values on the stack.
 void runBeginBlock(StaticScope scope, CompilerCallback body)
           
 void selfIsKindOf(java.lang.Object gotoToken)
           
 void setEnding(java.lang.Object endingToken)
           
 void setFilePosition(ISourcePosition position)
           
 void setLinePosition(ISourcePosition position)
           
protected  boolean shouldUseBoxedArgs(StaticScope scope)
           
 void singlifySplattedValue()
          Given a splatted value, extract a single value.
 void splatCurrentValue()
          Convert the current value into a "splatted value" suitable for passing as method arguments or disassembling into multiple variables.
 void storeExceptionInErrorInfo()
           
 void stringOrNil()
           
 void superClass()
           
 void swapValues()
          Swap the top and second values on the stack.
 void toJavaString()
           
 void typeCheckBranch(java.lang.Class type, BranchCallback trueCallback, BranchCallback falseCallback)
           
 void undefMethod(java.lang.String name)
           
 void unwrapPassedBlock()
           
 void unwrapRaiseException()
           
 void wrapJavaException()
           
 void wrapJavaObject()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jruby.compiler.BodyCompiler
issueBreakEvent, issueNextEvent, issueRedoEvent, performReturn
 

Field Detail

method

protected SkinnyMethodAdapter method

variableCompiler

protected VariableCompiler variableCompiler

invocationCompiler

protected InvocationCompiler invocationCompiler

argParamCount

protected int argParamCount

currentLoopLabels

protected Label[] currentLoopLabels

scopeStart

protected Label scopeStart

scopeEnd

protected Label scopeEnd

redoJump

protected Label redoJump

inNestedMethod

protected boolean inNestedMethod

scope

protected StaticScope scope

inspector

protected ASTInspector inspector

methodName

protected java.lang.String methodName

script

protected StandardASMCompiler script
Constructor Detail

BaseBodyCompiler

public BaseBodyCompiler(StandardASMCompiler scriptCompiler,
                        java.lang.String methodName,
                        ASTInspector inspector,
                        StaticScope scope)
Method Detail

shouldUseBoxedArgs

protected boolean shouldUseBoxedArgs(StaticScope scope)

getSignature

protected abstract java.lang.String getSignature()

createVariableCompiler

protected abstract void createVariableCompiler()

beginMethod

public abstract void beginMethod(CompilerCallback args,
                                 StaticScope scope)

endBody

public abstract void endBody()
Description copied from interface: BodyCompiler
End compilation for the method associated with the specified token. This should close out all structures created for compilation of the method.

Specified by:
endBody in interface BodyCompiler

chainToMethod

public BodyCompiler chainToMethod(java.lang.String methodName)
Specified by:
chainToMethod in interface BodyCompiler

beginChainedMethod

public void beginChainedMethod()

outline

public abstract BaseBodyCompiler outline(java.lang.String methodName)
Specified by:
outline in interface BodyCompiler

getScriptCompiler

public StandardASMCompiler getScriptCompiler()

lineNumber

public void lineNumber(ISourcePosition position)
Description copied from interface: BodyCompiler
This method provides a way to specify a line number for the current piece of code being compiled. The compiler may use this information to create debugging information in a bytecode-format-dependent way.

Specified by:
lineNumber in interface BodyCompiler
Parameters:
position - The ISourcePosition information to use.

loadThreadContext

public void loadThreadContext()

loadSelf

public void loadSelf()
Specified by:
loadSelf in interface BodyCompiler

getClosureIndex

protected int getClosureIndex()

getRuntimeIndex

protected int getRuntimeIndex()

getNilIndex

protected int getNilIndex()

getPreviousExceptionIndex

protected int getPreviousExceptionIndex()

getDynamicScopeIndex

protected int getDynamicScopeIndex()

getVarsArrayIndex

protected int getVarsArrayIndex()

getFirstTempIndex

protected int getFirstTempIndex()

getExceptionIndex

protected int getExceptionIndex()

loadThis

public void loadThis()

loadRuntime

public void loadRuntime()

loadBlock

public void loadBlock()

loadNil

public void loadNil()
Description copied from interface: BodyCompiler
Load a Ruby "nil" value on top of the stack.

Specified by:
loadNil in interface BodyCompiler

loadNull

public void loadNull()
Specified by:
loadNull in interface BodyCompiler

loadObject

public void loadObject()
Description copied from interface: BodyCompiler
Load the Object class

Specified by:
loadObject in interface BodyCompiler

invokeUtilityMethod

public void invokeUtilityMethod(java.lang.String methodName,
                                java.lang.String signature)
This is for utility methods used by the compiler, to reduce the amount of code generation necessary. All of these live in CompilerHelpers.


invokeThreadContext

public void invokeThreadContext(java.lang.String methodName,
                                java.lang.String signature)

invokeRuby

public void invokeRuby(java.lang.String methodName,
                       java.lang.String signature)

invokeIRubyObject

public void invokeIRubyObject(java.lang.String methodName,
                              java.lang.String signature)

consumeCurrentValue

public void consumeCurrentValue()
Description copied from interface: BodyCompiler
As code executes, values are assumed to be "generated", often by being pushed on to some execution stack. Generally, these values are consumed by other methods on the context, but occasionally a value must be "thrown out". This method provides a way to discard the previous value generated by some other call(s).

Specified by:
consumeCurrentValue in interface BodyCompiler

duplicateCurrentValue

public void duplicateCurrentValue()
Description copied from interface: BodyCompiler
Push a copy the topmost value on the stack.

Specified by:
duplicateCurrentValue in interface BodyCompiler

swapValues

public void swapValues()
Description copied from interface: BodyCompiler
Swap the top and second values on the stack.

Specified by:
swapValues in interface BodyCompiler

reverseValues

public void reverseValues(int count)
Description copied from interface: BodyCompiler
Reverse the top n values on the stack.

Specified by:
reverseValues in interface BodyCompiler
Parameters:
count - The number of values to reverse.

retrieveSelf

public void retrieveSelf()
Description copied from interface: BodyCompiler
Retrieve the current "self" and put a reference on top of the stack.

Specified by:
retrieveSelf in interface BodyCompiler

retrieveSelfClass

public void retrieveSelfClass()
Description copied from interface: BodyCompiler
Retrieve the current "self" object's metaclass and put a reference on top of the stack

Specified by:
retrieveSelfClass in interface BodyCompiler

getVariableCompiler

public VariableCompiler getVariableCompiler()
Specified by:
getVariableCompiler in interface BodyCompiler

getInvocationCompiler

public InvocationCompiler getInvocationCompiler()
Specified by:
getInvocationCompiler in interface BodyCompiler

assignConstantInCurrent

public void assignConstantInCurrent(java.lang.String name)
Specified by:
assignConstantInCurrent in interface BodyCompiler

assignConstantInModule

public void assignConstantInModule(java.lang.String name)
Specified by:
assignConstantInModule in interface BodyCompiler

assignConstantInObject

public void assignConstantInObject(java.lang.String name)
Specified by:
assignConstantInObject in interface BodyCompiler

retrieveConstant

public void retrieveConstant(java.lang.String name)
Description copied from interface: BodyCompiler
Retrieve the constant with the specified name available at the current point in the program's execution.

Specified by:
retrieveConstant in interface BodyCompiler
Parameters:
name - The name of the constant

retrieveConstantFromModule

public void retrieveConstantFromModule(java.lang.String name)
Description copied from interface: BodyCompiler
Retreive a named constant from the RubyModule/RubyClass that's just been pushed.

Specified by:
retrieveConstantFromModule in interface BodyCompiler
Parameters:
name - The name of the constant

retrieveConstantFromObject

public void retrieveConstantFromObject(java.lang.String name)
Description copied from interface: BodyCompiler
Retreive a named constant from the RubyModule/RubyClass that's just been pushed.

Specified by:
retrieveConstantFromObject in interface BodyCompiler
Parameters:
name - The name of the constant

retrieveClassVariable

public void retrieveClassVariable(java.lang.String name)
Specified by:
retrieveClassVariable in interface BodyCompiler

assignClassVariable

public void assignClassVariable(java.lang.String name)
Specified by:
assignClassVariable in interface BodyCompiler

assignClassVariable

public void assignClassVariable(java.lang.String name,
                                CompilerCallback value)
Specified by:
assignClassVariable in interface BodyCompiler

declareClassVariable

public void declareClassVariable(java.lang.String name)
Specified by:
declareClassVariable in interface BodyCompiler

declareClassVariable

public void declareClassVariable(java.lang.String name,
                                 CompilerCallback value)
Specified by:
declareClassVariable in interface BodyCompiler

createNewFloat

public void createNewFloat(double value)
Description copied from interface: BodyCompiler
Generate a new "Float" value.

Specified by:
createNewFloat in interface BodyCompiler

createNewFixnum

public void createNewFixnum(long value)
Description copied from interface: BodyCompiler
Generate a new "Fixnum" value.

Specified by:
createNewFixnum in interface BodyCompiler

createNewBignum

public void createNewBignum(java.math.BigInteger value)
Description copied from interface: BodyCompiler
Generate a new "Bignum" value.

Specified by:
createNewBignum in interface BodyCompiler

createNewString

public void createNewString(ArrayCallback callback,
                            int count)
Description copied from interface: BodyCompiler
Generate a new dynamic "String" value.

Specified by:
createNewString in interface BodyCompiler

createNewSymbol

public void createNewSymbol(ArrayCallback callback,
                            int count)
Specified by:
createNewSymbol in interface BodyCompiler

createNewString

public void createNewString(ByteList value)
Description copied from interface: BodyCompiler
Generate a new "String" value.

Specified by:
createNewString in interface BodyCompiler

createNewSymbol

public void createNewSymbol(java.lang.String name)
Description copied from interface: BodyCompiler
Generate a new "Symbol" value (or fetch the existing one).

Specified by:
createNewSymbol in interface BodyCompiler

createNewArray

public void createNewArray(boolean lightweight)
Description copied from interface: BodyCompiler
Given an aggregated set of objects (likely created through a call to createObjectArray) create a Ruby array object.

Specified by:
createNewArray in interface BodyCompiler

createNewArray

public void createNewArray(java.lang.Object[] sourceArray,
                           ArrayCallback callback,
                           boolean lightweight)
Description copied from interface: BodyCompiler
Given an aggregated set of objects (likely created through a call to createObjectArray) create a Ruby array object. This version accepts an array of objects to feed to an ArrayCallback to construct the elements of the array.

Specified by:
createNewArray in interface BodyCompiler

createEmptyArray

public void createEmptyArray()
Description copied from interface: BodyCompiler
Create an empty Ruby array

Specified by:
createEmptyArray in interface BodyCompiler

createObjectArray

public void createObjectArray(java.lang.Object[] sourceArray,
                              ArrayCallback callback)
Specified by:
createObjectArray in interface BodyCompiler

createObjectArray

public void createObjectArray(int elementCount)
Description copied from interface: BodyCompiler
Combine the top
elementCount
elements into a single element, generally an array or similar construct. The specified number of elements are consumed and an aggregate element remains.

Specified by:
createObjectArray in interface BodyCompiler
Parameters:
elementCount - The number of elements to consume

createEmptyHash

public void createEmptyHash()
Description copied from interface: BodyCompiler
Create an empty Ruby Hash object and put a reference on top of the stack.

Specified by:
createEmptyHash in interface BodyCompiler

createNewHash

public void createNewHash(java.lang.Object elements,
                          ArrayCallback callback,
                          int keyCount)
Description copied from interface: BodyCompiler
Create a new hash by calling back to the specified ArrayCallback. It is expected that the keyCount will be the actual count of key/value pairs, and the caller will handle passing an appropriate elements collection in and dealing with the sequential indices passed to the callback.

Specified by:
createNewHash in interface BodyCompiler
Parameters:
elements - An object holding the elements from which to create the Hash.
callback - An ArrayCallback implementation to which the elements array and iteration counts are passed in sequence.
keyCount - the total count of key-value pairs to be constructed from the elements collection.

createNewRange

public void createNewRange(CompilerCallback beginEndCallback,
                           boolean isExclusive)
Description copied from interface: BodyCompiler
Create a new range. It is expected that the stack will contain the end and begin values for the range as its topmost and second topmost elements.

Specified by:
createNewRange in interface BodyCompiler
isExclusive - Whether the range is exclusive or not (inclusive)

createNewLambda

public void createNewLambda(CompilerCallback closure)
Description copied from interface: BodyCompiler
Create a new literal lambda. The stack should contain a reference to the closure object.

Specified by:
createNewLambda in interface BodyCompiler

performBooleanBranch

public void performBooleanBranch(BranchCallback trueBranch,
                                 BranchCallback falseBranch)
Description copied from interface: BodyCompiler
Perform a boolean branch operation based on the Ruby "true" value of the top value on the stack. If Ruby "true", invoke the true branch callback. Otherwise, invoke the false branch callback.

Specified by:
performBooleanBranch in interface BodyCompiler
Parameters:
trueBranch - The callback for generating code for the "true" condition
falseBranch - The callback for generating code for the "false" condition

performLogicalAnd

public void performLogicalAnd(BranchCallback longBranch)
Description copied from interface: BodyCompiler
Perform a logical short-circuited Ruby "and" operation, using Ruby notions of true and false. If the value on top of the stack is false, it remains and the branch is not executed. If it is true, the top of the stack is replaced with the result of the branch.

Specified by:
performLogicalAnd in interface BodyCompiler
Parameters:
longBranch - The branch to execute if the "and" operation does not short-circuit.

performLogicalOr

public void performLogicalOr(BranchCallback longBranch)
Description copied from interface: BodyCompiler
Perform a logical short-circuited Ruby "or" operation, using Ruby notions of true and false. If the value on top of the stack is true, it remains and the branch is not executed. If it is false, the top of the stack is replaced with the result of the branch.

Specified by:
performLogicalOr in interface BodyCompiler
Parameters:
longBranch - The branch to execute if the "or" operation does not short-circuit.

performBooleanLoopSafe

public void performBooleanLoopSafe(BranchCallback condition,
                                   BranchCallback body,
                                   boolean checkFirst)
Description copied from interface: BodyCompiler
Perform a boolean loop using the given condition-calculating branch and body branch. For while loops, pass true for checkFirst. For statement-modifier while loops, pass false. For unless loops, reverse the result of the condition after calculating it. This version ensures the stack is maintained so while results can be used in any context.

Specified by:
performBooleanLoopSafe in interface BodyCompiler
Parameters:
condition - The code to execute for calculating the loop condition. A Ruby true result will cause the body to be executed again.
body - The body to executed for the loop.
checkFirst - whether to check the condition the first time through or not.

performBooleanLoop

public void performBooleanLoop(BranchCallback condition,
                               BranchCallback body,
                               boolean checkFirst)
Description copied from interface: BodyCompiler
Perform a boolean loop using the given condition-calculating branch and body branch. For while loops, pass true for checkFirst. For statement-modifier while loops, pass false. For unless loops, reverse the result of the condition after calculating it.

Specified by:
performBooleanLoop in interface BodyCompiler
Parameters:
condition - The code to execute for calculating the loop condition. A Ruby true result will cause the body to be executed again.
body - The body to executed for the loop.
checkFirst - whether to check the condition the first time through or not.

performBooleanLoopLight

public void performBooleanLoopLight(BranchCallback condition,
                                    BranchCallback body,
                                    boolean checkFirst)
Description copied from interface: BodyCompiler
Perform a boolean loop using the given condition-calculating branch and body branch. For while loops, pass true for checkFirst. For statement-modifier while loops, pass false. For unless loops, reverse the result of the condition after calculating it. This version does not handle non-local flow control which can bubble out of eval or closures, and only expects normal flow control to be used within its body.

Specified by:
performBooleanLoopLight in interface BodyCompiler
Parameters:
condition - The code to execute for calculating the loop condition. A Ruby true result will cause the body to be executed again.
body - The body to executed for the loop.
checkFirst - whether to check the condition the first time through or not.

createNewClosure

public void createNewClosure(int line,
                             StaticScope scope,
                             int arity,
                             CompilerCallback body,
                             CompilerCallback args,
                             boolean hasMultipleArgsHead,
                             NodeType argsNodeId,
                             ASTInspector inspector)
Description copied from interface: BodyCompiler
Create a new closure (block) using the given lexical scope information, call arity, and body generated by the body callback. The closure will capture containing scopes and related information.

Specified by:
createNewClosure in interface BodyCompiler
scope - The static scoping information
arity - The arity of the block's argument list
body - The callback which will generate the closure's body

createNewClosure19

public void createNewClosure19(int line,
                               StaticScope scope,
                               int arity,
                               CompilerCallback body,
                               CompilerCallback args,
                               boolean hasMultipleArgsHead,
                               NodeType argsNodeId,
                               ASTInspector inspector)
Description copied from interface: BodyCompiler
Create a new closure (block) using the given lexical scope information, call arity, and body generated by the body callback. The closure will capture containing scopes and related information.

Specified by:
createNewClosure19 in interface BodyCompiler
scope - The static scoping information
arity - The arity of the block's argument list
body - The callback which will generate the closure's body

runBeginBlock

public void runBeginBlock(StaticScope scope,
                          CompilerCallback body)
Specified by:
runBeginBlock in interface BodyCompiler

createNewForLoop

public void createNewForLoop(int arity,
                             CompilerCallback body,
                             CompilerCallback args,
                             boolean hasMultipleArgsHead,
                             NodeType argsNodeId,
                             ASTInspector inspector)
Description copied from interface: BodyCompiler
Create a new closure (block) for a for loop with the given call arity and body generated by the body callback.

Specified by:
createNewForLoop in interface BodyCompiler
Parameters:
arity - The arity of the block's argument list
body - The callback which will generate the closure's body

createNewEndBlock

public void createNewEndBlock(CompilerCallback body)
Specified by:
createNewEndBlock in interface BodyCompiler

getCompiledClass

public void getCompiledClass()

println

public void println()

defineAlias

public void defineAlias(java.lang.String newName,
                        java.lang.String oldName)
Description copied from interface: BodyCompiler
Define an alias for a new name to an existing oldName'd method.

Specified by:
defineAlias in interface BodyCompiler
Parameters:
newName - The new alias to create
oldName - The name of the existing method or alias

loadFalse

public void loadFalse()
Description copied from interface: BodyCompiler
Load a Ruby "false" value on top of the stack.

Specified by:
loadFalse in interface BodyCompiler

loadTrue

public void loadTrue()
Description copied from interface: BodyCompiler
Load a Ruby "true" value on top of the stack.

Specified by:
loadTrue in interface BodyCompiler

loadCurrentModule

public void loadCurrentModule()
Specified by:
loadCurrentModule in interface BodyCompiler

retrieveInstanceVariable

public void retrieveInstanceVariable(java.lang.String name)
Description copied from interface: BodyCompiler
Retrieve the instance variable with the given name, based on the current "self".

Specified by:
retrieveInstanceVariable in interface BodyCompiler
Parameters:
name - The name of the instance variable to retrieve.

assignInstanceVariable

public void assignInstanceVariable(java.lang.String name)
Description copied from interface: BodyCompiler
Assign the value on top of the stack to the instance variable with the specified name on the current "self". The value is consumed.

Specified by:
assignInstanceVariable in interface BodyCompiler
Parameters:
name - The name of the value to assign.

assignInstanceVariable

public void assignInstanceVariable(java.lang.String name,
                                   CompilerCallback value)
Description copied from interface: BodyCompiler
Assign the value on top of the stack to the instance variable with the specified name on the current "self". The value is consumed.

Specified by:
assignInstanceVariable in interface BodyCompiler
Parameters:
name - The name of the value to assign.
value - A callback for compiling the value to assign

retrieveGlobalVariable

public void retrieveGlobalVariable(java.lang.String name)
Description copied from interface: BodyCompiler
Retrieve the global variable with the specified name to the top of the stack.

Specified by:
retrieveGlobalVariable in interface BodyCompiler
Parameters:
name - The name of the global variable.

assignGlobalVariable

public void assignGlobalVariable(java.lang.String name)
Description copied from interface: BodyCompiler
Assign the top of the stack to the global variable with the specified name.

Specified by:
assignGlobalVariable in interface BodyCompiler
Parameters:
name - The name of the global variable.

assignGlobalVariable

public void assignGlobalVariable(java.lang.String name,
                                 CompilerCallback value)
Description copied from interface: BodyCompiler
Assign the top of the stack to the global variable with the specified name.

Specified by:
assignGlobalVariable in interface BodyCompiler
Parameters:
name - The name of the global variable.
value - The callback to compile the value to assign

negateCurrentValue

public void negateCurrentValue()
Description copied from interface: BodyCompiler
Perform a logical Ruby "not" operation on the value on top of the stack, leaving the negated result.

Specified by:
negateCurrentValue in interface BodyCompiler

splatCurrentValue

public void splatCurrentValue()
Description copied from interface: BodyCompiler
Convert the current value into a "splatted value" suitable for passing as method arguments or disassembling into multiple variables.

Specified by:
splatCurrentValue in interface BodyCompiler

singlifySplattedValue

public void singlifySplattedValue()
Description copied from interface: BodyCompiler
Given a splatted value, extract a single value. If no splat or length is zero, use nil

Specified by:
singlifySplattedValue in interface BodyCompiler

aryToAry

public void aryToAry()
Specified by:
aryToAry in interface BodyCompiler

ensureRubyArray

public void ensureRubyArray()
Description copied from interface: BodyCompiler
Ensures that the present value is an IRubyObject[] by wrapping it with one if it is not.

Specified by:
ensureRubyArray in interface BodyCompiler

ensureMultipleAssignableRubyArray

public void ensureMultipleAssignableRubyArray(boolean masgnHasHead)
Description copied from interface: BodyCompiler
Ensures that the present value is an IRubyObject[] by wrapping it with one or coercing it if it is not.

Specified by:
ensureMultipleAssignableRubyArray in interface BodyCompiler

forEachInValueArray

public void forEachInValueArray(int start,
                                int count,
                                java.lang.Object source,
                                ArrayCallback callback,
                                CompilerCallback argsCallback)
Description copied from interface: BodyCompiler
Given an IRubyObject[] on the stack (or otherwise available as the present object) call back to the provided ArrayCallback 'callback' for 'count' elements, starting with 'start'. Each call to callback will have a value from the input array on the stack; once the items are exhausted, the code in nilCallback will be invoked *with no value on the stack*.

Specified by:
forEachInValueArray in interface BodyCompiler

forEachInValueArray

public void forEachInValueArray(int start,
                                int preCount,
                                java.lang.Object preSource,
                                int postCount,
                                java.lang.Object postSource,
                                ArrayCallback callback,
                                CompilerCallback argsCallback)
Description copied from interface: BodyCompiler
Given an IRubyObject[] on the stack (or otherwise available as the present object) call back to the provided ArrayCallback 'callback' for 'count' elements, starting with 'start'. Each call to callback will have a value from the input array on the stack; once the items are exhausted, the code in nilCallback will be invoked *with no value on the stack*.

Specified by:
forEachInValueArray in interface BodyCompiler

asString

public void asString()
Specified by:
asString in interface BodyCompiler

toJavaString

public void toJavaString()
Specified by:
toJavaString in interface BodyCompiler

nthRef

public void nthRef(int match)
Specified by:
nthRef in interface BodyCompiler

match

public void match()
Specified by:
match in interface BodyCompiler

match2

public void match2(CompilerCallback value)
Specified by:
match2 in interface BodyCompiler

match3

public void match3()
Specified by:
match3 in interface BodyCompiler

createNewRegexp

public void createNewRegexp(ByteList value,
                            int options)
Specified by:
createNewRegexp in interface BodyCompiler

pollThreadEvents

public void pollThreadEvents()
Specified by:
pollThreadEvents in interface BodyCompiler

nullToNil

public void nullToNil()
Specified by:
nullToNil in interface BodyCompiler

isInstanceOf

public void isInstanceOf(java.lang.Class clazz,
                         BranchCallback trueBranch,
                         BranchCallback falseBranch)
Specified by:
isInstanceOf in interface BodyCompiler

isCaptured

public void isCaptured(int number,
                       BranchCallback trueBranch,
                       BranchCallback falseBranch)
Specified by:
isCaptured in interface BodyCompiler

backref

public void backref()
Description copied from interface: BodyCompiler
Push the current back reference

Specified by:
backref in interface BodyCompiler

backrefMethod

public void backrefMethod(java.lang.String methodName)
Description copied from interface: BodyCompiler
Call a static helper method on RubyRegexp with the current backref

Specified by:
backrefMethod in interface BodyCompiler

issueLoopBreak

public void issueLoopBreak()

issueLoopNext

public void issueLoopNext()

issueLoopRedo

public void issueLoopRedo()

getNewEnsureName

protected java.lang.String getNewEnsureName()

protect

public void protect(BranchCallback regularCode,
                    BranchCallback protectedCode,
                    java.lang.Class ret)
Description copied from interface: BodyCompiler
Makes sure that the code in protectedCode will always run after regularCode.

Specified by:
protect in interface BodyCompiler

performEnsure

public void performEnsure(BranchCallback regularCode,
                          BranchCallback protectedCode)
Specified by:
performEnsure in interface BodyCompiler

getNewRescueName

protected java.lang.String getNewRescueName()

storeExceptionInErrorInfo

public void storeExceptionInErrorInfo()
Specified by:
storeExceptionInErrorInfo in interface BodyCompiler

clearErrorInfo

public void clearErrorInfo()
Specified by:
clearErrorInfo in interface BodyCompiler

rescue

public void rescue(BranchCallback regularCode,
                   java.lang.Class exception,
                   BranchCallback catchCode,
                   java.lang.Class ret)
Specified by:
rescue in interface BodyCompiler

performRescue

public void performRescue(BranchCallback regularCode,
                          BranchCallback rubyCatchCode,
                          boolean needsRetry)
Specified by:
performRescue in interface BodyCompiler

performRescueLight

public void performRescueLight(BranchCallback regularCode,
                               BranchCallback rubyCatchCode,
                               boolean needsRetry)
Specified by:
performRescueLight in interface BodyCompiler

wrapJavaException

public void wrapJavaException()
Specified by:
wrapJavaException in interface BodyCompiler

wrapJavaObject

public void wrapJavaObject()

inDefined

public void inDefined()
Specified by:
inDefined in interface BodyCompiler

outDefined

public void outDefined()
Specified by:
outDefined in interface BodyCompiler

stringOrNil

public void stringOrNil()
Specified by:
stringOrNil in interface BodyCompiler

pushNull

public void pushNull()
Specified by:
pushNull in interface BodyCompiler

pushString

public void pushString(java.lang.String str)
Specified by:
pushString in interface BodyCompiler

isMethodBound

public void isMethodBound(java.lang.String name,
                          BranchCallback trueBranch,
                          BranchCallback falseBranch)
Specified by:
isMethodBound in interface BodyCompiler

hasBlock

public void hasBlock(BranchCallback trueBranch,
                     BranchCallback falseBranch)
Specified by:
hasBlock in interface BodyCompiler

isGlobalDefined

public void isGlobalDefined(java.lang.String name,
                            BranchCallback trueBranch,
                            BranchCallback falseBranch)
Specified by:
isGlobalDefined in interface BodyCompiler

isConstantDefined

public void isConstantDefined(java.lang.String name,
                              BranchCallback trueBranch,
                              BranchCallback falseBranch)
Specified by:
isConstantDefined in interface BodyCompiler

isInstanceVariableDefined

public void isInstanceVariableDefined(java.lang.String name,
                                      BranchCallback trueBranch,
                                      BranchCallback falseBranch)
Specified by:
isInstanceVariableDefined in interface BodyCompiler

isClassVarDefined

public void isClassVarDefined(java.lang.String name,
                              BranchCallback trueBranch,
                              BranchCallback falseBranch)
Specified by:
isClassVarDefined in interface BodyCompiler

getNewEnding

public java.lang.Object getNewEnding()
Specified by:
getNewEnding in interface BodyCompiler

isNil

public void isNil(BranchCallback trueBranch,
                  BranchCallback falseBranch)
Specified by:
isNil in interface BodyCompiler

isNull

public void isNull(BranchCallback trueBranch,
                   BranchCallback falseBranch)
Specified by:
isNull in interface BodyCompiler

ifNull

public void ifNull(java.lang.Object gotoToken)
Specified by:
ifNull in interface BodyCompiler

ifNotNull

public void ifNotNull(java.lang.Object gotoToken)
Specified by:
ifNotNull in interface BodyCompiler

setEnding

public void setEnding(java.lang.Object endingToken)
Specified by:
setEnding in interface BodyCompiler

go

public void go(java.lang.Object gotoToken)
Specified by:
go in interface BodyCompiler

isConstantBranch

public void isConstantBranch(BranchCallback setup,
                             BranchCallback isConstant,
                             BranchCallback isMethod,
                             BranchCallback none,
                             java.lang.String name)
Specified by:
isConstantBranch in interface BodyCompiler

metaclass

public void metaclass()
Specified by:
metaclass in interface BodyCompiler

aprintln

public void aprintln()
Description copied from interface: BodyCompiler
For logging, println the object reference currently atop the stack

Specified by:
aprintln in interface BodyCompiler

getVisibilityFor

public void getVisibilityFor(java.lang.String name)
Specified by:
getVisibilityFor in interface BodyCompiler

isPrivate

public void isPrivate(java.lang.Object gotoToken,
                      int toConsume)
Specified by:
isPrivate in interface BodyCompiler

isNotProtected

public void isNotProtected(java.lang.Object gotoToken,
                           int toConsume)
Specified by:
isNotProtected in interface BodyCompiler

selfIsKindOf

public void selfIsKindOf(java.lang.Object gotoToken)
Specified by:
selfIsKindOf in interface BodyCompiler

notIsModuleAndClassVarDefined

public void notIsModuleAndClassVarDefined(java.lang.String name,
                                          java.lang.Object gotoToken)
Specified by:
notIsModuleAndClassVarDefined in interface BodyCompiler

ifSingleton

public void ifSingleton(java.lang.Object gotoToken)
Specified by:
ifSingleton in interface BodyCompiler

getInstanceVariable

public void getInstanceVariable(java.lang.String name)
Specified by:
getInstanceVariable in interface BodyCompiler

getFrameName

public void getFrameName()
Specified by:
getFrameName in interface BodyCompiler

getFrameKlazz

public void getFrameKlazz()
Specified by:
getFrameKlazz in interface BodyCompiler

superClass

public void superClass()
Specified by:
superClass in interface BodyCompiler

attached

public void attached()
Specified by:
attached in interface BodyCompiler

ifNotSuperMethodBound

public void ifNotSuperMethodBound(java.lang.Object token)
Specified by:
ifNotSuperMethodBound in interface BodyCompiler

concatArrays

public void concatArrays()
Specified by:
concatArrays in interface BodyCompiler

concatObjectArrays

public void concatObjectArrays()

appendToArray

public void appendToArray()
Specified by:
appendToArray in interface BodyCompiler

appendToObjectArray

public void appendToObjectArray()
Specified by:
appendToObjectArray in interface BodyCompiler

convertToJavaArray

public void convertToJavaArray()
Specified by:
convertToJavaArray in interface BodyCompiler

aliasGlobal

public void aliasGlobal(java.lang.String newName,
                        java.lang.String oldName)
Specified by:
aliasGlobal in interface BodyCompiler

undefMethod

public void undefMethod(java.lang.String name)
Specified by:
undefMethod in interface BodyCompiler

defineClass

public void defineClass(java.lang.String name,
                        StaticScope staticScope,
                        CompilerCallback superCallback,
                        CompilerCallback pathCallback,
                        CompilerCallback bodyCallback,
                        CompilerCallback receiverCallback,
                        ASTInspector inspector)
Specified by:
defineClass in interface BodyCompiler

defineModule

public void defineModule(java.lang.String name,
                         StaticScope staticScope,
                         CompilerCallback pathCallback,
                         CompilerCallback bodyCallback,
                         ASTInspector inspector)
Specified by:
defineModule in interface BodyCompiler

unwrapPassedBlock

public void unwrapPassedBlock()
Specified by:
unwrapPassedBlock in interface BodyCompiler

performBackref

public void performBackref(char type)
Specified by:
performBackref in interface BodyCompiler

callZSuper

public void callZSuper(CompilerCallback closure)
Specified by:
callZSuper in interface BodyCompiler

checkIsExceptionHandled

public void checkIsExceptionHandled(ArgumentsCallback rescueArgs)
Specified by:
checkIsExceptionHandled in interface BodyCompiler

rethrowException

public void rethrowException()
Specified by:
rethrowException in interface BodyCompiler

loadClass

public void loadClass(java.lang.String name)
Specified by:
loadClass in interface BodyCompiler

loadStandardError

public void loadStandardError()
Specified by:
loadStandardError in interface BodyCompiler

unwrapRaiseException

public void unwrapRaiseException()
Specified by:
unwrapRaiseException in interface BodyCompiler

loadException

public void loadException()
Specified by:
loadException in interface BodyCompiler

setFilePosition

public void setFilePosition(ISourcePosition position)
Specified by:
setFilePosition in interface BodyCompiler

setLinePosition

public void setLinePosition(ISourcePosition position)
Specified by:
setLinePosition in interface BodyCompiler

checkWhenWithSplat

public void checkWhenWithSplat()
Specified by:
checkWhenWithSplat in interface BodyCompiler

issueRetryEvent

public void issueRetryEvent()
Specified by:
issueRetryEvent in interface BodyCompiler

defineNewMethod

public void defineNewMethod(java.lang.String name,
                            int methodArity,
                            StaticScope scope,
                            CompilerCallback body,
                            CompilerCallback args,
                            CompilerCallback receiver,
                            ASTInspector inspector,
                            boolean root)
Description copied from interface: BodyCompiler
Define a new method with the given name, arity, local variable count, and body callback. This will create a new compiled method and bind it to the given name at this point in the program's execution.

Specified by:
defineNewMethod in interface BodyCompiler
Parameters:
name - The name to which to bind the resulting method.
body - The callback which will generate the method's body.

rethrowIfSystemExit

public void rethrowIfSystemExit()
Specified by:
rethrowIfSystemExit in interface BodyCompiler

literalSwitch

public void literalSwitch(int[] cases,
                          java.lang.Object[] bodies,
                          ArrayCallback arrayCallback,
                          CompilerCallback defaultCallback)
Specified by:
literalSwitch in interface BodyCompiler

typeCheckBranch

public void typeCheckBranch(java.lang.Class type,
                            BranchCallback trueCallback,
                            BranchCallback falseCallback)
Specified by:
typeCheckBranch in interface BodyCompiler

loadFilename

public void loadFilename()
Specified by:
loadFilename in interface BodyCompiler

compileSequencedConditional

public void compileSequencedConditional(CompilerCallback inputValue,
                                        FastSwitchType fastSwitchType,
                                        java.util.Map<CompilerCallback,int[]> switchCases,
                                        java.util.List<ArgumentsCallback> conditionals,
                                        java.util.List<CompilerCallback> bodies,
                                        CompilerCallback fallback)
Specified by:
compileSequencedConditional in interface BodyCompiler


Copyright © 2002-2007 JRuby Team. All Rights Reserved.