Show
Ignore:
Timestamp:
07/02/09 07:59:33 (5 months ago)
Author:
jrhil47
Message:

[index] Changed all Functional indices to store a thunk to get the return types, since during type checking the return types might need to be lazily evaluated. Also changed Functional indices to yield an Option for return types.
[type checker] Started implementing extraction of bindings from nodes for type environments.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/index/DeclaredFunction.java

    r3764 r3915  
    3737import com.sun.fortress.useful.NI; 
    3838 
     39import edu.rice.cs.plt.lambda.SimpleBox; 
    3940import edu.rice.cs.plt.tuple.Option; 
    4041 
     
    4243    private final FnDecl _ast; 
    4344 
    44     public DeclaredFunction(FnDecl ast) { _ast = ast; } 
     45    public DeclaredFunction(FnDecl ast) { 
     46      _ast = ast; 
     47      putThunk(SimpleBox.make(NodeUtil.getReturnType(_ast))); 
     48    } 
    4549 
    4650    public FnDecl ast() { return _ast; } 
     
    98102 
    99103        @Override 
    100         public Type getReturnType() { 
    101                 return NodeUtil.getReturnType(_ast).unwrap(); 
    102         } 
    103  
    104         @Override 
    105104        public Functional acceptNodeUpdateVisitor(NodeUpdateVisitor visitor) { 
    106105                return new DeclaredFunction((FnDecl)this._ast.accept(visitor));