-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
141 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!-- Generated by documentation.js. Update this documentation by updating the source code. --> | ||
|
||
## API | ||
|
||
**Properties** | ||
|
||
- `token` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** | ||
- `lexer` **Lexer** | ||
- `parser` **Parser** | ||
|
||
### parse | ||
|
||
Parsing the specified input | ||
|
||
**Parameters** | ||
|
||
- `input` | ||
|
||
Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** AST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<!-- Generated by documentation.js. Update this documentation by updating the source code. --> | ||
|
||
## Lexer | ||
|
||
**Parameters** | ||
|
||
- `tokens` | ||
|
||
**Properties** | ||
|
||
- `text` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Current parsed text (attached to current token) | ||
- `offset` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Current offset | ||
- `token` **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number))** Current parsed token | ||
|
||
### read | ||
|
||
Initialize the lexer with specified text | ||
|
||
**Parameters** | ||
|
||
- `input` | ||
|
||
### input | ||
|
||
Consumes a char | ||
|
||
Returns **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** | ||
|
||
### unput | ||
|
||
Revert back the current consumed char | ||
|
||
Returns **void** | ||
|
||
### unlex | ||
|
||
Revert back the current consumed token | ||
|
||
Returns **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number))** the previous token | ||
|
||
### lex | ||
|
||
Consumes the next token (ignores whitespaces) | ||
|
||
Returns **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number))** the current token | ||
|
||
### next | ||
|
||
Eats a token (see lex for public usage) including whitespace | ||
|
||
Returns **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number))** the current token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<!-- Generated by documentation.js. Update this documentation by updating the source code. --> | ||
|
||
## Parser | ||
|
||
**Parameters** | ||
|
||
- `lexer` | ||
|
||
**Properties** | ||
|
||
- `lexer` **[Lexer](#lexer)** | ||
|
||
### parse | ||
|
||
Parses the specified input | ||
|
||
**Parameters** | ||
|
||
- `input` | ||
|
||
Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** AST | ||
|
||
## Lexer | ||
|
||
**Parameters** | ||
|
||
- `tokens` | ||
|
||
**Properties** | ||
|
||
- `text` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Current parsed text (attached to current token) | ||
- `offset` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Current offset | ||
- `token` **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number))** Current parsed token | ||
|
||
### read | ||
|
||
Initialize the lexer with specified text | ||
|
||
**Parameters** | ||
|
||
- `input` | ||
|
||
### input | ||
|
||
Consumes a char | ||
|
||
Returns **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** | ||
|
||
### unput | ||
|
||
Revert back the current consumed char | ||
|
||
Returns **void** | ||
|
||
### unlex | ||
|
||
Revert back the current consumed token | ||
|
||
Returns **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number))** the previous token | ||
|
||
### lex | ||
|
||
Consumes the next token (ignores whitespaces) | ||
|
||
Returns **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number))** the current token | ||
|
||
### next | ||
|
||
Eats a token (see lex for public usage) including whitespace | ||
|
||
Returns **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number))** the current token |