Skip to content

Latest commit

 

History

History
23 lines (23 loc) · 1.87 KB

BNF.md

File metadata and controls

23 lines (23 loc) · 1.87 KB
  • <statement list> := <statement>[<statement list>]
  • <statement> := (<input> | <output> | <print>)<location> | <assign><location><value> | <label><jump notation>
  • <operation> := (<add> | <sub> | <mul> | <div>)<value><value> | <location>
  • <location> := any singular note<value>
  • <value> := <lit><literal> | <op><operation>
  • <input> := any singular note | a chord of two notes whose interval is a perfect octave
  • <output> := a chord of three notes where the interval between the lowest and middle notes is greater than or equal to the interval between the middle and highest notes
  • <print> := a chord of three notes where the interval between the lowest and middle notes is strictly less than the interval between the middle and highest notes
  • <add> := a chord of two notes whose interval is a major third, major seventh, or tritone
  • <sub> := a chord of two notes whose interval is a perfect fourth, major second, or minor sixth
  • <mul> := a chord of two notes whose interval is a perfect fifth, minor second, or minor seventh
  • <div> := a chord of two notes whose interval is a major sixth or major third
  • <assign> := a chord of any two notes whose interval is not a perfect octave
  • <label> := a chord of any four notes
  • <jump notation> := <set label> | (<equals> | <not equals> | <greater> | <less>)<value><value>
  • <set label> := a rest | a chord of four or more notes
  • <lit> := chord with odd number of notes (including 1)
  • <op> := chord with even number of notes (not including 0)
  • <literal> := any amount of notes followed by a rest
  • <equals> := any singular note
  • <not equals> := a chord of any 3 notes
  • <greater> := a chord of 2 notes whose interval is an even number of semitones (major second, major third, tritone, etc.)
  • <less> := a chord of 2 notes whose interval is an odd number of semitones (minor second, minor third, perfect fifth, etc.)