Package ghidra.app.plugin.processors.sleigh.expression

# Class TokenField

java.lang.Object
ghidra.app.plugin.processors.sleigh.expression.PatternExpression
ghidra.app.plugin.processors.sleigh.expression.PatternValue
ghidra.app.plugin.processors.sleigh.expression.TokenField

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

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TokenField()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static long`
  `byteSwap(long val, int size)`
  Swap the least sig -size- bytes in -val-
  `boolean`
  `equals(Object obj)`
  `int`
  `getBitEnd()`
  `int`
  `getBitStart()`
  `int`
  `getByteEnd()`
  `int`
  `getByteStart()`
  `int`
  `getShift()`
  `long`
  `getValue(ParserWalker walker)`
  `int`
  `hashCode()`
  `boolean`
  `hasSignbit()`
  `boolean`
  `isBigEndian()`
  `long`
  `maxValue()`
  `long`
  `minValue()`
  `void`
  `restoreXml(XmlPullParser parser, SleighLanguage lang)`
  `static long`
  `signExtend(long val, int bit)`
  Sign extend -val- above -bit-
  `String`
  `toString()`
  `static long`
  `zeroExtend(long val, int bit)`
  Clear all bits in -val- above -bit-

  ### Methods inherited from class ghidra.app.plugin.processors.sleigh.expression.PatternExpression

  `restoreExpression`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## 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()

  - ### restoreXml

    public void restoreXml(XmlPullParser parser, SleighLanguage lang)
    Specified by:
      `restoreXml` in class `PatternExpression`

  - ### 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:

  - ### 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:

  - ### 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:

  - ### isBigEndian

    public boolean isBigEndian()

  - ### getShift

    public int getShift()

  - ### toString

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