|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object orc.ast.simple.expression.Expression orc.ast.simple.expression.WithLocation
public class WithLocation
Annotate an expression with a source location.
Constructor Summary | |
---|---|
WithLocation(Expression expr,
SourceLocation location)
|
Method Summary | |
---|---|
Expression |
convert(Env<Variable> vars,
Env<TypeVariable> typevars)
Converts abstract syntax tree into a serializable form, used to generate portable .oil (Orc Intermediate Language) files. |
SourceLocation |
getSourceLocation()
|
Expression |
subst(Argument a,
FreeVariable x)
Performs the substitution [a/x], replacing occurrences of the free variable x with the new argument a (which could be any argument, including another variable). |
Expression |
subst(Type T,
FreeTypeVariable X)
Performs the substitution [T/X], replacing occurrences of the free type variable X with the type T (which could be any type, including another variable). |
java.lang.String |
toString()
|
java.util.Set<Variable> |
vars()
Find the set of all Variables (note: not FreeVariables) that are not bound within this expression. |
Methods inherited from class orc.ast.simple.expression.Expression |
---|
convertAll, subMap, substAll, subvar, subvar |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WithLocation(Expression expr, SourceLocation location)
Method Detail |
---|
public Expression convert(Env<Variable> vars, Env<TypeVariable> typevars) throws CompilationException
Expression
convert
in class Expression
vars
- The vars environment, used in content addressable mode to
find the appropriate deBruijn index of a var.typevars
- The type vars environment, used in content addressable
mode to find the appropriate deBruijn index of a type var.
CompilationException
public Expression subst(Argument a, FreeVariable x)
Expression
subst
in class Expression
a
- The replacing variable or valuex
- The free variable whose occurrences will be replaced
public Expression subst(Type T, FreeTypeVariable X)
Expression
subst
in class Expression
T
- The replacing typeX
- The free type variable whose occurrences will be replaced
public java.util.Set<Variable> vars()
Expression
vars
in class Expression
public SourceLocation getSourceLocation()
getSourceLocation
in interface Located
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |