SFE.Compiler
Class UniqueVariables

java.lang.Object
  extended by SFE.Compiler.UniqueVariables

public class UniqueVariables
extends java.lang.Object

A class that handles the unique variables.


Method Summary
 void add(Lvalue lval, boolean isParameter)
           
 void addVar(java.lang.String name, Type type, boolean isParameter, boolean isOutput)
           
 java.util.Set enumScope()
          Returns all vars in current scope
 java.util.Vector getParameters()
           
 LvalExpression getVar(java.lang.String name)
          Returns the LvalExpression reference of a var.
 void multi2SingleBit()
           
 java.util.HashMap popScope()
          Removes the current scope (= hash table in head of linked list)
 void pushScope()
          Adds a new scope (= new hash table in linked list)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

pushScope

public void pushScope()
Adds a new scope (= new hash table in linked list)


popScope

public java.util.HashMap popScope()
Removes the current scope (= hash table in head of linked list)

Returns:
HashMap the current poped scope

enumScope

public java.util.Set enumScope()
Returns all vars in current scope

Returns:
Set all vars in current scope

addVar

public void addVar(java.lang.String name,
                   Type type,
                   boolean isParameter,
                   boolean isOutput)

add

public void add(Lvalue lval,
                boolean isParameter)

getVar

public LvalExpression getVar(java.lang.String name)
Returns the LvalExpression reference of a var. It searches the scopes from the current scope till the global scope.

Returns:
LvalExpression the reference of the variable

multi2SingleBit

public void multi2SingleBit()

getParameters

public java.util.Vector getParameters()