oracle-plsql-parser
TypeScript icon, indicating that this package has built-in type declarations

0.1.13 • Public • Published

PL/SQL-Parser

Test

This parser is a work in progress. Valid code may be marked as invalid.

My current goal is to make the lexing and parsing work for most projects. Better error messages are for now a problem of the future.

You are welcome to contribute, I am happy with every help :)

About

Lexer, parser and interpreter for Oracle PL/SQL.

This parser is build for basic code introspection and coding assistance. This means that it won't act 1:1 the same as the DB internal parser. My goal is more to not have false negative than false positives. For example parsing values is way more forgiving resulting in no errors from this parser where the DB parser would.

The interpreter gives an object with insights about the code. For example which packages are included, their functions / procedures + their parameters. All with position info. I am using this to build a VS Code Plugin with a Language Server.

Usage

import parse, { getInterpretation } from 'oracle-plsql-parser';

const code = `begin ... end;`;

// 2nd parameters logs errors to console
const {errors, cst} = parse(text, true);

// interpreter returns object with infos about the code
const interpreted = plSqlInterpreter.visit(cst);
console.log(interpreted);

Installation

npm i oracle-plsql-parser@latest

Diagram

Currently broken and not updated

https://phartenfeller.github.io/plsql-parser/

References

Readme

Keywords

none

Package Sidebar

Install

npm i oracle-plsql-parser

Weekly Downloads

1

Version

0.1.13

License

Apache-2.0

Unpacked Size

392 kB

Total Files

141

Last publish

Collaborators

  • phartenfeller