pegjs-prolog-parser

1.1.2 • Public • Published

PEGjs Prolog Parser

Description

Supports a function called parse which takes in a Prolog string and returns an AST from it. The AST returned is an ASTNode from the asty npm module.

Usage

const parser = require('pegjs-prolog-parser');

const clause = "script(X).";

const result = parser.parse(clause);

console.log(result.dump());

// Result:
//
// Prolog [1,1]
// └── Compound [1,1]
//    ├── Functor (value: "script") [1,1]
//    └── Arguments [1,8]
//        └── Variable (value: "X") [1,8]

Dependencies (3)

Dev Dependencies (2)

Package Sidebar

Install

npm i pegjs-prolog-parser

Weekly Downloads

0

Version

1.1.2

License

MIT

Unpacked Size

15.8 kB

Total Files

12

Last publish

Collaborators

  • rabestudios