|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.millscript.millscript.expr.Expr<If3Action>
org.millscript.millscript.expr.If3Expr
public final class If3Expr
This class implements an if3 expression. An if3 expression has a predicate,
ifso and ifnot expression, where if ifso expression is executed if the
predicate expression returns true and the ifnot expression is
executed otherwise.
ConditionalSyntax,
If2Expr,
If3Action| Constructor Summary | |
|---|---|
If3Expr(Expr a,
Expr b,
Expr c)
Creates a new if3 expression with the specified predicate, ifso and ifnot expressions. |
|
| Method Summary | |
|---|---|
int |
arity()
Returns the arity of this expression. |
If3Action |
compileIt()
Compiles this expression into an action. |
static Expr |
make(Expr a,
Expr<?> b,
Expr<?> c)
Returns an if3 expression for the specified predicate, ifso and ifnot expressions. |
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 |
|---|
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 If3Expr(Expr a,
Expr b,
Expr c)
a - the predicate expression which must return a single resultb - the ifso expressionc - the ifnot expression| Method Detail |
|---|
public static Expr make(Expr a,
Expr<?> b,
Expr<?> c)
a - the predicate expression which must return a single resultb - the ifso expressionc - the ifnot expression
public int arity()
Expr
arity in class Expr<If3Action>0 if the expression returns zero results,
1 if the expression returns one result or
-1 if the expression returns an unknown number of
results.Expr.arity()public If3Action compileIt()
Expr
compileIt in class Expr<If3Action>Action for this expressionExpr.compileIt()public 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<If3Action>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 | |||||||||