net.sf.farrago.fennel.calc
Class RexToCalcTranslator.ExpressionScope

java.lang.Object
  extended by net.sf.farrago.fennel.calc.RexToCalcTranslator.ExpressionScope
Enclosing class:
RexToCalcTranslator

public class RexToCalcTranslator.ExpressionScope
extends Object

Supports scoping rules for calculator programs. Conditional code, not visible outside a block of code, belongs in its own scope.


Field Summary
private  RexToCalcTranslator.ExpressionScope parent
           
private  Map<String,CalcReg> results
           
 
Constructor Summary
  RexToCalcTranslator.ExpressionScope()
          Constructs a new scope
private RexToCalcTranslator.ExpressionScope(RexToCalcTranslator.ExpressionScope parent)
           
 
Method Summary
 void clear()
           
 CalcReg get(String key)
           
 RexToCalcTranslator.ExpressionScope newScope()
          Returns a new scope extending the current scope.
 RexToCalcTranslator.ExpressionScope popScope()
          Returns the parent scope
 void set(String key, CalcReg result)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

private final RexToCalcTranslator.ExpressionScope parent

results

private final Map<String,CalcReg> results
Constructor Detail

RexToCalcTranslator.ExpressionScope

private RexToCalcTranslator.ExpressionScope(RexToCalcTranslator.ExpressionScope parent)

RexToCalcTranslator.ExpressionScope

public RexToCalcTranslator.ExpressionScope()
Constructs a new scope

Method Detail

newScope

public RexToCalcTranslator.ExpressionScope newScope()
Returns a new scope extending the current scope. Must always be matched with popScope or mysterious errors will arise.


popScope

public RexToCalcTranslator.ExpressionScope popScope()
Returns the parent scope


get

public CalcReg get(String key)

set

public void set(String key,
                CalcReg result)

clear

public void clear()