|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object orc.ast.simple.expression.Expression
public abstract class Expression
Base class for the simplified abstract syntax tree.
Constructor Summary | |
---|---|
Expression()
|
Method Summary | |
---|---|
abstract 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. |
static java.util.List<Expression> |
convertAll(java.util.List<Expression> es,
Env<Variable> vars,
Env<TypeVariable> typevars)
Convenience method, to apply convert to a list of expressions. |
Expression |
subMap(java.util.Map<FreeVariable,? extends Argument> m)
Perform a set of substitutions defined by a map. |
abstract 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). |
abstract 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). |
static java.util.List<Expression> |
substAll(java.util.List<Expression> es,
Argument a,
FreeVariable x)
Convenience method, to apply a substitution to a list of expressions. |
Expression |
subvar(TypeVariable U,
FreeTypeVariable X)
Performs the substitution [U/X], replacing occurrences of the free type variable X with the nameless type variable U. |
Expression |
subvar(Variable v,
FreeVariable x)
Performs the substitution [v/x], replacing occurrences of the free variable x with the nameless variable v. |
abstract 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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Expression()
Method Detail |
---|
public abstract Expression convert(Env<Variable> vars, Env<TypeVariable> typevars) throws CompilationException
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 static java.util.List<Expression> convertAll(java.util.List<Expression> es, Env<Variable> vars, Env<TypeVariable> typevars) throws CompilationException
es
- A list of expressions.vars
- typevars
-
CompilationException
public abstract Expression subst(Argument a, FreeVariable x)
a
- The replacing variable or valuex
- The free variable whose occurrences will be replaced
public static java.util.List<Expression> substAll(java.util.List<Expression> es, Argument a, FreeVariable x)
public Expression subvar(Variable v, FreeVariable x)
v
- The replacing variablex
- The free variable whose occurrences will be replaced
public Expression subMap(java.util.Map<FreeVariable,? extends Argument> m)
m
- public abstract Expression subst(Type T, FreeTypeVariable X)
T
- The replacing typeX
- The free type variable whose occurrences will be replaced
public Expression subvar(TypeVariable U, FreeTypeVariable X)
U
- The replacing type variableX
- The free type variable whose occurrences will be replaced
public abstract java.util.Set<Variable> vars()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |