Skip to content

Commit

Permalink
Added sample tunes; and eliminated (optionaly) shift-reduce conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
pgeerkens committed May 10, 2016
1 parent 294a74b commit 8052fa6
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 6 deletions.
21 changes: 18 additions & 3 deletions QABCIronyParser/QabcGrammar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public QabcGrammar() : base(false) {
var tempo = new CommandNonTerminal<Notes, byte>(Notes => Notes.Tempo);
var length = new CommandNonTerminal<Notes, byte>(Notes => Notes.Length);
var style = new CommandNonTerminal<Notes, Style>(Notes => Notes.Style);
var octaveNo = new CommandNonTerminal<Notes, byte>(Notes => Notes.Octave);
var octave = new CommandNonTerminal<Notes, byte>(Notes => Notes.Octave);
var shift = new CommandNonTerminal<Notes, OctaveShift>(Notes => Notes.Shift);

var note = new TypedNonTerminal<NoteAstNode>();
Expand Down Expand Up @@ -110,11 +110,11 @@ public QabcGrammar() : base(false) {
| FieldKeyLine
#endif
;
direction.Rule = length | octaveNo | style | tempo | shift | ModePlay;
direction.Rule = length | octave | style | tempo | shift | ModePlay;
length.Rule = Length + Integer;
style.Rule = Mode + ModeStyle;
tempo.Rule = Tempo + Integer;
octaveNo.Rule = Octave + Integer;
octave.Rule = Octave + Integer;
shift.Rule = Shift;

beam.Rule = MakePlusList<BeamAstNode>(note);
Expand Down Expand Up @@ -162,6 +162,21 @@ public QabcGrammar() : base(false) {
);
#endregion 4-Color Highlighting

#region Clear shift-reduce conflicts
#if !ClearConflict
RegisterOperators(10, Associativity.Right, Length);
RegisterOperators(10, Associativity.Right, Mode);
RegisterOperators(10, Associativity.Right, Tempo);
RegisterOperators(10, Associativity.Right, Octave);
RegisterOperators(10, Associativity.Right, Shift);
RegisterOperators(10, Associativity.Right, ModePlay);

RegisterOperators(10, Associativity.Right, Note);
RegisterOperators(10, Associativity.Right, NoteLetter);
RegisterOperators(10, Associativity.Right, Rest);
#endif
#endregion

LanguageFlags = LanguageFlags.CreateAst | LanguageFlags.NewLineBeforeEOF;
}

Expand Down
15 changes: 12 additions & 3 deletions QABCIronyParser/QabcIronyParser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,18 @@
</ItemGroup>
<ItemGroup>
<None Include="QabcPlayMidi.snk" />
<None Include="WillTell.qabc">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Sample Tunes\Can You Recognize It.qabc" />
<None Include="Sample Tunes\Doe, A Deer.qabc" />
<None Include="Sample Tunes\Ecuador.qabc" />
<None Include="Sample Tunes\Funeral March.qabc" />
<None Include="Sample Tunes\God Save The Queen.qabc" />
<None Include="Sample Tunes\Jingle Bells.qabc" />
<None Include="Sample Tunes\Macarena.qabc" />
<None Include="Sample Tunes\Popcorn.qabc" />
<None Include="Sample Tunes\Take Me Out To The Ball Game.qabc" />
<None Include="Sample Tunes\The Lion Sleeps Tonight.qabc" />
<None Include="Sample Tunes\William Tell Overture Finale.qabc" />
<None Include="Sample Tunes\Yankee Doodle.qabc" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
12 changes: 12 additions & 0 deletions QABCIronyParser/Sample Tunes/Can You Recognize It.qabc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
T150 L8 MN O3
B>C4MLD2. <B>C<B>E2. PCDE2..EEDCE2. E4G4 ED2.. P8
<G4B>C<B4 A1. P2
B>DD4D<B>DmlE D2P2 mn
EGGE GEMLAG EDD2MNDE
MLBAGED4<BA G2MNGAG4 ML>DC<B2. P1
P1

T150 L16 ML O2
e4 degb >egb>e gb2 b2. g8..f+32f+8p8>d8.<b b4.p8p4
<<f+4 e+f+ab >d+f+b>e+ f+b2 b2. a8..g32g8 >c8.< b16b4.p8p4
<g4.
5 changes: 5 additions & 0 deletions QABCIronyParser/Sample Tunes/Doe, A Deer.qabc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
T180 L4 O4
C.D8E.C8 | ECE2 | D.E8F8F8E8D8 | F1 |
E.F8G.E8 | GEG2 | F.G8A8A8G8F8 | A2..P8 |
G.C8D8E8F8G8 | A1 | A.D8E8F#8G8A8 | B1 |
B.E8F#8G#8A8B8 | >C2.C8<B8 | AFBG | >C<GED | C2.P4 |]
3 changes: 3 additions & 0 deletions QABCIronyParser/Sample Tunes/Ecuador.qabc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MFT150L16
AP8EP8>C<P | BP>D<PBPGP | AP8EP8>C<P | BP>D<PBPGP |
>CP8<GP8>EP | DPEPDP<GP | >CP8<AP8>CP | <BP>CP<BPGP |]
3 changes: 3 additions & 0 deletions QABCIronyParser/Sample Tunes/Funeral March.qabc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MN T100 L8 O1
A4 A. A16 | A4 >C. <B16 | B. A16 A. A16 | A2 |
>C4 C. C16 | C4 E. D16 | D. C16 C. C16 | C2 |]
3 changes: 3 additions & 0 deletions QABCIronyParser/Sample Tunes/God Save The Queen.qabc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MF T60 L8 O3
CCD<B> P16 C16D | EEFE P16 D16C | DC <B> C4 P8 |
CCD<B> P16 C16D | EEFE P16 D16C | DC <B> C4 P8 |]
3 changes: 3 additions & 0 deletions QABCIronyParser/Sample Tunes/Jingle Bells.qabc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
t200l4o4mn
eee2 | eee2 | egc.d8 | e1 | fff.f8 | fee2 | e8e8edd | ed2g. p8 |
eee2 | eee2 | egc.d8 | e1 | fff.f8 | fee2 | e8f8ggf | dc1
3 changes: 3 additions & 0 deletions QABCIronyParser/Sample Tunes/Macarena.qabc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MN T180 O2 L8
C4CCC4CC | CCCCCE<GG> | C4CCC4CC | CCCC<A4G4> |
C4CCC4CC | CCCCE4G4 | G2EPGE | P4C2P4 |]
3 changes: 3 additions & 0 deletions QABCIronyParser/Sample Tunes/Popcorn.qabc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MF T120 L16 O4
C<A#>C<G | D#GC P | >C<A#>C<G | D#GC P |
>CDD#D | D#CDC | D<A#>C<A# | >C<G#>C P4 |]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mn t200 l4 o3
c p>c< | ag e | ml g2. | d2d | mn c p>c | <ag e | ml g2. |
mn ag+a | e fg | a2 f | ml d2d | mn a2a | a b>c | d<b a | ged |
c p>c< | ag e | ml g2. | mn d2d | c2d | efg | ml a2. |
p mn ab | >c. | p. | c. | p. | c<ba | gf+g | ml a2. | b2. | >c2. |]
3 changes: 3 additions & 0 deletions QABCIronyParser/Sample Tunes/The Lion Sleeps Tonight.qabc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
T160 L4
MS F G A8 G A8 | B- A G8 F G8 | MS A G F A MS G1 |
MS F G A8 G A8 | B- A G8 F G8 | MS A G F A MS F1 |]
File renamed without changes.
7 changes: 7 additions & 0 deletions QABCIronyParser/Sample Tunes/Yankee Doodle.qabc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
MN T255 L4 O2
GGAB | GBAD | GGAB | G2F+2 | GGAB | >C<BAG | F+DEF+| G2GP |
EF+ED | EF+G2| DEDC | <B2>D2 | EF+ED | EF+GE | DGF+A | G2GP1 |

MN T255 L4 O3
GGAB | GBAD | GGAB | G2F+2 | GGAB | >C<BAG | F+DEF+ | G2GP |
EF+ED | EF+G2 | DEDC | <B2>D2 | EF+ED | EF+GE | DGF+A | G2GP |]

0 comments on commit 8052fa6

Please sign in to comment.