Siteswap

The Siteswap object is a utility for analyzing siteswap. It is not a constructor and has no properties. All methods of Siteswap are static.

Methods

Siteswap.analyze()
Parses an input string and returns siteswap data.
Siteswap.separate()
Analyzes siteswap data and returns throwing data for each prop.

Siteswap specifications

For reference, I describe the specifications of the pattern to be accepted as a siteswap in HABA format.

Pattern ::= Async | Sync ;
Async ::= EachHand+ ;
EachHand ::= AsyncSimple | AsyncMulti ;
AsyncSimple ::= Even | Odd ;
Even ::= "[02468acegikmoqsuwy]" ;
Odd ::= "[13579bdfhjlnprtvz]" | 'x' ;
AsyncMulti ::= '[' AsyncSimple AsyncSimple+ ']' ;
Sync ::= BothHand+ '*'? ;
BothHand ::= '(' OneHand ',' OneHand ')' ;
OneHand ::= SyncSimple | SyncMulti ;
SyncSimple ::= Even 'x'? ;
SyncMulti ::= '[' SyncSimple SyncSimple+ ']' ;
Space ::= "\s+" ;