Skip to content

Metasyntax and BNF Grammar

Umberto Paramento edited this page May 26, 2016 · 5 revisions

Navigate this page:


Metasyntax

A metasyntax is defined by nonterminal symbols and terminal symbols.

Nonterminal Symbols

Terminal Symbols

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 '(' ')' ','.

BNF Grammar

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

Clone this wiki locally