jlex 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,12 +23,12 @@ See https://github.com/ULL-ESIT-PL/jlex/blob/main/README.md for more help
|
|
|
23
23
|
|
|
24
24
|
## Example
|
|
25
25
|
|
|
26
|
-
`jlex` is a tiny wrapper around
|
|
26
|
+
`jlex` is a tiny wrapper around [Zaach jison-lex](https://www.npmjs.com/package/jison-lex) that allows you to use the script
|
|
27
27
|
`jlex` as standalone (`flex` like) processor.
|
|
28
28
|
|
|
29
29
|
Assuming the following lexer in file [examples/example.l](examples/example.l):
|
|
30
30
|
|
|
31
|
-
```
|
|
31
|
+
```js
|
|
32
32
|
comment [/][*](.|[\r\n])*?[*][/]
|
|
33
33
|
%%
|
|
34
34
|
\s+|{comment} /* skip whitespace */
|
|
@@ -97,8 +97,9 @@ When you execute the former program, you get:
|
|
|
97
97
|
|
|
98
98
|
## Using the lexer from a Jison grammar
|
|
99
99
|
|
|
100
|
-
In
|
|
101
|
-
of setting the
|
|
100
|
+
In folder [examples/](examples/) you'll find an example
|
|
101
|
+
of [grammar](examples/grammar.jison#L32-L33) setting the lexer generated by `jlex` from the file
|
|
102
|
+
[examples/example.l](examples/example.l) to be used from the Jison grammar. The key is
|
|
102
103
|
to set the `lex` attribute of the `parser` object to the generated lexer:
|
|
103
104
|
|
|
104
105
|
```js
|