Yarn Parser
Posted: Mon Oct 21, 2024 9:49 pm
I've created a new Yarn parser library that converts Yarn Spinner dialogues into Lua.
https://github.com/SiENcE/yarnparser/
It fully supports the current Yarn Spinner syntax. Additionally, I reverse-engineered the eBNF since there was no official one available (which is unfortunate).
Features
- Parses Yarn scripts into structured node objects
- Groups related content (like choices and their responses)
- Can locate dialogue lines preceding choice groups
Supports:
Previously, there was only this outdated parser, which is no longer compatible with the current yarn syntax.
Pull requests are welcome.
https://github.com/SiENcE/yarnparser/
It fully supports the current Yarn Spinner syntax. Additionally, I reverse-engineered the eBNF since there was no official one available (which is unfortunate).
Features
- Parses Yarn scripts into structured node objects
- Groups related content (like choices and their responses)
- Can locate dialogue lines preceding choice groups
Supports:
- Dialogue lines
- Choices (including nested choices)
- Conditional statements (if/else)
- Variable assignments, declarations, and interpolation
- Commands (jump, set, declare, etc.)
- Comments (both single-line and multi-line)
Previously, there was only this outdated parser, which is no longer compatible with the current yarn syntax.
Pull requests are welcome.