orc.ast.oil
Class Def

java.lang.Object
  extended by orc.ast.oil.Def

public class Def
extends java.lang.Object

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
 int arity
           
 Expr body
           
 ArrowType type
           
 
Constructor Summary
Def(int arity, Expr body)
           
Def(int arity, Expr body, ArrowType type)
           
 
Method Summary
 void addIndices(java.util.Set<java.lang.Integer> indices, int depth)
           
 Def compile()
           
 java.util.Set<Var> freeVars()
           
 java.lang.String toString()
           
 ArrowType type()
           
 void typecheck(Env<Type> ctx)
           
 
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

type

public ArrowType type
Constructor Detail

Def

public Def(int arity,
           Expr body)

Def

public Def(int arity,
           Expr body,
           ArrowType type)
Method Detail

compile

public Def compile()

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()

typecheck

public void typecheck(Env<Type> ctx)
               throws TypeException
Throws:
TypeException