Crate gambit_parser

source ·
Expand description

A library for parsing gambit extensive form game (.efg) files

Ths library produces an ExtensiveFormGame, which can then be easily used to model an extensive form game.

In order to minimize memory consumption, this stores references to the underlying string where possible. One side effect is that this is a borrowed struct, and any quoted labels will still have escape sequences in them in the form of EscapedStrs.

This also tries to represent the file as it’s structured, so if a name is attached to an infoset on one node, this won’t propogate the name to other nodes with the same infoset.

Structs

A chance node
A string with backslash escapes in it
A full extensive form game
A player node in the game tree
A terminal node represents the end of a game
An iterator over the true characters of an EscapedStr

Enums

An error that happens while trying to turn a string into an ExtensiveFormGame
An arbitrary node in the game tree
An error that results from something invalid about the parsed extensive form game