- Changed to table formatting
This commit is contained in:
Tristan B. Velloza Kildaire 2023-07-09 16:44:54 +02:00
parent 1eb58a4bf3
commit bf37603077
2 changed files with 19 additions and 33 deletions

View File

@ -149,11 +149,7 @@ unittest
}
```
#### performLex()
TODO: This is going to change sometime soonish, so I want the final
version of how it works here. I may as well, however, give a brief
explanation as I doubt *much* will change - only specific parsing cases.
#### Using `performLex()`
This method contains a looping structure which will read
character-by-character from the `sourceCode` string and follow the rules
@ -186,23 +182,15 @@ position += 2;
Helper functions relating to character and token availability.
1. `hasToken()`
- Returns `true` if there is a token currently built
i.e. `currentToken.length != 0`, `false` otherwise.
2. `isBackward()`
- Returns `true` if we can move the character pointer backwards,
`false` otherwise.
3. `isForward()`
- Returns `true` if we can move the character pointer forward,
`false` otherwise.
4. `isNumericalStr()`
- This method is called in order to chck if the build up,
`currentToken`, is a valid numerical string. If the string is
empty, then it returns `false`. If the string is non-empty and
contains anything other than digits then it returns `false`,
otherwise is returns `true`.
| Method name | Return type | Description |
|--------------------|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `hasToken()` | `bool` | Returns `true` if there is a token currently built i.e. `currentToken.length != 0`, `false` otherwise. |
| `isBackward()` | `bool` | Returns `true` if we can move the character pointer backwards, `false` otherwise. |
| `isForward()` | `bool` | Returns `true` if we can move the character pointer forward, `false` otherwise. |
| `isNumericalStr()` | `bool` | This method is called in order to chck if the build up, `currentToken`, is a valid numerical string. If the string is empty, then it returns `false`. If the string is non-empty and contains anything other than digits then it returns `false`, otherwise is returns `true`. |
TODO
TODO: There are probably some missing but the above are the most
general/used helper methods
#### isSpliter()

View File

@ -123,9 +123,7 @@ unittest
}
```
#### performLex()
TODO: This is going to change sometime soonish, so I want the final version of how it works here. I may as well, however, give a brief explanation as I doubt _much_ will change - only specific parsing cases.
#### Using `performLex()`
This method contains a looping structure which will read character-by-character from the `sourceCode` string and follow the rules of the grammar (TODO: add link), looping whilst there are still characters available for consumption (`position < sourceCode.length`).
@ -148,16 +146,16 @@ position += 2;
Helper functions relating to character and token availability.
1. `hasToken()`
* Returns `true` if there is a token currently built i.e. `currentToken.length != 0`, `false` otherwise.
2. `isBackward()`
* Returns `true` if we can move the character pointer backwards, `false` otherwise.
3. `isForward()`
* Returns `true` if we can move the character pointer forward, `false` otherwise.
4. `isNumericalStr()`
* This method is called in order to chck if the build up, `currentToken`, is a valid numerical string. If the string is empty, then it returns `false`. If the string is non-empty and contains anything other than digits then it returns `false`, otherwise is returns `true`.
| Method name | Return type | Description |
|-------------------------------|---------------|--------------------------------------------------------------------------------------------------------|
| `hasToken()` | `bool` | Returns `true` if there is a token currently built i.e. `currentToken.length != 0`, `false` otherwise. |
| `isBackward()` | `bool` | Returns `true` if we can move the character pointer backwards, `false` otherwise. |
| `isForward()` | `bool` | Returns `true` if we can move the character pointer forward, `false` otherwise. |
| `isNumericalStr()` | `bool` | This method is called in order to chck if the build up, `currentToken`, is a valid numerical string. If the string is empty, then it returns `false`. If the string is non-empty and contains anything other than digits then it returns `false`, otherwise is returns `true`. |
TODO
TODO: There are probably some missing but the above are the most general/used helper methods
#### isSpliter()