diff --git a/README.md b/README.md index 62301ee..5cd02eb 100644 --- a/README.md +++ b/README.md @@ -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= -t= <-nb|--no-beautify> +``` or - -node main.js - -###Flags - - -o= - -t= - -nb|--no-beautify - +```bash +./run.sh +``` Result fill write in file. -You can test it: -$ node test.js +## Flags +```bash +-o= +-t= +-nb|--no-beautify +``` +## Test +```bash +node test.js +``` + +## Manual +Read re2c manual: http://re2c.org/manual/manual.html Report for bugs: rolahd@yandex.ru \ No newline at end of file diff --git a/lexer.l b/lexer.l index 01f43da..a634599 100644 --- a/lexer.l +++ b/lexer.l @@ -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; }