This commit is contained in:
Aleksey Chichenkov 2019-01-29 13:06:27 +03:00
parent 37563c749f
commit 8ae334254d
2 changed files with 26 additions and 18 deletions

View File

@ -1,30 +1,35 @@
# re2-js-generator
### Install guide
## Install
You need install npm and node v.10;
```bash
npm install
```
Read re2c manual: http://re2c.org/manual/manual.html
### RUN:
./run.sh
## Start
```bash
node main.js -o=<output_path> -t=<web|node> <-nb|--no-beautify>
```
or
node main.js
###Flags
-o=<output_path>
-t=<web|node>
-nb|--no-beautify
```bash
./run.sh
```
Result fill write in <lexer.js> file.
You can test it:
$ node test.js
## Flags
```bash
-o=<output_path>
-t=<web|node>
-nb|--no-beautify
```
## Test
```bash
node test.js
```
## Manual
Read re2c manual: http://re2c.org/manual/manual.html
Report for bugs: rolahd@yandex.ru

View File

@ -1,4 +1,5 @@
var types = [
"SLASH",
"LSB",
"RSB",
"LCB",
@ -167,6 +168,7 @@ Lexer.prototype = {
DELIM = SP|TAB|CR|LF;
LSB = "[";
SLASH = "/";
RSB = "]";
LCB = "(";
RCB = ")";
@ -205,6 +207,7 @@ Lexer.prototype = {
end { this._endOfString(); return; }
SLASH { this._foundLexeme("SLASH"); this._set_next(); return; }
LSB { this._foundLexeme("LSB"); this._set_next(); return; }
RSB { this._foundLexeme("RSB"); this._set_next(); return; }
LCB { this._foundLexeme("LCB"); this._set_next(); return; }