orc.ast.extended.expression
Class Temporary

java.lang.Object
  extended by orc.ast.extended.expression.Expression
      extended by orc.ast.extended.expression.Temporary
All Implemented Interfaces:
ASTNode, Locatable, Located

public class Temporary
extends Expression

A temporary variable, which embeds a Variable object from the simple AST within the extended AST. Used to avoid the problem of generating string identifiers for unnamed vars in translation steps.

Author:
dkitchin

Nested Class Summary
 
Nested classes/interfaces inherited from class orc.ast.extended.expression.Expression
Expression.Arg
 
Field Summary
 Variable v
           
 
Constructor Summary
Temporary(Variable v)
           
 
Method Summary
<E> E
accept(Visitor<E> visitor)
           
 Expression.Arg argify()
          Simplify an expression which occurs in an argument (nested) position.
 Expression simplify()
          Simplify an expression which occurs in a call (non-nested) position.
 java.lang.String toString()
           
 
Methods inherited from class orc.ast.extended.expression.Expression
getSourceLocation, join, setSourceLocation, uncurry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

v

public Variable v
Constructor Detail

Temporary

public Temporary(Variable v)
Method Detail

simplify

public Expression simplify()
Description copied from class: Expression
Simplify an expression which occurs in a call (non-nested) position.

Specified by:
simplify in class Expression
Returns:
The simplified expression

argify

public Expression.Arg argify()
Description copied from class: Expression
Simplify an expression which occurs in an argument (nested) position. Returns an Arg, which produces an Argument for the simplified call, and may also introduce a binder, in the case of a nested expression. The default behavior is to act as a nested expression and produce a complexArg. Expressions which can validly occur in arg position on their own without a binder will override this behavior.

Overrides:
argify in class Expression
Returns:
The argified form of the expression

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

accept

public <E> E accept(Visitor<E> visitor)