public class TokenField extends PatternValue
A contiguous set of bits within instruction stream, interpreted as an integer value
  • Constructor Details

    • TokenField

      public TokenField()
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • minValue

      public long minValue()
      Specified by:
      minValue in class PatternValue
    • maxValue

      public long maxValue()
      Specified by:
      maxValue in class PatternValue
    • getValue

      public long getValue(ParserWalker walker) throws MemoryAccessException
      Specified by:
      getValue in class PatternExpression
      Throws:
      MemoryAccessException
    • getBitStart

      public int getBitStart()
    • getBitEnd

      public int getBitEnd()
    • getByteStart

      public int getByteStart()
    • getByteEnd

      public int getByteEnd()
    • decode

      public void decode(Decoder decoder, SleighLanguage lang) throws DecoderException
      Specified by:
      decode in class PatternExpression
      Throws:
      DecoderException
    • hasSignbit

      public boolean hasSignbit()
    • signExtend

      public static long signExtend(long val, int bit)
      Sign extend -val- above -bit-
      Parameters:
      val - value to extend
      bit - bit specifying sign
      Returns:
      the extended value
    • zeroExtend

      public static long zeroExtend(long val, int bit)
      Clear all bits in -val- above -bit-
      Parameters:
      val - value to zero extend
      bit - bit above which to zero extend
      Returns:
      the extended value
    • byteSwap

      public static long byteSwap(long val, int size)
      Swap the least sig -size- bytes in -val-
      Parameters:
      val - value to be byte swapped
      size - number of bytes involved in swap
      Returns:
      the byte swapped value
    • isBigEndian

      public boolean isBigEndian()
    • getShift

      public int getShift()
    • toString

      public String toString()
      Specified by:
      toString in class PatternExpression