orc.ast.oil.expression
Class Def

java.lang.Object
  extended by orc.ast.oil.expression.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 OIL abstract syntax tree by DeclareDefs.

Author:
dkitchin

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

Field Detail

arity

public int arity

body

public Expression body

typeArity

public int typeArity

argTypes

public java.util.List<Type> argTypes

resultType

public Type resultType

location

public SourceLocation location

name

public java.lang.String name

free

public java.util.Set<Variable> free
Constructor Detail

Def

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

freeVars

public final java.util.Set<Variable> 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(TypingContext ctx)
               throws TypeException
Throws:
TypeException

checkDef

public void checkDef(TypingContext ctx)
              throws TypeException
Throws:
TypeException

checkLambda

public void checkLambda(TypingContext ctx,
                        ArrowType t)
                 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

marshal

public Def marshal()
            throws CompilationException
Throws:
CompilationException

populateContinuations

public void populateContinuations()