@ibm/ibmi-eventf-parser
Version:
Parse event files that are generated by IBM i compilers
83 lines (82 loc) • 4.84 kB
TypeScript
import { IProcessor } from "./IProcessor";
import { ErrorInformationRecord } from "./record/ErrorInformationRecord";
import { ExpansionRecord } from "./record/ExpansionRecord";
import { FeedbackCodeRecord } from "./record/FeedbackCodeRecord";
import { FileEndRecord } from "./record/FileEndRecord";
import { FileIDRecord } from "./record/FileIDRecord";
import { MapDefineRecord } from "./record/MapDefineRecord";
import { MapEndRecord } from "./record/MapEndRecord";
import { MapStartRecord } from "./record/MapStartRecord";
import { ProcessorBlock } from "./ProcessorBlock";
import { ProcessorRecord } from "./record/ProcessorRecord";
import { ProgramRecord } from "./record/ProgramRecord";
import { TimestampRecord } from "./record/TimestampRecord";
export declare class ExpansionProcessor implements IProcessor {
private PRE_COMPILE_PROCESSOR_ID;
protected currentProcessor: ProcessorBlock | undefined;
protected postProcessingNeeded: boolean;
private _noProcessorEventsYet;
protected _containsPreCompileProcessorBlocks: boolean;
constructor();
processErrorRecord(record: ErrorInformationRecord): void;
processExpansionRecord(record: ExpansionRecord): void;
processFeedbackCodeRecord(record: FeedbackCodeRecord): void;
processFileEndRecord(record: FileEndRecord): void;
processFileIDRecord(record: FileIDRecord): void;
processMapDefineRecord(record: MapDefineRecord): void;
processMapEndRecord(record: MapEndRecord): void;
processMapStartRecord(record: MapStartRecord): void;
processProcessorRecord(record: ProcessorRecord): void;
protected constructEventsFileProcessorBlock(record: ProcessorRecord): ProcessorBlock;
processProgramRecord(record: ProgramRecord): void;
processTimestampRecord(record: TimestampRecord): void;
doPreProcessing(): boolean;
doPostProcessing(): boolean;
/**
* Recursively determines whether the events file (or any of the "sub" events files
* when multiple have been combined into one) supports mapping of errors from the
* final temporary output member to the original input members.
* Also sets a property of each processor block for whether it supports mappings.
* Mapping is supported for an events file if all its processor blocks support error mapping.
* IMPORTANT: When called at the top level, this method should only be called on the
* very last processor block of the [combined] events file.
*
* @param lastProcessorBlock The first processor block to check. When called at the top
* level, this should be the very last processor block of the [combined] events file.
* @return True if any of the events files support mapping of errors, false otherwise.
*/
protected determineAndSetMappingSupport(lastProcessorBlock: ProcessorBlock): boolean;
/**
* Sets the supportsMappings property for each processor block in the current events file
* to the value provided.
* IMPORTANT: This method should only be called on the last processor block
* of the current events file.
*
* @param lastProcessorBlock The last processor block of the current events file.
* @param support Boolean value corresponding to whether the current events file requires
* and supports mappings.
*/
private setMappingSupportForCurrentEventsFile;
/**
* Recursively determines whether the current events file (or "sub" events file in the case of
* multiple events files combined into one) requires and supports mapping of errors
* from its output file to its input files. An ["sub"] events file supports mapping of
* errors if all of its processor blocks support error mappings.
* For individual processor blocks in the events file:
* For compile processor blocks, when they come after pre-compile processor blocks(s),
* mapping is considered to be supported. If they do not come after pre-compile
* block(s), there is no need to do mappings, so mapping is not considered supported.
* For pre-compile processor blocks (which will have temporary output members),
* mapping is supported if there are expansion events, or if there are no
* expansion events but the total number of lines written to the output
* file equals the total number of lines read from the input files, and is not zero.
* IMPORTANT: When called at the top level, this method should only be called on
* the last processor block of the current events file.
*
* @param lastProcessorBlock The last processor block of the current events file.
* @return True if the current events file supports mapping of errors, false otherwise.
*/
private isMappingSupportedByCurrentEventsFile;
getAllErrors(): ErrorInformationRecord[][];
getAllFileIDRecords(): FileIDRecord[];
}