remove package-lock and correct readme
This commit is contained in:
parent
6fbe357ab9
commit
e56a8a7d9a
2 changed files with 10 additions and 270 deletions
57
README.md
57
README.md
|
@ -1,32 +1,19 @@
|
|||
# LEMON.JS - LALR(1) Parser Generator for JavaScript
|
||||
|
||||
Lemon.JS is an LALR(1) parser generator for JavaScript based on Lemon parser generator for C included in SQLite package distribution.
|
||||
|
||||
## Parser Code Base
|
||||
|
||||
Files `lemon.c`, `lempar.c`, `lemon.html` are extracted from SQLite v3.17.0. Original parser generator code is slightly fixed to produce JavaScript compatible statements. Parser template translated from C to JavaScript. Source comments mostly not touched to keep it easy diff against original file.
|
||||
|
||||
Both original C version and patched JS version are included for side by side comparison for reference.
|
||||
|
||||
## Installation
|
||||
|
||||
Compile lenon-js.c with any C compiler and place in anywhere with lempar.js side by side.
|
||||
|
||||
## Compilation
|
||||
|
||||
Prerequisites: C compiler, for example GCC.
|
||||
|
||||
## Compile lemon-js
|
||||
```bash
|
||||
gcc -o lemon-js -O2 lemon-js.c
|
||||
gcc -o ./lemon-src/lemon-js -O2 ./lemon-src/lemon-js.c
|
||||
|
||||
npm install
|
||||
```
|
||||
|
||||
## Usage
|
||||
## Start
|
||||
You need create your config.js from config.template
|
||||
|
||||
```bash
|
||||
lemon-js <filename>.y
|
||||
npm main --c=<your_config>.js --t=<web|node>
|
||||
```
|
||||
|
||||
See http://www.hwaci.com/sw/lemon/lemon.html for more details.
|
||||
default config -> config.js
|
||||
|
||||
## Special Directives
|
||||
|
||||
|
@ -56,29 +43,5 @@ See lemon.html for additional documentation.
|
|||
- %wildcard - Define WILDCARD token.
|
||||
- %token_class - **NOT SUPPORTED**
|
||||
|
||||
Notes:
|
||||
|
||||
- some expressions, for example, regular expression `/\*/` could break lemon parser in `%code` or `%include` sections.
|
||||
- the best place to put something like `module.exports = ParserName;` or `export default ParserName;` is in `%code` section.
|
||||
|
||||
## TODO
|
||||
|
||||
- add some tests for different options
|
||||
- document variables
|
||||
- YYNOERRORRECOVERY ?
|
||||
- YYERRORSYMBOL ?
|
||||
- rename methods, variables, get rid of YY prefixes?
|
||||
- enable asserts, could be usefull for testing
|
||||
|
||||
## Alternative Lexers
|
||||
|
||||
- https://github.com/tantaman/lexed.js
|
||||
- https://github.com/aaditmshah/lexer
|
||||
- https://github.com/YuhangGe/jslex
|
||||
|
||||
## Alternative Parsers
|
||||
|
||||
- https://github.com/sormy/flex-js
|
||||
- http://jscc.brobston.com
|
||||
- http://zaach.github.io/jison/
|
||||
- https://pegjs.org
|
||||
## Original project
|
||||
See https://github.com/sormy/lemon-js.
|
Loading…
Add table
Add a link
Reference in a new issue