orc.ast.simple
Class Definition

java.lang.Object
  extended by orc.ast.simple.Definition

public class Definition
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 Defs.

Author:
dkitchin

Field Summary
protected  java.util.List<Type> argTypes
           
 Expression body
           
 java.util.List<Var> formals
           
protected  SourceLocation location
           
 Var name
           
protected  Type resultType
           
protected  java.util.List<java.lang.String> typeParams
           
 
Constructor Summary
Definition(Var name, java.util.List<Var> formals, Expression body, java.util.List<java.lang.String> typeParams, java.util.List<Type> argTypes, Type resultType, SourceLocation location)
          Note that the constructor takes a bound Var as a name parameter.
 
Method Summary
 Def convert(Env<Var> vars, Env<java.lang.String> typevars)
           
 Definition suball(java.util.Map<NamedVar,? extends Argument> m)
           
 Definition subst(Argument a, NamedVar x)
           
 java.util.Set<Var> vars()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public Var name

formals

public java.util.List<Var> formals

body

public Expression body

typeParams

protected java.util.List<java.lang.String> typeParams

argTypes

protected java.util.List<Type> argTypes

resultType

protected Type resultType

location

protected SourceLocation location
Constructor Detail

Definition

public Definition(Var name,
                  java.util.List<Var> formals,
                  Expression body,
                  java.util.List<java.lang.String> typeParams,
                  java.util.List<Type> argTypes,
                  Type resultType,
                  SourceLocation location)
Note that the constructor takes a bound Var as a name parameter. This is because the binding of expression names occurs at the level of mutually recursive groups, not at the level of the individual definitions.

Parameters:
location -
Method Detail

subst

public Definition subst(Argument a,
                        NamedVar x)

suball

public Definition suball(java.util.Map<NamedVar,? extends Argument> m)

vars

public java.util.Set<Var> vars()

convert

public Def convert(Env<Var> vars,
                   Env<java.lang.String> typevars)
            throws CompilationException
Throws:
CompilationException