|
| 1 | +/* |
| 2 | +BSD License |
| 3 | +
|
| 4 | +Copyright (c) 2020, Tom Everett |
| 5 | +All rights reserved. |
| 6 | +
|
| 7 | +Redistribution and use in source and binary forms, with or without |
| 8 | +modification, are permitted provided that the following conditions |
| 9 | +are met: |
| 10 | +
|
| 11 | +1. Redistributions of source code must retain the above copyright |
| 12 | + notice, this list of conditions and the following disclaimer. |
| 13 | +2. Redistributions in binary form must reproduce the above copyright |
| 14 | + notice, this list of conditions and the following disclaimer in the |
| 15 | + documentation and/or other materials provided with the distribution. |
| 16 | +3. Neither the name of Tom Everett nor the names of its contributors |
| 17 | + may be used to endorse or promote products derived from this software |
| 18 | + without specific prior written permission. |
| 19 | +
|
| 20 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 21 | +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 22 | +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 23 | +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 24 | +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 25 | +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 26 | +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 27 | +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 28 | +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 29 | +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 30 | +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 31 | +*/ |
| 32 | +grammar guitartab; |
| 33 | + |
| 34 | +tab |
| 35 | + : string+ |
| 36 | + ; |
| 37 | + |
| 38 | +string |
| 39 | + : note (position FRET)+ |
| 40 | + ; |
| 41 | + |
| 42 | +position |
| 43 | + : (FINGER | BARLNE)+ |
| 44 | + ; |
| 45 | + |
| 46 | +note |
| 47 | + : BA |
| 48 | + | BB |
| 49 | + | BC |
| 50 | + | BD |
| 51 | + | BE |
| 52 | + | BF |
| 53 | + | BG |
| 54 | + | LA |
| 55 | + | LB |
| 56 | + | LC |
| 57 | + | LD |
| 58 | + | LE |
| 59 | + | LF |
| 60 | + | LG |
| 61 | + ; |
| 62 | + |
| 63 | +BA |
| 64 | + : 'A' |
| 65 | + ; |
| 66 | + |
| 67 | +BB |
| 68 | + : 'B' |
| 69 | + ; |
| 70 | + |
| 71 | +BC |
| 72 | + : 'C' |
| 73 | + ; |
| 74 | + |
| 75 | +BD |
| 76 | + : 'D' |
| 77 | + ; |
| 78 | + |
| 79 | +BE |
| 80 | + : 'E' |
| 81 | + ; |
| 82 | + |
| 83 | +BF |
| 84 | + : 'F' |
| 85 | + ; |
| 86 | + |
| 87 | +BG |
| 88 | + : 'G' |
| 89 | + ; |
| 90 | + |
| 91 | +LA |
| 92 | + : 'a' |
| 93 | + ; |
| 94 | + |
| 95 | +LB |
| 96 | + : 'b' |
| 97 | + ; |
| 98 | + |
| 99 | +LC |
| 100 | + : 'c' |
| 101 | + ; |
| 102 | + |
| 103 | +LD |
| 104 | + : 'd' |
| 105 | + ; |
| 106 | + |
| 107 | +LE |
| 108 | + : 'e' |
| 109 | + ; |
| 110 | + |
| 111 | +LF |
| 112 | + : 'f' |
| 113 | + ; |
| 114 | + |
| 115 | +LG |
| 116 | + : 'g' |
| 117 | + ; |
| 118 | + |
| 119 | +FINGER |
| 120 | + : 'x' |
| 121 | + | 'o' |
| 122 | + ; |
| 123 | + |
| 124 | +BARLNE |
| 125 | + : '-' |
| 126 | + ; |
| 127 | + |
| 128 | +FRET |
| 129 | + : '|' |
| 130 | + ; |
| 131 | + |
| 132 | +WHITESPACE |
| 133 | + : (' ' | '\t' | '\n')+ -> skip |
| 134 | + ; |
| 135 | + |
0 commit comments