org.millscript.millscript.expr
Class UnaryOpExpr<A extends Action>

java.lang.Object
  extended by org.millscript.millscript.expr.Expr<A>
      extended by org.millscript.millscript.expr.UnaryOpExpr<A>
All Implemented Interfaces:
OneResult
Direct Known Subclasses:
ConstantLeftArithExpr, ConstantRightArithExpr

public abstract class UnaryOpExpr<A extends Action>
extends Expr<A>
implements OneResult

This class represents binary opereration syntax. A binary operation is one which returns a single result, from two single inputs. This means the left and right hand side expressions must produce single results, and that the expression as a whole will return a single result.

See Also:
AppendExpr, BinaryOpAction

Constructor Summary
UnaryOpExpr(Expr<?> a)
          Creates a new unary operation expression for the specified expression.
 
Method Summary
 A compileIt()
          Compiles this expression into an action.
abstract  A newAction(Action a)
          Compiles this expression into an action.
 void resolve(CompilerState state)
          Resolves any NameExpr in the tree so that they refer to the correct ident.
 
Methods inherited from class org.millscript.millscript.expr.Expr
arity, compile, isIntegerExpr, resolveList, setLineNumber, setOrigin, show, show
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnaryOpExpr

public UnaryOpExpr(Expr<?> a)
Creates a new unary operation expression for the specified expression.

Parameters:
a - the single expression, which must return a single result
Method Detail

compileIt

public final A compileIt()
Description copied from class: Expr
Compiles this expression into an action.

Specified by:
compileIt in class Expr<A extends Action>
Returns:
the Action for this expression
See Also:
Expr.compileIt()

newAction

public abstract A newAction(Action a)
Compiles this expression into an action. This is method performs the expression specific compilation, but does not need to handle the single expression compilation.

Parameters:
a - the compiled single expression
Returns:
the Action for this expression

resolve

public void resolve(CompilerState state)
Description copied from class: Expr
Resolves any NameExpr in the tree so that they refer to the correct ident. e.g. This method is responsible for ensuring that references to a function argument in the body of a function actually refer to the correct value.

Specified by:
resolve in class Expr<A extends Action>
Parameters:
state - the compiler state we are resolving in
See Also:
Expr.resolve(org.millscript.millscript.vm.CompilerState)


Copyright © 2001-2007 Open World Ltd. All Rights Reserved.