orc.ast.simple.argument
Class Argument

java.lang.Object
  extended by orc.ast.simple.argument.Argument
All Implemented Interfaces:
java.io.Serializable, Locatable, Located
Direct Known Subclasses:
Constant, Field, FreeVariable, Site, Variable

public abstract class Argument
extends java.lang.Object
implements java.io.Serializable, Locatable

An AST class (distinct from Expression) which contains arguments to calls. These arguments may either be variable names or constant values. Note that in the call M(x,y), M is also technically an argument of the call. This allows variables to be used in call position.

Author:
dkitchin
See Also:
Serialized Form

Constructor Summary
Argument()
           
 
Method Summary
 void addFree(java.util.Set<Variable> freeset)
           
abstract  Argument convert(Env<Variable> vars)
          Convert to DeBruijn index.
static java.util.List<Argument> convertAll(java.util.List<Argument> as, Env<Variable> vars)
           
 SourceLocation getSourceLocation()
           
 void setSourceLocation(SourceLocation location)
           
 Argument subst(Argument newArg, FreeVariable oldArg)
           
static java.util.List<Argument> substAll(java.util.List<Argument> args, Argument a, FreeVariable x)
          Convenience method, to apply a substitution to a list of arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Argument

public Argument()
Method Detail

subst

public Argument subst(Argument newArg,
                      FreeVariable oldArg)

substAll

public static java.util.List<Argument> substAll(java.util.List<Argument> args,
                                                Argument a,
                                                FreeVariable x)
Convenience method, to apply a substitution to a list of arguments.


addFree

public void addFree(java.util.Set<Variable> freeset)

convert

public abstract Argument convert(Env<Variable> vars)
                          throws UnboundVariableException
Convert to DeBruijn index.

Throws:
UnboundVariableException

convertAll

public static java.util.List<Argument> convertAll(java.util.List<Argument> as,
                                                  Env<Variable> vars)
                                           throws UnboundVariableException
Throws:
UnboundVariableException

setSourceLocation

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

getSourceLocation

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