gnu.jel
Class OPunary
java.lang.Object
|
+--gnu.jel.OP
|
+--gnu.jel.OPfunction
|
+--gnu.jel.OPunary
- public class OPunary
- extends OPfunction
Constructor Summary |
OPunary(TypesStack typesStk,
java.lang.Class cls,
boolean allownarrowing)
Creates conversion operation to the given class. |
OPunary(TypesStack typesStk,
int code)
Constructs a new unary operation. |
OPunary(TypesStack typesStk,
int clsID,
java.lang.Class cls,
boolean allownarrowing)
Creates conversion operation to the given class. |
Method Summary |
protected void |
compile_pre(ClassFile cf)
Called to generate the code before the parameters processing starts. |
protected void |
compile(ClassFile cf)
Called to generate the code implementing this OP. |
protected void |
eval(OPlist list)
Attempts to perform this operation. |
int |
getNParams()
Returns number of parameters for this function. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
code
protected int code
sb_class
protected static java.lang.Class sb_class
string_class
protected static java.lang.Class string_class
unary_prmtns
protected static final int[] unary_prmtns
OPunary
public OPunary(TypesStack typesStk,
int code)
throws java.lang.IllegalStateException
- Constructs a new unary operation.
Codes are following:
0 -- negation (applicable to anything except boolean)
1 -- bitwise not (applicable to all integral types)
2 -- logical not (applicable to booleans only)
3 -- return the type in stack
- Parameters:
typesStk
- stack holding the current types (will be updated)code
- operation codecls
- class to convert to (used only if code==11)
OPunary
public OPunary(TypesStack typesStk,
int clsID,
java.lang.Class cls,
boolean allownarrowing)
- Creates conversion operation to the given class.
- Parameters:
typesStk
- stack holding the current types (will be updated)clsID
- ID of primitive type to convert to.cls
- the class to convert to, in case cldID=8allownarrowing
- if narrowing conversions are allowed.
OPunary
public OPunary(TypesStack typesStk,
java.lang.Class cls,
boolean allownarrowing)
- Creates conversion operation to the given class.
- Parameters:
typesStk
- stack holding the current types (will be updated)cls
- the class to convert to, in case cldID=8allownarrowing
- if narrowing conversions are allowed.
getNParams
public int getNParams()
- Returns number of parameters for this function.
- Overrides:
- getNParams in class OPfunction
compile_pre
protected void compile_pre(ClassFile cf)
- Description copied from class: OPfunction
- Called to generate the code before the parameters processing starts.
- Overrides:
- compile_pre in class OPfunction
- Tags copied from class: OPfunction
- Parameters:
cf
- class file to write the code into.
compile
protected void compile(ClassFile cf)
- Description copied from class: OP
- Called to generate the code implementing this OP.
- Overrides:
- compile in class OP
- Tags copied from class: OP
- Parameters:
cf
- class file to write the code into.
eval
protected void eval(OPlist list)
- Attempts to perform this operation.
- Overrides:
- eval in class OPfunction
- Parameters:
list
- is the list of OPs this one belong to,
if eval is unsuccessful this list is not modified.
toString
public java.lang.String toString()
- Overrides:
- toString in class java.lang.Object