Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## avrora.stack
Class AbstractInterpreter

    java.lang.Object
      avrora.stack.AbstractArithmetic
          avrora.stack.AbstractInterpreter

All Implemented Interfaces:
  InstrVisitor

public class AbstractInterpreter
extends AbstractArithmetic
implements InstrVisitor

The `AbstractInterpreter` class implements the abstract transfer function for each instruction type. Given an abstract state, it updates the abstract state according to the semantics of each instruction. The abstract interpreter works on the simple instructions. For complex instructions such as calls, returns, and pushes, it consults a `Policy` instance that implements the context sensitivity/insensitivity and stack modelling behavior of the particular analysis.

The `AbstractInterpreter` works on abstract values and uses abstract arithmetic. It operates on instances of the `AbstractState` class that represent the state of the processor.

See Also:
  `AbstractArithmetic`, `MutableState`

Field Summary
`protected StateCache.State` | `oldState`
`protected AnalyzerPolicy` | `policy`
`protected Program` | `program`
`protected MutableState` | `state`

Fields inherited from class avrora.stack.AbstractArithmetic
`FALSE, TRUE, UNKNOWN, ZERO`

Method Summary
`void` | `computeNextStates(StateCache.State os)` The `computeNextStates()` method computes the possible next states that follow the given immutable old state and then will push them to the `AnalyzerPolicy` instance that was passed in the constructor to this interpreter instance.
`void` | `visit(Instr.ADC i)`
`void` | `visit(Instr.ADD i)`
`void` | `visit(Instr.ADIW i)`
`void` | `visit(Instr.AND i)`
`void` | `visit(Instr.ANDI i)`
`void` | `visit(Instr.ASR i)`
`void` | `visit(Instr.BCLR i)`
`void` | `visit(Instr.BLD i)`
`void` | `visit(Instr.BRBC i)`
`void` | `visit(Instr.BRBS i)`
`void` | `visit(Instr.BRCC i)`
`void` | `visit(Instr.BRCS i)`
`void` | `visit(Instr.BREAK i)`
`void` | `visit(Instr.BREQ i)`
`void` | `visit(Instr.BRGE i)`
`void` | `visit(Instr.BRHC i)`
`void` | `visit(Instr.BRHS i)`
`void` | `visit(Instr.BRID i)`
`void` | `visit(Instr.BRIE i)`
`void` | `visit(Instr.BRLO i)`
`void` | `visit(Instr.BRLT i)`
`void` | `visit(Instr.BRMI i)`
`void` | `visit(Instr.BRNE i)`
`void` | `visit(Instr.BRPL i)`
`void` | `visit(Instr.BRSH i)`
`void` | `visit(Instr.BRTC i)`
`void` | `visit(Instr.BRTS i)`
`void` | `visit(Instr.BRVC i)`
`void` | `visit(Instr.BRVS i)`
`void` | `visit(Instr.BSET i)`
`void` | `visit(Instr.BST i)`
`void` | `visit(Instr.CALL i)`
`void` | `visit(Instr.CBI i)`
`void` | `visit(Instr.CBR i)`
`void` | `visit(Instr.CLC i)`
`void` | `visit(Instr.CLH i)`
`void` | `visit(Instr.CLI i)`
`void` | `visit(Instr.CLN i)`
`void` | `visit(Instr.CLR i)`
`void` | `visit(Instr.CLS i)`
`void` | `visit(Instr.CLT i)`
`void` | `visit(Instr.CLV i)`
`void` | `visit(Instr.CLZ i)`
`void` | `visit(Instr.COM i)`
`void` | `visit(Instr.CP i)`
`void` | `visit(Instr.CPC i)`
`void` | `visit(Instr.CPI i)`
`void` | `visit(Instr.CPSE i)`
`void` | `visit(Instr.DEC i)`
`void` | `visit(Instr.EICALL i)`
`void` | `visit(Instr.EIJMP i)`
`void` | `visit(Instr.ELPM i)`
`void` | `visit(Instr.ELPMD i)`
`void` | `visit(Instr.ELPMPI i)`
`void` | `visit(Instr.EOR i)`
`void` | `visit(Instr.FMUL i)`
`void` | `visit(Instr.FMULS i)`
`void` | `visit(Instr.FMULSU i)`
`void` | `visit(Instr.ICALL i)`
`void` | `visit(Instr.IJMP i)`
`void` | `visit(Instr.IN i)`
`void` | `visit(Instr.INC i)`
`void` | `visit(Instr.JMP i)`
`void` | `visit(Instr.LD i)`
`void` | `visit(Instr.LDD i)`
`void` | `visit(Instr.LDI i)`
`void` | `visit(Instr.LDPD i)`
`void` | `visit(Instr.LDPI i)`
`void` | `visit(Instr.LDS i)`
`void` | `visit(Instr.LPM i)`
`void` | `visit(Instr.LPMD i)`
`void` | `visit(Instr.LPMPI i)`
`void` | `visit(Instr.LSL i)`
`void` | `visit(Instr.LSR i)`
`void` | `visit(Instr.MOV i)`
`void` | `visit(Instr.MOVW i)`
`void` | `visit(Instr.MUL i)`
`void` | `visit(Instr.MULS i)`
`void` | `visit(Instr.MULSU i)`
`void` | `visit(Instr.NEG i)`
`void` | `visit(Instr.NOP i)`
`void` | `visit(Instr.OR i)`
`void` | `visit(Instr.ORI i)`
`void` | `visit(Instr.OUT i)`
`void` | `visit(Instr.POP i)`
`void` | `visit(Instr.PUSH i)`
`void` | `visit(Instr.RCALL i)`
`void` | `visit(Instr.RET i)`
`void` | `visit(Instr.RETI i)`
`void` | `visit(Instr.RJMP i)`
`void` | `visit(Instr.ROL i)`
`void` | `visit(Instr.ROR i)`
`void` | `visit(Instr.SBC i)`
`void` | `visit(Instr.SBCI i)`
`void` | `visit(Instr.SBI i)`
`void` | `visit(Instr.SBIC i)`
`void` | `visit(Instr.SBIS i)`
`void` | `visit(Instr.SBIW i)`
`void` | `visit(Instr.SBR i)`
`void` | `visit(Instr.SBRC i)`
`void` | `visit(Instr.SBRS i)`
`void` | `visit(Instr.SEC i)`
`void` | `visit(Instr.SEH i)`
`void` | `visit(Instr.SEI i)`
`void` | `visit(Instr.SEN i)`
`void` | `visit(Instr.SER i)`
`void` | `visit(Instr.SES i)`
`void` | `visit(Instr.SET i)`
`void` | `visit(Instr.SEV i)`
`void` | `visit(Instr.SEZ i)`
`void` | `visit(Instr.SLEEP i)`
`void` | `visit(Instr.SPM i)`
`void` | `visit(Instr.ST i)`
`void` | `visit(Instr.STD i)`
`void` | `visit(Instr.STPD i)`
`void` | `visit(Instr.STPI i)`
`void` | `visit(Instr.STS i)`
`void` | `visit(Instr.SUB i)`
`void` | `visit(Instr.SUBI i)`
`void` | `visit(Instr.SWAP i)`
`void` | `visit(Instr.TST i)`
`void` | `visit(Instr.WDR i)`

Methods inherited from class avrora.stack.AbstractArithmetic
`add, and, and, areEqual, areKnown, bitsOf, bitToChar, canon, canon, ceiling, ceiling, commonMask, commonMask, couldBeEqual, couldBeZero, couldBeZero, decrement, floor, floor, getBit, increment, isUnknown, knownBitsOf, knownVal, logicalAnd, maskOf, merge, merge, merge, merge, merge, mergeMask, not, or, or, setBit, shiftLeftOne, shiftLeftOne, subtract, toShortString, toString, toString, xor`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### policy

    protected final AnalyzerPolicy policy

### program

    protected final Program program

### oldState

    protected StateCache.State oldState

### state

    protected MutableState state

Method Detail

### computeNextStates

    public void computeNextStates(StateCache.State os)

  The `computeNextStates()` method computes the possible next states that follow the given immutable old state and then will push them to the `AnalyzerPolicy` instance that was passed in the constructor to this interpreter instance.

  Parameters:
    `os` - the immutable old state to compute the next state from

### visit

    public void visit(Instr.ADC i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.ADD i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.ADIW i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.AND i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.ANDI i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.ASR i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BCLR i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BLD i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRBC i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRBS i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRCC i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRCS i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BREAK i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BREQ i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRGE i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRHC i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRHS i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRID i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRIE i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRLO i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRLT i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRMI i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRNE i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRPL i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRSH i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRTC i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRTS i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRVC i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BRVS i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BSET i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.BST i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.CALL i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.CBI i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.CBR i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.CLC i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.CLH i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.CLI i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.CLN i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.CLR i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.CLS i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.CLT i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.CLV i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.CLZ i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.COM i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.CP i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.CPC i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.CPI i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.CPSE i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.DEC i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.EICALL i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.EIJMP i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.ELPM i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.ELPMD i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.ELPMPI i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.EOR i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.FMUL i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.FMULS i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.FMULSU i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.ICALL i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.IJMP i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.IN i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.INC i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.JMP i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.LD i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.LDD i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.LDI i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.LDPD i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.LDPI i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.LDS i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.LPM i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.LPMD i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.LPMPI i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.LSL i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.LSR i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.MOV i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.MOVW i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.MUL i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.MULS i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.MULSU i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.NEG i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.NOP i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.OR i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.ORI i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.OUT i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.POP i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.PUSH i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.RCALL i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.RET i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.RETI i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.RJMP i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.ROL i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.ROR i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SBC i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SBCI i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SBI i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SBIC i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SBIS i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SBIW i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SBR i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SBRC i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SBRS i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SEC i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SEH i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SEI i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SEN i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SER i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SES i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SET i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SEV i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SEZ i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SLEEP i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SPM i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.ST i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.STD i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.STPD i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.STPI i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.STS i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SUB i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SUBI i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.SWAP i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.TST i)

  Specified by:
    `visit` in interface `InstrVisitor`

### visit

    public void visit(Instr.WDR i)

  Specified by:
    `visit` in interface `InstrVisitor`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD