Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 1.47 KB

README.md

File metadata and controls

33 lines (23 loc) · 1.47 KB

armada-fleet-list-parser

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.

Prerequisites

  1. Node and npm
  2. npm modules: pegjs, mocha (for testing)

Generating parsers

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.

Using a parser

See test/test.js for examples.

Testing

Just run npm test.

Legal

All the Star Wars stuff is Copyright & Trademark Lucasfilm Ltd. Please Lord, don't let The Mouse sue me.