org.concord.util.script
Class ScriptObject

java.lang.Object
  |
  +--org.concord.util.script.ScriptObject
All Implemented Interfaces:
java.beans.BeanInfo
Direct Known Subclasses:
Expression, NameStack, Script, Statement

public class ScriptObject
extends java.lang.Object
implements java.beans.BeanInfo

The ScriptObject class is the base class of all the nodes in the semantic tree. It maintains the necessary global state for the interpreter such as the current script and stack frame. It also supports utility methods for looking up Java methods and constructors.

Version:
$Revision: 1.3 $ $Date: 2001/10/10 21:18:14 $
Author:
$Author: ed $

Field Summary
 int beginColumn
           
 int beginLine
           
static boolean debug
           
protected  boolean deleted
           
protected  boolean doConversion
           
 int endColumn
           
 int endLine
           
protected  java.lang.String name
          This is the name of this particular script node.
static Nil nil
           
static java.util.Hashtable runtimeTable
           
 Script script
          This is the currently executing script.
 
Fields inherited from interface java.beans.BeanInfo
ICON_COLOR_16x16, ICON_COLOR_32x32, ICON_MONO_16x16, ICON_MONO_32x32
 
Constructor Summary
protected ScriptObject()
           
protected ScriptObject(Script script)
           
 
Method Summary
 void delete()
           
 java.lang.reflect.Constructor findConstructor(java.lang.String className, java.lang.Object[] params)
          This method finds the appropriate consructor given the class name and the parameters.
 java.lang.reflect.Method findMethod(java.lang.String methodName, java.lang.Object object, java.lang.Object[] params)
          This method finds the appropriate method given the method name, the object and the parameters.
 java.beans.BeanInfo[] getAdditionalBeanInfo()
           
 java.lang.Object getArrayValue(java.lang.Object array, int[] indices)
           
 java.lang.String getAtom(java.lang.String atom)
           
 java.beans.BeanDescriptor getBeanDescriptor()
           
 NameStack getCurrentFrame()
           
 int getDefaultEventIndex()
           
 int getDefaultPropertyIndex()
           
 java.beans.EventSetDescriptor[] getEventSetDescriptors()
           
 java.lang.reflect.Field getField(java.lang.Object object, java.lang.String fieldName)
           
 java.lang.Object getFieldValue(java.lang.Object object, java.lang.String fieldName)
           
 java.awt.Image getIcon(int size)
           
 java.beans.MethodDescriptor[] getMethodDescriptors()
           
 java.lang.String getName()
          Get the node name;
 java.beans.PropertyDescriptor[] getPropertyDescriptors()
           
 Script getScript()
           
 void interpret()
          This does nothing.
 void popFrame()
           
 void pushFrame()
           
 void setArrayValue(java.lang.Object array, int[] indices, java.lang.Object value)
           
 void setCurrentFrame(NameStack frame)
           
 void setFieldValue(java.lang.Object object, java.lang.String fieldName, java.lang.Object value)
           
 void setName(java.lang.String theName)
          Set the node name.
 void setScript(Script script)
           
 void setSourceBounds(TextBounds bounds)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nil

public static Nil nil

debug

public static boolean debug

script

public Script script
This is the currently executing script.

name

protected java.lang.String name
This is the name of this particular script node.

runtimeTable

public static java.util.Hashtable runtimeTable

beginLine

public int beginLine

endLine

public int endLine

beginColumn

public int beginColumn

endColumn

public int endColumn

deleted

protected boolean deleted

doConversion

protected boolean doConversion
Constructor Detail

ScriptObject

protected ScriptObject()

ScriptObject

protected ScriptObject(Script script)
Method Detail

delete

public void delete()

getName

public java.lang.String getName()
Get the node name;

setName

public void setName(java.lang.String theName)
Set the node name.
Parameters:
theName - String - the name of this node.

setScript

public void setScript(Script script)

getScript

public Script getScript()

getCurrentFrame

public NameStack getCurrentFrame()

setCurrentFrame

public void setCurrentFrame(NameStack frame)

pushFrame

public void pushFrame()

popFrame

public void popFrame()

setSourceBounds

public void setSourceBounds(TextBounds bounds)

interpret

public void interpret()
This does nothing. Maybe should be abstract?

findConstructor

public java.lang.reflect.Constructor findConstructor(java.lang.String className,
                                                     java.lang.Object[] params)
This method finds the appropriate consructor given the class name and the parameters.
Parameters:
className - String - class name.
params - Object [] - constructor parameters.

findMethod

public java.lang.reflect.Method findMethod(java.lang.String methodName,
                                           java.lang.Object object,
                                           java.lang.Object[] params)
This method finds the appropriate method given the method name, the object and the parameters.
Parameters:
methodName - String - name of method.
object - Object - object of method invocation.
params - Object [] - constructor parameters.

getAtom

public java.lang.String getAtom(java.lang.String atom)

getField

public java.lang.reflect.Field getField(java.lang.Object object,
                                        java.lang.String fieldName)

getFieldValue

public java.lang.Object getFieldValue(java.lang.Object object,
                                      java.lang.String fieldName)

setFieldValue

public void setFieldValue(java.lang.Object object,
                          java.lang.String fieldName,
                          java.lang.Object value)

getArrayValue

public java.lang.Object getArrayValue(java.lang.Object array,
                                      int[] indices)

setArrayValue

public void setArrayValue(java.lang.Object array,
                          int[] indices,
                          java.lang.Object value)

getAdditionalBeanInfo

public java.beans.BeanInfo[] getAdditionalBeanInfo()
Specified by:
getAdditionalBeanInfo in interface java.beans.BeanInfo

getBeanDescriptor

public java.beans.BeanDescriptor getBeanDescriptor()
Specified by:
getBeanDescriptor in interface java.beans.BeanInfo

getEventSetDescriptors

public java.beans.EventSetDescriptor[] getEventSetDescriptors()
Specified by:
getEventSetDescriptors in interface java.beans.BeanInfo

getDefaultEventIndex

public int getDefaultEventIndex()
Specified by:
getDefaultEventIndex in interface java.beans.BeanInfo

getDefaultPropertyIndex

public int getDefaultPropertyIndex()
Specified by:
getDefaultPropertyIndex in interface java.beans.BeanInfo

getIcon

public java.awt.Image getIcon(int size)
Specified by:
getIcon in interface java.beans.BeanInfo

getMethodDescriptors

public java.beans.MethodDescriptor[] getMethodDescriptors()
Specified by:
getMethodDescriptors in interface java.beans.BeanInfo

getPropertyDescriptors

public java.beans.PropertyDescriptor[] getPropertyDescriptors()
Specified by:
getPropertyDescriptors in interface java.beans.BeanInfo