|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.millscript.millscript.expr.Expr<Action>
org.millscript.millscript.expr.LambdaExpr
public final class LambdaExpr
This class implements a lambda expression. A lambda expression always returns a single result, which is a wrapped lambda function. A lambda expression can have a fixed or variable(with some fixed) number of arguments.
DefineSyntax,
LambdaFunction,
MakeClosureAction| Constructor Summary | |
|---|---|
LambdaExpr(java.lang.String nm,
org.millscript.commons.util.IList<NameExpr> a,
NameExpr r,
Expr<?> b)
Creates a new lambda expression with the specified name, arguments and body expressions. |
|
| Method Summary | |
|---|---|
Action |
compileIt()
Compiles this expression into an action. |
org.millscript.commons.util.IList<NameExpr> |
getArgs()
Returns the list of argument name expressions for this lambda expression. |
java.lang.String |
getName()
Returns the name for this lamba expression. |
NameExpr |
getRest()
Returns the name expression for the list of unspecified arguments to this lambda expression. |
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 |
|---|
public LambdaExpr(java.lang.String nm,
org.millscript.commons.util.IList<NameExpr> a,
NameExpr r,
Expr<?> b)
nm - a string containing the lambda expression namea - a list of name expressions for the lambda expression
argumentsr - a name expression for a list, to contain any additional
arguments, or nullb - the lambda expression body expression| Method Detail |
|---|
public Action compileIt()
Expr
compileIt in class Expr<Action>Action for this expressionExpr.compileIt()public org.millscript.commons.util.IList<NameExpr> getArgs()
public java.lang.String getName()
public NameExpr getRest()
NameExpr for the list of unspecified arguments, or
nullpublic void resolve(CompilerState state)
ExprNameExpr 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.
resolve in class Expr<Action>state - the compiler state we are resolving inExpr.resolve(org.millscript.millscript.vm.CompilerState)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||