orc.ast.extended
Class Expression

java.lang.Object
  extended by orc.ast.extended.Expression
Direct Known Subclasses:
Call, ConsExpr, Declare, Dot, Field, Lambda, Let, ListExpr, Literal, Name, NilExpr, Parallel, Semi, Sequential, Silent, Tuple, Where

public abstract class Expression
extends java.lang.Object

Base class for the extended abstract syntax tree. Extended expressions are produced by the parser with minimal processing. They desugar to a simplified set of expressions.

Author:
dkitchin, wcook

Nested Class Summary
static interface Expression.Arg
          Variant type returned by the argify method.
 
Constructor Summary
Expression()
           
 
Method Summary
protected  Expression.Arg argify()
          Simplify an expression which occurs in an argument (nested) position.
abstract  Expression simplify()
          Simplify an expression which occurs in a call (non-nested) position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Expression

public Expression()
Method Detail

simplify

public abstract Expression simplify()
Simplify an expression which occurs in a call (non-nested) position.

Returns:
The simplified expression

argify

protected Expression.Arg argify()
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.

Returns:
The argified form of the expression