UNPKG

@ibm/ibmi-eventf-parser

Version:

Parse event files that are generated by IBM i compilers

94 lines (93 loc) 4.25 kB
import { ErrorInformationRecord } from "./record/ErrorInformationRecord"; import { FileEndRecord } from "./record/FileEndRecord"; import { FileIDRecord } from "./record/FileIDRecord"; import { MapTable } from "./MapTable"; import { ProcessorRecord } from "./record/ProcessorRecord"; export declare class ProcessorBlock { readonly INPUT_FILE_ID: number; private errors; private inputFile; private outputFile; private currentProcessor; private mappingTable; private previousProcessorBlock; private containsExpansionEvents; private isFirstInEventsFile; private mappingSupported; private totalNumberOfLinesInOutputFile; private totalNumberOfLinesInInputFiles; constructor(record: ProcessorRecord); getInputFile(): FileIDRecord | undefined; /** * Get the input file of the first processor block of the current events file. * * @return the input file of the first processor block of the current events file. */ getInitialInputFile(): FileIDRecord | undefined; setInputFile(file: FileIDRecord): void; addFile(file: FileIDRecord): void; closeFile(file: FileEndRecord): void; getOutputFile(): FileIDRecord | undefined; setOutputFile(file: FileIDRecord): void; getMappingTable(): MapTable; isProcessorIDZero(): boolean; addErrorInformation(record: ErrorInformationRecord): void; processorEnded(): void; setPreviousProcessor(previous: ProcessorBlock): void; setContainsExpansionEvents(containsExpansionEvents: boolean): void; getContainsExpansionEvents(): boolean; increaseTotalNumberOfLinesInInputFiles(numberOfLines: number): void; getTotalNumberOfLinesInInputFiles(): number; setTotalNumberOfLinesInOutputFile(numberOfLines: number): void; getTotalNumberOfLinesInOutputFile(): number; getPreviousProcessorBlock(): ProcessorBlock | undefined; modifyErrorInformation(error: ErrorInformationRecord): void; /** * Sets whether the current processor block is the first one in the current "sub" events file * (needed for events file that contains multiple events files that have been combined into one). * * @param isFirstInEventsFile */ setFirstInEventsFile(isFirstInEventsFile: boolean): void; /** * Returns whether the current processor block is the first one in the current "sub" events file * (needed for events file that contains multiple events files that have been combined into one). * * @return True if the current processor block is the first one in the current "sub" events file, false otherwise. */ getIsFirstInEventsFile(): boolean; setMappingSupported(mappingSupported: boolean): void; isMappingSupported(): boolean; /** * Determines whether a file in the current processor block is read-only or not. * A file is considered read-only if it is a temporary file created by an SQL pre-compiler. * * @param fileRecord The FileIDRecord of the file to check. * @return True if the file is read-only, false otherwise. */ isFileReadOnly(fileIDRecord: FileIDRecord): boolean; /** * This method is used by the test for event file processing. * * This method returns all errors in this and all previous processor blocks. * Since each ProcessorBlock contains an array of errors, the result will be * returned as an array of those arrays. * * This method is called by ExpansionProcessor.getAllErrors(). * * @return An array of arrays of all parsed errors from the current and all * previous processor blocks (one list for each processor block). */ getAllProcessorErrors(): ErrorInformationRecord[][]; resolveFileNamesForAllErrors(): void; /** * Maps the error back to the original input member and resolves the * file name of that member. If mappings are not supported, checks and * returns whether that member is read-only. * * @param error The ErrorInformationRecord to resolve. * @return True if mappings are not supported and the member that the * error points to is read-only, false otherwise. */ resolveFileNameAndDetermineIfReadOnly(error: ErrorInformationRecord): boolean; }