org.hawk.module.script
Class ParameterScript

java.lang.Object
  extended by org.hawk.module.script.AbstractScript
      extended by org.hawk.module.script.SingleLineScript
          extended by org.hawk.module.script.ParameterScript
All Implemented Interfaces:
IScript

public class ParameterScript
extends SingleLineScript


Field Summary
protected  java.util.Map<Variable,IScript> paramScripts
           
 
Fields inherited from class org.hawk.module.script.AbstractScript
outerMultiLineScript
 
Constructor Summary
ParameterScript()
           
 
Method Summary
 ParameterScript copy()
           
static IScript createScript(java.util.Map<java.lang.Integer,java.lang.String> lineParamMatcherMap)
          This returns EchoScript from echo matcher map.
 Variable execute()
          This executes the contents of a script.
 IScript findArrayType(java.lang.String localVar, java.util.Map<Variable,IScript> localVarTable)
           
 java.util.Set<java.lang.String> getLocalStructs()
           
 java.util.Map<Variable,IScript> getParamScripts()
           
 IScript getParamValue(java.lang.String localVar)
           
 IScript getParamValue(Variable paramVar)
           
static java.util.regex.Pattern getPattern()
          Echo script pattern.
 boolean initializeParams()
           
 boolean initializeParamsValue(java.util.Map<java.lang.Integer,IScript> params)
           
 boolean isParamVarDeclared(Variable paramVar)
           
 boolean isVariable()
           
 java.lang.String mangle()
           
static ParameterScript parseFunctionParameters(java.lang.String parameters)
           
 void setLocalStructs(java.util.Set<java.lang.String> localStructs)
           
 void setParamScripts(java.util.Map<Variable,IScript> paramScripts)
           
 void setParamValue(Variable variable, IScript localValue)
           
 java.lang.String toString()
           
 
Methods inherited from class org.hawk.module.script.SingleLineScript
addScripts, findNearestOuterMLScript, getVariable, getVariableValue, setVariable, setVariableValue, toUI
 
Methods inherited from class org.hawk.module.script.AbstractScript
add, and, arrayBracket, assign, divide, equalTo, evaluateGlobalVariable, evaluateLocalBoolean, evaluateLocalVariable, getLineNumber, getOuterMultiLineScript, greaterThan, greaterThanEqualTo, isLastScript, lessThan, lessThanEqualTo, modulus, multiply, or, popLocalVars, pushLocalVars, refer, setLastScript, setLineNumber, setOuterMultiLineScript, subtract, toJava, toJavaMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

paramScripts

protected java.util.Map<Variable,IScript> paramScripts
Constructor Detail

ParameterScript

public ParameterScript()
Method Detail

getParamScripts

public java.util.Map<Variable,IScript> getParamScripts()

setParamScripts

public void setParamScripts(java.util.Map<Variable,IScript> paramScripts)

getLocalStructs

public java.util.Set<java.lang.String> getLocalStructs()

setLocalStructs

public void setLocalStructs(java.util.Set<java.lang.String> localStructs)

initializeParams

public boolean initializeParams()

initializeParamsValue

public boolean initializeParamsValue(java.util.Map<java.lang.Integer,IScript> params)
                              throws HawkException
Throws:
HawkException

getParamValue

public IScript getParamValue(Variable paramVar)

getParamValue

public IScript getParamValue(java.lang.String localVar)

findArrayType

public IScript findArrayType(java.lang.String localVar,
                             java.util.Map<Variable,IScript> localVarTable)

setParamValue

public void setParamValue(Variable variable,
                          IScript localValue)

isParamVarDeclared

public boolean isParamVarDeclared(Variable paramVar)

copy

public ParameterScript copy()
Specified by:
copy in interface IScript
Overrides:
copy in class SingleLineScript

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

mangle

public java.lang.String mangle()
Specified by:
mangle in interface IScript
Overrides:
mangle in class AbstractScript

getPattern

public static java.util.regex.Pattern getPattern()
Echo script pattern.

Returns:
returns echo script pattern
See Also:
ScriptPattern

execute

public Variable execute()
                 throws HawkException
Description copied from interface: IScript
This executes the contents of a script. This returns either a boolean or double depending upon how a method is invoked.

Specified by:
execute in interface IScript
Overrides:
execute in class SingleLineScript
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

createScript

public static IScript createScript(java.util.Map<java.lang.Integer,java.lang.String> lineParamMatcherMap)
This returns EchoScript from echo matcher map.

Parameters:
lineEchoMatcherMap -
Returns:

parseFunctionParameters

public static ParameterScript parseFunctionParameters(java.lang.String parameters)
                                               throws HawkException
Throws:
HawkException

isVariable

public boolean isVariable()
Specified by:
isVariable in interface IScript
Overrides:
isVariable in class SingleLineScript
Returns: