orc.ast.simple.arg
Class NamedVar
java.lang.Object
orc.ast.simple.arg.Argument
orc.ast.simple.arg.NamedVar
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<NamedVar>, Locatable, Located
public class NamedVar
- extends Argument
- implements java.lang.Comparable<NamedVar>
Named (implicitly, free) variables. All such variables embed a String key.
Equivalence on these variables is equality of the embedded string.
Like normal Vars, these occur in argument position. However, since they
can never be bound at runtime, they compile to dead nodes.
The subst method on simplified expressions can only substitute for
a named variable.
- Author:
- dkitchin
- See Also:
- Serialized Form
Field Summary |
java.lang.String |
key
|
Constructor Summary |
NamedVar(java.lang.String key)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
key
public java.lang.String key
NamedVar
public NamedVar(java.lang.String key)
compareTo
public int compareTo(NamedVar f)
- Specified by:
compareTo
in interface java.lang.Comparable<NamedVar>
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
convert
public Arg convert(Env<Var> vars)
throws UnboundVariableException
- Description copied from class:
Argument
- Convert to DeBruijn index.
- Specified by:
convert
in class Argument
- Throws:
UnboundVariableException