readme
This commit is contained in:
parent
37563c749f
commit
8ae334254d
41
README.md
41
README.md
@ -1,30 +1,35 @@
|
|||||||
# re2-js-generator
|
# re2-js-generator
|
||||||
|
|
||||||
### Install guide
|
## Install
|
||||||
You need install npm and node v.10;
|
You need install npm and node v.10;
|
||||||
|
|
||||||
|
```bash
|
||||||
npm install
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
Read re2c manual: http://re2c.org/manual/manual.html
|
## Start
|
||||||
|
```bash
|
||||||
|
node main.js -o=<output_path> -t=<web|node> <-nb|--no-beautify>
|
||||||
### RUN:
|
```
|
||||||
./run.sh
|
|
||||||
|
|
||||||
or
|
or
|
||||||
|
```bash
|
||||||
node main.js
|
./run.sh
|
||||||
|
```
|
||||||
###Flags
|
|
||||||
|
|
||||||
-o=<output_path>
|
|
||||||
-t=<web|node>
|
|
||||||
-nb|--no-beautify
|
|
||||||
|
|
||||||
Result fill write in <lexer.js> file.
|
Result fill write in <lexer.js> file.
|
||||||
|
|
||||||
You can test it:
|
## Flags
|
||||||
$ node test.js
|
```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
|
Report for bugs: rolahd@yandex.ru
|
3
lexer.l
3
lexer.l
@ -1,4 +1,5 @@
|
|||||||
var types = [
|
var types = [
|
||||||
|
"SLASH",
|
||||||
"LSB",
|
"LSB",
|
||||||
"RSB",
|
"RSB",
|
||||||
"LCB",
|
"LCB",
|
||||||
@ -167,6 +168,7 @@ Lexer.prototype = {
|
|||||||
DELIM = SP|TAB|CR|LF;
|
DELIM = SP|TAB|CR|LF;
|
||||||
|
|
||||||
LSB = "[";
|
LSB = "[";
|
||||||
|
SLASH = "/";
|
||||||
RSB = "]";
|
RSB = "]";
|
||||||
LCB = "(";
|
LCB = "(";
|
||||||
RCB = ")";
|
RCB = ")";
|
||||||
@ -205,6 +207,7 @@ Lexer.prototype = {
|
|||||||
|
|
||||||
end { this._endOfString(); return; }
|
end { this._endOfString(); return; }
|
||||||
|
|
||||||
|
SLASH { this._foundLexeme("SLASH"); this._set_next(); return; }
|
||||||
LSB { this._foundLexeme("LSB"); this._set_next(); return; }
|
LSB { this._foundLexeme("LSB"); this._set_next(); return; }
|
||||||
RSB { this._foundLexeme("RSB"); this._set_next(); return; }
|
RSB { this._foundLexeme("RSB"); this._set_next(); return; }
|
||||||
LCB { this._foundLexeme("LCB"); this._set_next(); return; }
|
LCB { this._foundLexeme("LCB"); this._set_next(); return; }
|
||||||
|
Loading…
Reference in New Issue
Block a user