org.quattor.pan.dml.operators
Class SetSelf

java.lang.Object
  extended by org.quattor.pan.dml.AbstractOperation
      extended by org.quattor.pan.dml.operators.SetValue
          extended by org.quattor.pan.dml.operators.SetSelf
All Implemented Interfaces:
Operation

public class SetSelf
extends SetValue

Implements a special operation to allow a result to be assigned to a variable. This is generated by the compiler, but is not explicitly visible in the pan language.

Author:
loomis

Field Summary
 
Fields inherited from class org.quattor.pan.dml.operators.SetValue
identifier
 
Fields inherited from class org.quattor.pan.dml.AbstractOperation
ops, sourceRange
 
Constructor Summary
SetSelf(SourceRange sourceRange, Operation... operations)
           
 
Method Summary
 void checkInvalidSelfContext()
          Default implementation recursively calls this method on all of the contained operations (arguments).
 Element execute(Context context)
          Execute this operation within the given context.
 Element execute(Context context, Element result)
           
 java.lang.String toString()
          Default string representation of an operation is the class' simple name.
 
Methods inherited from class org.quattor.pan.dml.operators.SetValue
checkStaticIndexes, getInstance, getInstance, validName
 
Methods inherited from class org.quattor.pan.dml.AbstractOperation
calculateArgs, calculateTerms, checkRestrictedContext, getOperations, getSourceRange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SetSelf

public SetSelf(SourceRange sourceRange,
               Operation... operations)
        throws SyntaxException
Throws:
SyntaxException
Method Detail

checkInvalidSelfContext

public void checkInvalidSelfContext()
                             throws SyntaxException
Description copied from class: AbstractOperation
Default implementation recursively calls this method on all of the contained operations (arguments). Subclasses that reference SELF should override this method and throw a SyntaxException.

Specified by:
checkInvalidSelfContext in interface Operation
Overrides:
checkInvalidSelfContext in class AbstractOperation
Throws:
SyntaxException - if operation references SELF

execute

public Element execute(Context context)
Description copied from interface: Operation
Execute this operation within the given context. If an error occurs, an EvaluationException will be thrown with the details.

Specified by:
execute in interface Operation
Overrides:
execute in class SetValue
Parameters:
context - evaluation context for the statement
Returns:
Element produced by running operation

execute

public Element execute(Context context,
                       Element result)
Overrides:
execute in class SetValue

toString

public java.lang.String toString()
Description copied from class: AbstractOperation
Default string representation of an operation is the class' simple name.

Overrides:
toString in class SetValue
Returns:
string of class' simple name


Copyright © 2011 Quattor. All Rights Reserved.