npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ibm/ibmi-eventf-parser

v1.0.2

Published

Parse event files that are generated by IBM i compilers

Downloads

73

Readme

ibmi-eventf-parser

Parses the event files that are placed into the EVFEVENT SRC-PF by IBM i compilers. Provides a call back interface to allow any other tools to process compiler errors. The eventf format is described in this IBM documentation

Installation

This parser is available as an NPM module and can be installed as a dependency using:

npm i @ibm/ibmi-eventf-parser

Example

The API to use this parser is illustrated in the vitest/files.test.ts examples:

const parser = new Parser();
const markers: MarkerCreator = new MarkerCreator();
parser.parseFile(`${TEST_DIR}/SQLRPGLE.PGM.evfevent`, markers);

assert.ok(markers.equals(0, '/home/REINHARD/builds/hll/sqlrpgle.pgm.sqlrpgle', 328, 'Precompile option COMMIT changed by SET OPTION statement.'));
assert.ok(markers.equals(1, '/home/REINHARD/builds/hll/includes/familly.rpgleinc', 23, 'The Definition-Type entry is not valid; defaults to parameter definition.'));
assert.ok(markers.equals(60, '/home/REINHARD/builds/hll/sqlrpgle.pgm.sqlrpgle', 0, 'Compilation stopped. Severity 30 errors found in program.'));

Usage

In the simplest method, create a class that implements the IMarkerCreator interface and then pass an instance into the parseFile method on the Parser class.

For every error logged in the eventf, the following callback function will be called:

public createMarker(record: ErrorInformationRecord, fileLocation: string, isReadOnly: string) {
    //...
}

where the ErrorInformationRecord has all the information about the error included the original line and column range in the original source that this error was encountered in. The value is that the parser is able to interpret all of the expansion events from precompilers and includes to determine accurate token locations in the origination source file whose path is provided in the fileLocation.

If the eventf is not stored in a local file, using the more general ISequentialFileReader on the general parser.parse(fileReader: ISequentialFileReader, markerCreator?: IMarkerCreator) method. The readNextLine() method can use sockets, read from an array, or any arbitrary mechanism to get the contents of the eventf, one record at a time.

export interface ISequentialFileReader {
	readNextLine(): string | undefined;
}

For full access to every record that was parsed in the eventf, set an implementation of IProcessor on the parser using the parser.setProcessor() method.