net.janino
Class Java.AmbiguousName
java.lang.Object
|
+--net.janino.Java.Located
|
+--net.janino.Java.Atom
|
+--net.janino.Java.Rvalue
|
+--net.janino.Java.Lvalue
|
+--net.janino.Java.AmbiguousName
- All Implemented Interfaces:
- Java.Locatable
- Enclosing class:
- Java
- public static class Java.AmbiguousName
- extends Java.Lvalue
This class is special: It does not extend/implement the Atom subclasses,
but overrides Atom's "to...()" methods.
Methods inherited from class net.janino.Java.Atom |
addConstantFloatInfo, addConstantIntegerInfo, addConstantStringInfo, allocateLocalVariable, compileError, createDummyCodeAttribute, getLocation, newInserter, newOffset, newUnsetOffset, popInserter, pushInserter, restoreLocalVariables, saveLocalVariables, throwParseException, toLvalueOrCE, toLvalueOrPE, toRvalueOrCE, toRvalueOrPE, toTypeOrCE, toTypeOrPE, write, writeBranch, writeByte, writeConstantClassInfo, writeConstantDoubleInfo, writeConstantFieldrefInfo, writeConstantFloatInfo, writeConstantIntegerInfo, writeConstantInterfaceMethodrefInfo, writeConstantLongInfo, writeConstantMethodrefInfo, writeConstantStringInfo, writeInt, writeOffset, writeOpcode, writeShort |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Java.AmbiguousName
public Java.AmbiguousName(Scanner.Location location,
Java.Scope scope,
java.lang.String[] identifiers)
Java.AmbiguousName
public Java.AmbiguousName(Scanner.Location location,
Java.Scope scope,
java.lang.String[] identifiers,
int n)
toType
public Java.Type toType()
- Overrides:
toType
in class Java.Atom
getType
public IClass getType()
throws Java.CompileException
- Overrides:
getType
in class Java.Atom
isType
public boolean isType()
throws Java.CompileException
- Overrides:
isType
in class Java.Atom
compileContext
public int compileContext()
throws Java.CompileException
- Description copied from class:
Java.Rvalue
- Generates code that determines the context of the
Java.Rvalue
and puts it on the operand stack. Most expressions
do not have a "context", but some do. E.g. for "x[y]", the context
is "x, y". The bottom line is that for statements like "x[y] += 3"
the context is only evaluated once.
- Overrides:
compileContext
in class Java.Rvalue
- Following copied from class:
net.janino.Java.Rvalue
- Returns:
- The size of the context on the operand stack
compileGet
public IClass compileGet()
throws Java.CompileException
- Description copied from class:
Java.Rvalue
- Generates code that determines the value of the
Java.Rvalue
and puts it on the operand stack. This method relies on that the
"context" of the Java.Rvalue
is on top of the operand stack
(see Java.Rvalue.compileContext()
).
- Overrides:
compileGet
in class Java.Rvalue
- Following copied from class:
net.janino.Java.Rvalue
- Returns:
- The type of the
Java.Rvalue
getConstantValue
public java.lang.Object getConstantValue()
throws Java.CompileException
- Description copied from class:
Java.Rvalue
- Attempts to evaluate as a constant expression.
Expression type | Return value type |
String | String |
byte | Byte |
short | Chort |
int | Integer |
boolean | Boolean |
char | Character |
float | Float |
long | Long |
double | Double |
null | Java.Rvalue.CONSTANT_VALUE_NULL |
- Overrides:
getConstantValue
in class Java.Rvalue
compileSet
public void compileSet(IClass valueType,
java.lang.Object optionalConstantValue)
throws Java.CompileException
- Description copied from class:
Java.Lvalue
- Generates code that stores a value in the
Java.Lvalue
.
Expects the Java.Lvalue
's context (see Java.Rvalue.compileContext()
) and a value of type "valueType" on the operand
stack.
If optionalConstantValue
is not null, then the stack
top value is identical to it; this allows for "primitive constant
assignment conversion" (JLS 5.2).
- Overrides:
compileSet
in class Java.Lvalue
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object