orc.ast.oil
Class Def

java.lang.Object
  extended by orc.ast.oil.Def
All Implemented Interfaces:
Locatable, Located

public class Def
extends java.lang.Object
implements Locatable

A unit of syntax that encapsulates an expression definition. Groups of mutually recursive definitions are scoped in the simplified abstract syntax tree by a Def.

Author:
dkitchin

Field Summary
 java.util.List<Type> argTypes
           
 int arity
           
 Expr body
           
 SourceLocation location
           
 Type resultType
           
 int typeArity
           
 
Constructor Summary
Def(int arity, Expr body, int typeArity, java.util.List<Type> argTypes, Type resultType, SourceLocation location)
           
 
Method Summary
 void addIndices(java.util.Set<java.lang.Integer> indices, int depth)
           
 void checkDef(Env<Type> ctx, Env<Type> typectx)
           
 void checkLambda(ArrowType t, Env<Type> ctx, Env<Type> typectx)
           
 java.util.Set<Var> freeVars()
           
 SourceLocation getSourceLocation()
           
 void setSourceLocation(SourceLocation location)
           
 java.lang.String toString()
           
 ArrowType type(Env<Type> typectx)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

arity

public int arity

body

public Expr body

typeArity

public int typeArity

argTypes

public java.util.List<Type> argTypes

resultType

public Type resultType

location

public SourceLocation location
Constructor Detail

Def

public Def(int arity,
           Expr body,
           int typeArity,
           java.util.List<Type> argTypes,
           Type resultType,
           SourceLocation location)
Method Detail

freeVars

public final java.util.Set<Var> freeVars()

addIndices

public void addIndices(java.util.Set<java.lang.Integer> indices,
                       int depth)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

type

public ArrowType type(Env<Type> typectx)
               throws InsufficientTypeInformationException
Throws:
InsufficientTypeInformationException

checkDef

public void checkDef(Env<Type> ctx,
                     Env<Type> typectx)
              throws TypeException
Throws:
TypeException

checkLambda

public void checkLambda(ArrowType t,
                        Env<Type> ctx,
                        Env<Type> typectx)
                 throws TypeException
Throws:
TypeException

setSourceLocation

public void setSourceLocation(SourceLocation location)
Specified by:
setSourceLocation in interface Locatable

getSourceLocation

public SourceLocation getSourceLocation()
Specified by:
getSourceLocation in interface Located