Parse fleet lists for Star Wars: Armada
This module includes parsers for the text export formats used by some popular list-building apps for Armada:
The parsers return a JSON structure encoding the fleet list, including ships, upgrades, squadrons, objectives, and other data.
A goal of this project is to create increasingly consistent output from a larger number of export formats. Though the different apps export different data to some degree, these parsers attempt to normalize the output into a consistent schema, so that a fleet generated with any of the apps will produce (mostly) the same JSON.
pegjs
, mocha
(for testing)Parsers are written in a parsing expression grammar, which pegjs
turns into a JavaScript class implementing a parser. For example:
pegjs armada-warlords-fleet.pegjs
will produce armada-warlords-fleet.js
, which implements the parser for Armada Warlords.
See test/test.js
for examples.
Just run npm test
.
All the Star Wars stuff is Copyright & Trademark Lucasfilm Ltd. Please Lord, don't let The Mouse sue me.