Menu

SuperConstructorReference & MethodRe...

Developers
widheg
2009-11-16
2012-10-08
  • widheg

    widheg - 2009-11-16

    Hi all!
    In my visitor method visitSuperConstructorReference(SuperConstructorReference
    x) (i.e. the one being called when 'super()' appears in target code), I
    planned to call visitMethodReference() and do the processing in it (i.e.
    treating the SuperConstructorReference like an ordinary method reference).
    (This to have the code for all method references in one place.) What do I need
    to do in visitSuperConstructorReference() before calling visitMethodReference?

    The same question and reasoning applies also to
    visitThisConstructorReference().

    Thanks in advance for any help, it's greatly appreciated!

     
  • Tobias Gutzmann

    Tobias Gutzmann - 2009-11-16

    Hi,

    well, you cannot cast a This/SuperConstructorReference to a MethodReference.
    What you can do, is to extract all the desired information from both
    MethodReference and This/SuperConstructorReference (e.g., the arguments) in
    then visitXZY methods, and then call a common method that does the actual
    processing.

    /Tobias

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.