| 1 |
# `tokstools` - A TeX/LaTeX set of tools for manipulating tokens |
| 2 |
|
| 3 |
## Notice |
| 4 |
|
| 5 |
This package is still in the experimental stage. Therefore, its behavior is not guaranteed to match the description in the manual, and bugs of varying severity may occur. |
| 6 |
|
| 7 |
Additionally, some features, as well as their syntax, may be subject to change. |
| 8 |
|
| 9 |
It requires any modern engine that supports etex primitives and can therefore be used with either TeX or LaTeX. |
| 10 |
|
| 11 |
## Description |
| 12 |
|
| 13 |
The tokstools package provides tools for manipulating tokens and implements “PEG”-style grammars in TeX. Predefined elementary patterns can be combined to form grammars that search for matches within tokens. |
| 14 |
|
| 15 |
Two categories of macros are provided: |
| 16 |
* those operating on individual tokens (`\toksdo`, `\tokscount`, and `\printtoks`) |
| 17 |
* those operating on tokens that have matched a grammar (`\ifpegmatch`, `\pegcount`, and `\pegreplace`) |
| 18 |
|
| 19 |
These matches can be counted, captured, modified, or replaced. |
| 20 |
|
| 21 |
## License |
| 22 |
|
| 23 |
Released under the LaTeX Project Public License v1.3c or later. See https://www.latex-project.org/lppl.txt |