Motivations

While pure text rulings are nice for humans, it is quite hard for a computer to make sense of the abilities of MTG cards while only reading text. Converting this text into an AST makes this task way easier, since trees are data structures that are easy to work with from a machine standpoint. Generating AST for cards allows for all kind of automation on such cards, like generating code to handle a card's effects, make statistics, or look for subtrees to find cards that synergise well with each other (hello, Hexxed).

Implementation

The project is built in Rust, for it's strong type system and expressiveness that matches well the complexity of MTG abilities. The documentation for the project can be found here.

As of me writing this, the entire project is still very much in the prototyping phase, and can currently only handle 2k of the ~37k cards in MTG. The goal is to be able to parse every single card. The coverage is kept up to date on the README of the project's repo.