Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

nice.lang.inline
Class CompOp  view CompOp download CompOp.java

java.lang.Object
  extended bygnu.mapping.Procedure
      extended bygnu.mapping.Procedure2
          extended bynice.lang.inline.CompOp
All Implemented Interfaces:
gnu.expr.Branchable, gnu.expr.Inlineable, bossa.syntax.Macro, gnu.mapping.Named

public class CompOp
extends gnu.mapping.Procedure2
implements gnu.expr.Branchable, bossa.syntax.Macro

Inlining of native numeric types comparison operators.


Field Summary
private  gnu.bytecode.PrimType argType
           
private static int Eq
           
private static int error
           
private static int Ge
           
private static int Gt
           
private  int kind
           
private static int Le
           
private static int Lt
           
private static int Ne
           
private  gnu.bytecode.Type retType
           
 
Fields inherited from class gnu.mapping.Procedure
 
Constructor Summary
private CompOp(int kind, gnu.bytecode.PrimType argType)
           
 
Method Summary
 java.lang.Object apply2(java.lang.Object arg1, java.lang.Object arg2)
           
 void checkSpecialRequirements(bossa.syntax.Expression[] arguments)
          For each call site, this method is called with the actual arguments of the macro.
 void compile(gnu.expr.ApplyExp exp, gnu.expr.Compilation comp, gnu.expr.Target target)
           
 void compileJump(gnu.expr.Compilation comp, gnu.expr.Expression[] args, gnu.bytecode.Label to)
          Jump to label to if the comparison is true.
 void compileJumpNot(gnu.expr.Compilation comp, gnu.expr.Expression[] args, gnu.bytecode.Label to)
          Jump to label to if the comparison is false.
static CompOp create(java.lang.String param)
           
 gnu.bytecode.Type getReturnType(gnu.expr.Expression[] args)
           
 
Methods inherited from class gnu.mapping.Procedure2
apply0, apply1, apply3, apply4, applyN, numArgs
 
Methods inherited from class gnu.mapping.Procedure
apply, checkArgCount, getName, getProperty, getSetter, maxArgs, minArgs, name, removeProperty, set0, set1, setN, setName, setProperty, setProperty, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

error

private static final int error
See Also:
Constant Field Values

Eq

private static final int Eq
See Also:
Constant Field Values

Ge

private static final int Ge
See Also:
Constant Field Values

Le

private static final int Le
See Also:
Constant Field Values

Lt

private static final int Lt
See Also:
Constant Field Values

Gt

private static final int Gt
See Also:
Constant Field Values

Ne

private static final int Ne
See Also:
Constant Field Values

kind

private final int kind

argType

private final gnu.bytecode.PrimType argType

retType

private final gnu.bytecode.Type retType
Constructor Detail

CompOp

private CompOp(int kind,
               gnu.bytecode.PrimType argType)
Method Detail

create

public static CompOp create(java.lang.String param)

compile

public void compile(gnu.expr.ApplyExp exp,
                    gnu.expr.Compilation comp,
                    gnu.expr.Target target)
Specified by:
compile in interface gnu.expr.Inlineable

compileJump

public void compileJump(gnu.expr.Compilation comp,
                        gnu.expr.Expression[] args,
                        gnu.bytecode.Label to)
Jump to label to if the comparison is true.

Specified by:
compileJump in interface gnu.expr.Branchable

compileJumpNot

public void compileJumpNot(gnu.expr.Compilation comp,
                           gnu.expr.Expression[] args,
                           gnu.bytecode.Label to)
Jump to label to if the comparison is false.

Specified by:
compileJumpNot in interface gnu.expr.Branchable

getReturnType

public gnu.bytecode.Type getReturnType(gnu.expr.Expression[] args)
Specified by:
getReturnType in interface gnu.expr.Inlineable

checkSpecialRequirements

public void checkSpecialRequirements(bossa.syntax.Expression[] arguments)
Description copied from interface: bossa.syntax.Macro
For each call site, this method is called with the actual arguments of the macro. This can be used to check special requirements on the arguments that could not be expressed in the type of the macro. For instance, it might be necessary to check that a certain argument is assignable if it is modified by the macro.

Specified by:
checkSpecialRequirements in interface bossa.syntax.Macro

apply2

public java.lang.Object apply2(java.lang.Object arg1,
                               java.lang.Object arg2)