pascalinterpreter
Class Program

java.lang.Object
  extended byjava.lang.Thread
      extended bypascalinterpreter.Program
All Implemented Interfaces:
java.lang.Runnable

public class Program
extends java.lang.Thread

Represents a singleton.


Nested Class Summary
private  class Program.ComponentEn
           
 
Field Summary
private  Program.ComponentEn componentEn
           
private  java.util.ArrayList globalVariables
           
private static Program instance
          Holds singleton instance
private  Block mainBlock
           
private  Variable registry
          Rejestr programu - wykorzystywany np. przez operatory, do tymczasowego umieszczania wyników operacji.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
private Program()
          prevents instantiation
 
Method Summary
 void addVariable(Variable var)
          Metoda dodaje zmienną do zmiennych globalnych programu.
protected  java.util.ArrayList getGlobalVariables()
           
static Program getInstance()
          Returns the singleton instance.
 Block getMainBlock()
           
(package private)  Variable getRegistry()
          Zwraca zawartość rejestru oraz czyści rejestr programu użytkownika.
 Variable getVariable(java.lang.String name)
          Metoda wyszukuje wśród zmiennych globalnych, zmienną o podanej nazwie.
 void remVariable(Variable var)
          Metoda usuwa wskazaną zmienną ze zbioru zmiennych globalnych.
 void run()
           
 void setComponentEn(javax.swing.JComponent[] comp)
           
 void setGlobalVariables(java.util.ArrayList list)
           
 void setMainBlock(Block block)
           
(package private)  void setRegistry(Variable var)
          Wstawia do rejestru zmienną.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

componentEn

private Program.ComponentEn componentEn

registry

private Variable registry
Rejestr programu - wykorzystywany np. przez operatory, do tymczasowego umieszczania wyników operacji.


globalVariables

private java.util.ArrayList globalVariables

mainBlock

private Block mainBlock

instance

private static Program instance
Holds singleton instance

Constructor Detail

Program

private Program()
prevents instantiation

Method Detail

getVariable

public Variable getVariable(java.lang.String name)
Metoda wyszukuje wśród zmiennych globalnych, zmienną o podanej nazwie.

Parameters:
name - - nazwa poszukiwanej zmiennej.
Returns:
- Zmienna o podanej nazwie, albo null - jeśli nie znaleziono.

addVariable

public void addVariable(Variable var)
                 throws AnalyseException
Metoda dodaje zmienną do zmiennych globalnych programu.

Parameters:
var - - dodawana zmienna.
Throws:
AnalyseException - - Wyjątek generowany wówczas, gdy zmienna o takiej nazwie już istanieje w programie.

remVariable

public void remVariable(Variable var)
                 throws InternalException
Metoda usuwa wskazaną zmienną ze zbioru zmiennych globalnych.

Parameters:
var - - zmienna do usunięcia.
Throws:
InternalException - - Wyjątek generowany przy próbie usunięcia nieistniejącej w progrmie zmiennej.

getInstance

public static Program getInstance()
Returns the singleton instance.

Returns:
the singleton instance

getGlobalVariables

protected java.util.ArrayList getGlobalVariables()
Returns:

getMainBlock

public Block getMainBlock()
Returns:

setGlobalVariables

public void setGlobalVariables(java.util.ArrayList list)
Parameters:
list -

setMainBlock

public void setMainBlock(Block block)
Parameters:
block -

getRegistry

Variable getRegistry()
               throws InternalException
Zwraca zawartość rejestru oraz czyści rejestr programu użytkownika.

Returns:
Zmienna znajdująca się w rejestrze.
Throws:
InternalException - - Wyjątek generowany przy próbie odczytu pustego rejestru.

setRegistry

void setRegistry(Variable var)
           throws InternalException
Wstawia do rejestru zmienną.

Parameters:
var - - wstawiana zmienna.
Throws:
InternalException - - Wyjątek generowany przy próbie wstawienia wartości do niepustego rejestru.

run

public void run()

setComponentEn

public void setComponentEn(javax.swing.JComponent[] comp)