org.millscript.millscript.expr
Class ApplyExpr

java.lang.Object
  extended by org.millscript.millscript.expr.Expr<ApplyAction>
      extended by org.millscript.millscript.expr.ApplyExpr

public final class ApplyExpr
extends Expr<ApplyAction>

This class implements an apply expression.

See Also:
DotSyntax, ParenSyntax, Function, ApplyAction

Constructor Summary
ApplyExpr(Expr<?> f, Expr<?> a)
          Creates a new apply expression for the specified function and arguments expressions.
 
Method Summary
 ApplyAction compileIt()
          Compiles this expression into an action.
 Expr getArgs()
          Returns the arguments expression this apply expression will apply the function with.
 Expr getFun()
          Returns the function expression this apply expression will apply.
 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

ApplyExpr

public ApplyExpr(Expr<?> f,
                 Expr<?> a)
Creates a new apply expression for the specified function and arguments expressions.

Parameters:
f - the function expression, which must return a function as a single result
a - the arguments expression, which can return zero or more results
Method Detail

compileIt

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

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

getArgs

public Expr getArgs()
Returns the arguments expression this apply expression will apply the function with.

Returns:
the expression returning the arguments for the function

getFun

public Expr getFun()
Returns the function expression this apply expression will apply.

Returns:
the expression returning a single function

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