gt: 				if(tmp1 != null){
context: /**
   * 
   */
  package ffapl.lib;
  
  import java.util.Iterator;
  import java.util.Vector;
  
  import ffapl.exception.FFaplException;
  import ffapl.lib.interfaces.IAttribute;
  import ffapl.lib.interfaces.ICompilerError;
  import ffapl.lib.interfaces.ISymbol;
  import ffapl.lib.interfaces.ISymbolTable;
  
  /**
   * @author Alexander Ortner
   * @version 1.0
   *
   */
  public class FFaplSymbolTable implements ISymbolTable {
  
  	private ISymbol _currentScope;
  	private ISymbol _root;
  	private boolean _isGlobal;
  	private ISymbol _parentSymbol;//Head of the Scope
  	private ISymbol _actualSymbol;
  	private Vector<ISymbol[]> _overloading; //holds Symbols to control overloading for function and procedure
  
  	
  	/**
  	 * Constructor
  	 */
  	public FFaplSymbolTable() {
  		_currentScope = null;
  		_parentSymbol = null;
  		_actualSymbol = null;
  		_root = null;
  		_overloading = new Vector<ISymbol[]>(0,1);
  	}
  
  	/* (non-Javadoc)
  	 * @see ffapl.lib.interfaces.ISymbolTable#openScope(boolean)
  	 */
  	@Override
  	public void openScope(boolean isGlobal) throws FFaplException{
  		openScope(isGlobal, false);		
  	}
  	
  	/* (non-Javadoc)
  	 * @see ffapl.lib.interfaces.ISymbolTable#openScope(boolean, boolean)
  	 */
  	@Override
  	public void openScope(boolean isGlobal, boolean isShielded)
  			throws FFaplException {
  		if (_currentScope == null){// Control if scope is set
  			Object[] arguments = {"SymbolTable openScope"};
  			throw new FFaplException(arguments, ICompilerError.INTERNAL);
  		} 
  		_isGlobal = isGlobal;
  		_currentScope = _actualSymbol;
  		_currentScope.setShielded(isShielded);
  		_parentSymbol = _currentScope.local();
  		_actualSymbol = getLastSymbol(_parentSymbol);	
  	}
  
  	/* (non-Javadoc)
  	 * @see ffapl.lib.interfaces.ISymbolTable#openScope(ISymbol, boolean)
  	 */
  	@Override
  	public void openScope(ISymbol symbol, boolean isGlobal) throws FFaplException{
  		
  		openScope(symbol, isGlobal, false);
  	}
  	
  	/* (non-Javadoc)
  	 * @see ffapl.lib.interfaces.ISymbolTable#openScope(ISymbol, boolean, boolean)
  	 */
  	@Override
  	public void openScope(ISymbol symbol, boolean isGlobal, boolean isShielded)
  			throws FFaplException {
  		_isGlobal = isGlobal;
  		if (_currentScope != null){
  			this.addSymbol(symbol);
  			_currentScope = symbol;
  		}else{//first scope
  			_root = symbol;
  			_currentScope = symbol;
  			_currentScope.setLevel(0);
  		}
  		_currentScope.setShielded(isShielded);
  		_parentSymbol = symbol.local();
  		_actualSymbol = getLastSymbol(_parentSymbol);
  		
  	}	
  	
  	
  	/* (non-Javadoc)
  	 * @see ffapl.lib.interfaces.ISymbolTable#closeScope()
  	 */
  	@Override 
  	public void closeScope() throws FFaplException {
  		if (_currentScope == null){// Control if scope is set
  			Object[] arguments = {"SymbolTable closeScope"};
  			throw new FFaplException(arguments, ICompilerError.INTERNAL);
  		}
  		controlOverloading(_overloading);
  		_isGlobal = _currentScope.isGlobal();
  		_currentScope = _currentScope.scope();
  		if(_currentScope != null){
  			_parentSymbol = _currentScope.local();	
  		}else{
  			_parentSymbol = null;
  		}
  		_actualSymbol = getLastSymbol(_parentSymbol);
  		
  	}
  
  	/* (non-Javadoc)
  	 * @see ffapl.lib.interfaces.ISymbolTable#lookup(java.lang.String)
  	 */
  	@Override
  	public Vector<ISymbol> lookupsimilar(String symbolname) throws FFaplException {
  		ISymbol scope = null;
  		Vector<ISymbol> result = new Vector<ISymbol>(0,1);
  		ISymbol next = null;
  		
  		if (_currentScope == null || symbolname == null){// Control if scope is set
  			Object[] arguments = {"SymbolTable lookupsimilar"};
  			throw new FFaplException(arguments, ICompilerError.INTERNAL);
  		}
  		
  		scope = _currentScope;
  		next = _parentSymbol;
  		while (scope != null){
  			if(next == null){//end of list, go one scope up 
  				if(!scope.isShielded()){ //if not shielded
  					scope = scope.scope();
  					if(scope != null){
  						next = scope.local();
  					}
  				}else{
  					scope = null;
  				}
  			}else if (symbolname.equals(next.getName())){
  				result.add(next);
  				next = next.next();
  			}else{
  				next = next.next();
  			}				
  		}
  		
  		return result;
  	}
  
  	/* (non-Javadoc)
  	 * @see ffapl.lib.interfaces.ISymbolTable#lookup(ffapl.lib.interfaces.ISymbol)
  	 */
  	@Override
  	public Vector<ISymbol> lookupsimilar(ISymbol symbol) throws FFaplException {
  		ISymbol scope = null;
  		Vector<ISymbol> result = new Vector<ISymbol>(0,1);
  		ISymbol next = null;	
  		if (_currentScope == null || symbol == null){// Control if scope is set
  			Object[] arguments = {"SymbolTable lookupsimilar"};
  			throw new FFaplException(arguments, ICompilerError.INTERNAL);
  		}
  		scope = _currentScope;
  		next = _parentSymbol;
  		while (scope != null){
  			if(next == null){//end of list, go one scope up 
  				if(!scope.isShielded()){ //if not shielded
  					scope = scope.scope();
  					if(scope != null){
  						next = scope.local();
  					}
  				}else{
  					scope = null;
  				}
  			}else if (symbol.similarTo(next)){
  				result.add(next);
  				next = next.next();
  			}else{
  				next = next.next();
  			}				
  		}
  		
  		return result;
  	}
  	
  	@Override
  	public ISymbol lookup(ISymbol symbol) throws FFaplException {
  		// delete print
  		ISymbol scope = null;
  		ISymbol result = null;
  		ISymbol next = null;	
  		if (_currentScope == null || symbol == null){// Control if scope is set
  			Object[] arguments = {"SymbolTable lookup(symbol)"};
  			throw new FFaplException(arguments, ICompilerError.INTERNAL);
  		}
  		scope = _currentScope;
  		next = _parentSymbol;
  		//System.out.println("Scope: " + _currentScope + " -search: " + symbol);
  		while (result == null && scope != null){
  			if(next == null){//end of list, go one scope up 
  				//if(!scope.isShielded()){ //if not shielded
  					scope = scope.scope();
  					if(scope != null){
  						next = scope.local();
  					}
  				//}else{
  				//	scope = null;
  				//}
  		     
  			}else if (symbol.equals(next)){
  				result = next;
  			}else{
  				next = next.next();
  			}				
  		}
  		return result;
  	}
  	
  	@Override
  	public ISymbol lookup(ISymbol symbol, Vector<IAttribute> attribv)
  			throws FFaplException {
  		ISymbol tmp1 = null, tmp2;
  		if (symbol == null || symbol.local() != null){// Control if scope is set
  			Object[] arguments = {"SymbolTable lookup(Symbol, Vector Attribute)"};
  			throw new FFaplException(arguments, ICompilerError.INTERNAL);
  		}
         if(attribv != null){//has attributes -> Arguments
  			for(Iterator<IAttribute> attr = attribv.iterator(); attr.hasNext();){
  				tmp2 = new FFaplSymbol("argument", null, attr.next().getType(), ISymbol.PARAMETER);
  