org.hawk.module.script
Interface IScript

All Known Implementing Classes:
AbstractScript, AliasScript, ArrayDeclScript, AssignmentScript, BreakScript, CommentScript, DoWhileLoopScript, EchoScript, ElseIfScript, ExecBackgroundSingleLineScript, ExecFunctionScript, ExecModuleScript, ExecParallelSingleLineScript, ForLoopScript, FunctionScript, IfScript, LocalVarDeclScript, MultiLineScript, ParameterScript, ReadLineScript, ReturnScript, SingleLineScript, StructureDefnScript, StructureScript, ThinkScript, VariableDeclScript, WhileLoopScript

public interface IScript

The interface for scripts in Hawk.


Method Summary
 IScript add(IScript otherScript)
           
 IScript and(IScript otherScript)
           
 IScript arrayBracket(IScript otherScript)
           
 IScript assign(IScript otherScript)
           
 IScript copy()
           
 IScript divide(IScript otherScript)
           
 IScript equalTo(IScript otherScript)
           
 Variable execute()
          This executes the contents of a script.
 int getLineNumber()
           
 Variable getVariable()
           
 Variable getVariableValue()
           
 IScript greaterThan(IScript otherScript)
           
 IScript greaterThanEqualTo(IScript otherScript)
           
 boolean isVariable()
           
 IScript lessThan(IScript otherScript)
           
 IScript lessThanEqualTo(IScript otherScript)
           
 java.lang.String mangle()
           
 IScript modulus(IScript otherScript)
           
 IScript multiply(IScript otherScript)
           
 IScript or(IScript otherScript)
           
 java.util.Map<java.lang.String,IDataType> popLocalVars()
          This pops the local variable map out from the stack.
 void pushLocalVars()
          This pushes local variables into a stack.
 IScript refer(IScript otherScript)
           
 void setVariable(Variable value)
           
 void setVariableValue(Variable value)
           
 IScript subtract(IScript otherScript)
           
 java.lang.Object toJava()
          This converts the hawk object into java object
 java.util.Map<java.lang.Object,java.lang.Object> toJavaMap()
          This converts the hawk object into java map..
 java.lang.String toUI()
           
 

Method Detail

execute

Variable execute()
                 throws HawkException
This executes the contents of a script. This returns either a boolean or double depending upon how a method is invoked.

Returns:
the returned data is being used to test whether a function returns or not. Currently Hawk support two types return Double and Boolean.The implementation should look at the return type and script type to determine what action to be taken.
Throws:
HawkException

pushLocalVars

void pushLocalVars()
This pushes local variables into a stack. This is useful in case of function invocation.


popLocalVars

java.util.Map<java.lang.String,IDataType> popLocalVars()
This pops the local variable map out from the stack.

Returns:
a map containing local var and its value.

isVariable

boolean isVariable()
Returns:

getVariable

Variable getVariable()

setVariable

void setVariable(Variable value)

setVariableValue

void setVariableValue(Variable value)

getVariableValue

Variable getVariableValue()

mangle

java.lang.String mangle()

copy

IScript copy()

getLineNumber

int getLineNumber()

add

IScript add(IScript otherScript)
            throws HawkException
Throws:
HawkException

subtract

IScript subtract(IScript otherScript)
                 throws HawkException
Throws:
HawkException

multiply

IScript multiply(IScript otherScript)
                 throws HawkException
Throws:
HawkException

divide

IScript divide(IScript otherScript)
               throws HawkException
Throws:
HawkException

modulus

IScript modulus(IScript otherScript)
                throws HawkException
Throws:
HawkException

equalTo

IScript equalTo(IScript otherScript)
                throws HawkException
Throws:
HawkException

greaterThan

IScript greaterThan(IScript otherScript)
                    throws HawkException
Throws:
HawkException

lessThan

IScript lessThan(IScript otherScript)
                 throws HawkException
Throws:
HawkException

greaterThanEqualTo

IScript greaterThanEqualTo(IScript otherScript)
                           throws HawkException
Throws:
HawkException

lessThanEqualTo

IScript lessThanEqualTo(IScript otherScript)
                        throws HawkException
Throws:
HawkException

and

IScript and(IScript otherScript)
            throws HawkException
Throws:
HawkException

or

IScript or(IScript otherScript)
           throws HawkException
Throws:
HawkException

refer

IScript refer(IScript otherScript)
              throws HawkException
Throws:
HawkException

assign

IScript assign(IScript otherScript)
               throws HawkException
Throws:
HawkException

arrayBracket

IScript arrayBracket(IScript otherScript)
                     throws HawkException
Throws:
HawkException

toUI

java.lang.String toUI()

toJavaMap

java.util.Map<java.lang.Object,java.lang.Object> toJavaMap()
                                                           throws HawkException
This converts the hawk object into java map..

Returns:
Throws:
HawkException

toJava

java.lang.Object toJava()
                        throws HawkException
This converts the hawk object into java object

Returns:
Throws:
HawkException