|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.millscript.millscript.expr.Expr<ConstAction>
org.millscript.millscript.expr.ConstantExpr
public final class ConstantExpr
This class implements a constant expression. A constant expression always returns the same single result. As the returned result is an object, it is possible it could be modified. e.g. adding/changing/removing keys in a map.
ConstAction| Constructor Summary | |
|---|---|
ConstantExpr(java.lang.Object v)
Creates a new constant expression for the specified object. |
|
| Method Summary | |
|---|---|
ConstAction |
compileIt()
Compiles this expression into an action. |
java.lang.Object |
getValue()
Returns this constant expressions value. |
void |
resolve(CompilerState state)
Resolves any NameExpr in the tree so that they refer to the
correct ident. |
void |
show(int n)
Displays details about this expression, with the specified indent level. |
| Methods inherited from class org.millscript.millscript.expr.Expr |
|---|
arity, compile, isIntegerExpr, resolveList, setLineNumber, setOrigin, show |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConstantExpr(java.lang.Object v)
v - the value for this constant expression| Method Detail |
|---|
public ConstAction compileIt()
Expr
compileIt in class Expr<ConstAction>Action for this expressionExpr.compileIt()public java.lang.Object getValue()
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<ConstAction>state - the compiler state we are resolving inExpr.resolve(org.millscript.millscript.vm.CompilerState)public void show(int n)
Expr
show in class Expr<ConstAction>n - the indent level at which to start displayingExpr.show(int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||