OPcall (JEL API)
Date: 2015-05-14

gnu.jel

## Class OPcall

- java.lang.Object
- - gnu.jel.OP
  - - gnu.jel.OPcall

-     public class OPcall
      extends OP

  A tree node, representing a method call (field/local variable load).

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.lang.reflect.Member` | `m` Holds method to be executed
    `int` | `nplv` local variable number (in case m=null), number of formal parameters of the method to call otherwise.

    - ### Fields inherited from class gnu.jel.OP

      `chi, resID, resType, specialTypes, unwrapType`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OPcall(int lvarn, java.lang.Class type)` Prepares access to the local variable (formal parameter) of method.
    `OPcall(java.util.Stack<OP> paramOPs, java.lang.reflect.Member m, boolean aEval)` Prepares a new method/field call/get operation to be added to the code.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `compile(ClassFile cf)` Called to generate the code implementing this OP.
    `java.lang.Object` | `eval()` Attempts to evaluate this function.

    - ### Methods inherited from class gnu.jel.OP

      `isWidening, isWidening, narrow, typeID, typeIDObject, widen`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### m

          public java.lang.reflect.Member m

      Holds method to be executed

    - #### nplv

          public int nplv

      local variable number (in case m=null), number of formal parameters of the method to call otherwise.

  - ### Constructor Detail

    - #### OPcall

          public OPcall(java.util.Stack<OP> paramOPs,
                java.lang.reflect.Member m,
                boolean aEval)
                 throws CompilationException

      Prepares a new method/field call/get operation to be added to the code.
      Parameters:
        `paramOPs` - stack holding the operands
        `m` - method/field to call/get.
        `aEval` - indicates if the method call should be attempted at the compile time
      Throws:
        `CompilationException`

    - #### OPcall

          public OPcall(int lvarn,
                java.lang.Class type)

      Prepares access to the local variable (formal parameter) of method.
      Parameters:
        `lvarn` - local variable number.
        `type` - local variable type.

  - ### Method Detail

    - #### eval

          public java.lang.Object eval()
                                throws java.lang.Exception

      Attempts to evaluate this function.
      Specified by:
        `eval` in class `OP`
      Returns:
        the OPload, representing the function's result (if it can \ be evaluated).
      Throws:
        `java.lang.Exception` - if the function can't be evaluated, or the evaluation results in error.

    - #### compile

          public void compile(ClassFile cf)

      Description copied from class: `OP`
      Called to generate the code implementing this OP.
      Specified by:
        `compile` in class `OP`
      Parameters:
        `cf` - class file with a new open method to write the code into.

Copyright © 1998-2015 Konstantin L. Metlov All Rights Reserved.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the JEL manual.