orc.ast.oil.expression
Class Def
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
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
Def
public Def(int arity,
Expression body,
int typeArity,
java.util.List<Type> argTypes,
Type resultType,
SourceLocation location,
java.lang.String name)
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()