ca.uwaterloo.cs.ql.interp
Class ScriptUnitNode

java.lang.Object
  extended by ca.uwaterloo.cs.ql.interp.SyntaxTreeNode
      extended by ca.uwaterloo.cs.ql.interp.ScopedNode
          extended by ca.uwaterloo.cs.ql.interp.ScriptUnitNode
All Implemented Interfaces:
Scope

public class ScriptUnitNode
extends ScopedNode


Constructor Summary
ScriptUnitNode()
          Constructor.
 
Method Summary
 void addSourceUnit(ScriptUnitNode unit)
           
 void addStatement(StatementNode stmtNode)
           
 Value debugEvaluate(Env env, int qdbCode)
           
 void decrEchoIndent()
           
 Value evaluate(Env env)
           
 java.lang.String getAliasName()
          Gets this script's alias name.
 java.lang.String getEchoIndent()
           
 java.io.File getFile()
          Gets the script file.
 java.lang.String getFileName()
          Gets this script's file name.
 java.lang.String getFileParent()
          Gets this script's parent directory.
 java.lang.String getFilePath()
          Gets this script's full-path name.
 java.lang.String getFullName()
          Gets this script's full-path name.
 Option getOption()
          Gets this script's setting option.
 ScriptUnitNode[] getSourceUnits()
           
 ScriptUnitNode[] getSourceUnits(java.lang.String alias)
           
 void incrEchoIndent()
           
 boolean isEchoOn()
          Tests if echo setting is on.
 boolean isPauseOn()
          Tests if debug setting pause is on.
 boolean isTimeOn()
          Tests if timing setting is on.
 Variable lookup(java.lang.String name)
          Looks up a variable from this scope.
 void propagate(Env env, java.lang.Object userObj)
           
 void setAliasName(java.lang.String alias)
          Sets this script's alias name.
 void setFile(java.io.File file)
          Sets the script file.
 void setOption(Option opt)
          Sets this script's setting option.
 java.lang.String toString()
           
 
Methods inherited from class ca.uwaterloo.cs.ql.interp.ScopedNode
addVariable, allVariables, clear, getParent, hasVariable, removeVariable
 
Methods inherited from class ca.uwaterloo.cs.ql.interp.SyntaxTreeNode
getLocation, setLocation, strLocation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScriptUnitNode

public ScriptUnitNode()
Constructor.

Method Detail

getFile

public java.io.File getFile()
Gets the script file.


setFile

public void setFile(java.io.File file)
Sets the script file.


getAliasName

public java.lang.String getAliasName()
Gets this script's alias name.


setAliasName

public void setAliasName(java.lang.String alias)
Sets this script's alias name.


getFileName

public java.lang.String getFileName()
Gets this script's file name.
 For example:
     Script  "/data/analysis/grep.ql"
     Return  "grep.ql"
 


getFullName

public java.lang.String getFullName()
Gets this script's full-path name.
 For example:
     Script  "/data/analysis/grep.ql"
     Return  "/data/analysis/grep.ql"
 


getFilePath

public java.lang.String getFilePath()
Gets this script's full-path name.
 For example:
     Script  "/data/analysis/grep.ql"
     Return  "/data/analysis/grep.ql"
 


getFileParent

public java.lang.String getFileParent()
Gets this script's parent directory.
 For example:
     Script  "/data/analysis/grep.ql"
     Return  "/data/analysis"
 


getOption

public Option getOption()
Gets this script's setting option.


setOption

public void setOption(Option opt)
Sets this script's setting option.


isEchoOn

public boolean isEchoOn()
Tests if echo setting is on.


isTimeOn

public boolean isTimeOn()
Tests if timing setting is on.


isPauseOn

public boolean isPauseOn()
Tests if debug setting pause is on.


addStatement

public void addStatement(StatementNode stmtNode)

getSourceUnits

public ScriptUnitNode[] getSourceUnits()

getSourceUnits

public ScriptUnitNode[] getSourceUnits(java.lang.String alias)

addSourceUnit

public void addSourceUnit(ScriptUnitNode unit)

lookup

public Variable lookup(java.lang.String name)
                throws LookupException
Looks up a variable from this scope.

Specified by:
lookup in interface Scope
Specified by:
lookup in class ScopedNode
Parameters:
name - the name of the variable to look up.
Returns:
the variable found.
Throws:
LookupException - if no variable was found.

propagate

public void propagate(Env env,
                      java.lang.Object userObj)
               throws EvaluationException
Specified by:
propagate in class SyntaxTreeNode
Throws:
EvaluationException

evaluate

public Value evaluate(Env env)
               throws EvaluationException
Specified by:
evaluate in class SyntaxTreeNode
Throws:
EvaluationException

debugEvaluate

public Value debugEvaluate(Env env,
                           int qdbCode)
                    throws EvaluationException
Throws:
EvaluationException

toString

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

incrEchoIndent

public void incrEchoIndent()

decrEchoIndent

public void decrEchoIndent()

getEchoIndent

public java.lang.String getEchoIndent()