@ibm/ibmi-eventf-parser
Version:
Parse event files that are generated by IBM i compilers
50 lines (49 loc) • 1.99 kB
TypeScript
import { FileIDRecord } from './record/FileIDRecord';
import { IProcessor } from './IProcessor';
import { ISequentialFileReader } from './ISequentialFileReader';
import { IMarkerCreator } from './IMarkerCreator';
import { ErrorInformationRecord } from './record/ErrorInformationRecord';
export declare class Parser {
private _loggingEnabled;
private exception;
private processor;
private lastOutputFile;
private currentOutputFile;
private sourceTable;
constructor();
private getUntilTheEndOfTheLine;
/**
* Enable or disable logging.
*
* @param {boolean} enable true to enable or false to disable logging
*/
loggingEnabled(enable: boolean): void;
private log;
/**
* To parse an eventf generated by an IBM i compiler.
* @param fileReader a generic reader implementing {@link ISequentialFileReader}.
* @param markerCreator optionally passing in an object implementing {@link IMarkerCreator}
* allows the parser to call this object back with each error. The original source
* file name and error location and error message will be in the information provided
* on the callback
*/
parse(fileReader: ISequentialFileReader, markerCreator?: IMarkerCreator): void;
private resolveRelativePath;
getException(): Error | undefined;
setProcessor(processor: IProcessor): void;
/**
* After all records in the Events File are processed, this method is called to
* return all the errors from all the processor blocks (ProcessorBlock) of the
* Events File. Since each ProcessorBlock contains an array of errors, the result
* will be flattened to an array.
*
* @return An array of all parsed errors from all processor blocks of the Events File.
*/
getAllErrors(): ErrorInformationRecord[];
/**
* Get all file ID records.
*
* @return An array of all file ID records.
*/
getAllFileIDRecords(): FileIDRecord[];
}