gambit-parser

Crates.iogambit-parser
lib.rsgambit-parser
version0.2.0
sourcesrc
created_at2022-09-29 20:08:14.813418
updated_at2023-01-14 03:43:28.079464
descriptionparser for gambit efg files
homepage
repositoryhttps://github.com/erikbrinkman/gambit-parser-rs
max_upload_size
id676896
size78,765
Erik Brinkman (erikbrinkman)

documentation

README

Gambit Parser

crates.io docs license tests

A rust parser for gambit extensive form game (.efg) files.

Usage

use gambit_parser::ExtensiveFormGame;
use std::fs::File;
use std::io::Read;

let mut buffer = String::new();
File::open("my path")?.read_to_string(&mut buffer)?;
let parsed: ExtensiveFormGame<'_> = original.as_str().try_into()?;

Remarks

The gambit spec says that the list of actions in chance and player nodes is technically optional. For this to be optional, they would need to be defined for the same infoset in the same file. Handling this case is slightly more difficult and not well documented. Since I couldn't find any examples of a file like this, this specific omission isn't handled.

To Do

Ultimately this represents a data model that could be modified and serialized, but that's not implemented yet. The current version keeps a reference to the underlying file bytes, to implement a full data model there should be an owned version of the ExtensiveFormGame that supports full serialization and modification.

Commit count: 6

cargo fmt