# Generated from kernSpineParser.g4 by ANTLR 4.13.1
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
	from typing import TextIO
else:
	from typing.io import TextIO

def serializedATN():
    return [
        4,1,141,1087,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,
        7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,
        13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,
        20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,
        26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,
        33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,
        39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,
        46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,2,51,7,51,2,52,7,
        52,2,53,7,53,2,54,7,54,2,55,7,55,2,56,7,56,2,57,7,57,2,58,7,58,2,
        59,7,59,2,60,7,60,2,61,7,61,2,62,7,62,2,63,7,63,2,64,7,64,2,65,7,
        65,2,66,7,66,2,67,7,67,2,68,7,68,2,69,7,69,2,70,7,70,2,71,7,71,2,
        72,7,72,2,73,7,73,2,74,7,74,2,75,7,75,2,76,7,76,2,77,7,77,2,78,7,
        78,2,79,7,79,2,80,7,80,2,81,7,81,2,82,7,82,2,83,7,83,2,84,7,84,2,
        85,7,85,2,86,7,86,2,87,7,87,2,88,7,88,2,89,7,89,2,90,7,90,2,91,7,
        91,2,92,7,92,2,93,7,93,2,94,7,94,2,95,7,95,2,96,7,96,2,97,7,97,2,
        98,7,98,2,99,7,99,2,100,7,100,2,101,7,101,2,102,7,102,2,103,7,103,
        2,104,7,104,2,105,7,105,2,106,7,106,2,107,7,107,2,108,7,108,2,109,
        7,109,2,110,7,110,2,111,7,111,2,112,7,112,2,113,7,113,2,114,7,114,
        2,115,7,115,2,116,7,116,2,117,7,117,2,118,7,118,2,119,7,119,2,120,
        7,120,2,121,7,121,2,122,7,122,2,123,7,123,2,124,7,124,2,125,7,125,
        2,126,7,126,2,127,7,127,2,128,7,128,2,129,7,129,2,130,7,130,2,131,
        7,131,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,275,8,1,1,2,1,
        2,1,2,3,2,280,8,2,1,3,1,3,1,4,1,4,3,4,286,8,4,1,5,1,5,1,5,1,5,1,
        5,3,5,293,8,5,1,6,1,6,1,6,3,6,298,8,6,1,7,1,7,3,7,302,8,7,1,8,5,
        8,305,8,8,10,8,12,8,308,9,8,1,8,3,8,311,8,8,1,8,1,8,5,8,315,8,8,
        10,8,12,8,318,9,8,1,9,1,9,3,9,322,8,9,1,10,1,10,1,10,1,10,1,10,1,
        10,1,10,1,10,1,10,1,10,1,10,1,10,1,10,3,10,337,8,10,1,11,1,11,3,
        11,341,8,11,1,11,1,11,1,11,3,11,346,8,11,4,11,348,8,11,11,11,12,
        11,349,1,12,5,12,353,8,12,10,12,12,12,356,9,12,1,12,3,12,359,8,12,
        1,12,5,12,362,8,12,10,12,12,12,365,9,12,1,12,1,12,5,12,369,8,12,
        10,12,12,12,372,9,12,1,12,3,12,375,8,12,1,12,5,12,378,8,12,10,12,
        12,12,381,9,12,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,
        1,13,1,13,3,13,395,8,13,1,14,1,14,1,14,1,14,1,14,1,14,1,15,1,15,
        1,15,1,15,1,15,1,15,1,15,1,15,1,16,1,16,1,17,1,17,1,18,1,18,1,19,
        1,19,1,20,5,20,420,8,20,10,20,12,20,423,9,20,1,21,1,21,1,21,1,21,
        1,21,1,21,1,21,1,21,1,21,3,21,434,8,21,1,22,1,22,1,22,5,22,439,8,
        22,10,22,12,22,442,9,22,1,23,1,23,1,24,1,24,1,25,1,25,1,26,1,26,
        1,27,1,27,1,28,1,28,1,29,1,29,1,30,1,30,1,30,1,30,1,30,3,30,463,
        8,30,1,31,1,31,1,32,1,32,1,33,1,33,1,34,1,34,3,34,473,8,34,1,34,
        1,34,1,34,1,34,1,34,3,34,480,8,34,1,35,1,35,1,35,5,35,485,8,35,10,
        35,12,35,488,9,35,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,
        36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,
        36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,
        36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,
        36,1,36,1,36,1,36,1,36,1,36,4,36,544,8,36,11,36,12,36,545,1,37,1,
        37,1,37,3,37,551,8,37,1,37,1,37,1,37,3,37,556,8,37,1,37,1,37,1,38,
        1,38,1,39,1,39,1,40,4,40,565,8,40,11,40,12,40,566,1,41,1,41,1,42,
        1,42,1,43,1,43,1,43,1,44,1,44,1,45,1,45,1,46,1,46,1,47,1,47,1,47,
        1,48,1,48,1,48,1,49,1,49,1,49,1,50,1,50,3,50,593,8,50,1,50,1,50,
        1,50,3,50,598,8,50,1,51,1,51,1,51,1,52,1,52,3,52,605,8,52,1,52,3,
        52,608,8,52,1,53,1,53,1,54,1,54,1,55,1,55,3,55,616,8,55,1,55,1,55,
        3,55,620,8,55,3,55,622,8,55,1,56,1,56,1,56,5,56,627,8,56,10,56,12,
        56,630,9,56,1,56,1,56,3,56,634,8,56,1,57,1,57,1,58,1,58,1,59,1,59,
        1,60,1,60,1,60,3,60,645,8,60,1,61,1,61,1,61,1,61,3,61,651,8,61,1,
        62,1,62,3,62,655,8,62,1,62,1,62,3,62,659,8,62,1,62,3,62,662,8,62,
        3,62,664,8,62,1,63,1,63,3,63,668,8,63,1,64,1,64,3,64,672,8,64,1,
        65,1,65,1,65,1,65,1,65,1,65,1,65,3,65,681,8,65,1,66,1,66,1,66,1,
        66,1,67,1,67,1,67,1,67,1,68,1,68,1,68,1,68,1,69,1,69,1,69,1,69,1,
        70,1,70,1,70,1,70,1,71,1,71,1,71,1,71,1,72,1,72,1,72,1,72,1,73,1,
        73,1,73,1,73,1,73,1,73,3,73,717,8,73,1,73,1,73,3,73,721,8,73,1,74,
        1,74,1,75,1,75,1,76,1,76,1,76,1,76,1,77,1,77,1,77,4,77,734,8,77,
        11,77,12,77,735,1,77,1,77,1,77,1,78,1,78,1,78,4,78,744,8,78,11,78,
        12,78,745,1,79,1,79,1,79,4,79,751,8,79,11,79,12,79,752,1,80,1,80,
        1,80,3,80,758,8,80,1,81,1,81,1,81,1,81,1,82,1,82,1,82,1,82,3,82,
        768,8,82,1,82,1,82,1,83,1,83,1,83,3,83,775,8,83,1,84,4,84,778,8,
        84,11,84,12,84,779,1,85,1,85,1,85,1,85,3,85,786,8,85,1,86,1,86,1,
        87,1,87,3,87,792,8,87,1,87,3,87,795,8,87,1,87,3,87,798,8,87,1,87,
        3,87,801,8,87,1,87,3,87,804,8,87,1,87,3,87,807,8,87,1,87,3,87,810,
        8,87,1,87,3,87,813,8,87,1,87,3,87,816,8,87,1,87,3,87,819,8,87,1,
        88,1,88,1,88,1,88,1,88,3,88,826,8,88,1,88,1,88,1,88,1,88,1,88,1,
        88,3,88,834,8,88,1,88,1,88,1,88,1,88,1,88,1,88,3,88,842,8,88,1,88,
        1,88,1,88,1,88,1,88,1,88,1,88,1,88,1,88,1,88,3,88,854,8,88,1,89,
        1,89,1,90,1,90,5,90,860,8,90,10,90,12,90,863,9,90,1,90,1,90,3,90,
        867,8,90,1,91,1,91,1,92,1,92,1,92,3,92,874,8,92,1,93,1,93,1,94,1,
        94,3,94,880,8,94,1,95,1,95,1,96,3,96,885,8,96,1,97,1,97,3,97,889,
        8,97,1,98,1,98,1,99,1,99,1,100,1,100,1,100,3,100,898,8,100,1,100,
        3,100,901,8,100,1,101,1,101,1,101,1,101,1,101,1,101,1,101,1,101,
        1,101,1,101,1,101,1,101,1,101,1,101,1,101,1,101,1,101,1,101,1,101,
        1,101,1,101,1,101,1,101,1,101,1,101,1,101,1,101,1,101,1,101,1,101,
        3,101,933,8,101,1,102,1,102,3,102,937,8,102,1,103,1,103,1,104,1,
        104,3,104,943,8,104,1,105,4,105,946,8,105,11,105,12,105,947,1,106,
        4,106,951,8,106,11,106,12,106,952,1,107,1,107,1,107,3,107,958,8,
        107,3,107,960,8,107,1,107,1,107,1,107,3,107,965,8,107,3,107,967,
        8,107,1,107,3,107,970,8,107,1,108,1,108,1,108,1,108,1,108,1,108,
        1,108,1,108,3,108,980,8,108,1,108,1,108,3,108,984,8,108,3,108,986,
        8,108,1,109,1,109,1,110,1,110,1,111,1,111,1,112,1,112,1,112,1,112,
        1,112,1,112,3,112,1000,8,112,1,113,1,113,1,114,1,114,1,115,1,115,
        1,116,1,116,1,117,1,117,1,118,1,118,1,119,1,119,5,119,1016,8,119,
        10,119,12,119,1019,9,119,1,119,3,119,1022,8,119,1,119,3,119,1025,
        8,119,1,120,5,120,1028,8,120,10,120,12,120,1031,9,120,1,120,1,120,
        3,120,1035,8,120,1,121,1,121,1,121,3,121,1040,8,121,3,121,1042,8,
        121,1,122,1,122,1,123,1,123,1,124,5,124,1049,8,124,10,124,12,124,
        1052,9,124,1,124,1,124,1,125,1,125,1,126,1,126,1,127,1,127,1,128,
        1,128,3,128,1064,8,128,1,129,1,129,1,129,1,129,3,129,1070,8,129,
        1,129,3,129,1073,8,129,1,130,1,130,3,130,1077,8,130,1,130,3,130,
        1080,8,130,1,131,4,131,1083,8,131,11,131,12,131,1084,1,131,0,0,132,
        0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,
        46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,
        90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,
        126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,
        158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,
        190,192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,
        222,224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,
        254,256,258,260,262,0,23,1,0,135,135,1,0,15,16,1,0,23,24,1,0,25,
        26,1,0,27,28,1,0,33,36,2,0,20,20,22,22,1,0,17,19,1,0,97,106,1,0,
        70,76,1,0,44,50,4,0,46,46,49,50,59,59,63,63,1,0,98,102,2,0,11,11,
        32,32,6,0,46,46,58,58,87,87,99,100,122,123,129,129,2,0,120,120,122,
        122,1,0,127,128,2,0,59,59,85,85,1,0,116,117,2,0,62,62,132,132,2,
        0,115,115,128,128,1,0,129,130,2,0,53,55,80,80,1213,0,264,1,0,0,0,
        2,274,1,0,0,0,4,279,1,0,0,0,6,281,1,0,0,0,8,285,1,0,0,0,10,292,1,
        0,0,0,12,297,1,0,0,0,14,301,1,0,0,0,16,306,1,0,0,0,18,319,1,0,0,
        0,20,336,1,0,0,0,22,340,1,0,0,0,24,354,1,0,0,0,26,394,1,0,0,0,28,
        396,1,0,0,0,30,402,1,0,0,0,32,410,1,0,0,0,34,412,1,0,0,0,36,414,
        1,0,0,0,38,416,1,0,0,0,40,421,1,0,0,0,42,433,1,0,0,0,44,435,1,0,
        0,0,46,443,1,0,0,0,48,445,1,0,0,0,50,447,1,0,0,0,52,449,1,0,0,0,
        54,451,1,0,0,0,56,453,1,0,0,0,58,455,1,0,0,0,60,457,1,0,0,0,62,464,
        1,0,0,0,64,466,1,0,0,0,66,468,1,0,0,0,68,470,1,0,0,0,70,481,1,0,
        0,0,72,543,1,0,0,0,74,547,1,0,0,0,76,559,1,0,0,0,78,561,1,0,0,0,
        80,564,1,0,0,0,82,568,1,0,0,0,84,570,1,0,0,0,86,572,1,0,0,0,88,575,
        1,0,0,0,90,577,1,0,0,0,92,579,1,0,0,0,94,581,1,0,0,0,96,584,1,0,
        0,0,98,587,1,0,0,0,100,590,1,0,0,0,102,599,1,0,0,0,104,602,1,0,0,
        0,106,609,1,0,0,0,108,611,1,0,0,0,110,621,1,0,0,0,112,623,1,0,0,
        0,114,635,1,0,0,0,116,637,1,0,0,0,118,639,1,0,0,0,120,644,1,0,0,
        0,122,646,1,0,0,0,124,652,1,0,0,0,126,665,1,0,0,0,128,669,1,0,0,
        0,130,680,1,0,0,0,132,682,1,0,0,0,134,686,1,0,0,0,136,690,1,0,0,
        0,138,694,1,0,0,0,140,698,1,0,0,0,142,702,1,0,0,0,144,706,1,0,0,
        0,146,710,1,0,0,0,148,722,1,0,0,0,150,724,1,0,0,0,152,726,1,0,0,
        0,154,730,1,0,0,0,156,740,1,0,0,0,158,747,1,0,0,0,160,754,1,0,0,
        0,162,759,1,0,0,0,164,763,1,0,0,0,166,774,1,0,0,0,168,777,1,0,0,
        0,170,781,1,0,0,0,172,787,1,0,0,0,174,789,1,0,0,0,176,853,1,0,0,
        0,178,855,1,0,0,0,180,857,1,0,0,0,182,868,1,0,0,0,184,870,1,0,0,
        0,186,875,1,0,0,0,188,877,1,0,0,0,190,881,1,0,0,0,192,884,1,0,0,
        0,194,886,1,0,0,0,196,890,1,0,0,0,198,892,1,0,0,0,200,897,1,0,0,
        0,202,932,1,0,0,0,204,934,1,0,0,0,206,938,1,0,0,0,208,942,1,0,0,
        0,210,945,1,0,0,0,212,950,1,0,0,0,214,969,1,0,0,0,216,985,1,0,0,
        0,218,987,1,0,0,0,220,989,1,0,0,0,222,991,1,0,0,0,224,999,1,0,0,
        0,226,1001,1,0,0,0,228,1003,1,0,0,0,230,1005,1,0,0,0,232,1007,1,
        0,0,0,234,1009,1,0,0,0,236,1011,1,0,0,0,238,1024,1,0,0,0,240,1029,
        1,0,0,0,242,1041,1,0,0,0,244,1043,1,0,0,0,246,1045,1,0,0,0,248,1050,
        1,0,0,0,250,1055,1,0,0,0,252,1057,1,0,0,0,254,1059,1,0,0,0,256,1061,
        1,0,0,0,258,1072,1,0,0,0,260,1079,1,0,0,0,262,1082,1,0,0,0,264,265,
        3,2,1,0,265,1,1,0,0,0,266,275,3,4,2,0,267,275,3,6,3,0,268,275,3,
        8,4,0,269,275,3,174,87,0,270,275,3,14,7,0,271,275,3,42,21,0,272,
        275,3,26,13,0,273,275,3,28,14,0,274,266,1,0,0,0,274,267,1,0,0,0,
        274,268,1,0,0,0,274,269,1,0,0,0,274,270,1,0,0,0,274,271,1,0,0,0,
        274,272,1,0,0,0,274,273,1,0,0,0,275,3,1,0,0,0,276,280,3,24,12,0,
        277,280,3,16,8,0,278,280,3,22,11,0,279,276,1,0,0,0,279,277,1,0,0,
        0,279,278,1,0,0,0,280,5,1,0,0,0,281,282,3,100,50,0,282,7,1,0,0,0,
        283,286,3,10,5,0,284,286,3,12,6,0,285,283,1,0,0,0,285,284,1,0,0,
        0,286,9,1,0,0,0,287,293,3,102,51,0,288,293,3,146,73,0,289,293,3,
        164,82,0,290,293,3,118,59,0,291,293,3,112,56,0,292,287,1,0,0,0,292,
        288,1,0,0,0,292,289,1,0,0,0,292,290,1,0,0,0,292,291,1,0,0,0,293,
        11,1,0,0,0,294,298,3,48,24,0,295,298,3,122,61,0,296,298,3,170,85,
        0,297,294,1,0,0,0,297,295,1,0,0,0,297,296,1,0,0,0,298,13,1,0,0,0,
        299,302,3,172,86,0,300,302,3,46,23,0,301,299,1,0,0,0,301,300,1,0,
        0,0,302,15,1,0,0,0,303,305,3,20,10,0,304,303,1,0,0,0,305,308,1,0,
        0,0,306,304,1,0,0,0,306,307,1,0,0,0,307,310,1,0,0,0,308,306,1,0,
        0,0,309,311,3,180,90,0,310,309,1,0,0,0,310,311,1,0,0,0,311,312,1,
        0,0,0,312,316,3,18,9,0,313,315,3,20,10,0,314,313,1,0,0,0,315,318,
        1,0,0,0,316,314,1,0,0,0,316,317,1,0,0,0,317,17,1,0,0,0,318,316,1,
        0,0,0,319,321,5,87,0,0,320,322,5,87,0,0,321,320,1,0,0,0,321,322,
        1,0,0,0,322,19,1,0,0,0,323,337,3,240,120,0,324,337,3,194,97,0,325,
        337,3,190,95,0,326,337,3,178,89,0,327,337,3,182,91,0,328,337,3,238,
        119,0,329,337,3,248,124,0,330,337,3,236,118,0,331,337,3,206,103,
        0,332,337,3,186,93,0,333,334,3,254,127,0,334,335,5,79,0,0,335,337,
        1,0,0,0,336,323,1,0,0,0,336,324,1,0,0,0,336,325,1,0,0,0,336,326,
        1,0,0,0,336,327,1,0,0,0,336,328,1,0,0,0,336,329,1,0,0,0,336,330,
        1,0,0,0,336,331,1,0,0,0,336,332,1,0,0,0,336,333,1,0,0,0,337,21,1,
        0,0,0,338,341,3,24,12,0,339,341,3,16,8,0,340,338,1,0,0,0,340,339,
        1,0,0,0,341,347,1,0,0,0,342,345,3,192,96,0,343,346,3,24,12,0,344,
        346,3,16,8,0,345,343,1,0,0,0,345,344,1,0,0,0,346,348,1,0,0,0,347,
        342,1,0,0,0,348,349,1,0,0,0,349,347,1,0,0,0,349,350,1,0,0,0,350,
        23,1,0,0,0,351,353,3,202,101,0,352,351,1,0,0,0,353,356,1,0,0,0,354,
        352,1,0,0,0,354,355,1,0,0,0,355,358,1,0,0,0,356,354,1,0,0,0,357,
        359,3,180,90,0,358,357,1,0,0,0,358,359,1,0,0,0,359,363,1,0,0,0,360,
        362,3,202,101,0,361,360,1,0,0,0,362,365,1,0,0,0,363,361,1,0,0,0,
        363,364,1,0,0,0,364,366,1,0,0,0,365,363,1,0,0,0,366,370,3,208,104,
        0,367,369,3,202,101,0,368,367,1,0,0,0,369,372,1,0,0,0,370,368,1,
        0,0,0,370,371,1,0,0,0,371,374,1,0,0,0,372,370,1,0,0,0,373,375,3,
        188,94,0,374,373,1,0,0,0,374,375,1,0,0,0,375,379,1,0,0,0,376,378,
        3,202,101,0,377,376,1,0,0,0,378,381,1,0,0,0,379,377,1,0,0,0,379,
        380,1,0,0,0,380,25,1,0,0,0,381,379,1,0,0,0,382,395,3,94,47,0,383,
        395,3,90,45,0,384,395,3,88,44,0,385,395,3,92,46,0,386,395,3,96,48,
        0,387,395,3,98,49,0,388,395,3,76,38,0,389,395,3,78,39,0,390,395,
        3,74,37,0,391,395,3,68,34,0,392,395,3,50,25,0,393,395,3,58,29,0,
        394,382,1,0,0,0,394,383,1,0,0,0,394,384,1,0,0,0,394,385,1,0,0,0,
        394,386,1,0,0,0,394,387,1,0,0,0,394,388,1,0,0,0,394,389,1,0,0,0,
        394,390,1,0,0,0,394,391,1,0,0,0,394,392,1,0,0,0,394,393,1,0,0,0,
        395,27,1,0,0,0,396,397,5,38,0,0,397,398,5,120,0,0,398,399,3,40,20,
        0,399,400,5,135,0,0,400,401,3,30,15,0,401,29,1,0,0,0,402,403,3,32,
        16,0,403,404,5,137,0,0,404,405,3,34,17,0,405,406,5,137,0,0,406,407,
        3,36,18,0,407,408,5,137,0,0,408,409,3,38,19,0,409,31,1,0,0,0,410,
        411,3,80,40,0,411,33,1,0,0,0,412,413,3,80,40,0,413,35,1,0,0,0,414,
        415,3,80,40,0,415,37,1,0,0,0,416,417,3,80,40,0,417,39,1,0,0,0,418,
        420,8,0,0,0,419,418,1,0,0,0,420,423,1,0,0,0,421,419,1,0,0,0,421,
        422,1,0,0,0,422,41,1,0,0,0,423,421,1,0,0,0,424,434,3,66,33,0,425,
        434,3,54,27,0,426,434,3,56,28,0,427,434,3,60,30,0,428,434,3,62,31,
        0,429,434,3,64,32,0,430,434,3,52,26,0,431,434,5,29,0,0,432,434,5,
        30,0,0,433,424,1,0,0,0,433,425,1,0,0,0,433,426,1,0,0,0,433,427,1,
        0,0,0,433,428,1,0,0,0,433,429,1,0,0,0,433,430,1,0,0,0,433,431,1,
        0,0,0,433,432,1,0,0,0,434,43,1,0,0,0,435,440,3,80,40,0,436,437,5,
        137,0,0,437,439,3,44,22,0,438,436,1,0,0,0,439,442,1,0,0,0,440,438,
        1,0,0,0,440,441,1,0,0,0,441,45,1,0,0,0,442,440,1,0,0,0,443,444,5,
        122,0,0,444,47,1,0,0,0,445,446,5,39,0,0,446,49,1,0,0,0,447,448,7,
        1,0,0,448,51,1,0,0,0,449,450,7,2,0,0,450,53,1,0,0,0,451,452,7,3,
        0,0,452,55,1,0,0,0,453,454,7,4,0,0,454,57,1,0,0,0,455,456,7,5,0,
        0,456,59,1,0,0,0,457,458,5,31,0,0,458,459,5,135,0,0,459,462,3,80,
        40,0,460,461,5,129,0,0,461,463,3,80,40,0,462,460,1,0,0,0,462,463,
        1,0,0,0,463,61,1,0,0,0,464,465,7,6,0,0,465,63,1,0,0,0,466,467,5,
        21,0,0,467,65,1,0,0,0,468,469,7,7,0,0,469,67,1,0,0,0,470,479,5,13,
        0,0,471,473,5,14,0,0,472,471,1,0,0,0,472,473,1,0,0,0,473,474,1,0,
        0,0,474,475,5,114,0,0,475,476,3,70,35,0,476,477,5,115,0,0,477,480,
        1,0,0,0,478,480,3,72,36,0,479,472,1,0,0,0,479,478,1,0,0,0,480,69,
        1,0,0,0,481,486,3,72,36,0,482,483,5,137,0,0,483,485,3,72,36,0,484,
        482,1,0,0,0,485,488,1,0,0,0,486,484,1,0,0,0,486,487,1,0,0,0,487,
        71,1,0,0,0,488,486,1,0,0,0,489,544,5,44,0,0,490,544,5,45,0,0,491,
        544,5,46,0,0,492,544,5,47,0,0,493,544,5,48,0,0,494,544,5,49,0,0,
        495,544,5,50,0,0,496,544,5,51,0,0,497,544,5,52,0,0,498,544,5,53,
        0,0,499,544,5,54,0,0,500,544,5,55,0,0,501,544,5,56,0,0,502,544,5,
        57,0,0,503,544,5,58,0,0,504,544,5,59,0,0,505,544,5,60,0,0,506,544,
        5,61,0,0,507,544,5,62,0,0,508,544,5,63,0,0,509,544,5,64,0,0,510,
        544,5,65,0,0,511,544,5,66,0,0,512,544,5,67,0,0,513,544,5,68,0,0,
        514,544,5,69,0,0,515,544,5,70,0,0,516,544,5,71,0,0,517,544,5,72,
        0,0,518,544,5,73,0,0,519,544,5,74,0,0,520,544,5,75,0,0,521,544,5,
        76,0,0,522,544,5,77,0,0,523,544,5,78,0,0,524,544,5,79,0,0,525,544,
        5,80,0,0,526,544,5,81,0,0,527,544,5,82,0,0,528,544,5,83,0,0,529,
        544,5,84,0,0,530,544,5,85,0,0,531,544,5,86,0,0,532,544,5,87,0,0,
        533,544,5,88,0,0,534,544,5,89,0,0,535,544,5,90,0,0,536,544,5,91,
        0,0,537,544,5,92,0,0,538,544,5,93,0,0,539,544,5,94,0,0,540,544,5,
        95,0,0,541,544,5,139,0,0,542,544,3,80,40,0,543,489,1,0,0,0,543,490,
        1,0,0,0,543,491,1,0,0,0,543,492,1,0,0,0,543,493,1,0,0,0,543,494,
        1,0,0,0,543,495,1,0,0,0,543,496,1,0,0,0,543,497,1,0,0,0,543,498,
        1,0,0,0,543,499,1,0,0,0,543,500,1,0,0,0,543,501,1,0,0,0,543,502,
        1,0,0,0,543,503,1,0,0,0,543,504,1,0,0,0,543,505,1,0,0,0,543,506,
        1,0,0,0,543,507,1,0,0,0,543,508,1,0,0,0,543,509,1,0,0,0,543,510,
        1,0,0,0,543,511,1,0,0,0,543,512,1,0,0,0,543,513,1,0,0,0,543,514,
        1,0,0,0,543,515,1,0,0,0,543,516,1,0,0,0,543,517,1,0,0,0,543,518,
        1,0,0,0,543,519,1,0,0,0,543,520,1,0,0,0,543,521,1,0,0,0,543,522,
        1,0,0,0,543,523,1,0,0,0,543,524,1,0,0,0,543,525,1,0,0,0,543,526,
        1,0,0,0,543,527,1,0,0,0,543,528,1,0,0,0,543,529,1,0,0,0,543,530,
        1,0,0,0,543,531,1,0,0,0,543,532,1,0,0,0,543,533,1,0,0,0,543,534,
        1,0,0,0,543,535,1,0,0,0,543,536,1,0,0,0,543,537,1,0,0,0,543,538,
        1,0,0,0,543,539,1,0,0,0,543,540,1,0,0,0,543,541,1,0,0,0,543,542,
        1,0,0,0,544,545,1,0,0,0,545,543,1,0,0,0,545,546,1,0,0,0,546,73,1,
        0,0,0,547,548,5,8,0,0,548,550,5,73,0,0,549,551,5,120,0,0,550,549,
        1,0,0,0,550,551,1,0,0,0,551,552,1,0,0,0,552,553,3,80,40,0,553,555,
        5,72,0,0,554,556,5,120,0,0,555,554,1,0,0,0,555,556,1,0,0,0,556,557,
        1,0,0,0,557,558,3,80,40,0,558,75,1,0,0,0,559,560,5,141,0,0,560,77,
        1,0,0,0,561,562,5,140,0,0,562,79,1,0,0,0,563,565,7,8,0,0,564,563,
        1,0,0,0,565,566,1,0,0,0,566,564,1,0,0,0,566,567,1,0,0,0,567,81,1,
        0,0,0,568,569,7,9,0,0,569,83,1,0,0,0,570,571,7,10,0,0,571,85,1,0,
        0,0,572,573,3,82,41,0,573,574,3,214,107,0,574,87,1,0,0,0,575,576,
        5,4,0,0,576,89,1,0,0,0,577,578,5,5,0,0,578,91,1,0,0,0,579,580,5,
        6,0,0,580,93,1,0,0,0,581,582,5,37,0,0,582,583,3,80,40,0,583,95,1,
        0,0,0,584,585,5,2,0,0,585,586,3,80,40,0,586,97,1,0,0,0,587,588,5,
        3,0,0,588,589,3,80,40,0,589,99,1,0,0,0,590,592,5,7,0,0,591,593,5,
        119,0,0,592,591,1,0,0,0,592,593,1,0,0,0,593,594,1,0,0,0,594,597,
        3,80,40,0,595,596,5,129,0,0,596,598,3,80,40,0,597,595,1,0,0,0,597,
        598,1,0,0,0,598,101,1,0,0,0,599,600,5,9,0,0,600,601,3,104,52,0,601,
        103,1,0,0,0,602,604,3,106,53,0,603,605,3,110,55,0,604,603,1,0,0,
        0,604,605,1,0,0,0,605,607,1,0,0,0,606,608,3,108,54,0,607,606,1,0,
        0,0,607,608,1,0,0,0,608,105,1,0,0,0,609,610,7,11,0,0,610,107,1,0,
        0,0,611,612,7,12,0,0,612,109,1,0,0,0,613,615,5,91,0,0,614,616,5,
        91,0,0,615,614,1,0,0,0,615,616,1,0,0,0,616,622,1,0,0,0,617,619,5,
        125,0,0,618,620,5,125,0,0,619,618,1,0,0,0,619,620,1,0,0,0,620,622,
        1,0,0,0,621,613,1,0,0,0,621,617,1,0,0,0,622,111,1,0,0,0,623,624,
        5,10,0,0,624,628,5,114,0,0,625,627,3,114,57,0,626,625,1,0,0,0,627,
        630,1,0,0,0,628,626,1,0,0,0,628,629,1,0,0,0,629,631,1,0,0,0,630,
        628,1,0,0,0,631,633,5,115,0,0,632,634,3,116,58,0,633,632,1,0,0,0,
        633,634,1,0,0,0,634,113,1,0,0,0,635,636,3,86,43,0,636,115,1,0,0,
        0,637,638,5,67,0,0,638,117,1,0,0,0,639,640,5,1,0,0,640,119,1,0,0,
        0,641,645,3,126,63,0,642,645,3,128,64,0,643,645,5,138,0,0,644,641,
        1,0,0,0,644,642,1,0,0,0,644,643,1,0,0,0,645,121,1,0,0,0,646,647,
        5,111,0,0,647,650,3,124,62,0,648,649,5,129,0,0,649,651,3,124,62,
        0,650,648,1,0,0,0,650,651,1,0,0,0,651,123,1,0,0,0,652,654,3,120,
        60,0,653,655,3,116,58,0,654,653,1,0,0,0,654,655,1,0,0,0,655,663,
        1,0,0,0,656,658,5,135,0,0,657,659,3,130,65,0,658,657,1,0,0,0,658,
        659,1,0,0,0,659,664,1,0,0,0,660,662,3,80,40,0,661,660,1,0,0,0,661,
        662,1,0,0,0,662,664,1,0,0,0,663,656,1,0,0,0,663,661,1,0,0,0,664,
        125,1,0,0,0,665,667,3,82,41,0,666,668,3,214,107,0,667,666,1,0,0,
        0,667,668,1,0,0,0,668,127,1,0,0,0,669,671,3,84,42,0,670,672,3,214,
        107,0,671,670,1,0,0,0,671,672,1,0,0,0,672,129,1,0,0,0,673,681,3,
        144,72,0,674,681,3,142,71,0,675,681,3,140,70,0,676,681,3,138,69,
        0,677,681,3,136,68,0,678,681,3,134,67,0,679,681,3,132,66,0,680,673,
        1,0,0,0,680,674,1,0,0,0,680,675,1,0,0,0,680,676,1,0,0,0,680,677,
        1,0,0,0,680,678,1,0,0,0,680,679,1,0,0,0,681,131,1,0,0,0,682,683,
        5,81,0,0,683,684,5,84,0,0,684,685,5,72,0,0,685,133,1,0,0,0,686,687,
        5,78,0,0,687,688,5,84,0,0,688,689,5,83,0,0,689,135,1,0,0,0,690,691,
        5,70,0,0,691,692,5,74,0,0,692,693,5,84,0,0,693,137,1,0,0,0,694,695,
        5,82,0,0,695,696,5,78,0,0,696,697,5,93,0,0,697,139,1,0,0,0,698,699,
        5,81,0,0,699,700,5,94,0,0,700,701,5,73,0,0,701,141,1,0,0,0,702,703,
        5,85,0,0,703,704,5,77,0,0,704,705,5,87,0,0,705,143,1,0,0,0,706,707,
        5,73,0,0,707,708,5,84,0,0,708,709,5,87,0,0,709,145,1,0,0,0,710,716,
        5,32,0,0,711,717,3,152,76,0,712,717,3,154,77,0,713,717,3,156,78,
        0,714,717,3,158,79,0,715,717,3,162,81,0,716,711,1,0,0,0,716,712,
        1,0,0,0,716,713,1,0,0,0,716,714,1,0,0,0,716,715,1,0,0,0,717,720,
        1,0,0,0,718,719,5,41,0,0,719,721,5,99,0,0,720,718,1,0,0,0,720,721,
        1,0,0,0,721,147,1,0,0,0,722,723,3,80,40,0,723,149,1,0,0,0,724,725,
        3,80,40,0,725,151,1,0,0,0,726,727,3,148,74,0,727,728,5,129,0,0,728,
        729,3,150,75,0,729,153,1,0,0,0,730,733,3,148,74,0,731,732,5,119,
        0,0,732,734,3,148,74,0,733,731,1,0,0,0,734,735,1,0,0,0,735,733,1,
        0,0,0,735,736,1,0,0,0,736,737,1,0,0,0,737,738,5,129,0,0,738,739,
        3,150,75,0,739,155,1,0,0,0,740,743,3,152,76,0,741,742,5,119,0,0,
        742,744,3,152,76,0,743,741,1,0,0,0,744,745,1,0,0,0,745,743,1,0,0,
        0,745,746,1,0,0,0,746,157,1,0,0,0,747,750,3,160,80,0,748,749,5,135,
        0,0,749,751,3,160,80,0,750,748,1,0,0,0,751,752,1,0,0,0,752,750,1,
        0,0,0,752,753,1,0,0,0,753,159,1,0,0,0,754,757,3,152,76,0,755,756,
        5,136,0,0,756,758,3,80,40,0,757,755,1,0,0,0,757,758,1,0,0,0,758,
        161,1,0,0,0,759,760,3,152,76,0,760,761,5,123,0,0,761,762,3,152,76,
        0,762,163,1,0,0,0,763,764,7,13,0,0,764,767,5,133,0,0,765,768,3,166,
        83,0,766,768,3,168,84,0,767,765,1,0,0,0,767,766,1,0,0,0,768,769,
        1,0,0,0,769,770,5,134,0,0,770,165,1,0,0,0,771,775,5,72,0,0,772,773,
        5,72,0,0,773,775,5,123,0,0,774,771,1,0,0,0,774,772,1,0,0,0,775,167,
        1,0,0,0,776,778,7,14,0,0,777,776,1,0,0,0,778,779,1,0,0,0,779,777,
        1,0,0,0,779,780,1,0,0,0,780,169,1,0,0,0,781,782,5,12,0,0,782,785,
        3,80,40,0,783,784,7,15,0,0,784,786,3,80,40,0,785,783,1,0,0,0,785,
        786,1,0,0,0,786,171,1,0,0,0,787,788,5,111,0,0,788,173,1,0,0,0,789,
        791,5,121,0,0,790,792,5,121,0,0,791,790,1,0,0,0,791,792,1,0,0,0,
        792,794,1,0,0,0,793,795,3,80,40,0,794,793,1,0,0,0,794,795,1,0,0,
        0,795,797,1,0,0,0,796,798,5,70,0,0,797,796,1,0,0,0,797,798,1,0,0,
        0,798,800,1,0,0,0,799,801,5,71,0,0,800,799,1,0,0,0,800,801,1,0,0,
        0,801,803,1,0,0,0,802,804,5,120,0,0,803,802,1,0,0,0,803,804,1,0,
        0,0,804,806,1,0,0,0,805,807,3,176,88,0,806,805,1,0,0,0,806,807,1,
        0,0,0,807,809,1,0,0,0,808,810,3,182,91,0,809,808,1,0,0,0,809,810,
        1,0,0,0,810,812,1,0,0,0,811,813,5,79,0,0,812,811,1,0,0,0,812,813,
        1,0,0,0,813,815,1,0,0,0,814,816,5,122,0,0,815,814,1,0,0,0,815,816,
        1,0,0,0,816,818,1,0,0,0,817,819,3,262,131,0,818,817,1,0,0,0,818,
        819,1,0,0,0,819,175,1,0,0,0,820,821,5,123,0,0,821,854,5,123,0,0,
        822,823,5,123,0,0,823,825,5,40,0,0,824,826,5,135,0,0,825,824,1,0,
        0,0,825,826,1,0,0,0,826,854,1,0,0,0,827,828,5,123,0,0,828,854,5,
        135,0,0,829,830,5,40,0,0,830,831,5,123,0,0,831,854,5,135,0,0,832,
        834,5,121,0,0,833,832,1,0,0,0,833,834,1,0,0,0,834,835,1,0,0,0,835,
        836,5,135,0,0,836,837,5,123,0,0,837,854,5,40,0,0,838,839,5,135,0,
        0,839,841,5,123,0,0,840,842,5,40,0,0,841,840,1,0,0,0,841,842,1,0,
        0,0,842,843,1,0,0,0,843,844,5,123,0,0,844,854,5,135,0,0,845,846,
        5,135,0,0,846,847,5,40,0,0,847,854,5,135,0,0,848,849,5,135,0,0,849,
        850,5,40,0,0,850,851,5,40,0,0,851,854,5,135,0,0,852,854,5,121,0,
        0,853,820,1,0,0,0,853,822,1,0,0,0,853,827,1,0,0,0,853,829,1,0,0,
        0,853,833,1,0,0,0,853,838,1,0,0,0,853,845,1,0,0,0,853,848,1,0,0,
        0,853,852,1,0,0,0,854,177,1,0,0,0,855,856,3,208,104,0,856,179,1,
        0,0,0,857,861,3,184,92,0,858,860,3,186,93,0,859,858,1,0,0,0,860,
        863,1,0,0,0,861,859,1,0,0,0,861,862,1,0,0,0,862,866,1,0,0,0,863,
        861,1,0,0,0,864,867,3,194,97,0,865,867,3,196,98,0,866,864,1,0,0,
        0,866,865,1,0,0,0,866,867,1,0,0,0,867,181,1,0,0,0,868,869,5,136,
        0,0,869,183,1,0,0,0,870,873,3,80,40,0,871,872,5,41,0,0,872,874,3,
        80,40,0,873,871,1,0,0,0,873,874,1,0,0,0,874,185,1,0,0,0,875,876,
        5,122,0,0,876,187,1,0,0,0,877,879,3,214,107,0,878,880,3,216,108,
        0,879,878,1,0,0,0,879,880,1,0,0,0,880,189,1,0,0,0,881,882,7,16,0,
        0,882,191,1,0,0,0,883,885,5,139,0,0,884,883,1,0,0,0,884,885,1,0,
        0,0,885,193,1,0,0,0,886,888,5,86,0,0,887,889,5,86,0,0,888,887,1,
        0,0,0,888,889,1,0,0,0,889,195,1,0,0,0,890,891,3,198,99,0,891,197,
        1,0,0,0,892,893,7,17,0,0,893,199,1,0,0,0,894,898,3,242,121,0,895,
        898,3,246,123,0,896,898,3,244,122,0,897,894,1,0,0,0,897,895,1,0,
        0,0,897,896,1,0,0,0,898,900,1,0,0,0,899,901,3,190,95,0,900,899,1,
        0,0,0,900,901,1,0,0,0,901,201,1,0,0,0,902,933,3,226,113,0,903,933,
        3,196,98,0,904,933,3,224,112,0,905,933,3,250,125,0,906,933,3,252,
        126,0,907,933,3,256,128,0,908,933,3,238,119,0,909,933,3,182,91,0,
        910,933,3,262,131,0,911,933,3,222,111,0,912,933,3,194,97,0,913,933,
        3,200,100,0,914,933,3,258,129,0,915,933,3,186,93,0,916,933,3,206,
        103,0,917,933,3,240,120,0,918,933,3,248,124,0,919,933,3,190,95,0,
        920,933,3,254,127,0,921,933,3,218,109,0,922,933,3,260,130,0,923,
        933,3,220,110,0,924,933,5,57,0,0,925,933,5,79,0,0,926,933,5,67,0,
        0,927,933,5,69,0,0,928,933,5,58,0,0,929,933,5,81,0,0,930,933,5,65,
        0,0,931,933,3,204,102,0,932,902,1,0,0,0,932,903,1,0,0,0,932,904,
        1,0,0,0,932,905,1,0,0,0,932,906,1,0,0,0,932,907,1,0,0,0,932,908,
        1,0,0,0,932,909,1,0,0,0,932,910,1,0,0,0,932,911,1,0,0,0,932,912,
        1,0,0,0,932,913,1,0,0,0,932,914,1,0,0,0,932,915,1,0,0,0,932,916,
        1,0,0,0,932,917,1,0,0,0,932,918,1,0,0,0,932,919,1,0,0,0,932,920,
        1,0,0,0,932,921,1,0,0,0,932,922,1,0,0,0,932,923,1,0,0,0,932,924,
        1,0,0,0,932,925,1,0,0,0,932,926,1,0,0,0,932,927,1,0,0,0,932,928,
        1,0,0,0,932,929,1,0,0,0,932,930,1,0,0,0,932,931,1,0,0,0,933,203,
        1,0,0,0,934,936,5,93,0,0,935,937,5,93,0,0,936,935,1,0,0,0,936,937,
        1,0,0,0,937,205,1,0,0,0,938,939,7,18,0,0,939,207,1,0,0,0,940,943,
        3,212,106,0,941,943,3,210,105,0,942,940,1,0,0,0,942,941,1,0,0,0,
        943,209,1,0,0,0,944,946,3,82,41,0,945,944,1,0,0,0,946,947,1,0,0,
        0,947,945,1,0,0,0,947,948,1,0,0,0,948,211,1,0,0,0,949,951,3,84,42,
        0,950,949,1,0,0,0,951,952,1,0,0,0,952,950,1,0,0,0,952,953,1,0,0,
        0,953,213,1,0,0,0,954,959,5,118,0,0,955,957,5,118,0,0,956,958,5,
        118,0,0,957,956,1,0,0,0,957,958,1,0,0,0,958,960,1,0,0,0,959,955,
        1,0,0,0,959,960,1,0,0,0,960,970,1,0,0,0,961,966,5,120,0,0,962,964,
        5,120,0,0,963,965,5,120,0,0,964,963,1,0,0,0,964,965,1,0,0,0,965,
        967,1,0,0,0,966,962,1,0,0,0,966,967,1,0,0,0,967,970,1,0,0,0,968,
        970,5,83,0,0,969,954,1,0,0,0,969,961,1,0,0,0,969,968,1,0,0,0,970,
        215,1,0,0,0,971,986,5,93,0,0,972,986,5,67,0,0,973,986,5,78,0,0,974,
        986,5,52,0,0,975,986,5,79,0,0,976,986,5,69,0,0,977,979,5,94,0,0,
        978,980,5,94,0,0,979,978,1,0,0,0,979,980,1,0,0,0,980,986,1,0,0,0,
        981,983,5,68,0,0,982,984,5,68,0,0,983,982,1,0,0,0,983,984,1,0,0,
        0,984,986,1,0,0,0,985,971,1,0,0,0,985,972,1,0,0,0,985,973,1,0,0,
        0,985,974,1,0,0,0,985,975,1,0,0,0,985,976,1,0,0,0,985,977,1,0,0,
        0,985,981,1,0,0,0,986,217,1,0,0,0,987,988,7,19,0,0,988,219,1,0,0,
        0,989,990,5,78,0,0,990,221,1,0,0,0,991,992,5,135,0,0,992,223,1,0,
        0,0,993,1000,3,236,118,0,994,1000,3,234,117,0,995,1000,3,232,116,
        0,996,1000,3,230,115,0,997,1000,3,228,114,0,998,1000,3,226,113,0,
        999,993,1,0,0,0,999,994,1,0,0,0,999,995,1,0,0,0,999,996,1,0,0,0,
        999,997,1,0,0,0,999,998,1,0,0,0,1000,225,1,0,0,0,1001,1002,5,125,
        0,0,1002,227,1,0,0,0,1003,1004,5,126,0,0,1004,229,1,0,0,0,1005,1006,
        5,124,0,0,1006,231,1,0,0,0,1007,1008,5,112,0,0,1008,233,1,0,0,0,
        1009,1010,5,88,0,0,1010,235,1,0,0,0,1011,1012,5,113,0,0,1012,237,
        1,0,0,0,1013,1017,5,94,0,0,1014,1016,5,94,0,0,1015,1014,1,0,0,0,
        1016,1019,1,0,0,0,1017,1015,1,0,0,0,1017,1018,1,0,0,0,1018,1021,
        1,0,0,0,1019,1017,1,0,0,0,1020,1022,5,43,0,0,1021,1020,1,0,0,0,1021,
        1022,1,0,0,0,1022,1025,1,0,0,0,1023,1025,5,67,0,0,1024,1013,1,0,
        0,0,1024,1023,1,0,0,0,1025,239,1,0,0,0,1026,1028,5,42,0,0,1027,1026,
        1,0,0,0,1028,1031,1,0,0,0,1029,1027,1,0,0,0,1029,1030,1,0,0,0,1030,
        1032,1,0,0,0,1031,1029,1,0,0,0,1032,1034,5,133,0,0,1033,1035,3,190,
        95,0,1034,1033,1,0,0,0,1034,1035,1,0,0,0,1035,241,1,0,0,0,1036,1042,
        5,127,0,0,1037,1039,5,114,0,0,1038,1040,5,94,0,0,1039,1038,1,0,0,
        0,1039,1040,1,0,0,0,1040,1042,1,0,0,0,1041,1036,1,0,0,0,1041,1037,
        1,0,0,0,1042,243,1,0,0,0,1043,1044,5,131,0,0,1044,245,1,0,0,0,1045,
        1046,7,20,0,0,1046,247,1,0,0,0,1047,1049,5,42,0,0,1048,1047,1,0,
        0,0,1049,1052,1,0,0,0,1050,1048,1,0,0,0,1050,1051,1,0,0,0,1051,1053,
        1,0,0,0,1052,1050,1,0,0,0,1053,1054,5,134,0,0,1054,249,1,0,0,0,1055,
        1056,5,63,0,0,1056,251,1,0,0,0,1057,1058,5,89,0,0,1058,253,1,0,0,
        0,1059,1060,7,21,0,0,1060,255,1,0,0,0,1061,1063,7,22,0,0,1062,1064,
        3,190,95,0,1063,1062,1,0,0,0,1063,1064,1,0,0,0,1064,257,1,0,0,0,
        1065,1073,5,56,0,0,1066,1073,5,82,0,0,1067,1069,5,66,0,0,1068,1070,
        5,92,0,0,1069,1068,1,0,0,0,1069,1070,1,0,0,0,1070,1073,1,0,0,0,1071,
        1073,5,92,0,0,1072,1065,1,0,0,0,1072,1066,1,0,0,0,1072,1067,1,0,
        0,0,1072,1071,1,0,0,0,1073,259,1,0,0,0,1074,1076,5,63,0,0,1075,1077,
        5,63,0,0,1076,1075,1,0,0,0,1076,1077,1,0,0,0,1077,1080,1,0,0,0,1078,
        1080,5,89,0,0,1079,1074,1,0,0,0,1079,1078,1,0,0,0,1080,261,1,0,0,
        0,1081,1083,5,138,0,0,1082,1081,1,0,0,0,1083,1084,1,0,0,0,1084,1082,
        1,0,0,0,1084,1085,1,0,0,0,1085,263,1,0,0,0,111,274,279,285,292,297,
        301,306,310,316,321,336,340,345,349,354,358,363,370,374,379,394,
        421,433,440,462,472,479,486,543,545,550,555,566,592,597,604,607,
        615,619,621,628,633,644,650,654,658,661,663,667,671,680,716,720,
        735,745,752,757,767,774,779,785,791,794,797,800,803,806,809,812,
        815,818,825,833,841,853,861,866,873,879,884,888,897,900,932,936,
        942,947,952,957,959,964,966,969,979,983,985,999,1017,1021,1024,1029,
        1034,1039,1041,1050,1063,1069,1072,1076,1079,1084
    ]

class kernSpineParser ( Parser ):

    grammarFileName = "kernSpineParser.g4"

    atn = ATNDeserializer().deserialize(serializedATN())

    decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "'norep'", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "'!'", "'%'", 
                     "'&'", "'@'", "'A'", "'B'", "'C'", "'D'", "'E'", "'F'", 
                     "'G'", "'H'", "'I'", "'J'", "'K'", "'L'", "'M'", "'N'", 
                     "'O'", "'P'", "'Q'", "'R'", "'S'", "'T'", "'U'", "'V'", 
                     "'W'", "'X'", "'Y'", "'Z'", "'a'", "'b'", "'c'", "'d'", 
                     "'e'", "'f'", "'g'", "'h'", "'i'", "'j'", "'k'", "'l'", 
                     "'m'", "'n'", "'o'", "'p'", "'q'", "'r'", "'s'", "'t'", 
                     "'u'", "'v'", "'w'", "'x'", "'y'", "'z'", "<INVALID>", 
                     "'0'", "'1'", "'2'", "'3'", "'4'", "'5'", "'6'", "'7'", 
                     "'8'", "'9'", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "'\"'", "'''", "'['", "']'", 
                     "'{'", "'}'", "'#'", "'+'", "'-'", "'='", "'.'", "'|'", 
                     "'`'", "'^'", "'~'", "'<'", "'>'", "'/'", "'\\'", "'_'", 
                     "'$'", "'('", "')'", "':'", "';'", "','", "'?'", "' '" ]

    symbolicNames = [ "<INVALID>", "TANDEM_KEYCANCEL", "TANDEM_PART", "TANDEM_GROUP", 
                      "TANDEM_ACCOMP", "TANDEM_SOLO", "TANDEM_STROPHE", 
                      "TANDEM_STAFF", "TANDEM_TRANSPOSITION", "TANDEM_CLEF", 
                      "TANDEM_KEY_SIGNATURE", "TANDEM_MET", "METRONOME", 
                      "TANDEM_SECTION", "NO_REPEAT", "TANDEM_LEFT_HAND", 
                      "TANDEM_RIGHT_HAND", "TANDEM_ABOVE", "TANDEM_BELOW", 
                      "TANDEM_CENTERED", "TANDEM_PEDAL_START", "TANDEM_ELA", 
                      "TANDEM_PEDAL_END", "TANDEM_TUPLET_START", "TANDEM_TUPLET_END", 
                      "TANDEM_CUE_START", "TANDEM_CUE_END", "TANDEM_TREMOLO_START", 
                      "TANDEM_TREMOLO_END", "TANDEM_TSTART", "TANDEM_TEND", 
                      "TANDEM_RSCALE", "TANDEM_TIMESIGNATURE", "TANDEM_SIC", 
                      "TANDEM_OSSIA", "TANDEM_FIN", "TANDEM_SMINUS", "TANDEM_TIMEBASE", 
                      "TANDEM_BOUNDING_BOX", "OCTAVE_SHIFT", "EXCLAMATION", 
                      "PERCENT", "AMPERSAND", "AT", "CHAR_A", "CHAR_B", 
                      "CHAR_C", "CHAR_D", "CHAR_E", "CHAR_F", "CHAR_G", 
                      "CHAR_H", "CHAR_I", "CHAR_J", "CHAR_K", "CHAR_L", 
                      "CHAR_M", "CHAR_N", "CHAR_O", "CHAR_P", "CHAR_Q", 
                      "CHAR_R", "CHAR_S", "CHAR_T", "CHAR_U", "CHAR_V", 
                      "CHAR_W", "CHAR_X", "CHAR_Y", "CHAR_Z", "CHAR_a", 
                      "CHAR_b", "CHAR_c", "CHAR_d", "CHAR_e", "CHAR_f", 
                      "CHAR_g", "CHAR_h", "CHAR_i", "CHAR_j", "CHAR_k", 
                      "CHAR_l", "CHAR_m", "CHAR_n", "CHAR_o", "CHAR_p", 
                      "CHAR_q", "CHAR_r", "CHAR_s", "CHAR_t", "CHAR_u", 
                      "CHAR_v", "CHAR_w", "CHAR_x", "CHAR_y", "CHAR_z", 
                      "NON_ENGLISH", "DIGIT_0", "DIGIT_1", "DIGIT_2", "DIGIT_3", 
                      "DIGIT_4", "DIGIT_5", "DIGIT_6", "DIGIT_7", "DIGIT_8", 
                      "DIGIT_9", "SPINE_TERMINATOR", "SPINE_ADD", "SPINE_SPLIT", 
                      "SPINE_JOIN", "ASTERISK", "QUOTATION_MARK", "APOSTROPHE", 
                      "LEFT_BRACKET", "RIGHT_BRACKET", "LEFT_CURLY_BRACES", 
                      "RIGHT_CURLY_BRACES", "OCTOTHORPE", "PLUS", "MINUS", 
                      "EQUAL", "DOT", "PIPE", "GRAVE_ACCENT", "CIRCUMFLEX", 
                      "TILDE", "ANGLE_BRACKET_OPEN", "ANGLE_BRACKET_CLOSE", 
                      "SLASH", "BACKSLASH", "UNDERSCORE", "DOLLAR", "LEFT_PARENTHESIS", 
                      "RIGHT_PARENTHESIS", "COLON", "SEMICOLON", "COMMA", 
                      "QUESTION_MARK", "SPACE", "INSTRUMENT_TITLE", "INSTRUMENT" ]

    RULE_start = 0
    RULE_field = 1
    RULE_notes_rests_chords = 2
    RULE_structural = 3
    RULE_contextual = 4
    RULE_signatures = 5
    RULE_otherContextual = 6
    RULE_empty = 7
    RULE_rest = 8
    RULE_restChar_r = 9
    RULE_restDecoration = 10
    RULE_chord = 11
    RULE_note = 12
    RULE_nonVisualTandemInterpretation = 13
    RULE_boundingBox = 14
    RULE_xywh = 15
    RULE_x = 16
    RULE_y = 17
    RULE_w = 18
    RULE_h = 19
    RULE_pageNumber = 20
    RULE_visualTandemInterpretation = 21
    RULE_associatedIDS = 22
    RULE_placeHolder = 23
    RULE_octaveShift = 24
    RULE_pianoHand = 25
    RULE_tandemTuplet = 26
    RULE_tandemCue = 27
    RULE_tandemTremolo = 28
    RULE_ossia = 29
    RULE_rscale = 30
    RULE_pedal = 31
    RULE_ela = 32
    RULE_dynamics_position = 33
    RULE_sections = 34
    RULE_sectionNames = 35
    RULE_sectionName = 36
    RULE_transposition = 37
    RULE_instrument = 38
    RULE_instrumentTitle = 39
    RULE_number = 40
    RULE_lowerCasePitch = 41
    RULE_upperCasePitch = 42
    RULE_pitchClass = 43
    RULE_accomp = 44
    RULE_solo = 45
    RULE_strophe = 46
    RULE_timebase = 47
    RULE_part = 48
    RULE_group = 49
    RULE_staff = 50
    RULE_clef = 51
    RULE_clefValue = 52
    RULE_clefSign = 53
    RULE_clefLine = 54
    RULE_clefOctave = 55
    RULE_keySignature = 56
    RULE_keySignaturePitchClass = 57
    RULE_keySignatureCancel = 58
    RULE_keyCancel = 59
    RULE_keyMode = 60
    RULE_key = 61
    RULE_singleKey = 62
    RULE_minorKey = 63
    RULE_majorKey = 64
    RULE_modal = 65
    RULE_locrian = 66
    RULE_ionian = 67
    RULE_aeolian = 68
    RULE_mixolydian = 69
    RULE_lydian = 70
    RULE_phrygian = 71
    RULE_dorian = 72
    RULE_timeSignature = 73
    RULE_numerator = 74
    RULE_denominator = 75
    RULE_standardTimeSignature = 76
    RULE_additiveTimeSignature = 77
    RULE_mixedTimeSignature = 78
    RULE_alternatingTimeSignature = 79
    RULE_alternatingTimeSignatureItem = 80
    RULE_interchangingTimeSignature = 81
    RULE_meterSymbol = 82
    RULE_modernMeterSymbolSign = 83
    RULE_mensuration = 84
    RULE_metronome = 85
    RULE_nullInterpretation = 86
    RULE_barline = 87
    RULE_barLineType = 88
    RULE_restPosition = 89
    RULE_duration = 90
    RULE_fermata = 91
    RULE_modernDuration = 92
    RULE_augmentationDot = 93
    RULE_alteration = 94
    RULE_staffChange = 95
    RULE_chordSpace = 96
    RULE_graceNote = 97
    RULE_appoggiatura = 98
    RULE_appoggiaturaMode = 99
    RULE_ligatureTie = 100
    RULE_noteDecoration = 101
    RULE_noteDecorationCharX = 102
    RULE_phrase = 103
    RULE_diatonicPitchAndOctave = 104
    RULE_trebleNotes = 105
    RULE_bassNotes = 106
    RULE_accidental = 107
    RULE_alterationDisplay = 108
    RULE_turn = 109
    RULE_userAssignable = 110
    RULE_glissando = 111
    RULE_articulation = 112
    RULE_accent = 113
    RULE_tenuto = 114
    RULE_staccatissimo = 115
    RULE_pizzicato = 116
    RULE_spiccato = 117
    RULE_staccato = 118
    RULE_editorialIntervention = 119
    RULE_slurStart = 120
    RULE_ligatureTieStart = 121
    RULE_tieContinue = 122
    RULE_ligatureTieEnd = 123
    RULE_slurEnd = 124
    RULE_barLineCrossedNoteStart = 125
    RULE_barLineCrossedNoteEnd = 126
    RULE_stem = 127
    RULE_beam = 128
    RULE_mordent = 129
    RULE_trill = 130
    RULE_footnote = 131

    ruleNames =  [ "start", "field", "notes_rests_chords", "structural", 
                   "contextual", "signatures", "otherContextual", "empty", 
                   "rest", "restChar_r", "restDecoration", "chord", "note", 
                   "nonVisualTandemInterpretation", "boundingBox", "xywh", 
                   "x", "y", "w", "h", "pageNumber", "visualTandemInterpretation", 
                   "associatedIDS", "placeHolder", "octaveShift", "pianoHand", 
                   "tandemTuplet", "tandemCue", "tandemTremolo", "ossia", 
                   "rscale", "pedal", "ela", "dynamics_position", "sections", 
                   "sectionNames", "sectionName", "transposition", "instrument", 
                   "instrumentTitle", "number", "lowerCasePitch", "upperCasePitch", 
                   "pitchClass", "accomp", "solo", "strophe", "timebase", 
                   "part", "group", "staff", "clef", "clefValue", "clefSign", 
                   "clefLine", "clefOctave", "keySignature", "keySignaturePitchClass", 
                   "keySignatureCancel", "keyCancel", "keyMode", "key", 
                   "singleKey", "minorKey", "majorKey", "modal", "locrian", 
                   "ionian", "aeolian", "mixolydian", "lydian", "phrygian", 
                   "dorian", "timeSignature", "numerator", "denominator", 
                   "standardTimeSignature", "additiveTimeSignature", "mixedTimeSignature", 
                   "alternatingTimeSignature", "alternatingTimeSignatureItem", 
                   "interchangingTimeSignature", "meterSymbol", "modernMeterSymbolSign", 
                   "mensuration", "metronome", "nullInterpretation", "barline", 
                   "barLineType", "restPosition", "duration", "fermata", 
                   "modernDuration", "augmentationDot", "alteration", "staffChange", 
                   "chordSpace", "graceNote", "appoggiatura", "appoggiaturaMode", 
                   "ligatureTie", "noteDecoration", "noteDecorationCharX", 
                   "phrase", "diatonicPitchAndOctave", "trebleNotes", "bassNotes", 
                   "accidental", "alterationDisplay", "turn", "userAssignable", 
                   "glissando", "articulation", "accent", "tenuto", "staccatissimo", 
                   "pizzicato", "spiccato", "staccato", "editorialIntervention", 
                   "slurStart", "ligatureTieStart", "tieContinue", "ligatureTieEnd", 
                   "slurEnd", "barLineCrossedNoteStart", "barLineCrossedNoteEnd", 
                   "stem", "beam", "mordent", "trill", "footnote" ]

    EOF = Token.EOF
    TANDEM_KEYCANCEL=1
    TANDEM_PART=2
    TANDEM_GROUP=3
    TANDEM_ACCOMP=4
    TANDEM_SOLO=5
    TANDEM_STROPHE=6
    TANDEM_STAFF=7
    TANDEM_TRANSPOSITION=8
    TANDEM_CLEF=9
    TANDEM_KEY_SIGNATURE=10
    TANDEM_MET=11
    METRONOME=12
    TANDEM_SECTION=13
    NO_REPEAT=14
    TANDEM_LEFT_HAND=15
    TANDEM_RIGHT_HAND=16
    TANDEM_ABOVE=17
    TANDEM_BELOW=18
    TANDEM_CENTERED=19
    TANDEM_PEDAL_START=20
    TANDEM_ELA=21
    TANDEM_PEDAL_END=22
    TANDEM_TUPLET_START=23
    TANDEM_TUPLET_END=24
    TANDEM_CUE_START=25
    TANDEM_CUE_END=26
    TANDEM_TREMOLO_START=27
    TANDEM_TREMOLO_END=28
    TANDEM_TSTART=29
    TANDEM_TEND=30
    TANDEM_RSCALE=31
    TANDEM_TIMESIGNATURE=32
    TANDEM_SIC=33
    TANDEM_OSSIA=34
    TANDEM_FIN=35
    TANDEM_SMINUS=36
    TANDEM_TIMEBASE=37
    TANDEM_BOUNDING_BOX=38
    OCTAVE_SHIFT=39
    EXCLAMATION=40
    PERCENT=41
    AMPERSAND=42
    AT=43
    CHAR_A=44
    CHAR_B=45
    CHAR_C=46
    CHAR_D=47
    CHAR_E=48
    CHAR_F=49
    CHAR_G=50
    CHAR_H=51
    CHAR_I=52
    CHAR_J=53
    CHAR_K=54
    CHAR_L=55
    CHAR_M=56
    CHAR_N=57
    CHAR_O=58
    CHAR_P=59
    CHAR_Q=60
    CHAR_R=61
    CHAR_S=62
    CHAR_T=63
    CHAR_U=64
    CHAR_V=65
    CHAR_W=66
    CHAR_X=67
    CHAR_Y=68
    CHAR_Z=69
    CHAR_a=70
    CHAR_b=71
    CHAR_c=72
    CHAR_d=73
    CHAR_e=74
    CHAR_f=75
    CHAR_g=76
    CHAR_h=77
    CHAR_i=78
    CHAR_j=79
    CHAR_k=80
    CHAR_l=81
    CHAR_m=82
    CHAR_n=83
    CHAR_o=84
    CHAR_p=85
    CHAR_q=86
    CHAR_r=87
    CHAR_s=88
    CHAR_t=89
    CHAR_u=90
    CHAR_v=91
    CHAR_w=92
    CHAR_x=93
    CHAR_y=94
    CHAR_z=95
    NON_ENGLISH=96
    DIGIT_0=97
    DIGIT_1=98
    DIGIT_2=99
    DIGIT_3=100
    DIGIT_4=101
    DIGIT_5=102
    DIGIT_6=103
    DIGIT_7=104
    DIGIT_8=105
    DIGIT_9=106
    SPINE_TERMINATOR=107
    SPINE_ADD=108
    SPINE_SPLIT=109
    SPINE_JOIN=110
    ASTERISK=111
    QUOTATION_MARK=112
    APOSTROPHE=113
    LEFT_BRACKET=114
    RIGHT_BRACKET=115
    LEFT_CURLY_BRACES=116
    RIGHT_CURLY_BRACES=117
    OCTOTHORPE=118
    PLUS=119
    MINUS=120
    EQUAL=121
    DOT=122
    PIPE=123
    GRAVE_ACCENT=124
    CIRCUMFLEX=125
    TILDE=126
    ANGLE_BRACKET_OPEN=127
    ANGLE_BRACKET_CLOSE=128
    SLASH=129
    BACKSLASH=130
    UNDERSCORE=131
    DOLLAR=132
    LEFT_PARENTHESIS=133
    RIGHT_PARENTHESIS=134
    COLON=135
    SEMICOLON=136
    COMMA=137
    QUESTION_MARK=138
    SPACE=139
    INSTRUMENT_TITLE=140
    INSTRUMENT=141

    def __init__(self, input:TokenStream, output:TextIO = sys.stdout):
        super().__init__(input, output)
        self.checkVersion("4.13.1")
        self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
        self._predicates = None




    class StartContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def field(self):
            return self.getTypedRuleContext(kernSpineParser.FieldContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_start

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStart" ):
                listener.enterStart(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStart" ):
                listener.exitStart(self)




    def start(self):

        localctx = kernSpineParser.StartContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_start)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 264
            self.field()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class FieldContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def notes_rests_chords(self):
            return self.getTypedRuleContext(kernSpineParser.Notes_rests_chordsContext,0)


        def structural(self):
            return self.getTypedRuleContext(kernSpineParser.StructuralContext,0)


        def contextual(self):
            return self.getTypedRuleContext(kernSpineParser.ContextualContext,0)


        def barline(self):
            return self.getTypedRuleContext(kernSpineParser.BarlineContext,0)


        def empty(self):
            return self.getTypedRuleContext(kernSpineParser.EmptyContext,0)


        def visualTandemInterpretation(self):
            return self.getTypedRuleContext(kernSpineParser.VisualTandemInterpretationContext,0)


        def nonVisualTandemInterpretation(self):
            return self.getTypedRuleContext(kernSpineParser.NonVisualTandemInterpretationContext,0)


        def boundingBox(self):
            return self.getTypedRuleContext(kernSpineParser.BoundingBoxContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_field

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterField" ):
                listener.enterField(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitField" ):
                listener.exitField(self)




    def field(self):

        localctx = kernSpineParser.FieldContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_field)
        try:
            self.state = 274
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,0,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 266
                self.notes_rests_chords()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 267
                self.structural()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 268
                self.contextual()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 269
                self.barline()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 270
                self.empty()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 271
                self.visualTandemInterpretation()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 272
                self.nonVisualTandemInterpretation()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 273
                self.boundingBox()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Notes_rests_chordsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def note(self):
            return self.getTypedRuleContext(kernSpineParser.NoteContext,0)


        def rest(self):
            return self.getTypedRuleContext(kernSpineParser.RestContext,0)


        def chord(self):
            return self.getTypedRuleContext(kernSpineParser.ChordContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_notes_rests_chords

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNotes_rests_chords" ):
                listener.enterNotes_rests_chords(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNotes_rests_chords" ):
                listener.exitNotes_rests_chords(self)




    def notes_rests_chords(self):

        localctx = kernSpineParser.Notes_rests_chordsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_notes_rests_chords)
        try:
            self.state = 279
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,1,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 276
                self.note()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 277
                self.rest()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 278
                self.chord()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class StructuralContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def staff(self):
            return self.getTypedRuleContext(kernSpineParser.StaffContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_structural

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStructural" ):
                listener.enterStructural(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStructural" ):
                listener.exitStructural(self)




    def structural(self):

        localctx = kernSpineParser.StructuralContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_structural)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 281
            self.staff()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ContextualContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def signatures(self):
            return self.getTypedRuleContext(kernSpineParser.SignaturesContext,0)


        def otherContextual(self):
            return self.getTypedRuleContext(kernSpineParser.OtherContextualContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_contextual

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterContextual" ):
                listener.enterContextual(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitContextual" ):
                listener.exitContextual(self)




    def contextual(self):

        localctx = kernSpineParser.ContextualContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_contextual)
        try:
            self.state = 285
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [1, 9, 10, 11, 32]:
                self.enterOuterAlt(localctx, 1)
                self.state = 283
                self.signatures()
                pass
            elif token in [12, 39, 111]:
                self.enterOuterAlt(localctx, 2)
                self.state = 284
                self.otherContextual()
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SignaturesContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def clef(self):
            return self.getTypedRuleContext(kernSpineParser.ClefContext,0)


        def timeSignature(self):
            return self.getTypedRuleContext(kernSpineParser.TimeSignatureContext,0)


        def meterSymbol(self):
            return self.getTypedRuleContext(kernSpineParser.MeterSymbolContext,0)


        def keyCancel(self):
            return self.getTypedRuleContext(kernSpineParser.KeyCancelContext,0)


        def keySignature(self):
            return self.getTypedRuleContext(kernSpineParser.KeySignatureContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_signatures

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSignatures" ):
                listener.enterSignatures(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSignatures" ):
                listener.exitSignatures(self)




    def signatures(self):

        localctx = kernSpineParser.SignaturesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_signatures)
        try:
            self.state = 292
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,3,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 287
                self.clef()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 288
                self.timeSignature()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 289
                self.meterSymbol()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 290
                self.keyCancel()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 291
                self.keySignature()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class OtherContextualContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def octaveShift(self):
            return self.getTypedRuleContext(kernSpineParser.OctaveShiftContext,0)


        def key(self):
            return self.getTypedRuleContext(kernSpineParser.KeyContext,0)


        def metronome(self):
            return self.getTypedRuleContext(kernSpineParser.MetronomeContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_otherContextual

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOtherContextual" ):
                listener.enterOtherContextual(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOtherContextual" ):
                listener.exitOtherContextual(self)




    def otherContextual(self):

        localctx = kernSpineParser.OtherContextualContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_otherContextual)
        try:
            self.state = 297
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [39]:
                self.enterOuterAlt(localctx, 1)
                self.state = 294
                self.octaveShift()
                pass
            elif token in [111]:
                self.enterOuterAlt(localctx, 2)
                self.state = 295
                self.key()
                pass
            elif token in [12]:
                self.enterOuterAlt(localctx, 3)
                self.state = 296
                self.metronome()
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class EmptyContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def nullInterpretation(self):
            return self.getTypedRuleContext(kernSpineParser.NullInterpretationContext,0)


        def placeHolder(self):
            return self.getTypedRuleContext(kernSpineParser.PlaceHolderContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_empty

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterEmpty" ):
                listener.enterEmpty(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitEmpty" ):
                listener.exitEmpty(self)




    def empty(self):

        localctx = kernSpineParser.EmptyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_empty)
        try:
            self.state = 301
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [111]:
                self.enterOuterAlt(localctx, 1)
                self.state = 299
                self.nullInterpretation()
                pass
            elif token in [122]:
                self.enterOuterAlt(localctx, 2)
                self.state = 300
                self.placeHolder()
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RestContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def restChar_r(self):
            return self.getTypedRuleContext(kernSpineParser.RestChar_rContext,0)


        def restDecoration(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.RestDecorationContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.RestDecorationContext,i)


        def duration(self):
            return self.getTypedRuleContext(kernSpineParser.DurationContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_rest

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRest" ):
                listener.enterRest(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRest" ):
                listener.exitRest(self)




    def rest(self):

        localctx = kernSpineParser.RestContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_rest)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 306
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 42)) & ~0x3f) == 0 and ((1 << (_la - 42)) & 4521225938272765) != 0) or ((((_la - 113)) & ~0x3f) == 0 and ((1 << (_la - 113)) & 11780633) != 0):
                self.state = 303
                self.restDecoration()
                self.state = 308
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 310
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if ((((_la - 97)) & ~0x3f) == 0 and ((1 << (_la - 97)) & 1023) != 0):
                self.state = 309
                self.duration()


            self.state = 312
            self.restChar_r()
            self.state = 316
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,8,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 313
                    self.restDecoration() 
                self.state = 318
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,8,self._ctx)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RestChar_rContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_r(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_r)
            else:
                return self.getToken(kernSpineParser.CHAR_r, i)

        def getRuleIndex(self):
            return kernSpineParser.RULE_restChar_r

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRestChar_r" ):
                listener.enterRestChar_r(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRestChar_r" ):
                listener.exitRestChar_r(self)




    def restChar_r(self):

        localctx = kernSpineParser.RestChar_rContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_restChar_r)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 319
            self.match(kernSpineParser.CHAR_r)
            self.state = 321
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,9,self._ctx)
            if la_ == 1:
                self.state = 320
                self.match(kernSpineParser.CHAR_r)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RestDecorationContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def slurStart(self):
            return self.getTypedRuleContext(kernSpineParser.SlurStartContext,0)


        def graceNote(self):
            return self.getTypedRuleContext(kernSpineParser.GraceNoteContext,0)


        def staffChange(self):
            return self.getTypedRuleContext(kernSpineParser.StaffChangeContext,0)


        def restPosition(self):
            return self.getTypedRuleContext(kernSpineParser.RestPositionContext,0)


        def fermata(self):
            return self.getTypedRuleContext(kernSpineParser.FermataContext,0)


        def editorialIntervention(self):
            return self.getTypedRuleContext(kernSpineParser.EditorialInterventionContext,0)


        def slurEnd(self):
            return self.getTypedRuleContext(kernSpineParser.SlurEndContext,0)


        def staccato(self):
            return self.getTypedRuleContext(kernSpineParser.StaccatoContext,0)


        def phrase(self):
            return self.getTypedRuleContext(kernSpineParser.PhraseContext,0)


        def augmentationDot(self):
            return self.getTypedRuleContext(kernSpineParser.AugmentationDotContext,0)


        def stem(self):
            return self.getTypedRuleContext(kernSpineParser.StemContext,0)


        def CHAR_j(self):
            return self.getToken(kernSpineParser.CHAR_j, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_restDecoration

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRestDecoration" ):
                listener.enterRestDecoration(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRestDecoration" ):
                listener.exitRestDecoration(self)




    def restDecoration(self):

        localctx = kernSpineParser.RestDecorationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_restDecoration)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 336
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,10,self._ctx)
            if la_ == 1:
                self.state = 323
                self.slurStart()
                pass

            elif la_ == 2:
                self.state = 324
                self.graceNote()
                pass

            elif la_ == 3:
                self.state = 325
                self.staffChange()
                pass

            elif la_ == 4:
                self.state = 326
                self.restPosition()
                pass

            elif la_ == 5:
                self.state = 327
                self.fermata()
                pass

            elif la_ == 6:
                self.state = 328
                self.editorialIntervention()
                pass

            elif la_ == 7:
                self.state = 329
                self.slurEnd()
                pass

            elif la_ == 8:
                self.state = 330
                self.staccato()
                pass

            elif la_ == 9:
                self.state = 331
                self.phrase()
                pass

            elif la_ == 10:
                self.state = 332
                self.augmentationDot()
                pass

            elif la_ == 11:
                self.state = 333
                self.stem()
                self.state = 334
                self.match(kernSpineParser.CHAR_j)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ChordContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def note(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.NoteContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.NoteContext,i)


        def rest(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.RestContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.RestContext,i)


        def chordSpace(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.ChordSpaceContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.ChordSpaceContext,i)


        def getRuleIndex(self):
            return kernSpineParser.RULE_chord

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterChord" ):
                listener.enterChord(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitChord" ):
                listener.exitChord(self)




    def chord(self):

        localctx = kernSpineParser.ChordContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_chord)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 340
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,11,self._ctx)
            if la_ == 1:
                self.state = 338
                self.note()
                pass

            elif la_ == 2:
                self.state = 339
                self.rest()
                pass


            self.state = 347 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 342
                self.chordSpace()
                self.state = 345
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,12,self._ctx)
                if la_ == 1:
                    self.state = 343
                    self.note()
                    pass

                elif la_ == 2:
                    self.state = 344
                    self.rest()
                    pass


                self.state = 349 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (((((_la - 42)) & ~0x3f) == 0 and ((1 << (_la - 42)) & -27872654195951107) != 0) or ((((_la - 106)) & ~0x3f) == 0 and ((1 << (_la - 106)) & 15032192961) != 0)):
                    break

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class NoteContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def diatonicPitchAndOctave(self):
            return self.getTypedRuleContext(kernSpineParser.DiatonicPitchAndOctaveContext,0)


        def noteDecoration(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.NoteDecorationContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.NoteDecorationContext,i)


        def duration(self):
            return self.getTypedRuleContext(kernSpineParser.DurationContext,0)


        def alteration(self):
            return self.getTypedRuleContext(kernSpineParser.AlterationContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_note

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNote" ):
                listener.enterNote(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNote" ):
                listener.exitNote(self)




    def note(self):

        localctx = kernSpineParser.NoteContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_note)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 354
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,14,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 351
                    self.noteDecoration() 
                self.state = 356
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,14,self._ctx)

            self.state = 358
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if ((((_la - 97)) & ~0x3f) == 0 and ((1 << (_la - 97)) & 1023) != 0):
                self.state = 357
                self.duration()


            self.state = 363
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 42)) & ~0x3f) == 0 and ((1 << (_la - 42)) & 8120924359620609) != 0) or ((((_la - 112)) & ~0x3f) == 0 and ((1 << (_la - 112)) & 100660287) != 0):
                self.state = 360
                self.noteDecoration()
                self.state = 365
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 366
            self.diatonicPitchAndOctave()
            self.state = 370
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,17,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 367
                    self.noteDecoration() 
                self.state = 372
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,17,self._ctx)

            self.state = 374
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if ((((_la - 83)) & ~0x3f) == 0 and ((1 << (_la - 83)) & 171798691841) != 0):
                self.state = 373
                self.alteration()


            self.state = 379
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,19,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 376
                    self.noteDecoration() 
                self.state = 381
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,19,self._ctx)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class NonVisualTandemInterpretationContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def timebase(self):
            return self.getTypedRuleContext(kernSpineParser.TimebaseContext,0)


        def solo(self):
            return self.getTypedRuleContext(kernSpineParser.SoloContext,0)


        def accomp(self):
            return self.getTypedRuleContext(kernSpineParser.AccompContext,0)


        def strophe(self):
            return self.getTypedRuleContext(kernSpineParser.StropheContext,0)


        def part(self):
            return self.getTypedRuleContext(kernSpineParser.PartContext,0)


        def group(self):
            return self.getTypedRuleContext(kernSpineParser.GroupContext,0)


        def instrument(self):
            return self.getTypedRuleContext(kernSpineParser.InstrumentContext,0)


        def instrumentTitle(self):
            return self.getTypedRuleContext(kernSpineParser.InstrumentTitleContext,0)


        def transposition(self):
            return self.getTypedRuleContext(kernSpineParser.TranspositionContext,0)


        def sections(self):
            return self.getTypedRuleContext(kernSpineParser.SectionsContext,0)


        def pianoHand(self):
            return self.getTypedRuleContext(kernSpineParser.PianoHandContext,0)


        def ossia(self):
            return self.getTypedRuleContext(kernSpineParser.OssiaContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_nonVisualTandemInterpretation

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNonVisualTandemInterpretation" ):
                listener.enterNonVisualTandemInterpretation(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNonVisualTandemInterpretation" ):
                listener.exitNonVisualTandemInterpretation(self)




    def nonVisualTandemInterpretation(self):

        localctx = kernSpineParser.NonVisualTandemInterpretationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_nonVisualTandemInterpretation)
        try:
            self.state = 394
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [37]:
                self.enterOuterAlt(localctx, 1)
                self.state = 382
                self.timebase()
                pass
            elif token in [5]:
                self.enterOuterAlt(localctx, 2)
                self.state = 383
                self.solo()
                pass
            elif token in [4]:
                self.enterOuterAlt(localctx, 3)
                self.state = 384
                self.accomp()
                pass
            elif token in [6]:
                self.enterOuterAlt(localctx, 4)
                self.state = 385
                self.strophe()
                pass
            elif token in [2]:
                self.enterOuterAlt(localctx, 5)
                self.state = 386
                self.part()
                pass
            elif token in [3]:
                self.enterOuterAlt(localctx, 6)
                self.state = 387
                self.group()
                pass
            elif token in [141]:
                self.enterOuterAlt(localctx, 7)
                self.state = 388
                self.instrument()
                pass
            elif token in [140]:
                self.enterOuterAlt(localctx, 8)
                self.state = 389
                self.instrumentTitle()
                pass
            elif token in [8]:
                self.enterOuterAlt(localctx, 9)
                self.state = 390
                self.transposition()
                pass
            elif token in [13]:
                self.enterOuterAlt(localctx, 10)
                self.state = 391
                self.sections()
                pass
            elif token in [15, 16]:
                self.enterOuterAlt(localctx, 11)
                self.state = 392
                self.pianoHand()
                pass
            elif token in [33, 34, 35, 36]:
                self.enterOuterAlt(localctx, 12)
                self.state = 393
                self.ossia()
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class BoundingBoxContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_BOUNDING_BOX(self):
            return self.getToken(kernSpineParser.TANDEM_BOUNDING_BOX, 0)

        def MINUS(self):
            return self.getToken(kernSpineParser.MINUS, 0)

        def pageNumber(self):
            return self.getTypedRuleContext(kernSpineParser.PageNumberContext,0)


        def COLON(self):
            return self.getToken(kernSpineParser.COLON, 0)

        def xywh(self):
            return self.getTypedRuleContext(kernSpineParser.XywhContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_boundingBox

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBoundingBox" ):
                listener.enterBoundingBox(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBoundingBox" ):
                listener.exitBoundingBox(self)




    def boundingBox(self):

        localctx = kernSpineParser.BoundingBoxContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_boundingBox)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 396
            self.match(kernSpineParser.TANDEM_BOUNDING_BOX)
            self.state = 397
            self.match(kernSpineParser.MINUS)
            self.state = 398
            self.pageNumber()
            self.state = 399
            self.match(kernSpineParser.COLON)
            self.state = 400
            self.xywh()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class XywhContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def x(self):
            return self.getTypedRuleContext(kernSpineParser.XContext,0)


        def COMMA(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.COMMA)
            else:
                return self.getToken(kernSpineParser.COMMA, i)

        def y(self):
            return self.getTypedRuleContext(kernSpineParser.YContext,0)


        def w(self):
            return self.getTypedRuleContext(kernSpineParser.WContext,0)


        def h(self):
            return self.getTypedRuleContext(kernSpineParser.HContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_xywh

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterXywh" ):
                listener.enterXywh(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitXywh" ):
                listener.exitXywh(self)




    def xywh(self):

        localctx = kernSpineParser.XywhContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_xywh)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 402
            self.x()
            self.state = 403
            self.match(kernSpineParser.COMMA)
            self.state = 404
            self.y()
            self.state = 405
            self.match(kernSpineParser.COMMA)
            self.state = 406
            self.w()
            self.state = 407
            self.match(kernSpineParser.COMMA)
            self.state = 408
            self.h()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class XContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def number(self):
            return self.getTypedRuleContext(kernSpineParser.NumberContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_x

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterX" ):
                listener.enterX(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitX" ):
                listener.exitX(self)




    def x(self):

        localctx = kernSpineParser.XContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_x)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 410
            self.number()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class YContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def number(self):
            return self.getTypedRuleContext(kernSpineParser.NumberContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_y

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterY" ):
                listener.enterY(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitY" ):
                listener.exitY(self)




    def y(self):

        localctx = kernSpineParser.YContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_y)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 412
            self.number()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class WContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def number(self):
            return self.getTypedRuleContext(kernSpineParser.NumberContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_w

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterW" ):
                listener.enterW(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitW" ):
                listener.exitW(self)




    def w(self):

        localctx = kernSpineParser.WContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_w)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 414
            self.number()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class HContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def number(self):
            return self.getTypedRuleContext(kernSpineParser.NumberContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_h

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterH" ):
                listener.enterH(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitH" ):
                listener.exitH(self)




    def h(self):

        localctx = kernSpineParser.HContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_h)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 416
            self.number()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PageNumberContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def COLON(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.COLON)
            else:
                return self.getToken(kernSpineParser.COLON, i)

        def getRuleIndex(self):
            return kernSpineParser.RULE_pageNumber

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPageNumber" ):
                listener.enterPageNumber(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPageNumber" ):
                listener.exitPageNumber(self)




    def pageNumber(self):

        localctx = kernSpineParser.PageNumberContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_pageNumber)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 421
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & -2) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & -1) != 0) or ((((_la - 128)) & ~0x3f) == 0 and ((1 << (_la - 128)) & 16255) != 0):
                self.state = 418
                _la = self._input.LA(1)
                if _la <= 0 or _la==135:
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 423
                self._errHandler.sync(self)
                _la = self._input.LA(1)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class VisualTandemInterpretationContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def dynamics_position(self):
            return self.getTypedRuleContext(kernSpineParser.Dynamics_positionContext,0)


        def tandemCue(self):
            return self.getTypedRuleContext(kernSpineParser.TandemCueContext,0)


        def tandemTremolo(self):
            return self.getTypedRuleContext(kernSpineParser.TandemTremoloContext,0)


        def rscale(self):
            return self.getTypedRuleContext(kernSpineParser.RscaleContext,0)


        def pedal(self):
            return self.getTypedRuleContext(kernSpineParser.PedalContext,0)


        def ela(self):
            return self.getTypedRuleContext(kernSpineParser.ElaContext,0)


        def tandemTuplet(self):
            return self.getTypedRuleContext(kernSpineParser.TandemTupletContext,0)


        def TANDEM_TSTART(self):
            return self.getToken(kernSpineParser.TANDEM_TSTART, 0)

        def TANDEM_TEND(self):
            return self.getToken(kernSpineParser.TANDEM_TEND, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_visualTandemInterpretation

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterVisualTandemInterpretation" ):
                listener.enterVisualTandemInterpretation(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitVisualTandemInterpretation" ):
                listener.exitVisualTandemInterpretation(self)




    def visualTandemInterpretation(self):

        localctx = kernSpineParser.VisualTandemInterpretationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 42, self.RULE_visualTandemInterpretation)
        try:
            self.state = 433
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [17, 18, 19]:
                self.enterOuterAlt(localctx, 1)
                self.state = 424
                self.dynamics_position()
                pass
            elif token in [25, 26]:
                self.enterOuterAlt(localctx, 2)
                self.state = 425
                self.tandemCue()
                pass
            elif token in [27, 28]:
                self.enterOuterAlt(localctx, 3)
                self.state = 426
                self.tandemTremolo()
                pass
            elif token in [31]:
                self.enterOuterAlt(localctx, 4)
                self.state = 427
                self.rscale()
                pass
            elif token in [20, 22]:
                self.enterOuterAlt(localctx, 5)
                self.state = 428
                self.pedal()
                pass
            elif token in [21]:
                self.enterOuterAlt(localctx, 6)
                self.state = 429
                self.ela()
                pass
            elif token in [23, 24]:
                self.enterOuterAlt(localctx, 7)
                self.state = 430
                self.tandemTuplet()
                pass
            elif token in [29]:
                self.enterOuterAlt(localctx, 8)
                self.state = 431
                self.match(kernSpineParser.TANDEM_TSTART)
                pass
            elif token in [30]:
                self.enterOuterAlt(localctx, 9)
                self.state = 432
                self.match(kernSpineParser.TANDEM_TEND)
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AssociatedIDSContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def number(self):
            return self.getTypedRuleContext(kernSpineParser.NumberContext,0)


        def COMMA(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.COMMA)
            else:
                return self.getToken(kernSpineParser.COMMA, i)

        def associatedIDS(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.AssociatedIDSContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.AssociatedIDSContext,i)


        def getRuleIndex(self):
            return kernSpineParser.RULE_associatedIDS

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAssociatedIDS" ):
                listener.enterAssociatedIDS(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAssociatedIDS" ):
                listener.exitAssociatedIDS(self)




    def associatedIDS(self):

        localctx = kernSpineParser.AssociatedIDSContext(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_associatedIDS)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 435
            self.number()
            self.state = 440
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,23,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 436
                    self.match(kernSpineParser.COMMA)
                    self.state = 437
                    self.associatedIDS() 
                self.state = 442
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,23,self._ctx)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PlaceHolderContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DOT(self):
            return self.getToken(kernSpineParser.DOT, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_placeHolder

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPlaceHolder" ):
                listener.enterPlaceHolder(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPlaceHolder" ):
                listener.exitPlaceHolder(self)




    def placeHolder(self):

        localctx = kernSpineParser.PlaceHolderContext(self, self._ctx, self.state)
        self.enterRule(localctx, 46, self.RULE_placeHolder)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 443
            self.match(kernSpineParser.DOT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class OctaveShiftContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OCTAVE_SHIFT(self):
            return self.getToken(kernSpineParser.OCTAVE_SHIFT, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_octaveShift

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOctaveShift" ):
                listener.enterOctaveShift(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOctaveShift" ):
                listener.exitOctaveShift(self)




    def octaveShift(self):

        localctx = kernSpineParser.OctaveShiftContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_octaveShift)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 445
            self.match(kernSpineParser.OCTAVE_SHIFT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PianoHandContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_LEFT_HAND(self):
            return self.getToken(kernSpineParser.TANDEM_LEFT_HAND, 0)

        def TANDEM_RIGHT_HAND(self):
            return self.getToken(kernSpineParser.TANDEM_RIGHT_HAND, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_pianoHand

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPianoHand" ):
                listener.enterPianoHand(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPianoHand" ):
                listener.exitPianoHand(self)




    def pianoHand(self):

        localctx = kernSpineParser.PianoHandContext(self, self._ctx, self.state)
        self.enterRule(localctx, 50, self.RULE_pianoHand)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 447
            _la = self._input.LA(1)
            if not(_la==15 or _la==16):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TandemTupletContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_TUPLET_START(self):
            return self.getToken(kernSpineParser.TANDEM_TUPLET_START, 0)

        def TANDEM_TUPLET_END(self):
            return self.getToken(kernSpineParser.TANDEM_TUPLET_END, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_tandemTuplet

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTandemTuplet" ):
                listener.enterTandemTuplet(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTandemTuplet" ):
                listener.exitTandemTuplet(self)




    def tandemTuplet(self):

        localctx = kernSpineParser.TandemTupletContext(self, self._ctx, self.state)
        self.enterRule(localctx, 52, self.RULE_tandemTuplet)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 449
            _la = self._input.LA(1)
            if not(_la==23 or _la==24):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TandemCueContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_CUE_START(self):
            return self.getToken(kernSpineParser.TANDEM_CUE_START, 0)

        def TANDEM_CUE_END(self):
            return self.getToken(kernSpineParser.TANDEM_CUE_END, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_tandemCue

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTandemCue" ):
                listener.enterTandemCue(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTandemCue" ):
                listener.exitTandemCue(self)




    def tandemCue(self):

        localctx = kernSpineParser.TandemCueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 54, self.RULE_tandemCue)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 451
            _la = self._input.LA(1)
            if not(_la==25 or _la==26):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TandemTremoloContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_TREMOLO_START(self):
            return self.getToken(kernSpineParser.TANDEM_TREMOLO_START, 0)

        def TANDEM_TREMOLO_END(self):
            return self.getToken(kernSpineParser.TANDEM_TREMOLO_END, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_tandemTremolo

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTandemTremolo" ):
                listener.enterTandemTremolo(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTandemTremolo" ):
                listener.exitTandemTremolo(self)




    def tandemTremolo(self):

        localctx = kernSpineParser.TandemTremoloContext(self, self._ctx, self.state)
        self.enterRule(localctx, 56, self.RULE_tandemTremolo)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 453
            _la = self._input.LA(1)
            if not(_la==27 or _la==28):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class OssiaContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_SIC(self):
            return self.getToken(kernSpineParser.TANDEM_SIC, 0)

        def TANDEM_OSSIA(self):
            return self.getToken(kernSpineParser.TANDEM_OSSIA, 0)

        def TANDEM_FIN(self):
            return self.getToken(kernSpineParser.TANDEM_FIN, 0)

        def TANDEM_SMINUS(self):
            return self.getToken(kernSpineParser.TANDEM_SMINUS, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_ossia

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterOssia" ):
                listener.enterOssia(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitOssia" ):
                listener.exitOssia(self)




    def ossia(self):

        localctx = kernSpineParser.OssiaContext(self, self._ctx, self.state)
        self.enterRule(localctx, 58, self.RULE_ossia)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 455
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 128849018880) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RscaleContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_RSCALE(self):
            return self.getToken(kernSpineParser.TANDEM_RSCALE, 0)

        def COLON(self):
            return self.getToken(kernSpineParser.COLON, 0)

        def number(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.NumberContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.NumberContext,i)


        def SLASH(self):
            return self.getToken(kernSpineParser.SLASH, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_rscale

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRscale" ):
                listener.enterRscale(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRscale" ):
                listener.exitRscale(self)




    def rscale(self):

        localctx = kernSpineParser.RscaleContext(self, self._ctx, self.state)
        self.enterRule(localctx, 60, self.RULE_rscale)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 457
            self.match(kernSpineParser.TANDEM_RSCALE)
            self.state = 458
            self.match(kernSpineParser.COLON)
            self.state = 459
            self.number()
            self.state = 462
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==129:
                self.state = 460
                self.match(kernSpineParser.SLASH)
                self.state = 461
                self.number()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PedalContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_PEDAL_START(self):
            return self.getToken(kernSpineParser.TANDEM_PEDAL_START, 0)

        def TANDEM_PEDAL_END(self):
            return self.getToken(kernSpineParser.TANDEM_PEDAL_END, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_pedal

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPedal" ):
                listener.enterPedal(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPedal" ):
                listener.exitPedal(self)




    def pedal(self):

        localctx = kernSpineParser.PedalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 62, self.RULE_pedal)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 464
            _la = self._input.LA(1)
            if not(_la==20 or _la==22):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ElaContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_ELA(self):
            return self.getToken(kernSpineParser.TANDEM_ELA, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_ela

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterEla" ):
                listener.enterEla(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitEla" ):
                listener.exitEla(self)




    def ela(self):

        localctx = kernSpineParser.ElaContext(self, self._ctx, self.state)
        self.enterRule(localctx, 64, self.RULE_ela)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 466
            self.match(kernSpineParser.TANDEM_ELA)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Dynamics_positionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_ABOVE(self):
            return self.getToken(kernSpineParser.TANDEM_ABOVE, 0)

        def TANDEM_BELOW(self):
            return self.getToken(kernSpineParser.TANDEM_BELOW, 0)

        def TANDEM_CENTERED(self):
            return self.getToken(kernSpineParser.TANDEM_CENTERED, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_dynamics_position

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDynamics_position" ):
                listener.enterDynamics_position(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDynamics_position" ):
                listener.exitDynamics_position(self)




    def dynamics_position(self):

        localctx = kernSpineParser.Dynamics_positionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 66, self.RULE_dynamics_position)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 468
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 917504) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SectionsContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_SECTION(self):
            return self.getToken(kernSpineParser.TANDEM_SECTION, 0)

        def LEFT_BRACKET(self):
            return self.getToken(kernSpineParser.LEFT_BRACKET, 0)

        def sectionNames(self):
            return self.getTypedRuleContext(kernSpineParser.SectionNamesContext,0)


        def RIGHT_BRACKET(self):
            return self.getToken(kernSpineParser.RIGHT_BRACKET, 0)

        def sectionName(self):
            return self.getTypedRuleContext(kernSpineParser.SectionNameContext,0)


        def NO_REPEAT(self):
            return self.getToken(kernSpineParser.NO_REPEAT, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_sections

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSections" ):
                listener.enterSections(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSections" ):
                listener.exitSections(self)




    def sections(self):

        localctx = kernSpineParser.SectionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 68, self.RULE_sections)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 470
            self.match(kernSpineParser.TANDEM_SECTION)
            self.state = 479
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [14, 114]:
                self.state = 472
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==14:
                    self.state = 471
                    self.match(kernSpineParser.NO_REPEAT)


                self.state = 474
                self.match(kernSpineParser.LEFT_BRACKET)
                self.state = 475
                self.sectionNames()
                self.state = 476
                self.match(kernSpineParser.RIGHT_BRACKET)
                pass
            elif token in [44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 139]:
                self.state = 478
                self.sectionName()
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SectionNamesContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def sectionName(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.SectionNameContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.SectionNameContext,i)


        def COMMA(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.COMMA)
            else:
                return self.getToken(kernSpineParser.COMMA, i)

        def getRuleIndex(self):
            return kernSpineParser.RULE_sectionNames

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSectionNames" ):
                listener.enterSectionNames(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSectionNames" ):
                listener.exitSectionNames(self)




    def sectionNames(self):

        localctx = kernSpineParser.SectionNamesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 70, self.RULE_sectionNames)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 481
            self.sectionName()
            self.state = 486
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==137:
                self.state = 482
                self.match(kernSpineParser.COMMA)
                self.state = 483
                self.sectionName()
                self.state = 488
                self._errHandler.sync(self)
                _la = self._input.LA(1)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SectionNameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_A(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_A)
            else:
                return self.getToken(kernSpineParser.CHAR_A, i)

        def CHAR_B(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_B)
            else:
                return self.getToken(kernSpineParser.CHAR_B, i)

        def CHAR_C(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_C)
            else:
                return self.getToken(kernSpineParser.CHAR_C, i)

        def CHAR_D(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_D)
            else:
                return self.getToken(kernSpineParser.CHAR_D, i)

        def CHAR_E(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_E)
            else:
                return self.getToken(kernSpineParser.CHAR_E, i)

        def CHAR_F(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_F)
            else:
                return self.getToken(kernSpineParser.CHAR_F, i)

        def CHAR_G(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_G)
            else:
                return self.getToken(kernSpineParser.CHAR_G, i)

        def CHAR_H(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_H)
            else:
                return self.getToken(kernSpineParser.CHAR_H, i)

        def CHAR_I(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_I)
            else:
                return self.getToken(kernSpineParser.CHAR_I, i)

        def CHAR_J(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_J)
            else:
                return self.getToken(kernSpineParser.CHAR_J, i)

        def CHAR_K(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_K)
            else:
                return self.getToken(kernSpineParser.CHAR_K, i)

        def CHAR_L(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_L)
            else:
                return self.getToken(kernSpineParser.CHAR_L, i)

        def CHAR_M(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_M)
            else:
                return self.getToken(kernSpineParser.CHAR_M, i)

        def CHAR_N(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_N)
            else:
                return self.getToken(kernSpineParser.CHAR_N, i)

        def CHAR_O(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_O)
            else:
                return self.getToken(kernSpineParser.CHAR_O, i)

        def CHAR_P(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_P)
            else:
                return self.getToken(kernSpineParser.CHAR_P, i)

        def CHAR_Q(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_Q)
            else:
                return self.getToken(kernSpineParser.CHAR_Q, i)

        def CHAR_R(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_R)
            else:
                return self.getToken(kernSpineParser.CHAR_R, i)

        def CHAR_S(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_S)
            else:
                return self.getToken(kernSpineParser.CHAR_S, i)

        def CHAR_T(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_T)
            else:
                return self.getToken(kernSpineParser.CHAR_T, i)

        def CHAR_U(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_U)
            else:
                return self.getToken(kernSpineParser.CHAR_U, i)

        def CHAR_V(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_V)
            else:
                return self.getToken(kernSpineParser.CHAR_V, i)

        def CHAR_W(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_W)
            else:
                return self.getToken(kernSpineParser.CHAR_W, i)

        def CHAR_X(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_X)
            else:
                return self.getToken(kernSpineParser.CHAR_X, i)

        def CHAR_Y(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_Y)
            else:
                return self.getToken(kernSpineParser.CHAR_Y, i)

        def CHAR_Z(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_Z)
            else:
                return self.getToken(kernSpineParser.CHAR_Z, i)

        def CHAR_a(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_a)
            else:
                return self.getToken(kernSpineParser.CHAR_a, i)

        def CHAR_b(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_b)
            else:
                return self.getToken(kernSpineParser.CHAR_b, i)

        def CHAR_c(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_c)
            else:
                return self.getToken(kernSpineParser.CHAR_c, i)

        def CHAR_d(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_d)
            else:
                return self.getToken(kernSpineParser.CHAR_d, i)

        def CHAR_e(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_e)
            else:
                return self.getToken(kernSpineParser.CHAR_e, i)

        def CHAR_f(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_f)
            else:
                return self.getToken(kernSpineParser.CHAR_f, i)

        def CHAR_g(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_g)
            else:
                return self.getToken(kernSpineParser.CHAR_g, i)

        def CHAR_h(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_h)
            else:
                return self.getToken(kernSpineParser.CHAR_h, i)

        def CHAR_i(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_i)
            else:
                return self.getToken(kernSpineParser.CHAR_i, i)

        def CHAR_j(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_j)
            else:
                return self.getToken(kernSpineParser.CHAR_j, i)

        def CHAR_k(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_k)
            else:
                return self.getToken(kernSpineParser.CHAR_k, i)

        def CHAR_l(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_l)
            else:
                return self.getToken(kernSpineParser.CHAR_l, i)

        def CHAR_m(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_m)
            else:
                return self.getToken(kernSpineParser.CHAR_m, i)

        def CHAR_n(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_n)
            else:
                return self.getToken(kernSpineParser.CHAR_n, i)

        def CHAR_o(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_o)
            else:
                return self.getToken(kernSpineParser.CHAR_o, i)

        def CHAR_p(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_p)
            else:
                return self.getToken(kernSpineParser.CHAR_p, i)

        def CHAR_q(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_q)
            else:
                return self.getToken(kernSpineParser.CHAR_q, i)

        def CHAR_r(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_r)
            else:
                return self.getToken(kernSpineParser.CHAR_r, i)

        def CHAR_s(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_s)
            else:
                return self.getToken(kernSpineParser.CHAR_s, i)

        def CHAR_t(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_t)
            else:
                return self.getToken(kernSpineParser.CHAR_t, i)

        def CHAR_u(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_u)
            else:
                return self.getToken(kernSpineParser.CHAR_u, i)

        def CHAR_v(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_v)
            else:
                return self.getToken(kernSpineParser.CHAR_v, i)

        def CHAR_w(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_w)
            else:
                return self.getToken(kernSpineParser.CHAR_w, i)

        def CHAR_x(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_x)
            else:
                return self.getToken(kernSpineParser.CHAR_x, i)

        def CHAR_y(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_y)
            else:
                return self.getToken(kernSpineParser.CHAR_y, i)

        def CHAR_z(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_z)
            else:
                return self.getToken(kernSpineParser.CHAR_z, i)

        def SPACE(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.SPACE)
            else:
                return self.getToken(kernSpineParser.SPACE, i)

        def number(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.NumberContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.NumberContext,i)


        def getRuleIndex(self):
            return kernSpineParser.RULE_sectionName

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSectionName" ):
                listener.enterSectionName(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSectionName" ):
                listener.exitSectionName(self)




    def sectionName(self):

        localctx = kernSpineParser.SectionNameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 72, self.RULE_sectionName)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 543 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 543
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [44]:
                    self.state = 489
                    self.match(kernSpineParser.CHAR_A)
                    pass
                elif token in [45]:
                    self.state = 490
                    self.match(kernSpineParser.CHAR_B)
                    pass
                elif token in [46]:
                    self.state = 491
                    self.match(kernSpineParser.CHAR_C)
                    pass
                elif token in [47]:
                    self.state = 492
                    self.match(kernSpineParser.CHAR_D)
                    pass
                elif token in [48]:
                    self.state = 493
                    self.match(kernSpineParser.CHAR_E)
                    pass
                elif token in [49]:
                    self.state = 494
                    self.match(kernSpineParser.CHAR_F)
                    pass
                elif token in [50]:
                    self.state = 495
                    self.match(kernSpineParser.CHAR_G)
                    pass
                elif token in [51]:
                    self.state = 496
                    self.match(kernSpineParser.CHAR_H)
                    pass
                elif token in [52]:
                    self.state = 497
                    self.match(kernSpineParser.CHAR_I)
                    pass
                elif token in [53]:
                    self.state = 498
                    self.match(kernSpineParser.CHAR_J)
                    pass
                elif token in [54]:
                    self.state = 499
                    self.match(kernSpineParser.CHAR_K)
                    pass
                elif token in [55]:
                    self.state = 500
                    self.match(kernSpineParser.CHAR_L)
                    pass
                elif token in [56]:
                    self.state = 501
                    self.match(kernSpineParser.CHAR_M)
                    pass
                elif token in [57]:
                    self.state = 502
                    self.match(kernSpineParser.CHAR_N)
                    pass
                elif token in [58]:
                    self.state = 503
                    self.match(kernSpineParser.CHAR_O)
                    pass
                elif token in [59]:
                    self.state = 504
                    self.match(kernSpineParser.CHAR_P)
                    pass
                elif token in [60]:
                    self.state = 505
                    self.match(kernSpineParser.CHAR_Q)
                    pass
                elif token in [61]:
                    self.state = 506
                    self.match(kernSpineParser.CHAR_R)
                    pass
                elif token in [62]:
                    self.state = 507
                    self.match(kernSpineParser.CHAR_S)
                    pass
                elif token in [63]:
                    self.state = 508
                    self.match(kernSpineParser.CHAR_T)
                    pass
                elif token in [64]:
                    self.state = 509
                    self.match(kernSpineParser.CHAR_U)
                    pass
                elif token in [65]:
                    self.state = 510
                    self.match(kernSpineParser.CHAR_V)
                    pass
                elif token in [66]:
                    self.state = 511
                    self.match(kernSpineParser.CHAR_W)
                    pass
                elif token in [67]:
                    self.state = 512
                    self.match(kernSpineParser.CHAR_X)
                    pass
                elif token in [68]:
                    self.state = 513
                    self.match(kernSpineParser.CHAR_Y)
                    pass
                elif token in [69]:
                    self.state = 514
                    self.match(kernSpineParser.CHAR_Z)
                    pass
                elif token in [70]:
                    self.state = 515
                    self.match(kernSpineParser.CHAR_a)
                    pass
                elif token in [71]:
                    self.state = 516
                    self.match(kernSpineParser.CHAR_b)
                    pass
                elif token in [72]:
                    self.state = 517
                    self.match(kernSpineParser.CHAR_c)
                    pass
                elif token in [73]:
                    self.state = 518
                    self.match(kernSpineParser.CHAR_d)
                    pass
                elif token in [74]:
                    self.state = 519
                    self.match(kernSpineParser.CHAR_e)
                    pass
                elif token in [75]:
                    self.state = 520
                    self.match(kernSpineParser.CHAR_f)
                    pass
                elif token in [76]:
                    self.state = 521
                    self.match(kernSpineParser.CHAR_g)
                    pass
                elif token in [77]:
                    self.state = 522
                    self.match(kernSpineParser.CHAR_h)
                    pass
                elif token in [78]:
                    self.state = 523
                    self.match(kernSpineParser.CHAR_i)
                    pass
                elif token in [79]:
                    self.state = 524
                    self.match(kernSpineParser.CHAR_j)
                    pass
                elif token in [80]:
                    self.state = 525
                    self.match(kernSpineParser.CHAR_k)
                    pass
                elif token in [81]:
                    self.state = 526
                    self.match(kernSpineParser.CHAR_l)
                    pass
                elif token in [82]:
                    self.state = 527
                    self.match(kernSpineParser.CHAR_m)
                    pass
                elif token in [83]:
                    self.state = 528
                    self.match(kernSpineParser.CHAR_n)
                    pass
                elif token in [84]:
                    self.state = 529
                    self.match(kernSpineParser.CHAR_o)
                    pass
                elif token in [85]:
                    self.state = 530
                    self.match(kernSpineParser.CHAR_p)
                    pass
                elif token in [86]:
                    self.state = 531
                    self.match(kernSpineParser.CHAR_q)
                    pass
                elif token in [87]:
                    self.state = 532
                    self.match(kernSpineParser.CHAR_r)
                    pass
                elif token in [88]:
                    self.state = 533
                    self.match(kernSpineParser.CHAR_s)
                    pass
                elif token in [89]:
                    self.state = 534
                    self.match(kernSpineParser.CHAR_t)
                    pass
                elif token in [90]:
                    self.state = 535
                    self.match(kernSpineParser.CHAR_u)
                    pass
                elif token in [91]:
                    self.state = 536
                    self.match(kernSpineParser.CHAR_v)
                    pass
                elif token in [92]:
                    self.state = 537
                    self.match(kernSpineParser.CHAR_w)
                    pass
                elif token in [93]:
                    self.state = 538
                    self.match(kernSpineParser.CHAR_x)
                    pass
                elif token in [94]:
                    self.state = 539
                    self.match(kernSpineParser.CHAR_y)
                    pass
                elif token in [95]:
                    self.state = 540
                    self.match(kernSpineParser.CHAR_z)
                    pass
                elif token in [139]:
                    self.state = 541
                    self.match(kernSpineParser.SPACE)
                    pass
                elif token in [97, 98, 99, 100, 101, 102, 103, 104, 105, 106]:
                    self.state = 542
                    self.number()
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 545 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (((((_la - 44)) & ~0x3f) == 0 and ((1 << (_la - 44)) & 9218868437227405311) != 0) or _la==139):
                    break

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TranspositionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_TRANSPOSITION(self):
            return self.getToken(kernSpineParser.TANDEM_TRANSPOSITION, 0)

        def CHAR_d(self):
            return self.getToken(kernSpineParser.CHAR_d, 0)

        def number(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.NumberContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.NumberContext,i)


        def CHAR_c(self):
            return self.getToken(kernSpineParser.CHAR_c, 0)

        def MINUS(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.MINUS)
            else:
                return self.getToken(kernSpineParser.MINUS, i)

        def getRuleIndex(self):
            return kernSpineParser.RULE_transposition

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTransposition" ):
                listener.enterTransposition(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTransposition" ):
                listener.exitTransposition(self)




    def transposition(self):

        localctx = kernSpineParser.TranspositionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 74, self.RULE_transposition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 547
            self.match(kernSpineParser.TANDEM_TRANSPOSITION)
            self.state = 548
            self.match(kernSpineParser.CHAR_d)
            self.state = 550
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==120:
                self.state = 549
                self.match(kernSpineParser.MINUS)


            self.state = 552
            self.number()
            self.state = 553
            self.match(kernSpineParser.CHAR_c)
            self.state = 555
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==120:
                self.state = 554
                self.match(kernSpineParser.MINUS)


            self.state = 557
            self.number()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class InstrumentContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def INSTRUMENT(self):
            return self.getToken(kernSpineParser.INSTRUMENT, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_instrument

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterInstrument" ):
                listener.enterInstrument(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitInstrument" ):
                listener.exitInstrument(self)




    def instrument(self):

        localctx = kernSpineParser.InstrumentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 76, self.RULE_instrument)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 559
            self.match(kernSpineParser.INSTRUMENT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class InstrumentTitleContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def INSTRUMENT_TITLE(self):
            return self.getToken(kernSpineParser.INSTRUMENT_TITLE, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_instrumentTitle

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterInstrumentTitle" ):
                listener.enterInstrumentTitle(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitInstrumentTitle" ):
                listener.exitInstrumentTitle(self)




    def instrumentTitle(self):

        localctx = kernSpineParser.InstrumentTitleContext(self, self._ctx, self.state)
        self.enterRule(localctx, 78, self.RULE_instrumentTitle)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 561
            self.match(kernSpineParser.INSTRUMENT_TITLE)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class NumberContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DIGIT_0(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.DIGIT_0)
            else:
                return self.getToken(kernSpineParser.DIGIT_0, i)

        def DIGIT_1(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.DIGIT_1)
            else:
                return self.getToken(kernSpineParser.DIGIT_1, i)

        def DIGIT_2(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.DIGIT_2)
            else:
                return self.getToken(kernSpineParser.DIGIT_2, i)

        def DIGIT_3(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.DIGIT_3)
            else:
                return self.getToken(kernSpineParser.DIGIT_3, i)

        def DIGIT_4(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.DIGIT_4)
            else:
                return self.getToken(kernSpineParser.DIGIT_4, i)

        def DIGIT_5(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.DIGIT_5)
            else:
                return self.getToken(kernSpineParser.DIGIT_5, i)

        def DIGIT_6(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.DIGIT_6)
            else:
                return self.getToken(kernSpineParser.DIGIT_6, i)

        def DIGIT_7(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.DIGIT_7)
            else:
                return self.getToken(kernSpineParser.DIGIT_7, i)

        def DIGIT_8(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.DIGIT_8)
            else:
                return self.getToken(kernSpineParser.DIGIT_8, i)

        def DIGIT_9(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.DIGIT_9)
            else:
                return self.getToken(kernSpineParser.DIGIT_9, i)

        def getRuleIndex(self):
            return kernSpineParser.RULE_number

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNumber" ):
                listener.enterNumber(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNumber" ):
                listener.exitNumber(self)




    def number(self):

        localctx = kernSpineParser.NumberContext(self, self._ctx, self.state)
        self.enterRule(localctx, 80, self.RULE_number)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 564 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 563
                    _la = self._input.LA(1)
                    if not(((((_la - 97)) & ~0x3f) == 0 and ((1 << (_la - 97)) & 1023) != 0)):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()

                else:
                    raise NoViableAltException(self)
                self.state = 566 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,32,self._ctx)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class LowerCasePitchContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_a(self):
            return self.getToken(kernSpineParser.CHAR_a, 0)

        def CHAR_b(self):
            return self.getToken(kernSpineParser.CHAR_b, 0)

        def CHAR_c(self):
            return self.getToken(kernSpineParser.CHAR_c, 0)

        def CHAR_d(self):
            return self.getToken(kernSpineParser.CHAR_d, 0)

        def CHAR_e(self):
            return self.getToken(kernSpineParser.CHAR_e, 0)

        def CHAR_f(self):
            return self.getToken(kernSpineParser.CHAR_f, 0)

        def CHAR_g(self):
            return self.getToken(kernSpineParser.CHAR_g, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_lowerCasePitch

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterLowerCasePitch" ):
                listener.enterLowerCasePitch(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitLowerCasePitch" ):
                listener.exitLowerCasePitch(self)




    def lowerCasePitch(self):

        localctx = kernSpineParser.LowerCasePitchContext(self, self._ctx, self.state)
        self.enterRule(localctx, 82, self.RULE_lowerCasePitch)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 568
            _la = self._input.LA(1)
            if not(((((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 127) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class UpperCasePitchContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_A(self):
            return self.getToken(kernSpineParser.CHAR_A, 0)

        def CHAR_B(self):
            return self.getToken(kernSpineParser.CHAR_B, 0)

        def CHAR_C(self):
            return self.getToken(kernSpineParser.CHAR_C, 0)

        def CHAR_D(self):
            return self.getToken(kernSpineParser.CHAR_D, 0)

        def CHAR_E(self):
            return self.getToken(kernSpineParser.CHAR_E, 0)

        def CHAR_F(self):
            return self.getToken(kernSpineParser.CHAR_F, 0)

        def CHAR_G(self):
            return self.getToken(kernSpineParser.CHAR_G, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_upperCasePitch

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterUpperCasePitch" ):
                listener.enterUpperCasePitch(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitUpperCasePitch" ):
                listener.exitUpperCasePitch(self)




    def upperCasePitch(self):

        localctx = kernSpineParser.UpperCasePitchContext(self, self._ctx, self.state)
        self.enterRule(localctx, 84, self.RULE_upperCasePitch)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 570
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 2234207627640832) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PitchClassContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def lowerCasePitch(self):
            return self.getTypedRuleContext(kernSpineParser.LowerCasePitchContext,0)


        def accidental(self):
            return self.getTypedRuleContext(kernSpineParser.AccidentalContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_pitchClass

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPitchClass" ):
                listener.enterPitchClass(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPitchClass" ):
                listener.exitPitchClass(self)




    def pitchClass(self):

        localctx = kernSpineParser.PitchClassContext(self, self._ctx, self.state)
        self.enterRule(localctx, 86, self.RULE_pitchClass)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 572
            self.lowerCasePitch()
            self.state = 573
            self.accidental()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AccompContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_ACCOMP(self):
            return self.getToken(kernSpineParser.TANDEM_ACCOMP, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_accomp

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAccomp" ):
                listener.enterAccomp(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAccomp" ):
                listener.exitAccomp(self)




    def accomp(self):

        localctx = kernSpineParser.AccompContext(self, self._ctx, self.state)
        self.enterRule(localctx, 88, self.RULE_accomp)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 575
            self.match(kernSpineParser.TANDEM_ACCOMP)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SoloContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_SOLO(self):
            return self.getToken(kernSpineParser.TANDEM_SOLO, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_solo

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSolo" ):
                listener.enterSolo(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSolo" ):
                listener.exitSolo(self)




    def solo(self):

        localctx = kernSpineParser.SoloContext(self, self._ctx, self.state)
        self.enterRule(localctx, 90, self.RULE_solo)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 577
            self.match(kernSpineParser.TANDEM_SOLO)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class StropheContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_STROPHE(self):
            return self.getToken(kernSpineParser.TANDEM_STROPHE, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_strophe

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStrophe" ):
                listener.enterStrophe(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStrophe" ):
                listener.exitStrophe(self)




    def strophe(self):

        localctx = kernSpineParser.StropheContext(self, self._ctx, self.state)
        self.enterRule(localctx, 92, self.RULE_strophe)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 579
            self.match(kernSpineParser.TANDEM_STROPHE)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TimebaseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_TIMEBASE(self):
            return self.getToken(kernSpineParser.TANDEM_TIMEBASE, 0)

        def number(self):
            return self.getTypedRuleContext(kernSpineParser.NumberContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_timebase

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTimebase" ):
                listener.enterTimebase(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTimebase" ):
                listener.exitTimebase(self)




    def timebase(self):

        localctx = kernSpineParser.TimebaseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 94, self.RULE_timebase)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 581
            self.match(kernSpineParser.TANDEM_TIMEBASE)
            self.state = 582
            self.number()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PartContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_PART(self):
            return self.getToken(kernSpineParser.TANDEM_PART, 0)

        def number(self):
            return self.getTypedRuleContext(kernSpineParser.NumberContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_part

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPart" ):
                listener.enterPart(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPart" ):
                listener.exitPart(self)




    def part(self):

        localctx = kernSpineParser.PartContext(self, self._ctx, self.state)
        self.enterRule(localctx, 96, self.RULE_part)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 584
            self.match(kernSpineParser.TANDEM_PART)
            self.state = 585
            self.number()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class GroupContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_GROUP(self):
            return self.getToken(kernSpineParser.TANDEM_GROUP, 0)

        def number(self):
            return self.getTypedRuleContext(kernSpineParser.NumberContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_group

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGroup" ):
                listener.enterGroup(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGroup" ):
                listener.exitGroup(self)




    def group(self):

        localctx = kernSpineParser.GroupContext(self, self._ctx, self.state)
        self.enterRule(localctx, 98, self.RULE_group)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 587
            self.match(kernSpineParser.TANDEM_GROUP)
            self.state = 588
            self.number()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class StaffContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_STAFF(self):
            return self.getToken(kernSpineParser.TANDEM_STAFF, 0)

        def number(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.NumberContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.NumberContext,i)


        def PLUS(self):
            return self.getToken(kernSpineParser.PLUS, 0)

        def SLASH(self):
            return self.getToken(kernSpineParser.SLASH, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_staff

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStaff" ):
                listener.enterStaff(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStaff" ):
                listener.exitStaff(self)




    def staff(self):

        localctx = kernSpineParser.StaffContext(self, self._ctx, self.state)
        self.enterRule(localctx, 100, self.RULE_staff)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 590
            self.match(kernSpineParser.TANDEM_STAFF)
            self.state = 592
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==119:
                self.state = 591
                self.match(kernSpineParser.PLUS)


            self.state = 594
            self.number()
            self.state = 597
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==129:
                self.state = 595
                self.match(kernSpineParser.SLASH)
                self.state = 596
                self.number()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ClefContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_CLEF(self):
            return self.getToken(kernSpineParser.TANDEM_CLEF, 0)

        def clefValue(self):
            return self.getTypedRuleContext(kernSpineParser.ClefValueContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_clef

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterClef" ):
                listener.enterClef(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitClef" ):
                listener.exitClef(self)




    def clef(self):

        localctx = kernSpineParser.ClefContext(self, self._ctx, self.state)
        self.enterRule(localctx, 102, self.RULE_clef)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 599
            self.match(kernSpineParser.TANDEM_CLEF)
            self.state = 600
            self.clefValue()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ClefValueContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def clefSign(self):
            return self.getTypedRuleContext(kernSpineParser.ClefSignContext,0)


        def clefOctave(self):
            return self.getTypedRuleContext(kernSpineParser.ClefOctaveContext,0)


        def clefLine(self):
            return self.getTypedRuleContext(kernSpineParser.ClefLineContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_clefValue

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterClefValue" ):
                listener.enterClefValue(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitClefValue" ):
                listener.exitClefValue(self)




    def clefValue(self):

        localctx = kernSpineParser.ClefValueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 104, self.RULE_clefValue)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 602
            self.clefSign()
            self.state = 604
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==91 or _la==125:
                self.state = 603
                self.clefOctave()


            self.state = 607
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if ((((_la - 98)) & ~0x3f) == 0 and ((1 << (_la - 98)) & 31) != 0):
                self.state = 606
                self.clefLine()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ClefSignContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_C(self):
            return self.getToken(kernSpineParser.CHAR_C, 0)

        def CHAR_F(self):
            return self.getToken(kernSpineParser.CHAR_F, 0)

        def CHAR_G(self):
            return self.getToken(kernSpineParser.CHAR_G, 0)

        def CHAR_P(self):
            return self.getToken(kernSpineParser.CHAR_P, 0)

        def CHAR_T(self):
            return self.getToken(kernSpineParser.CHAR_T, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_clefSign

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterClefSign" ):
                listener.enterClefSign(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitClefSign" ):
                listener.exitClefSign(self)




    def clefSign(self):

        localctx = kernSpineParser.ClefSignContext(self, self._ctx, self.state)
        self.enterRule(localctx, 106, self.RULE_clefSign)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 609
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & -8645152065946910720) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ClefLineContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DIGIT_1(self):
            return self.getToken(kernSpineParser.DIGIT_1, 0)

        def DIGIT_2(self):
            return self.getToken(kernSpineParser.DIGIT_2, 0)

        def DIGIT_3(self):
            return self.getToken(kernSpineParser.DIGIT_3, 0)

        def DIGIT_4(self):
            return self.getToken(kernSpineParser.DIGIT_4, 0)

        def DIGIT_5(self):
            return self.getToken(kernSpineParser.DIGIT_5, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_clefLine

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterClefLine" ):
                listener.enterClefLine(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitClefLine" ):
                listener.exitClefLine(self)




    def clefLine(self):

        localctx = kernSpineParser.ClefLineContext(self, self._ctx, self.state)
        self.enterRule(localctx, 108, self.RULE_clefLine)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 611
            _la = self._input.LA(1)
            if not(((((_la - 98)) & ~0x3f) == 0 and ((1 << (_la - 98)) & 31) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ClefOctaveContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_v(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_v)
            else:
                return self.getToken(kernSpineParser.CHAR_v, i)

        def CIRCUMFLEX(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CIRCUMFLEX)
            else:
                return self.getToken(kernSpineParser.CIRCUMFLEX, i)

        def getRuleIndex(self):
            return kernSpineParser.RULE_clefOctave

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterClefOctave" ):
                listener.enterClefOctave(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitClefOctave" ):
                listener.exitClefOctave(self)




    def clefOctave(self):

        localctx = kernSpineParser.ClefOctaveContext(self, self._ctx, self.state)
        self.enterRule(localctx, 110, self.RULE_clefOctave)
        self._la = 0 # Token type
        try:
            self.state = 621
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [91]:
                self.enterOuterAlt(localctx, 1)
                self.state = 613
                self.match(kernSpineParser.CHAR_v)
                self.state = 615
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==91:
                    self.state = 614
                    self.match(kernSpineParser.CHAR_v)


                pass
            elif token in [125]:
                self.enterOuterAlt(localctx, 2)
                self.state = 617
                self.match(kernSpineParser.CIRCUMFLEX)
                self.state = 619
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==125:
                    self.state = 618
                    self.match(kernSpineParser.CIRCUMFLEX)


                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class KeySignatureContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_KEY_SIGNATURE(self):
            return self.getToken(kernSpineParser.TANDEM_KEY_SIGNATURE, 0)

        def LEFT_BRACKET(self):
            return self.getToken(kernSpineParser.LEFT_BRACKET, 0)

        def RIGHT_BRACKET(self):
            return self.getToken(kernSpineParser.RIGHT_BRACKET, 0)

        def keySignaturePitchClass(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.KeySignaturePitchClassContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.KeySignaturePitchClassContext,i)


        def keySignatureCancel(self):
            return self.getTypedRuleContext(kernSpineParser.KeySignatureCancelContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_keySignature

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterKeySignature" ):
                listener.enterKeySignature(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitKeySignature" ):
                listener.exitKeySignature(self)




    def keySignature(self):

        localctx = kernSpineParser.KeySignatureContext(self, self._ctx, self.state)
        self.enterRule(localctx, 112, self.RULE_keySignature)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 623
            self.match(kernSpineParser.TANDEM_KEY_SIGNATURE)
            self.state = 624
            self.match(kernSpineParser.LEFT_BRACKET)
            self.state = 628
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 127) != 0):
                self.state = 625
                self.keySignaturePitchClass()
                self.state = 630
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 631
            self.match(kernSpineParser.RIGHT_BRACKET)
            self.state = 633
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==67:
                self.state = 632
                self.keySignatureCancel()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class KeySignaturePitchClassContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def pitchClass(self):
            return self.getTypedRuleContext(kernSpineParser.PitchClassContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_keySignaturePitchClass

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterKeySignaturePitchClass" ):
                listener.enterKeySignaturePitchClass(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitKeySignaturePitchClass" ):
                listener.exitKeySignaturePitchClass(self)




    def keySignaturePitchClass(self):

        localctx = kernSpineParser.KeySignaturePitchClassContext(self, self._ctx, self.state)
        self.enterRule(localctx, 114, self.RULE_keySignaturePitchClass)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 635
            self.pitchClass()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class KeySignatureCancelContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_X(self):
            return self.getToken(kernSpineParser.CHAR_X, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_keySignatureCancel

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterKeySignatureCancel" ):
                listener.enterKeySignatureCancel(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitKeySignatureCancel" ):
                listener.exitKeySignatureCancel(self)




    def keySignatureCancel(self):

        localctx = kernSpineParser.KeySignatureCancelContext(self, self._ctx, self.state)
        self.enterRule(localctx, 116, self.RULE_keySignatureCancel)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 637
            self.match(kernSpineParser.CHAR_X)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class KeyCancelContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_KEYCANCEL(self):
            return self.getToken(kernSpineParser.TANDEM_KEYCANCEL, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_keyCancel

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterKeyCancel" ):
                listener.enterKeyCancel(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitKeyCancel" ):
                listener.exitKeyCancel(self)




    def keyCancel(self):

        localctx = kernSpineParser.KeyCancelContext(self, self._ctx, self.state)
        self.enterRule(localctx, 118, self.RULE_keyCancel)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 639
            self.match(kernSpineParser.TANDEM_KEYCANCEL)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class KeyModeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def minorKey(self):
            return self.getTypedRuleContext(kernSpineParser.MinorKeyContext,0)


        def majorKey(self):
            return self.getTypedRuleContext(kernSpineParser.MajorKeyContext,0)


        def QUESTION_MARK(self):
            return self.getToken(kernSpineParser.QUESTION_MARK, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_keyMode

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterKeyMode" ):
                listener.enterKeyMode(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitKeyMode" ):
                listener.exitKeyMode(self)




    def keyMode(self):

        localctx = kernSpineParser.KeyModeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 120, self.RULE_keyMode)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 644
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [70, 71, 72, 73, 74, 75, 76]:
                self.state = 641
                self.minorKey()
                pass
            elif token in [44, 45, 46, 47, 48, 49, 50]:
                self.state = 642
                self.majorKey()
                pass
            elif token in [138]:
                self.state = 643
                self.match(kernSpineParser.QUESTION_MARK)
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class KeyContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ASTERISK(self):
            return self.getToken(kernSpineParser.ASTERISK, 0)

        def singleKey(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.SingleKeyContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.SingleKeyContext,i)


        def SLASH(self):
            return self.getToken(kernSpineParser.SLASH, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_key

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterKey" ):
                listener.enterKey(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitKey" ):
                listener.exitKey(self)




    def key(self):

        localctx = kernSpineParser.KeyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 122, self.RULE_key)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 646
            self.match(kernSpineParser.ASTERISK)
            self.state = 647
            self.singleKey()
            self.state = 650
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==129:
                self.state = 648
                self.match(kernSpineParser.SLASH)
                self.state = 649
                self.singleKey()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SingleKeyContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def keyMode(self):
            return self.getTypedRuleContext(kernSpineParser.KeyModeContext,0)


        def keySignatureCancel(self):
            return self.getTypedRuleContext(kernSpineParser.KeySignatureCancelContext,0)


        def COLON(self):
            return self.getToken(kernSpineParser.COLON, 0)

        def number(self):
            return self.getTypedRuleContext(kernSpineParser.NumberContext,0)


        def modal(self):
            return self.getTypedRuleContext(kernSpineParser.ModalContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_singleKey

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSingleKey" ):
                listener.enterSingleKey(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSingleKey" ):
                listener.exitSingleKey(self)




    def singleKey(self):

        localctx = kernSpineParser.SingleKeyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 124, self.RULE_singleKey)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 652
            self.keyMode()
            self.state = 654
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==67:
                self.state = 653
                self.keySignatureCancel()


            self.state = 663
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [135]:
                self.state = 656
                self.match(kernSpineParser.COLON)
                self.state = 658
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if ((((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & 39177) != 0):
                    self.state = 657
                    self.modal()


                pass
            elif token in [-1, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 129]:
                self.state = 661
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if ((((_la - 97)) & ~0x3f) == 0 and ((1 << (_la - 97)) & 1023) != 0):
                    self.state = 660
                    self.number()


                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class MinorKeyContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def lowerCasePitch(self):
            return self.getTypedRuleContext(kernSpineParser.LowerCasePitchContext,0)


        def accidental(self):
            return self.getTypedRuleContext(kernSpineParser.AccidentalContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_minorKey

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterMinorKey" ):
                listener.enterMinorKey(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitMinorKey" ):
                listener.exitMinorKey(self)




    def minorKey(self):

        localctx = kernSpineParser.MinorKeyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 126, self.RULE_minorKey)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 665
            self.lowerCasePitch()
            self.state = 667
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if ((((_la - 83)) & ~0x3f) == 0 and ((1 << (_la - 83)) & 171798691841) != 0):
                self.state = 666
                self.accidental()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class MajorKeyContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def upperCasePitch(self):
            return self.getTypedRuleContext(kernSpineParser.UpperCasePitchContext,0)


        def accidental(self):
            return self.getTypedRuleContext(kernSpineParser.AccidentalContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_majorKey

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterMajorKey" ):
                listener.enterMajorKey(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitMajorKey" ):
                listener.exitMajorKey(self)




    def majorKey(self):

        localctx = kernSpineParser.MajorKeyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 128, self.RULE_majorKey)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 669
            self.upperCasePitch()
            self.state = 671
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if ((((_la - 83)) & ~0x3f) == 0 and ((1 << (_la - 83)) & 171798691841) != 0):
                self.state = 670
                self.accidental()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ModalContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def dorian(self):
            return self.getTypedRuleContext(kernSpineParser.DorianContext,0)


        def phrygian(self):
            return self.getTypedRuleContext(kernSpineParser.PhrygianContext,0)


        def lydian(self):
            return self.getTypedRuleContext(kernSpineParser.LydianContext,0)


        def mixolydian(self):
            return self.getTypedRuleContext(kernSpineParser.MixolydianContext,0)


        def aeolian(self):
            return self.getTypedRuleContext(kernSpineParser.AeolianContext,0)


        def ionian(self):
            return self.getTypedRuleContext(kernSpineParser.IonianContext,0)


        def locrian(self):
            return self.getTypedRuleContext(kernSpineParser.LocrianContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_modal

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterModal" ):
                listener.enterModal(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitModal" ):
                listener.exitModal(self)




    def modal(self):

        localctx = kernSpineParser.ModalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 130, self.RULE_modal)
        try:
            self.state = 680
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,50,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 673
                self.dorian()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 674
                self.phrygian()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 675
                self.lydian()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 676
                self.mixolydian()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 677
                self.aeolian()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 678
                self.ionian()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 679
                self.locrian()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class LocrianContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_l(self):
            return self.getToken(kernSpineParser.CHAR_l, 0)

        def CHAR_o(self):
            return self.getToken(kernSpineParser.CHAR_o, 0)

        def CHAR_c(self):
            return self.getToken(kernSpineParser.CHAR_c, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_locrian

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterLocrian" ):
                listener.enterLocrian(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitLocrian" ):
                listener.exitLocrian(self)




    def locrian(self):

        localctx = kernSpineParser.LocrianContext(self, self._ctx, self.state)
        self.enterRule(localctx, 132, self.RULE_locrian)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 682
            self.match(kernSpineParser.CHAR_l)
            self.state = 683
            self.match(kernSpineParser.CHAR_o)
            self.state = 684
            self.match(kernSpineParser.CHAR_c)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class IonianContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_i(self):
            return self.getToken(kernSpineParser.CHAR_i, 0)

        def CHAR_o(self):
            return self.getToken(kernSpineParser.CHAR_o, 0)

        def CHAR_n(self):
            return self.getToken(kernSpineParser.CHAR_n, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_ionian

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterIonian" ):
                listener.enterIonian(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitIonian" ):
                listener.exitIonian(self)




    def ionian(self):

        localctx = kernSpineParser.IonianContext(self, self._ctx, self.state)
        self.enterRule(localctx, 134, self.RULE_ionian)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 686
            self.match(kernSpineParser.CHAR_i)
            self.state = 687
            self.match(kernSpineParser.CHAR_o)
            self.state = 688
            self.match(kernSpineParser.CHAR_n)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AeolianContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_a(self):
            return self.getToken(kernSpineParser.CHAR_a, 0)

        def CHAR_e(self):
            return self.getToken(kernSpineParser.CHAR_e, 0)

        def CHAR_o(self):
            return self.getToken(kernSpineParser.CHAR_o, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_aeolian

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAeolian" ):
                listener.enterAeolian(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAeolian" ):
                listener.exitAeolian(self)




    def aeolian(self):

        localctx = kernSpineParser.AeolianContext(self, self._ctx, self.state)
        self.enterRule(localctx, 136, self.RULE_aeolian)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 690
            self.match(kernSpineParser.CHAR_a)
            self.state = 691
            self.match(kernSpineParser.CHAR_e)
            self.state = 692
            self.match(kernSpineParser.CHAR_o)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class MixolydianContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_m(self):
            return self.getToken(kernSpineParser.CHAR_m, 0)

        def CHAR_i(self):
            return self.getToken(kernSpineParser.CHAR_i, 0)

        def CHAR_x(self):
            return self.getToken(kernSpineParser.CHAR_x, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_mixolydian

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterMixolydian" ):
                listener.enterMixolydian(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitMixolydian" ):
                listener.exitMixolydian(self)




    def mixolydian(self):

        localctx = kernSpineParser.MixolydianContext(self, self._ctx, self.state)
        self.enterRule(localctx, 138, self.RULE_mixolydian)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 694
            self.match(kernSpineParser.CHAR_m)
            self.state = 695
            self.match(kernSpineParser.CHAR_i)
            self.state = 696
            self.match(kernSpineParser.CHAR_x)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class LydianContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_l(self):
            return self.getToken(kernSpineParser.CHAR_l, 0)

        def CHAR_y(self):
            return self.getToken(kernSpineParser.CHAR_y, 0)

        def CHAR_d(self):
            return self.getToken(kernSpineParser.CHAR_d, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_lydian

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterLydian" ):
                listener.enterLydian(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitLydian" ):
                listener.exitLydian(self)




    def lydian(self):

        localctx = kernSpineParser.LydianContext(self, self._ctx, self.state)
        self.enterRule(localctx, 140, self.RULE_lydian)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 698
            self.match(kernSpineParser.CHAR_l)
            self.state = 699
            self.match(kernSpineParser.CHAR_y)
            self.state = 700
            self.match(kernSpineParser.CHAR_d)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PhrygianContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_p(self):
            return self.getToken(kernSpineParser.CHAR_p, 0)

        def CHAR_h(self):
            return self.getToken(kernSpineParser.CHAR_h, 0)

        def CHAR_r(self):
            return self.getToken(kernSpineParser.CHAR_r, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_phrygian

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPhrygian" ):
                listener.enterPhrygian(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPhrygian" ):
                listener.exitPhrygian(self)




    def phrygian(self):

        localctx = kernSpineParser.PhrygianContext(self, self._ctx, self.state)
        self.enterRule(localctx, 142, self.RULE_phrygian)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 702
            self.match(kernSpineParser.CHAR_p)
            self.state = 703
            self.match(kernSpineParser.CHAR_h)
            self.state = 704
            self.match(kernSpineParser.CHAR_r)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DorianContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_d(self):
            return self.getToken(kernSpineParser.CHAR_d, 0)

        def CHAR_o(self):
            return self.getToken(kernSpineParser.CHAR_o, 0)

        def CHAR_r(self):
            return self.getToken(kernSpineParser.CHAR_r, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_dorian

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDorian" ):
                listener.enterDorian(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDorian" ):
                listener.exitDorian(self)




    def dorian(self):

        localctx = kernSpineParser.DorianContext(self, self._ctx, self.state)
        self.enterRule(localctx, 144, self.RULE_dorian)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 706
            self.match(kernSpineParser.CHAR_d)
            self.state = 707
            self.match(kernSpineParser.CHAR_o)
            self.state = 708
            self.match(kernSpineParser.CHAR_r)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TimeSignatureContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TANDEM_TIMESIGNATURE(self):
            return self.getToken(kernSpineParser.TANDEM_TIMESIGNATURE, 0)

        def standardTimeSignature(self):
            return self.getTypedRuleContext(kernSpineParser.StandardTimeSignatureContext,0)


        def additiveTimeSignature(self):
            return self.getTypedRuleContext(kernSpineParser.AdditiveTimeSignatureContext,0)


        def mixedTimeSignature(self):
            return self.getTypedRuleContext(kernSpineParser.MixedTimeSignatureContext,0)


        def alternatingTimeSignature(self):
            return self.getTypedRuleContext(kernSpineParser.AlternatingTimeSignatureContext,0)


        def interchangingTimeSignature(self):
            return self.getTypedRuleContext(kernSpineParser.InterchangingTimeSignatureContext,0)


        def PERCENT(self):
            return self.getToken(kernSpineParser.PERCENT, 0)

        def DIGIT_2(self):
            return self.getToken(kernSpineParser.DIGIT_2, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_timeSignature

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTimeSignature" ):
                listener.enterTimeSignature(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTimeSignature" ):
                listener.exitTimeSignature(self)




    def timeSignature(self):

        localctx = kernSpineParser.TimeSignatureContext(self, self._ctx, self.state)
        self.enterRule(localctx, 146, self.RULE_timeSignature)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 710
            self.match(kernSpineParser.TANDEM_TIMESIGNATURE)
            self.state = 716
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,51,self._ctx)
            if la_ == 1:
                self.state = 711
                self.standardTimeSignature()
                pass

            elif la_ == 2:
                self.state = 712
                self.additiveTimeSignature()
                pass

            elif la_ == 3:
                self.state = 713
                self.mixedTimeSignature()
                pass

            elif la_ == 4:
                self.state = 714
                self.alternatingTimeSignature()
                pass

            elif la_ == 5:
                self.state = 715
                self.interchangingTimeSignature()
                pass


            self.state = 720
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==41:
                self.state = 718
                self.match(kernSpineParser.PERCENT)
                self.state = 719
                self.match(kernSpineParser.DIGIT_2)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class NumeratorContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def number(self):
            return self.getTypedRuleContext(kernSpineParser.NumberContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_numerator

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNumerator" ):
                listener.enterNumerator(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNumerator" ):
                listener.exitNumerator(self)




    def numerator(self):

        localctx = kernSpineParser.NumeratorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 148, self.RULE_numerator)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 722
            self.number()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DenominatorContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def number(self):
            return self.getTypedRuleContext(kernSpineParser.NumberContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_denominator

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDenominator" ):
                listener.enterDenominator(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDenominator" ):
                listener.exitDenominator(self)




    def denominator(self):

        localctx = kernSpineParser.DenominatorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 150, self.RULE_denominator)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 724
            self.number()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class StandardTimeSignatureContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def numerator(self):
            return self.getTypedRuleContext(kernSpineParser.NumeratorContext,0)


        def SLASH(self):
            return self.getToken(kernSpineParser.SLASH, 0)

        def denominator(self):
            return self.getTypedRuleContext(kernSpineParser.DenominatorContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_standardTimeSignature

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStandardTimeSignature" ):
                listener.enterStandardTimeSignature(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStandardTimeSignature" ):
                listener.exitStandardTimeSignature(self)




    def standardTimeSignature(self):

        localctx = kernSpineParser.StandardTimeSignatureContext(self, self._ctx, self.state)
        self.enterRule(localctx, 152, self.RULE_standardTimeSignature)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 726
            self.numerator()
            self.state = 727
            self.match(kernSpineParser.SLASH)
            self.state = 728
            self.denominator()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AdditiveTimeSignatureContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def numerator(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.NumeratorContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.NumeratorContext,i)


        def SLASH(self):
            return self.getToken(kernSpineParser.SLASH, 0)

        def denominator(self):
            return self.getTypedRuleContext(kernSpineParser.DenominatorContext,0)


        def PLUS(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.PLUS)
            else:
                return self.getToken(kernSpineParser.PLUS, i)

        def getRuleIndex(self):
            return kernSpineParser.RULE_additiveTimeSignature

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAdditiveTimeSignature" ):
                listener.enterAdditiveTimeSignature(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAdditiveTimeSignature" ):
                listener.exitAdditiveTimeSignature(self)




    def additiveTimeSignature(self):

        localctx = kernSpineParser.AdditiveTimeSignatureContext(self, self._ctx, self.state)
        self.enterRule(localctx, 154, self.RULE_additiveTimeSignature)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 730
            self.numerator()
            self.state = 733 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 731
                self.match(kernSpineParser.PLUS)
                self.state = 732
                self.numerator()
                self.state = 735 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==119):
                    break

            self.state = 737
            self.match(kernSpineParser.SLASH)
            self.state = 738
            self.denominator()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class MixedTimeSignatureContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def standardTimeSignature(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.StandardTimeSignatureContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.StandardTimeSignatureContext,i)


        def PLUS(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.PLUS)
            else:
                return self.getToken(kernSpineParser.PLUS, i)

        def getRuleIndex(self):
            return kernSpineParser.RULE_mixedTimeSignature

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterMixedTimeSignature" ):
                listener.enterMixedTimeSignature(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitMixedTimeSignature" ):
                listener.exitMixedTimeSignature(self)




    def mixedTimeSignature(self):

        localctx = kernSpineParser.MixedTimeSignatureContext(self, self._ctx, self.state)
        self.enterRule(localctx, 156, self.RULE_mixedTimeSignature)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 740
            self.standardTimeSignature()
            self.state = 743 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 741
                self.match(kernSpineParser.PLUS)
                self.state = 742
                self.standardTimeSignature()
                self.state = 745 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==119):
                    break

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AlternatingTimeSignatureContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def alternatingTimeSignatureItem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.AlternatingTimeSignatureItemContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.AlternatingTimeSignatureItemContext,i)


        def COLON(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.COLON)
            else:
                return self.getToken(kernSpineParser.COLON, i)

        def getRuleIndex(self):
            return kernSpineParser.RULE_alternatingTimeSignature

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlternatingTimeSignature" ):
                listener.enterAlternatingTimeSignature(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlternatingTimeSignature" ):
                listener.exitAlternatingTimeSignature(self)




    def alternatingTimeSignature(self):

        localctx = kernSpineParser.AlternatingTimeSignatureContext(self, self._ctx, self.state)
        self.enterRule(localctx, 158, self.RULE_alternatingTimeSignature)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 747
            self.alternatingTimeSignatureItem()
            self.state = 750 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 748
                self.match(kernSpineParser.COLON)
                self.state = 749
                self.alternatingTimeSignatureItem()
                self.state = 752 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==135):
                    break

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AlternatingTimeSignatureItemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def standardTimeSignature(self):
            return self.getTypedRuleContext(kernSpineParser.StandardTimeSignatureContext,0)


        def SEMICOLON(self):
            return self.getToken(kernSpineParser.SEMICOLON, 0)

        def number(self):
            return self.getTypedRuleContext(kernSpineParser.NumberContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_alternatingTimeSignatureItem

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlternatingTimeSignatureItem" ):
                listener.enterAlternatingTimeSignatureItem(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlternatingTimeSignatureItem" ):
                listener.exitAlternatingTimeSignatureItem(self)




    def alternatingTimeSignatureItem(self):

        localctx = kernSpineParser.AlternatingTimeSignatureItemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 160, self.RULE_alternatingTimeSignatureItem)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 754
            self.standardTimeSignature()
            self.state = 757
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==136:
                self.state = 755
                self.match(kernSpineParser.SEMICOLON)
                self.state = 756
                self.number()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class InterchangingTimeSignatureContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def standardTimeSignature(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.StandardTimeSignatureContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.StandardTimeSignatureContext,i)


        def PIPE(self):
            return self.getToken(kernSpineParser.PIPE, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_interchangingTimeSignature

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterInterchangingTimeSignature" ):
                listener.enterInterchangingTimeSignature(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitInterchangingTimeSignature" ):
                listener.exitInterchangingTimeSignature(self)




    def interchangingTimeSignature(self):

        localctx = kernSpineParser.InterchangingTimeSignatureContext(self, self._ctx, self.state)
        self.enterRule(localctx, 162, self.RULE_interchangingTimeSignature)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 759
            self.standardTimeSignature()
            self.state = 760
            self.match(kernSpineParser.PIPE)
            self.state = 761
            self.standardTimeSignature()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class MeterSymbolContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def LEFT_PARENTHESIS(self):
            return self.getToken(kernSpineParser.LEFT_PARENTHESIS, 0)

        def RIGHT_PARENTHESIS(self):
            return self.getToken(kernSpineParser.RIGHT_PARENTHESIS, 0)

        def TANDEM_TIMESIGNATURE(self):
            return self.getToken(kernSpineParser.TANDEM_TIMESIGNATURE, 0)

        def TANDEM_MET(self):
            return self.getToken(kernSpineParser.TANDEM_MET, 0)

        def modernMeterSymbolSign(self):
            return self.getTypedRuleContext(kernSpineParser.ModernMeterSymbolSignContext,0)


        def mensuration(self):
            return self.getTypedRuleContext(kernSpineParser.MensurationContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_meterSymbol

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterMeterSymbol" ):
                listener.enterMeterSymbol(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitMeterSymbol" ):
                listener.exitMeterSymbol(self)




    def meterSymbol(self):

        localctx = kernSpineParser.MeterSymbolContext(self, self._ctx, self.state)
        self.enterRule(localctx, 164, self.RULE_meterSymbol)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 763
            _la = self._input.LA(1)
            if not(_la==11 or _la==32):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 764
            self.match(kernSpineParser.LEFT_PARENTHESIS)
            self.state = 767
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [72]:
                self.state = 765
                self.modernMeterSymbolSign()
                pass
            elif token in [46, 58, 87, 99, 100, 122, 123, 129]:
                self.state = 766
                self.mensuration()
                pass
            else:
                raise NoViableAltException(self)

            self.state = 769
            self.match(kernSpineParser.RIGHT_PARENTHESIS)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ModernMeterSymbolSignContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_c(self):
            return self.getToken(kernSpineParser.CHAR_c, 0)

        def PIPE(self):
            return self.getToken(kernSpineParser.PIPE, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_modernMeterSymbolSign

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterModernMeterSymbolSign" ):
                listener.enterModernMeterSymbolSign(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitModernMeterSymbolSign" ):
                listener.exitModernMeterSymbolSign(self)




    def modernMeterSymbolSign(self):

        localctx = kernSpineParser.ModernMeterSymbolSignContext(self, self._ctx, self.state)
        self.enterRule(localctx, 166, self.RULE_modernMeterSymbolSign)
        try:
            self.state = 774
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,58,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 771
                self.match(kernSpineParser.CHAR_c)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 772
                self.match(kernSpineParser.CHAR_c)
                self.state = 773
                self.match(kernSpineParser.PIPE)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class MensurationContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_C(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_C)
            else:
                return self.getToken(kernSpineParser.CHAR_C, i)

        def CHAR_O(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_O)
            else:
                return self.getToken(kernSpineParser.CHAR_O, i)

        def DOT(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.DOT)
            else:
                return self.getToken(kernSpineParser.DOT, i)

        def PIPE(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.PIPE)
            else:
                return self.getToken(kernSpineParser.PIPE, i)

        def SLASH(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.SLASH)
            else:
                return self.getToken(kernSpineParser.SLASH, i)

        def DIGIT_2(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.DIGIT_2)
            else:
                return self.getToken(kernSpineParser.DIGIT_2, i)

        def DIGIT_3(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.DIGIT_3)
            else:
                return self.getToken(kernSpineParser.DIGIT_3, i)

        def CHAR_r(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_r)
            else:
                return self.getToken(kernSpineParser.CHAR_r, i)

        def getRuleIndex(self):
            return kernSpineParser.RULE_mensuration

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterMensuration" ):
                listener.enterMensuration(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitMensuration" ):
                listener.exitMensuration(self)




    def mensuration(self):

        localctx = kernSpineParser.MensurationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 168, self.RULE_mensuration)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 777 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 776
                _la = self._input.LA(1)
                if not(_la==46 or _la==58 or ((((_la - 87)) & ~0x3f) == 0 and ((1 << (_la - 87)) & 4501125738497) != 0)):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 779 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==46 or _la==58 or ((((_la - 87)) & ~0x3f) == 0 and ((1 << (_la - 87)) & 4501125738497) != 0)):
                    break

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class MetronomeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def METRONOME(self):
            return self.getToken(kernSpineParser.METRONOME, 0)

        def number(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.NumberContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.NumberContext,i)


        def DOT(self):
            return self.getToken(kernSpineParser.DOT, 0)

        def MINUS(self):
            return self.getToken(kernSpineParser.MINUS, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_metronome

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterMetronome" ):
                listener.enterMetronome(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitMetronome" ):
                listener.exitMetronome(self)




    def metronome(self):

        localctx = kernSpineParser.MetronomeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 170, self.RULE_metronome)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 781
            self.match(kernSpineParser.METRONOME)
            self.state = 782
            self.number()
            self.state = 785
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==120 or _la==122:
                self.state = 783
                _la = self._input.LA(1)
                if not(_la==120 or _la==122):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 784
                self.number()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class NullInterpretationContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ASTERISK(self):
            return self.getToken(kernSpineParser.ASTERISK, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_nullInterpretation

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNullInterpretation" ):
                listener.enterNullInterpretation(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNullInterpretation" ):
                listener.exitNullInterpretation(self)




    def nullInterpretation(self):

        localctx = kernSpineParser.NullInterpretationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 172, self.RULE_nullInterpretation)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 787
            self.match(kernSpineParser.ASTERISK)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class BarlineContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def EQUAL(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.EQUAL)
            else:
                return self.getToken(kernSpineParser.EQUAL, i)

        def number(self):
            return self.getTypedRuleContext(kernSpineParser.NumberContext,0)


        def MINUS(self):
            return self.getToken(kernSpineParser.MINUS, 0)

        def barLineType(self):
            return self.getTypedRuleContext(kernSpineParser.BarLineTypeContext,0)


        def fermata(self):
            return self.getTypedRuleContext(kernSpineParser.FermataContext,0)


        def CHAR_j(self):
            return self.getToken(kernSpineParser.CHAR_j, 0)

        def DOT(self):
            return self.getToken(kernSpineParser.DOT, 0)

        def footnote(self):
            return self.getTypedRuleContext(kernSpineParser.FootnoteContext,0)


        def CHAR_a(self):
            return self.getToken(kernSpineParser.CHAR_a, 0)

        def CHAR_b(self):
            return self.getToken(kernSpineParser.CHAR_b, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_barline

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBarline" ):
                listener.enterBarline(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBarline" ):
                listener.exitBarline(self)




    def barline(self):

        localctx = kernSpineParser.BarlineContext(self, self._ctx, self.state)
        self.enterRule(localctx, 174, self.RULE_barline)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 789
            self.match(kernSpineParser.EQUAL)
            self.state = 791
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,61,self._ctx)
            if la_ == 1:
                self.state = 790
                self.match(kernSpineParser.EQUAL)


            self.state = 794
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if ((((_la - 97)) & ~0x3f) == 0 and ((1 << (_la - 97)) & 1023) != 0):
                self.state = 793
                self.number()


            self.state = 797
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==70:
                self.state = 796
                self.match(kernSpineParser.CHAR_a)


            self.state = 800
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==71:
                self.state = 799
                self.match(kernSpineParser.CHAR_b)


            self.state = 803
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==120:
                self.state = 802
                self.match(kernSpineParser.MINUS)


            self.state = 806
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==40 or ((((_la - 121)) & ~0x3f) == 0 and ((1 << (_la - 121)) & 16389) != 0):
                self.state = 805
                self.barLineType()


            self.state = 809
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==136:
                self.state = 808
                self.fermata()


            self.state = 812
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==79:
                self.state = 811
                self.match(kernSpineParser.CHAR_j)


            self.state = 815
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==122:
                self.state = 814
                self.match(kernSpineParser.DOT)


            self.state = 818
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==138:
                self.state = 817
                self.footnote()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class BarLineTypeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def PIPE(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.PIPE)
            else:
                return self.getToken(kernSpineParser.PIPE, i)

        def EXCLAMATION(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.EXCLAMATION)
            else:
                return self.getToken(kernSpineParser.EXCLAMATION, i)

        def COLON(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.COLON)
            else:
                return self.getToken(kernSpineParser.COLON, i)

        def EQUAL(self):
            return self.getToken(kernSpineParser.EQUAL, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_barLineType

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBarLineType" ):
                listener.enterBarLineType(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBarLineType" ):
                listener.exitBarLineType(self)




    def barLineType(self):

        localctx = kernSpineParser.BarLineTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 176, self.RULE_barLineType)
        self._la = 0 # Token type
        try:
            self.state = 853
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,74,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 820
                self.match(kernSpineParser.PIPE)
                self.state = 821
                self.match(kernSpineParser.PIPE)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 822
                self.match(kernSpineParser.PIPE)
                self.state = 823
                self.match(kernSpineParser.EXCLAMATION)
                self.state = 825
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==135:
                    self.state = 824
                    self.match(kernSpineParser.COLON)


                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 827
                self.match(kernSpineParser.PIPE)
                self.state = 828
                self.match(kernSpineParser.COLON)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 829
                self.match(kernSpineParser.EXCLAMATION)
                self.state = 830
                self.match(kernSpineParser.PIPE)
                self.state = 831
                self.match(kernSpineParser.COLON)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 833
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==121:
                    self.state = 832
                    self.match(kernSpineParser.EQUAL)


                self.state = 835
                self.match(kernSpineParser.COLON)
                self.state = 836
                self.match(kernSpineParser.PIPE)
                self.state = 837
                self.match(kernSpineParser.EXCLAMATION)
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 838
                self.match(kernSpineParser.COLON)
                self.state = 839
                self.match(kernSpineParser.PIPE)
                self.state = 841
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==40:
                    self.state = 840
                    self.match(kernSpineParser.EXCLAMATION)


                self.state = 843
                self.match(kernSpineParser.PIPE)
                self.state = 844
                self.match(kernSpineParser.COLON)
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 845
                self.match(kernSpineParser.COLON)
                self.state = 846
                self.match(kernSpineParser.EXCLAMATION)
                self.state = 847
                self.match(kernSpineParser.COLON)
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 848
                self.match(kernSpineParser.COLON)
                self.state = 849
                self.match(kernSpineParser.EXCLAMATION)
                self.state = 850
                self.match(kernSpineParser.EXCLAMATION)
                self.state = 851
                self.match(kernSpineParser.COLON)
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 852
                self.match(kernSpineParser.EQUAL)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RestPositionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def diatonicPitchAndOctave(self):
            return self.getTypedRuleContext(kernSpineParser.DiatonicPitchAndOctaveContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_restPosition

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterRestPosition" ):
                listener.enterRestPosition(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitRestPosition" ):
                listener.exitRestPosition(self)




    def restPosition(self):

        localctx = kernSpineParser.RestPositionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 178, self.RULE_restPosition)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 855
            self.diatonicPitchAndOctave()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DurationContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def modernDuration(self):
            return self.getTypedRuleContext(kernSpineParser.ModernDurationContext,0)


        def augmentationDot(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.AugmentationDotContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.AugmentationDotContext,i)


        def graceNote(self):
            return self.getTypedRuleContext(kernSpineParser.GraceNoteContext,0)


        def appoggiatura(self):
            return self.getTypedRuleContext(kernSpineParser.AppoggiaturaContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_duration

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDuration" ):
                listener.enterDuration(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDuration" ):
                listener.exitDuration(self)




    def duration(self):

        localctx = kernSpineParser.DurationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 180, self.RULE_duration)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 857
            self.modernDuration()
            self.state = 861
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,75,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 858
                    self.augmentationDot() 
                self.state = 863
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,75,self._ctx)

            self.state = 866
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,76,self._ctx)
            if la_ == 1:
                self.state = 864
                self.graceNote()

            elif la_ == 2:
                self.state = 865
                self.appoggiatura()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class FermataContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def SEMICOLON(self):
            return self.getToken(kernSpineParser.SEMICOLON, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_fermata

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFermata" ):
                listener.enterFermata(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFermata" ):
                listener.exitFermata(self)




    def fermata(self):

        localctx = kernSpineParser.FermataContext(self, self._ctx, self.state)
        self.enterRule(localctx, 182, self.RULE_fermata)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 868
            self.match(kernSpineParser.SEMICOLON)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ModernDurationContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def number(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.NumberContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.NumberContext,i)


        def PERCENT(self):
            return self.getToken(kernSpineParser.PERCENT, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_modernDuration

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterModernDuration" ):
                listener.enterModernDuration(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitModernDuration" ):
                listener.exitModernDuration(self)




    def modernDuration(self):

        localctx = kernSpineParser.ModernDurationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 184, self.RULE_modernDuration)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 870
            self.number()
            self.state = 873
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==41:
                self.state = 871
                self.match(kernSpineParser.PERCENT)
                self.state = 872
                self.number()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AugmentationDotContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def DOT(self):
            return self.getToken(kernSpineParser.DOT, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_augmentationDot

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAugmentationDot" ):
                listener.enterAugmentationDot(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAugmentationDot" ):
                listener.exitAugmentationDot(self)




    def augmentationDot(self):

        localctx = kernSpineParser.AugmentationDotContext(self, self._ctx, self.state)
        self.enterRule(localctx, 186, self.RULE_augmentationDot)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 875
            self.match(kernSpineParser.DOT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AlterationContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def accidental(self):
            return self.getTypedRuleContext(kernSpineParser.AccidentalContext,0)


        def alterationDisplay(self):
            return self.getTypedRuleContext(kernSpineParser.AlterationDisplayContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_alteration

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlteration" ):
                listener.enterAlteration(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlteration" ):
                listener.exitAlteration(self)




    def alteration(self):

        localctx = kernSpineParser.AlterationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 188, self.RULE_alteration)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 877
            self.accidental()
            self.state = 879
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,78,self._ctx)
            if la_ == 1:
                self.state = 878
                self.alterationDisplay()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class StaffChangeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ANGLE_BRACKET_OPEN(self):
            return self.getToken(kernSpineParser.ANGLE_BRACKET_OPEN, 0)

        def ANGLE_BRACKET_CLOSE(self):
            return self.getToken(kernSpineParser.ANGLE_BRACKET_CLOSE, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_staffChange

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStaffChange" ):
                listener.enterStaffChange(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStaffChange" ):
                listener.exitStaffChange(self)




    def staffChange(self):

        localctx = kernSpineParser.StaffChangeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 190, self.RULE_staffChange)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 881
            _la = self._input.LA(1)
            if not(_la==127 or _la==128):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ChordSpaceContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def SPACE(self):
            return self.getToken(kernSpineParser.SPACE, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_chordSpace

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterChordSpace" ):
                listener.enterChordSpace(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitChordSpace" ):
                listener.exitChordSpace(self)




    def chordSpace(self):

        localctx = kernSpineParser.ChordSpaceContext(self, self._ctx, self.state)
        self.enterRule(localctx, 192, self.RULE_chordSpace)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 884
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==139:
                self.state = 883
                self.match(kernSpineParser.SPACE)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class GraceNoteContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_q(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_q)
            else:
                return self.getToken(kernSpineParser.CHAR_q, i)

        def getRuleIndex(self):
            return kernSpineParser.RULE_graceNote

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGraceNote" ):
                listener.enterGraceNote(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGraceNote" ):
                listener.exitGraceNote(self)




    def graceNote(self):

        localctx = kernSpineParser.GraceNoteContext(self, self._ctx, self.state)
        self.enterRule(localctx, 194, self.RULE_graceNote)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 886
            self.match(kernSpineParser.CHAR_q)
            self.state = 888
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,80,self._ctx)
            if la_ == 1:
                self.state = 887
                self.match(kernSpineParser.CHAR_q)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AppoggiaturaContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def appoggiaturaMode(self):
            return self.getTypedRuleContext(kernSpineParser.AppoggiaturaModeContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_appoggiatura

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAppoggiatura" ):
                listener.enterAppoggiatura(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAppoggiatura" ):
                listener.exitAppoggiatura(self)




    def appoggiatura(self):

        localctx = kernSpineParser.AppoggiaturaContext(self, self._ctx, self.state)
        self.enterRule(localctx, 196, self.RULE_appoggiatura)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 890
            self.appoggiaturaMode()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AppoggiaturaModeContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_p(self):
            return self.getToken(kernSpineParser.CHAR_p, 0)

        def CHAR_P(self):
            return self.getToken(kernSpineParser.CHAR_P, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_appoggiaturaMode

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAppoggiaturaMode" ):
                listener.enterAppoggiaturaMode(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAppoggiaturaMode" ):
                listener.exitAppoggiaturaMode(self)




    def appoggiaturaMode(self):

        localctx = kernSpineParser.AppoggiaturaModeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 198, self.RULE_appoggiaturaMode)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 892
            _la = self._input.LA(1)
            if not(_la==59 or _la==85):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class LigatureTieContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ligatureTieStart(self):
            return self.getTypedRuleContext(kernSpineParser.LigatureTieStartContext,0)


        def ligatureTieEnd(self):
            return self.getTypedRuleContext(kernSpineParser.LigatureTieEndContext,0)


        def tieContinue(self):
            return self.getTypedRuleContext(kernSpineParser.TieContinueContext,0)


        def staffChange(self):
            return self.getTypedRuleContext(kernSpineParser.StaffChangeContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_ligatureTie

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterLigatureTie" ):
                listener.enterLigatureTie(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitLigatureTie" ):
                listener.exitLigatureTie(self)




    def ligatureTie(self):

        localctx = kernSpineParser.LigatureTieContext(self, self._ctx, self.state)
        self.enterRule(localctx, 200, self.RULE_ligatureTie)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 897
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [114, 127]:
                self.state = 894
                self.ligatureTieStart()
                pass
            elif token in [115, 128]:
                self.state = 895
                self.ligatureTieEnd()
                pass
            elif token in [131]:
                self.state = 896
                self.tieContinue()
                pass
            else:
                raise NoViableAltException(self)

            self.state = 900
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,82,self._ctx)
            if la_ == 1:
                self.state = 899
                self.staffChange()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class NoteDecorationContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def accent(self):
            return self.getTypedRuleContext(kernSpineParser.AccentContext,0)


        def appoggiatura(self):
            return self.getTypedRuleContext(kernSpineParser.AppoggiaturaContext,0)


        def articulation(self):
            return self.getTypedRuleContext(kernSpineParser.ArticulationContext,0)


        def barLineCrossedNoteStart(self):
            return self.getTypedRuleContext(kernSpineParser.BarLineCrossedNoteStartContext,0)


        def barLineCrossedNoteEnd(self):
            return self.getTypedRuleContext(kernSpineParser.BarLineCrossedNoteEndContext,0)


        def beam(self):
            return self.getTypedRuleContext(kernSpineParser.BeamContext,0)


        def editorialIntervention(self):
            return self.getTypedRuleContext(kernSpineParser.EditorialInterventionContext,0)


        def fermata(self):
            return self.getTypedRuleContext(kernSpineParser.FermataContext,0)


        def footnote(self):
            return self.getTypedRuleContext(kernSpineParser.FootnoteContext,0)


        def glissando(self):
            return self.getTypedRuleContext(kernSpineParser.GlissandoContext,0)


        def graceNote(self):
            return self.getTypedRuleContext(kernSpineParser.GraceNoteContext,0)


        def ligatureTie(self):
            return self.getTypedRuleContext(kernSpineParser.LigatureTieContext,0)


        def mordent(self):
            return self.getTypedRuleContext(kernSpineParser.MordentContext,0)


        def augmentationDot(self):
            return self.getTypedRuleContext(kernSpineParser.AugmentationDotContext,0)


        def phrase(self):
            return self.getTypedRuleContext(kernSpineParser.PhraseContext,0)


        def slurStart(self):
            return self.getTypedRuleContext(kernSpineParser.SlurStartContext,0)


        def slurEnd(self):
            return self.getTypedRuleContext(kernSpineParser.SlurEndContext,0)


        def staffChange(self):
            return self.getTypedRuleContext(kernSpineParser.StaffChangeContext,0)


        def stem(self):
            return self.getTypedRuleContext(kernSpineParser.StemContext,0)


        def turn(self):
            return self.getTypedRuleContext(kernSpineParser.TurnContext,0)


        def trill(self):
            return self.getTypedRuleContext(kernSpineParser.TrillContext,0)


        def userAssignable(self):
            return self.getTypedRuleContext(kernSpineParser.UserAssignableContext,0)


        def CHAR_N(self):
            return self.getToken(kernSpineParser.CHAR_N, 0)

        def CHAR_j(self):
            return self.getToken(kernSpineParser.CHAR_j, 0)

        def CHAR_X(self):
            return self.getToken(kernSpineParser.CHAR_X, 0)

        def CHAR_Z(self):
            return self.getToken(kernSpineParser.CHAR_Z, 0)

        def CHAR_O(self):
            return self.getToken(kernSpineParser.CHAR_O, 0)

        def CHAR_l(self):
            return self.getToken(kernSpineParser.CHAR_l, 0)

        def CHAR_V(self):
            return self.getToken(kernSpineParser.CHAR_V, 0)

        def noteDecorationCharX(self):
            return self.getTypedRuleContext(kernSpineParser.NoteDecorationCharXContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_noteDecoration

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNoteDecoration" ):
                listener.enterNoteDecoration(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNoteDecoration" ):
                listener.exitNoteDecoration(self)




    def noteDecoration(self):

        localctx = kernSpineParser.NoteDecorationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 202, self.RULE_noteDecoration)
        try:
            self.state = 932
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,83,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 902
                self.accent()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 903
                self.appoggiatura()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 904
                self.articulation()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 905
                self.barLineCrossedNoteStart()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 906
                self.barLineCrossedNoteEnd()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 907
                self.beam()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 908
                self.editorialIntervention()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 909
                self.fermata()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 910
                self.footnote()
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 911
                self.glissando()
                pass

            elif la_ == 11:
                self.enterOuterAlt(localctx, 11)
                self.state = 912
                self.graceNote()
                pass

            elif la_ == 12:
                self.enterOuterAlt(localctx, 12)
                self.state = 913
                self.ligatureTie()
                pass

            elif la_ == 13:
                self.enterOuterAlt(localctx, 13)
                self.state = 914
                self.mordent()
                pass

            elif la_ == 14:
                self.enterOuterAlt(localctx, 14)
                self.state = 915
                self.augmentationDot()
                pass

            elif la_ == 15:
                self.enterOuterAlt(localctx, 15)
                self.state = 916
                self.phrase()
                pass

            elif la_ == 16:
                self.enterOuterAlt(localctx, 16)
                self.state = 917
                self.slurStart()
                pass

            elif la_ == 17:
                self.enterOuterAlt(localctx, 17)
                self.state = 918
                self.slurEnd()
                pass

            elif la_ == 18:
                self.enterOuterAlt(localctx, 18)
                self.state = 919
                self.staffChange()
                pass

            elif la_ == 19:
                self.enterOuterAlt(localctx, 19)
                self.state = 920
                self.stem()
                pass

            elif la_ == 20:
                self.enterOuterAlt(localctx, 20)
                self.state = 921
                self.turn()
                pass

            elif la_ == 21:
                self.enterOuterAlt(localctx, 21)
                self.state = 922
                self.trill()
                pass

            elif la_ == 22:
                self.enterOuterAlt(localctx, 22)
                self.state = 923
                self.userAssignable()
                pass

            elif la_ == 23:
                self.enterOuterAlt(localctx, 23)
                self.state = 924
                self.match(kernSpineParser.CHAR_N)
                pass

            elif la_ == 24:
                self.enterOuterAlt(localctx, 24)
                self.state = 925
                self.match(kernSpineParser.CHAR_j)
                pass

            elif la_ == 25:
                self.enterOuterAlt(localctx, 25)
                self.state = 926
                self.match(kernSpineParser.CHAR_X)
                pass

            elif la_ == 26:
                self.enterOuterAlt(localctx, 26)
                self.state = 927
                self.match(kernSpineParser.CHAR_Z)
                pass

            elif la_ == 27:
                self.enterOuterAlt(localctx, 27)
                self.state = 928
                self.match(kernSpineParser.CHAR_O)
                pass

            elif la_ == 28:
                self.enterOuterAlt(localctx, 28)
                self.state = 929
                self.match(kernSpineParser.CHAR_l)
                pass

            elif la_ == 29:
                self.enterOuterAlt(localctx, 29)
                self.state = 930
                self.match(kernSpineParser.CHAR_V)
                pass

            elif la_ == 30:
                self.enterOuterAlt(localctx, 30)
                self.state = 931
                self.noteDecorationCharX()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class NoteDecorationCharXContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_x(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_x)
            else:
                return self.getToken(kernSpineParser.CHAR_x, i)

        def getRuleIndex(self):
            return kernSpineParser.RULE_noteDecorationCharX

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterNoteDecorationCharX" ):
                listener.enterNoteDecorationCharX(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitNoteDecorationCharX" ):
                listener.exitNoteDecorationCharX(self)




    def noteDecorationCharX(self):

        localctx = kernSpineParser.NoteDecorationCharXContext(self, self._ctx, self.state)
        self.enterRule(localctx, 204, self.RULE_noteDecorationCharX)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 934
            self.match(kernSpineParser.CHAR_x)
            self.state = 936
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,84,self._ctx)
            if la_ == 1:
                self.state = 935
                self.match(kernSpineParser.CHAR_x)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PhraseContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def LEFT_CURLY_BRACES(self):
            return self.getToken(kernSpineParser.LEFT_CURLY_BRACES, 0)

        def RIGHT_CURLY_BRACES(self):
            return self.getToken(kernSpineParser.RIGHT_CURLY_BRACES, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_phrase

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPhrase" ):
                listener.enterPhrase(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPhrase" ):
                listener.exitPhrase(self)




    def phrase(self):

        localctx = kernSpineParser.PhraseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 206, self.RULE_phrase)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 938
            _la = self._input.LA(1)
            if not(_la==116 or _la==117):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DiatonicPitchAndOctaveContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def bassNotes(self):
            return self.getTypedRuleContext(kernSpineParser.BassNotesContext,0)


        def trebleNotes(self):
            return self.getTypedRuleContext(kernSpineParser.TrebleNotesContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_diatonicPitchAndOctave

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterDiatonicPitchAndOctave" ):
                listener.enterDiatonicPitchAndOctave(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitDiatonicPitchAndOctave" ):
                listener.exitDiatonicPitchAndOctave(self)




    def diatonicPitchAndOctave(self):

        localctx = kernSpineParser.DiatonicPitchAndOctaveContext(self, self._ctx, self.state)
        self.enterRule(localctx, 208, self.RULE_diatonicPitchAndOctave)
        try:
            self.state = 942
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [44, 45, 46, 47, 48, 49, 50]:
                self.enterOuterAlt(localctx, 1)
                self.state = 940
                self.bassNotes()
                pass
            elif token in [70, 71, 72, 73, 74, 75, 76]:
                self.enterOuterAlt(localctx, 2)
                self.state = 941
                self.trebleNotes()
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TrebleNotesContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def lowerCasePitch(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.LowerCasePitchContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.LowerCasePitchContext,i)


        def getRuleIndex(self):
            return kernSpineParser.RULE_trebleNotes

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTrebleNotes" ):
                listener.enterTrebleNotes(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTrebleNotes" ):
                listener.exitTrebleNotes(self)




    def trebleNotes(self):

        localctx = kernSpineParser.TrebleNotesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 210, self.RULE_trebleNotes)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 945 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 944
                    self.lowerCasePitch()

                else:
                    raise NoViableAltException(self)
                self.state = 947 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,86,self._ctx)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class BassNotesContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def upperCasePitch(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(kernSpineParser.UpperCasePitchContext)
            else:
                return self.getTypedRuleContext(kernSpineParser.UpperCasePitchContext,i)


        def getRuleIndex(self):
            return kernSpineParser.RULE_bassNotes

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBassNotes" ):
                listener.enterBassNotes(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBassNotes" ):
                listener.exitBassNotes(self)




    def bassNotes(self):

        localctx = kernSpineParser.BassNotesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 212, self.RULE_bassNotes)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 950 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 949
                    self.upperCasePitch()

                else:
                    raise NoViableAltException(self)
                self.state = 952 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,87,self._ctx)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AccidentalContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def OCTOTHORPE(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.OCTOTHORPE)
            else:
                return self.getToken(kernSpineParser.OCTOTHORPE, i)

        def MINUS(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.MINUS)
            else:
                return self.getToken(kernSpineParser.MINUS, i)

        def CHAR_n(self):
            return self.getToken(kernSpineParser.CHAR_n, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_accidental

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAccidental" ):
                listener.enterAccidental(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAccidental" ):
                listener.exitAccidental(self)




    def accidental(self):

        localctx = kernSpineParser.AccidentalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 214, self.RULE_accidental)
        self._la = 0 # Token type
        try:
            self.state = 969
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [118]:
                self.enterOuterAlt(localctx, 1)
                self.state = 954
                self.match(kernSpineParser.OCTOTHORPE)
                self.state = 959
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==118:
                    self.state = 955
                    self.match(kernSpineParser.OCTOTHORPE)
                    self.state = 957
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==118:
                        self.state = 956
                        self.match(kernSpineParser.OCTOTHORPE)




                pass
            elif token in [120]:
                self.enterOuterAlt(localctx, 2)
                self.state = 961
                self.match(kernSpineParser.MINUS)
                self.state = 966
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==120:
                    self.state = 962
                    self.match(kernSpineParser.MINUS)
                    self.state = 964
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==120:
                        self.state = 963
                        self.match(kernSpineParser.MINUS)




                pass
            elif token in [83]:
                self.enterOuterAlt(localctx, 3)
                self.state = 968
                self.match(kernSpineParser.CHAR_n)
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AlterationDisplayContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_x(self):
            return self.getToken(kernSpineParser.CHAR_x, 0)

        def CHAR_X(self):
            return self.getToken(kernSpineParser.CHAR_X, 0)

        def CHAR_i(self):
            return self.getToken(kernSpineParser.CHAR_i, 0)

        def CHAR_I(self):
            return self.getToken(kernSpineParser.CHAR_I, 0)

        def CHAR_j(self):
            return self.getToken(kernSpineParser.CHAR_j, 0)

        def CHAR_Z(self):
            return self.getToken(kernSpineParser.CHAR_Z, 0)

        def CHAR_y(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_y)
            else:
                return self.getToken(kernSpineParser.CHAR_y, i)

        def CHAR_Y(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_Y)
            else:
                return self.getToken(kernSpineParser.CHAR_Y, i)

        def getRuleIndex(self):
            return kernSpineParser.RULE_alterationDisplay

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAlterationDisplay" ):
                listener.enterAlterationDisplay(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAlterationDisplay" ):
                listener.exitAlterationDisplay(self)




    def alterationDisplay(self):

        localctx = kernSpineParser.AlterationDisplayContext(self, self._ctx, self.state)
        self.enterRule(localctx, 216, self.RULE_alterationDisplay)
        self._la = 0 # Token type
        try:
            self.state = 985
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [93]:
                self.enterOuterAlt(localctx, 1)
                self.state = 971
                self.match(kernSpineParser.CHAR_x)
                pass
            elif token in [67]:
                self.enterOuterAlt(localctx, 2)
                self.state = 972
                self.match(kernSpineParser.CHAR_X)
                pass
            elif token in [78]:
                self.enterOuterAlt(localctx, 3)
                self.state = 973
                self.match(kernSpineParser.CHAR_i)
                pass
            elif token in [52]:
                self.enterOuterAlt(localctx, 4)
                self.state = 974
                self.match(kernSpineParser.CHAR_I)
                pass
            elif token in [79]:
                self.enterOuterAlt(localctx, 5)
                self.state = 975
                self.match(kernSpineParser.CHAR_j)
                pass
            elif token in [69]:
                self.enterOuterAlt(localctx, 6)
                self.state = 976
                self.match(kernSpineParser.CHAR_Z)
                pass
            elif token in [94]:
                self.enterOuterAlt(localctx, 7)
                self.state = 977
                self.match(kernSpineParser.CHAR_y)
                self.state = 979
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,93,self._ctx)
                if la_ == 1:
                    self.state = 978
                    self.match(kernSpineParser.CHAR_y)


                pass
            elif token in [68]:
                self.enterOuterAlt(localctx, 8)
                self.state = 981
                self.match(kernSpineParser.CHAR_Y)
                self.state = 983
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==68:
                    self.state = 982
                    self.match(kernSpineParser.CHAR_Y)


                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TurnContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_S(self):
            return self.getToken(kernSpineParser.CHAR_S, 0)

        def DOLLAR(self):
            return self.getToken(kernSpineParser.DOLLAR, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_turn

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTurn" ):
                listener.enterTurn(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTurn" ):
                listener.exitTurn(self)




    def turn(self):

        localctx = kernSpineParser.TurnContext(self, self._ctx, self.state)
        self.enterRule(localctx, 218, self.RULE_turn)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 987
            _la = self._input.LA(1)
            if not(_la==62 or _la==132):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class UserAssignableContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_i(self):
            return self.getToken(kernSpineParser.CHAR_i, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_userAssignable

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterUserAssignable" ):
                listener.enterUserAssignable(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitUserAssignable" ):
                listener.exitUserAssignable(self)




    def userAssignable(self):

        localctx = kernSpineParser.UserAssignableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 220, self.RULE_userAssignable)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 989
            self.match(kernSpineParser.CHAR_i)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class GlissandoContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def COLON(self):
            return self.getToken(kernSpineParser.COLON, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_glissando

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterGlissando" ):
                listener.enterGlissando(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitGlissando" ):
                listener.exitGlissando(self)




    def glissando(self):

        localctx = kernSpineParser.GlissandoContext(self, self._ctx, self.state)
        self.enterRule(localctx, 222, self.RULE_glissando)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 991
            self.match(kernSpineParser.COLON)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ArticulationContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def staccato(self):
            return self.getTypedRuleContext(kernSpineParser.StaccatoContext,0)


        def spiccato(self):
            return self.getTypedRuleContext(kernSpineParser.SpiccatoContext,0)


        def pizzicato(self):
            return self.getTypedRuleContext(kernSpineParser.PizzicatoContext,0)


        def staccatissimo(self):
            return self.getTypedRuleContext(kernSpineParser.StaccatissimoContext,0)


        def tenuto(self):
            return self.getTypedRuleContext(kernSpineParser.TenutoContext,0)


        def accent(self):
            return self.getTypedRuleContext(kernSpineParser.AccentContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_articulation

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterArticulation" ):
                listener.enterArticulation(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitArticulation" ):
                listener.exitArticulation(self)




    def articulation(self):

        localctx = kernSpineParser.ArticulationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 224, self.RULE_articulation)
        try:
            self.state = 999
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [113]:
                self.enterOuterAlt(localctx, 1)
                self.state = 993
                self.staccato()
                pass
            elif token in [88]:
                self.enterOuterAlt(localctx, 2)
                self.state = 994
                self.spiccato()
                pass
            elif token in [112]:
                self.enterOuterAlt(localctx, 3)
                self.state = 995
                self.pizzicato()
                pass
            elif token in [124]:
                self.enterOuterAlt(localctx, 4)
                self.state = 996
                self.staccatissimo()
                pass
            elif token in [126]:
                self.enterOuterAlt(localctx, 5)
                self.state = 997
                self.tenuto()
                pass
            elif token in [125]:
                self.enterOuterAlt(localctx, 6)
                self.state = 998
                self.accent()
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AccentContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CIRCUMFLEX(self):
            return self.getToken(kernSpineParser.CIRCUMFLEX, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_accent

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAccent" ):
                listener.enterAccent(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAccent" ):
                listener.exitAccent(self)




    def accent(self):

        localctx = kernSpineParser.AccentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 226, self.RULE_accent)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1001
            self.match(kernSpineParser.CIRCUMFLEX)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TenutoContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def TILDE(self):
            return self.getToken(kernSpineParser.TILDE, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_tenuto

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTenuto" ):
                listener.enterTenuto(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTenuto" ):
                listener.exitTenuto(self)




    def tenuto(self):

        localctx = kernSpineParser.TenutoContext(self, self._ctx, self.state)
        self.enterRule(localctx, 228, self.RULE_tenuto)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1003
            self.match(kernSpineParser.TILDE)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class StaccatissimoContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def GRAVE_ACCENT(self):
            return self.getToken(kernSpineParser.GRAVE_ACCENT, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_staccatissimo

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStaccatissimo" ):
                listener.enterStaccatissimo(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStaccatissimo" ):
                listener.exitStaccatissimo(self)




    def staccatissimo(self):

        localctx = kernSpineParser.StaccatissimoContext(self, self._ctx, self.state)
        self.enterRule(localctx, 230, self.RULE_staccatissimo)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1005
            self.match(kernSpineParser.GRAVE_ACCENT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PizzicatoContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def QUOTATION_MARK(self):
            return self.getToken(kernSpineParser.QUOTATION_MARK, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_pizzicato

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPizzicato" ):
                listener.enterPizzicato(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPizzicato" ):
                listener.exitPizzicato(self)




    def pizzicato(self):

        localctx = kernSpineParser.PizzicatoContext(self, self._ctx, self.state)
        self.enterRule(localctx, 232, self.RULE_pizzicato)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1007
            self.match(kernSpineParser.QUOTATION_MARK)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SpiccatoContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_s(self):
            return self.getToken(kernSpineParser.CHAR_s, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_spiccato

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSpiccato" ):
                listener.enterSpiccato(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSpiccato" ):
                listener.exitSpiccato(self)




    def spiccato(self):

        localctx = kernSpineParser.SpiccatoContext(self, self._ctx, self.state)
        self.enterRule(localctx, 234, self.RULE_spiccato)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1009
            self.match(kernSpineParser.CHAR_s)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class StaccatoContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def APOSTROPHE(self):
            return self.getToken(kernSpineParser.APOSTROPHE, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_staccato

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStaccato" ):
                listener.enterStaccato(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStaccato" ):
                listener.exitStaccato(self)




    def staccato(self):

        localctx = kernSpineParser.StaccatoContext(self, self._ctx, self.state)
        self.enterRule(localctx, 236, self.RULE_staccato)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1011
            self.match(kernSpineParser.APOSTROPHE)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class EditorialInterventionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_y(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_y)
            else:
                return self.getToken(kernSpineParser.CHAR_y, i)

        def AT(self):
            return self.getToken(kernSpineParser.AT, 0)

        def CHAR_X(self):
            return self.getToken(kernSpineParser.CHAR_X, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_editorialIntervention

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterEditorialIntervention" ):
                listener.enterEditorialIntervention(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitEditorialIntervention" ):
                listener.exitEditorialIntervention(self)




    def editorialIntervention(self):

        localctx = kernSpineParser.EditorialInterventionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 238, self.RULE_editorialIntervention)
        self._la = 0 # Token type
        try:
            self.state = 1024
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [94]:
                self.enterOuterAlt(localctx, 1)
                self.state = 1013
                self.match(kernSpineParser.CHAR_y)
                self.state = 1017
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,97,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 1014
                        self.match(kernSpineParser.CHAR_y) 
                    self.state = 1019
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,97,self._ctx)

                self.state = 1021
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==43:
                    self.state = 1020
                    self.match(kernSpineParser.AT)


                pass
            elif token in [67]:
                self.enterOuterAlt(localctx, 2)
                self.state = 1023
                self.match(kernSpineParser.CHAR_X)
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SlurStartContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def LEFT_PARENTHESIS(self):
            return self.getToken(kernSpineParser.LEFT_PARENTHESIS, 0)

        def AMPERSAND(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.AMPERSAND)
            else:
                return self.getToken(kernSpineParser.AMPERSAND, i)

        def staffChange(self):
            return self.getTypedRuleContext(kernSpineParser.StaffChangeContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_slurStart

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSlurStart" ):
                listener.enterSlurStart(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSlurStart" ):
                listener.exitSlurStart(self)




    def slurStart(self):

        localctx = kernSpineParser.SlurStartContext(self, self._ctx, self.state)
        self.enterRule(localctx, 240, self.RULE_slurStart)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1029
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==42:
                self.state = 1026
                self.match(kernSpineParser.AMPERSAND)
                self.state = 1031
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 1032
            self.match(kernSpineParser.LEFT_PARENTHESIS)
            self.state = 1034
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,101,self._ctx)
            if la_ == 1:
                self.state = 1033
                self.staffChange()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class LigatureTieStartContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ANGLE_BRACKET_OPEN(self):
            return self.getToken(kernSpineParser.ANGLE_BRACKET_OPEN, 0)

        def LEFT_BRACKET(self):
            return self.getToken(kernSpineParser.LEFT_BRACKET, 0)

        def CHAR_y(self):
            return self.getToken(kernSpineParser.CHAR_y, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_ligatureTieStart

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterLigatureTieStart" ):
                listener.enterLigatureTieStart(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitLigatureTieStart" ):
                listener.exitLigatureTieStart(self)




    def ligatureTieStart(self):

        localctx = kernSpineParser.LigatureTieStartContext(self, self._ctx, self.state)
        self.enterRule(localctx, 242, self.RULE_ligatureTieStart)
        try:
            self.state = 1041
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [127]:
                self.enterOuterAlt(localctx, 1)
                self.state = 1036
                self.match(kernSpineParser.ANGLE_BRACKET_OPEN)
                pass
            elif token in [114]:
                self.enterOuterAlt(localctx, 2)
                self.state = 1037
                self.match(kernSpineParser.LEFT_BRACKET)
                self.state = 1039
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,102,self._ctx)
                if la_ == 1:
                    self.state = 1038
                    self.match(kernSpineParser.CHAR_y)


                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TieContinueContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def UNDERSCORE(self):
            return self.getToken(kernSpineParser.UNDERSCORE, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_tieContinue

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTieContinue" ):
                listener.enterTieContinue(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTieContinue" ):
                listener.exitTieContinue(self)




    def tieContinue(self):

        localctx = kernSpineParser.TieContinueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 244, self.RULE_tieContinue)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1043
            self.match(kernSpineParser.UNDERSCORE)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class LigatureTieEndContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ANGLE_BRACKET_CLOSE(self):
            return self.getToken(kernSpineParser.ANGLE_BRACKET_CLOSE, 0)

        def RIGHT_BRACKET(self):
            return self.getToken(kernSpineParser.RIGHT_BRACKET, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_ligatureTieEnd

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterLigatureTieEnd" ):
                listener.enterLigatureTieEnd(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitLigatureTieEnd" ):
                listener.exitLigatureTieEnd(self)




    def ligatureTieEnd(self):

        localctx = kernSpineParser.LigatureTieEndContext(self, self._ctx, self.state)
        self.enterRule(localctx, 246, self.RULE_ligatureTieEnd)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1045
            _la = self._input.LA(1)
            if not(_la==115 or _la==128):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SlurEndContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def RIGHT_PARENTHESIS(self):
            return self.getToken(kernSpineParser.RIGHT_PARENTHESIS, 0)

        def AMPERSAND(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.AMPERSAND)
            else:
                return self.getToken(kernSpineParser.AMPERSAND, i)

        def getRuleIndex(self):
            return kernSpineParser.RULE_slurEnd

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterSlurEnd" ):
                listener.enterSlurEnd(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitSlurEnd" ):
                listener.exitSlurEnd(self)




    def slurEnd(self):

        localctx = kernSpineParser.SlurEndContext(self, self._ctx, self.state)
        self.enterRule(localctx, 248, self.RULE_slurEnd)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1050
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==42:
                self.state = 1047
                self.match(kernSpineParser.AMPERSAND)
                self.state = 1052
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 1053
            self.match(kernSpineParser.RIGHT_PARENTHESIS)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class BarLineCrossedNoteStartContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_T(self):
            return self.getToken(kernSpineParser.CHAR_T, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_barLineCrossedNoteStart

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBarLineCrossedNoteStart" ):
                listener.enterBarLineCrossedNoteStart(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBarLineCrossedNoteStart" ):
                listener.exitBarLineCrossedNoteStart(self)




    def barLineCrossedNoteStart(self):

        localctx = kernSpineParser.BarLineCrossedNoteStartContext(self, self._ctx, self.state)
        self.enterRule(localctx, 250, self.RULE_barLineCrossedNoteStart)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1055
            self.match(kernSpineParser.CHAR_T)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class BarLineCrossedNoteEndContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_t(self):
            return self.getToken(kernSpineParser.CHAR_t, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_barLineCrossedNoteEnd

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBarLineCrossedNoteEnd" ):
                listener.enterBarLineCrossedNoteEnd(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBarLineCrossedNoteEnd" ):
                listener.exitBarLineCrossedNoteEnd(self)




    def barLineCrossedNoteEnd(self):

        localctx = kernSpineParser.BarLineCrossedNoteEndContext(self, self._ctx, self.state)
        self.enterRule(localctx, 252, self.RULE_barLineCrossedNoteEnd)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1057
            self.match(kernSpineParser.CHAR_t)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class StemContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def SLASH(self):
            return self.getToken(kernSpineParser.SLASH, 0)

        def BACKSLASH(self):
            return self.getToken(kernSpineParser.BACKSLASH, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_stem

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterStem" ):
                listener.enterStem(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitStem" ):
                listener.exitStem(self)




    def stem(self):

        localctx = kernSpineParser.StemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 254, self.RULE_stem)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1059
            _la = self._input.LA(1)
            if not(_la==129 or _la==130):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class BeamContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_L(self):
            return self.getToken(kernSpineParser.CHAR_L, 0)

        def CHAR_J(self):
            return self.getToken(kernSpineParser.CHAR_J, 0)

        def CHAR_K(self):
            return self.getToken(kernSpineParser.CHAR_K, 0)

        def CHAR_k(self):
            return self.getToken(kernSpineParser.CHAR_k, 0)

        def staffChange(self):
            return self.getTypedRuleContext(kernSpineParser.StaffChangeContext,0)


        def getRuleIndex(self):
            return kernSpineParser.RULE_beam

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBeam" ):
                listener.enterBeam(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBeam" ):
                listener.exitBeam(self)




    def beam(self):

        localctx = kernSpineParser.BeamContext(self, self._ctx, self.state)
        self.enterRule(localctx, 256, self.RULE_beam)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1061
            _la = self._input.LA(1)
            if not(((((_la - 53)) & ~0x3f) == 0 and ((1 << (_la - 53)) & 134217735) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 1063
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,105,self._ctx)
            if la_ == 1:
                self.state = 1062
                self.staffChange()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class MordentContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_M(self):
            return self.getToken(kernSpineParser.CHAR_M, 0)

        def CHAR_m(self):
            return self.getToken(kernSpineParser.CHAR_m, 0)

        def CHAR_W(self):
            return self.getToken(kernSpineParser.CHAR_W, 0)

        def CHAR_w(self):
            return self.getToken(kernSpineParser.CHAR_w, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_mordent

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterMordent" ):
                listener.enterMordent(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitMordent" ):
                listener.exitMordent(self)




    def mordent(self):

        localctx = kernSpineParser.MordentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 258, self.RULE_mordent)
        try:
            self.state = 1072
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [56]:
                self.enterOuterAlt(localctx, 1)
                self.state = 1065
                self.match(kernSpineParser.CHAR_M)
                pass
            elif token in [82]:
                self.enterOuterAlt(localctx, 2)
                self.state = 1066
                self.match(kernSpineParser.CHAR_m)
                pass
            elif token in [66]:
                self.enterOuterAlt(localctx, 3)
                self.state = 1067
                self.match(kernSpineParser.CHAR_W)
                self.state = 1069
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,106,self._ctx)
                if la_ == 1:
                    self.state = 1068
                    self.match(kernSpineParser.CHAR_w)


                pass
            elif token in [92]:
                self.enterOuterAlt(localctx, 4)
                self.state = 1071
                self.match(kernSpineParser.CHAR_w)
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TrillContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def CHAR_T(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.CHAR_T)
            else:
                return self.getToken(kernSpineParser.CHAR_T, i)

        def CHAR_t(self):
            return self.getToken(kernSpineParser.CHAR_t, 0)

        def getRuleIndex(self):
            return kernSpineParser.RULE_trill

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterTrill" ):
                listener.enterTrill(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitTrill" ):
                listener.exitTrill(self)




    def trill(self):

        localctx = kernSpineParser.TrillContext(self, self._ctx, self.state)
        self.enterRule(localctx, 260, self.RULE_trill)
        try:
            self.state = 1079
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [63]:
                self.enterOuterAlt(localctx, 1)
                self.state = 1074
                self.match(kernSpineParser.CHAR_T)
                self.state = 1076
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,108,self._ctx)
                if la_ == 1:
                    self.state = 1075
                    self.match(kernSpineParser.CHAR_T)


                pass
            elif token in [89]:
                self.enterOuterAlt(localctx, 2)
                self.state = 1078
                self.match(kernSpineParser.CHAR_t)
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class FootnoteContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def QUESTION_MARK(self, i:int=None):
            if i is None:
                return self.getTokens(kernSpineParser.QUESTION_MARK)
            else:
                return self.getToken(kernSpineParser.QUESTION_MARK, i)

        def getRuleIndex(self):
            return kernSpineParser.RULE_footnote

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterFootnote" ):
                listener.enterFootnote(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitFootnote" ):
                listener.exitFootnote(self)




    def footnote(self):

        localctx = kernSpineParser.FootnoteContext(self, self._ctx, self.state)
        self.enterRule(localctx, 262, self.RULE_footnote)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1082 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 1081
                    self.match(kernSpineParser.QUESTION_MARK)

                else:
                    raise NoViableAltException(self)
                self.state = 1084 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,110,self._ctx)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx





