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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static long
byteSwap(long val, int size)
Swap the least sig -size- bytes in -val-boolean
equals(java.lang.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-java.lang.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
-
-
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
minValue
public long minValue()
- Specified by:
minValue
in classPatternValue
-
maxValue
public long maxValue()
- Specified by:
maxValue
in classPatternValue
-
getValue
public long getValue(ParserWalker walker) throws MemoryAccessException
- Specified by:
getValue
in classPatternExpression
- 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 classPatternExpression
-
hasSignbit
public boolean hasSignbit()
-
signExtend
public static long signExtend(long val, int bit)
Sign extend -val- above -bit-- Parameters:
val
- value to extendbit
- 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 extendbit
- 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 swappedsize
- number of bytes involved in swap- Returns:
-
isBigEndian
public boolean isBigEndian()
-
getShift
public int getShift()
-
toString
public java.lang.String toString()
- Specified by:
toString
in classPatternExpression
-
-