2 Replies Latest reply on Mar 9, 2005 11:43 AM by rezahay

    Why is there no LocalVarAccess just like FieldAccess Expr?

    rezahay

      Hi,

      I use javassist Expr classes (for example FieldAccess) to construct a model of the running java class. It would be very fine if there was a javassist LocalVarAccess (just like FieldAccess) in order to get information about the local-variables of a method (and hence about the behavior of the method).

      Is this absence intentional? Is it feasible that I can make it using the javassist Expr class or should you I use the javassist low level API?

      Thanks in advance

      With kindly regards
      Reza

        • 1. Re: Why is there no LocalVarAccess just like FieldAccess Exp
          chiba

          Yes, you can implement LocalVarAccess with the low-level
          API.

          • 2. Re: Why is there no LocalVarAccess just like FieldAccess Exp
            rezahay

            Thank you Mr. Chiba for your response. I have another question which is almost the same as my previous question.

            Why is there no Expr class for logical-expressions, arithmetic-expressions, and things like them? I want to analyse a code-line (as a Abstract Syntax Tree) to see what kind expressions a given code-line contains. I can now know whether an expression is a method-call, new, cast, instanceOf, fieldAccess, but not if it's a logical-expression, using the high-level API.

            I think, I can use the low-level API to realise that kind of analysis. Am I right? Is it valuable to make high-level API for that kind expressions?

            I appriciate very much your valuable responses.

            Thanks