orc.ast.simple.argument
Class Argument
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Argument
public Argument()
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