gnu.jel
Class OPbinary
java.lang.Object
|
+--gnu.jel.OP
|
+--gnu.jel.OPfunction
|
+--gnu.jel.OPbinary
- public class OPbinary
- extends OPfunction
Constructor Summary |
OPbinary(TypesStack typesStk,
java.util.Stack paramOPs,
int code,
OPlist list)
Constructs a new binary operation. |
Method Summary |
protected void |
compile_par(ClassFile cf)
Called to generate the code after a parameter is processed. |
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 |
promotions
protected static final int[][] promotions
OPbinary
public OPbinary(TypesStack typesStk,
java.util.Stack paramOPs,
int code,
OPlist list)
throws java.lang.IllegalStateException
- Constructs a new binary operation.
Codes are following:
0 -- addition
1 -- substraction
2 -- multiplication
3 -- division
4 -- remainder
5 -- bitwise AND
6 -- bitwise OR
7 -- bitwise and logical XOR
8 -- comparizon for equality
9 -- comparizon for non-equality
10 -- comparizon for "less" <
11 -- comparizon for "greater or equal" >=
12 -- comparizon for "greater" >
13 -- comparizon for "less or equal" <=
14 -- bitwise left shift <<
15 -- bitwise right signed shift >>
16 -- bitwise right unsigned shift >>>
17 -- logical conjunction operator (AND)
18 -- logical disjunction operator (OR)
19 -- array element access operation
- Parameters:
typesStk
- holds current items on stackcode
- is the operation code
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_par
protected void compile_par(ClassFile cf)
- Description copied from class: OPfunction
- Called to generate the code after a parameter is processed.
- Overrides:
- compile_par 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