Skip to content
HGARgG-0710 edited this page Mar 28, 2025 · 18 revisions

parsers.js

Welcome to the parsers.js (v0.3) wiki!

Installation

npm install @hgargg-0710/parsers.js

Status

The library is still under active development, so certain definitions may yet be replaced/optimized, and interfaces/implementations can change wildly.

As of the present, it contains ample tools for easy and fast creation of creation of highly modular and maintainable parsers for arbitrarily complex grammars.

More specifically, it includes:

  1. Highly modular recursive descent parsers
  2. Generic Stream types
  3. Generic AST types
  4. Self-modifying parsers
  5. Substantial interface collection
  6. Parsing tables (manually constructed)
  7. Basic utility types (Position, EnumSpace, etc)
  8. Easy regular expression construction
  9. TypeScript support
  10. Basic tree-walking algorithm
  11. Basic validation techniques

Items currently in work for addition:

  1. Its own Regular Expression Engine
  2. Various Common Utility Types
  3. Class-Manager for Stream Types

Currently, the library lacks proper interfaces for:

  1. Bottom-Up Parsing
  2. Non-Recursive Top-Down Parsing
  3. Pattern Matching
  4. Reusable samples for "common usage" patterns
  5. Certain tree-walking Algorithms
  6. Various optimization utilities/types

Also, amongst its existing problems are:

  1. No Peeking for Streams Present
  2. No v flag support for regex module

Usage Tips (Tutorial)

The amount of abstractions present can be somewhat overwhelming, and even obscuring the ultimate purpose of simplifying the user's workflow.

For tips on how to apply the library abstractions successfully, read the Usage Page.

Note: the page will become partially redundant once a full-fledged samples module gets introduced in the future version v0.4

Exports

The library's exports separate onto modules:

  1. classes
  2. utils
  3. regex
  4. constants

It also provides a variety of interfaces

Clone this wiki locally