@ibm/ibmi-eventf-parser
Version:
Parse event files that are generated by IBM i compilers
79 lines (78 loc) • 2.9 kB
TypeScript
import { ErrorInformationRecord } from "./record/ErrorInformationRecord";
import { ExpansionRecord } from "./record/ExpansionRecord";
import { FileEndRecord } from "./record/FileEndRecord";
import { FileIDRecord } from "./record/FileIDRecord";
export declare class MapTable {
private map;
private queueExpansion;
private files;
private lookupIndex;
private fileTable;
constructor();
/**
* Adds file information to the map.
*
* @param Tecord The File ID record.
*/
addFileInformation(record: FileIDRecord): void;
/**
* Adds file information only to the file table. This is useful for processing the
* compiler (000) processor block, since we don't need to keep track of line mappings
* and FileIDLinesPair pairings.
*
* @param record The File ID record
*/
addFileToFileTable(record: FileIDRecord): void;
/**
* Sets the correct bounds for the files in the map that were added using `AddFileInformation()`.
*
* @param record The File End record that contains the number of lines in the source.
*/
closeFile(record: FileEndRecord): void;
/**
* Create a `SourceLineRange` with open bounds. The bounds will be set once the FileEnd record is read.
*
* @param record The FileID record that contains information about where the `SourceLineRange` should start.
*/
private createOpenEndedSourceLineRange;
addExpansionRecord(record: ExpansionRecord): void;
private getSourceLineRangeForOutputLine;
private optimizedSourceLineRangeLookup;
private getSourceLineRangeForInputLine;
private shiftRangesBy;
private handleExpansion;
private splitExpandedSourceLineRange;
private createSourceLineRange;
/**
* Returns the QSYSEventsFileFileIDRecord corresponding to a file ID.
*
* @param ID The ID of the file to look for.
* @return The FileIDRecord corresponding to the file ID if it exists in the table, `undefined` otherwise.
*/
getFileIDRecordForFileID(ID: number): FileIDRecord | undefined;
getFileLocationForFileID(ID: number): string | undefined;
/**
* Modifies the information contained in the Error record based on the available map.
*
* @param record The Error record to be modified.
*/
modifyErrorInformation(record: ErrorInformationRecord): void;
/**
* Calculates the line number based on the initial number and how many lines where
* shifted in the expansion process.
*
* @param range `SourceLineRange` that contains mapping information.
* @param initial The line number.
* @return The new line number.
*/
private getLineFromSourceLineRange;
finalizeMap(): void;
/**
* Prints the map.
*/
toString(): string;
/**
* Get all file locations.
*/
getAllFileIDRecords(): FileIDRecord[];
}