-
Notifications
You must be signed in to change notification settings - Fork 0
Metasyntax and BNF Grammar
Umberto Paramento edited this page May 26, 2016
·
5 revisions
Navigate this page:
A metasyntax is defined by nonterminal symbols and terminal symbols.
- START - Necessary to define the beginning of our semantic;
- TITLE - Title of the song;
- AUTHOR - Author of the song (field not mandatory);
- BAR - Beat expressed in quarters (x/4);
- SOUND - Every possible sound that defines a song, can by any of the following:
- NOTE - Single note;
- CHORD - Simply a chord;
- POWERCHORD - Definition of Power Chord;
- STRUMMING - Definition of Strumming;
- SLIDEUP - Definition of Slide Up;
- SLIDEDOWN - Definition of Slide Down;
- HAMMER - Definition of Hammer-On;
- PULLOFF - Definition of Pull-Off;
- PAUSE_G - A graphical pause;
- NEWLINE - Produces a line break.
The terminal symbols we'll use are:
- Numbers from 1 to 4 for defining the beat;
- Numbers from 1 to 24 for defining the frets;
- Numbers from 1 to 6 for defining strings;
- Characters from 'A' to 'G' for defining notes;
- Words pause and pause_g for defining the normal pause and the graphical pause;
- Word newline in order to start a new line;
- All the words from the dictionary for defining Author and title of the song;
- Some useful symbols suchs as '(' ')' ','.
| START | → | OUT |
|---|---|---|
| S | → | START |
| START | → | TITLE |
| TITLE | → | '(' WORD ')'AUTHOR |
| TITLE | → | '(' WORD ')'BAR |
| AUTHOR | → | '(' WORD ')'BAR |
| BAR | → | '(' A '/' A ')' SOUND |
| SOUND | → | SOUND |
| SOUND | → | NOTE |
| NOTE | → | '(' T ',' F ')' |
| SOUND | → | CHORD |
| CHORD | → | '(' C ')' |
| SOUND | → | POWERCHORD |
| POWERCHORD | → | '(' T ',' F ')' |
| SOUND | → | STRUMMING |
| STRUMMING | → | '(' F ',' F ',' F ',' F ',' F ',' F ')' |
| SOUND | → | SLIDEUP |
| SLIDEUP | → | '(' C ',' F ',' F ')' |
| SOUND | → | SLIDEDOWN |
| SLIDEDOWN | → | '(' C ',' F ',' F ')' |
| SOUND | → | HAMMER |
| HAMMER | → | '(' C ',' F ',' F ')' |
| SOUND | → | PULLOFF |
| PULLOFF | → | '(' C ',' F ',' F ')' |
| SOUND | → | PAUSE |
| PAUSE | → | 'pause' |
| SOUND | → | PAUSE_G |
| SOUND | → | 'pause_g' |
| SOUND | → | NEWLINE |
| NEWLINE | -> | 'newline' |
| A (beAt) | → | 1..4 |
| F (Fret) | → | 1..24 |
| T (sTring) | → | 1..6 |
| C (Chord) | → | 'A'..'G' |
| WORD | → | All the vocabulary |