org.millscript.millscript.expr
Class CheckNoneExpr

java.lang.Object
  extended by org.millscript.millscript.expr.Expr<CheckNoneAction>
      extended by org.millscript.millscript.expr.CheckNoneExpr
All Implemented Interfaces:
ZeroResults

public final class CheckNoneExpr
extends Expr<CheckNoneAction>
implements ZeroResults

This class implements a check none expression. A check none expression is guaranteed to return no results.

See Also:
CheckNoneAction

Constructor Summary
CheckNoneExpr(Expr<?> x)
          Creates a new check none expression, to check the specified expression returns no results.
 
Method Summary
 CheckNoneAction compileIt()
          Compiles this expression into an action.
static Expr<?> make(Expr<?> x)
          Returns an expression that is guaranteed to return no results.
 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

CheckNoneExpr

public CheckNoneExpr(Expr<?> x)
Creates a new check none expression, to check the specified expression returns no results.

Parameters:
x - the expression which must return no results
Method Detail

make

public static Expr<?> make(Expr<?> x)
Returns an expression that is guaranteed to return no results. This method provides some compile-time optimisation, as it avoids creating additional unnecessary objects in the expression tree. If the specified expression already returns no results, it is simply returned, otherwise if it returns an unknown number of results, a new check none expression is created.

Parameters:
x - the expression which must return no results
Returns:
the specified expression if it already returns no results, otherwise a new CheckNoneExpr

compileIt

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

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

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<CheckNoneAction>
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.