Class SourceFileIndexer
java.lang.Object
ghidra.sleigh.grammar.SourceFileIndexer
This class is used to index source files in a SLEIGH language module.
The SLEIGH compiler records the index of the source file for a constructor rather
than the file name. This is an optimization to avoid repeating the file name in
the .sla files.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a {code SourceFileIndexer} object with an empty index. -
Method Summary
Modifier and TypeMethodDescriptionvoidDecode an index from a streamvoidEncode the index to a streamgetFileName(Integer index) Returns the file name at a given indexReturns the index for a filenameAdds the filename of a location to the index if it is not already present.
-
Constructor Details
-
SourceFileIndexer
public SourceFileIndexer()Creates a {code SourceFileIndexer} object with an empty index.
-
-
Method Details
-
index
-
getIndex
-
getFileName
-
encode
Encode the index to a stream- Parameters:
encoder- stream to write to- Throws:
IOException- for errors writing to the stream
-
decode
Decode an index from a stream- Parameters:
decoder- is the stream- Throws:
DecoderException- for errors in the encoding
-