jce-lexer

0.1.0 • Public • Published

node-jce-lexer

Lexical analyzer library for JCE language in NodeJS

Usage

var lexer = require("node-jce-lexer");
var tokenStream = lexer.lexUnit.tokenize(codeText);
/* Now do what you want with token stream */

Token stream is actually an array of tokens. Single token is a single javascript object. Format of a single token is following

{
    "lexeme": "module",
    "row": 5,
    "col": 3,
    "tokenClass": "MODULE",
    "keyword": true,
    "parent": null,
    "child": null
}

parent and child these two are kept so that parse tree can be built using the tokens as nodes.

Readme

Keywords

Package Sidebar

Install

npm i jce-lexer

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

42.5 kB

Total Files

59

Last publish

Collaborators

  • nfer