|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.millscript.millscript.expr.Expr<SwitchAction>
org.millscript.millscript.expr.SwitchExpr
public final class SwitchExpr
This class implements a switch expression.
SwitchSyntax,
SwitchAction| Constructor Summary | |
|---|---|
SwitchExpr(Expr<?> a,
org.millscript.commons.util.IList<CaseExpr> b,
Expr<?> c)
Creates a new switch expression for the specified choice,
case and default expressions. |
|
| Method Summary | |
|---|---|
int |
arity()
Returns the arity of this expression. |
SwitchAction |
compileIt()
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 |
|---|
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 SwitchExpr(Expr<?> a,
org.millscript.commons.util.IList<CaseExpr> b,
Expr<?> c)
switch expression for the specified choice,
case and default expressions.
a - the choice expressionb - the list of case expressionsc - the default expression| Method Detail |
|---|
public int arity()
Expr
arity in class Expr<SwitchAction>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 SwitchAction compileIt()
Expr
compileIt in class Expr<SwitchAction>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<SwitchAction>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 | |||||||||