All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opalj.br.instructions.LocalVariableAccess.scala Maven / Gradle / Ivy

The newest version!
/* BSD 2-Clause License - see OPAL/LICENSE for details. */
package org.opalj
package br
package instructions

/**
 * Defines an extractor to determine the local variable index accessed by the instruction.
 *
 * @author Arne Lottmann
 * @author Michael Eichberg
 */
object LocalVariableAccess {

    def unapply(i: Instruction): Option[(Int, Boolean)] = {
        i match {
            case i: LoadLocalVariableInstruction  => Some((i.indexOfReadLocal, true))
            case i: StoreLocalVariableInstruction => Some((i.indexOfWrittenLocal, false))
            case _                                => None
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy