# Generated from CyanaMRParser.g4 by ANTLR 4.10.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,44,530,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,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
        0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,5,0,105,8,0,10,0,12,0,108,9,0,
        1,0,1,0,1,1,1,1,5,1,114,8,1,10,1,12,1,117,9,1,1,1,1,1,1,2,4,2,122,
        8,2,11,2,12,2,123,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,3,3,134,8,3,1,
        3,3,3,137,8,3,1,3,3,3,140,8,3,1,3,3,3,143,8,3,1,3,3,3,146,8,3,1,
        4,4,4,149,8,4,11,4,12,4,150,1,5,1,5,1,5,1,5,1,5,1,5,3,5,159,8,5,
        1,5,1,5,1,5,3,5,164,8,5,1,5,3,5,167,8,5,1,6,4,6,170,8,6,11,6,12,
        6,171,1,6,5,6,175,8,6,10,6,12,6,178,9,6,1,6,4,6,181,8,6,11,6,12,
        6,182,1,7,1,7,1,7,1,7,1,7,1,8,5,8,191,8,8,10,8,12,8,194,9,8,1,8,
        1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,3,8,207,8,8,1,9,4,9,210,
        8,9,11,9,12,9,211,1,9,5,9,215,8,9,10,9,12,9,218,9,9,1,9,4,9,221,
        8,9,11,9,12,9,222,1,10,1,10,1,10,1,10,1,10,1,11,5,11,231,8,11,10,
        11,12,11,234,9,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,12,4,
        12,245,8,12,11,12,12,12,246,1,13,1,13,1,13,3,13,252,8,13,1,13,1,
        13,1,13,1,13,1,13,1,13,4,13,260,8,13,11,13,12,13,261,1,14,4,14,265,
        8,14,11,14,12,14,266,1,15,1,15,1,15,3,15,272,8,15,1,15,1,15,1,15,
        1,15,1,15,1,15,1,15,1,15,4,15,282,8,15,11,15,12,15,283,1,16,4,16,
        287,8,16,11,16,12,16,288,1,17,1,17,1,17,3,17,294,8,17,1,17,1,17,
        1,17,1,17,1,17,1,17,1,17,1,17,1,17,4,17,305,8,17,11,17,12,17,306,
        1,18,4,18,310,8,18,11,18,12,18,311,1,19,1,19,1,19,1,19,3,19,318,
        8,19,1,19,1,19,1,19,1,19,1,19,4,19,325,8,19,11,19,12,19,326,1,20,
        4,20,330,8,20,11,20,12,20,331,1,21,1,21,1,21,1,21,3,21,338,8,21,
        1,21,1,21,1,21,1,21,1,21,1,21,1,21,4,21,347,8,21,11,21,12,21,348,
        1,22,4,22,352,8,22,11,22,12,22,353,1,23,1,23,1,23,1,23,3,23,360,
        8,23,1,23,1,23,1,23,1,23,1,23,1,23,1,23,1,23,4,23,370,8,23,11,23,
        12,23,371,1,24,4,24,375,8,24,11,24,12,24,376,1,25,1,25,1,25,1,25,
        1,25,1,25,1,25,1,25,1,25,1,25,3,25,389,8,25,1,25,3,25,392,8,25,1,
        26,4,26,395,8,26,11,26,12,26,396,1,27,1,27,1,27,1,27,1,27,1,27,1,
        27,1,27,1,27,1,27,3,27,409,8,27,1,27,3,27,412,8,27,1,28,4,28,415,
        8,28,11,28,12,28,416,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,
        1,29,3,29,429,8,29,1,29,3,29,432,8,29,1,30,4,30,435,8,30,11,30,12,
        30,436,1,31,1,31,1,31,1,31,1,31,1,31,3,31,445,8,31,1,31,3,31,448,
        8,31,1,31,3,31,451,8,31,1,31,3,31,454,8,31,1,31,3,31,457,8,31,1,
        32,1,32,1,32,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,
        33,1,33,1,33,1,33,1,33,1,34,1,34,1,34,1,34,1,34,1,34,1,35,1,35,1,
        35,3,35,486,8,35,1,35,1,35,4,35,490,8,35,11,35,12,35,491,1,36,1,
        36,1,36,1,36,4,36,498,8,36,11,36,12,36,499,1,36,1,36,1,37,1,37,1,
        37,3,37,507,8,37,1,37,1,37,4,37,511,8,37,11,37,12,37,512,1,38,1,
        38,1,38,1,38,1,38,4,38,520,8,38,11,38,12,38,521,1,38,1,38,1,39,1,
        39,1,40,1,40,1,40,0,0,41,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,0,3,2,0,37,37,39,39,1,0,2,3,2,0,1,1,18,18,577,0,106,
        1,0,0,0,2,111,1,0,0,0,4,121,1,0,0,0,6,125,1,0,0,0,8,148,1,0,0,0,
        10,152,1,0,0,0,12,169,1,0,0,0,14,184,1,0,0,0,16,192,1,0,0,0,18,209,
        1,0,0,0,20,224,1,0,0,0,22,232,1,0,0,0,24,244,1,0,0,0,26,248,1,0,
        0,0,28,264,1,0,0,0,30,268,1,0,0,0,32,286,1,0,0,0,34,290,1,0,0,0,
        36,309,1,0,0,0,38,313,1,0,0,0,40,329,1,0,0,0,42,333,1,0,0,0,44,351,
        1,0,0,0,46,355,1,0,0,0,48,374,1,0,0,0,50,378,1,0,0,0,52,394,1,0,
        0,0,54,398,1,0,0,0,56,414,1,0,0,0,58,418,1,0,0,0,60,434,1,0,0,0,
        62,438,1,0,0,0,64,458,1,0,0,0,66,461,1,0,0,0,68,476,1,0,0,0,70,482,
        1,0,0,0,72,493,1,0,0,0,74,503,1,0,0,0,76,514,1,0,0,0,78,525,1,0,
        0,0,80,527,1,0,0,0,82,105,5,4,0,0,83,105,5,5,0,0,84,105,3,2,1,0,
        85,105,3,4,2,0,86,105,3,24,12,0,87,105,3,28,14,0,88,105,3,32,16,
        0,89,105,3,36,18,0,90,105,3,40,20,0,91,105,3,44,22,0,92,105,3,48,
        24,0,93,105,3,52,26,0,94,105,3,56,28,0,95,105,3,8,4,0,96,105,3,12,
        6,0,97,105,3,18,9,0,98,105,3,60,30,0,99,105,3,64,32,0,100,105,3,
        66,33,0,101,105,3,68,34,0,102,105,3,70,35,0,103,105,3,74,37,0,104,
        82,1,0,0,0,104,83,1,0,0,0,104,84,1,0,0,0,104,85,1,0,0,0,104,86,1,
        0,0,0,104,87,1,0,0,0,104,88,1,0,0,0,104,89,1,0,0,0,104,90,1,0,0,
        0,104,91,1,0,0,0,104,92,1,0,0,0,104,93,1,0,0,0,104,94,1,0,0,0,104,
        95,1,0,0,0,104,96,1,0,0,0,104,97,1,0,0,0,104,98,1,0,0,0,104,99,1,
        0,0,0,104,100,1,0,0,0,104,101,1,0,0,0,104,102,1,0,0,0,104,103,1,
        0,0,0,105,108,1,0,0,0,106,104,1,0,0,0,106,107,1,0,0,0,107,109,1,
        0,0,0,108,106,1,0,0,0,109,110,5,0,0,1,110,1,1,0,0,0,111,115,5,7,
        0,0,112,114,5,23,0,0,113,112,1,0,0,0,114,117,1,0,0,0,115,113,1,0,
        0,0,115,116,1,0,0,0,116,118,1,0,0,0,117,115,1,0,0,0,118,119,5,25,
        0,0,119,3,1,0,0,0,120,122,3,6,3,0,121,120,1,0,0,0,122,123,1,0,0,
        0,123,121,1,0,0,0,123,124,1,0,0,0,124,5,1,0,0,0,125,126,5,2,0,0,
        126,127,5,18,0,0,127,128,3,80,40,0,128,129,5,2,0,0,129,130,5,18,
        0,0,130,131,3,80,40,0,131,133,3,78,39,0,132,134,3,78,39,0,133,132,
        1,0,0,0,133,134,1,0,0,0,134,136,1,0,0,0,135,137,3,78,39,0,136,135,
        1,0,0,0,136,137,1,0,0,0,137,139,1,0,0,0,138,140,3,78,39,0,139,138,
        1,0,0,0,139,140,1,0,0,0,140,142,1,0,0,0,141,143,3,78,39,0,142,141,
        1,0,0,0,142,143,1,0,0,0,143,145,1,0,0,0,144,146,3,78,39,0,145,144,
        1,0,0,0,145,146,1,0,0,0,146,7,1,0,0,0,147,149,3,10,5,0,148,147,1,
        0,0,0,149,150,1,0,0,0,150,148,1,0,0,0,150,151,1,0,0,0,151,9,1,0,
        0,0,152,153,5,2,0,0,153,154,5,18,0,0,154,155,5,18,0,0,155,156,3,
        78,39,0,156,158,3,78,39,0,157,159,3,78,39,0,158,157,1,0,0,0,158,
        159,1,0,0,0,159,163,1,0,0,0,160,161,5,8,0,0,161,162,5,9,0,0,162,
        164,5,2,0,0,163,160,1,0,0,0,163,164,1,0,0,0,164,166,1,0,0,0,165,
        167,5,10,0,0,166,165,1,0,0,0,166,167,1,0,0,0,167,11,1,0,0,0,168,
        170,3,14,7,0,169,168,1,0,0,0,170,171,1,0,0,0,171,169,1,0,0,0,171,
        172,1,0,0,0,172,176,1,0,0,0,173,175,3,2,1,0,174,173,1,0,0,0,175,
        178,1,0,0,0,176,174,1,0,0,0,176,177,1,0,0,0,177,180,1,0,0,0,178,
        176,1,0,0,0,179,181,3,16,8,0,180,179,1,0,0,0,181,182,1,0,0,0,182,
        180,1,0,0,0,182,183,1,0,0,0,183,13,1,0,0,0,184,185,5,2,0,0,185,186,
        5,3,0,0,186,187,5,3,0,0,187,188,5,2,0,0,188,15,1,0,0,0,189,191,3,
        2,1,0,190,189,1,0,0,0,191,194,1,0,0,0,192,190,1,0,0,0,192,193,1,
        0,0,0,193,195,1,0,0,0,194,192,1,0,0,0,195,196,5,2,0,0,196,197,5,
        18,0,0,197,198,5,18,0,0,198,199,5,2,0,0,199,200,5,18,0,0,200,201,
        5,18,0,0,201,202,3,78,39,0,202,203,3,78,39,0,203,204,3,78,39,0,204,
        206,5,2,0,0,205,207,3,78,39,0,206,205,1,0,0,0,206,207,1,0,0,0,207,
        17,1,0,0,0,208,210,3,20,10,0,209,208,1,0,0,0,210,211,1,0,0,0,211,
        209,1,0,0,0,211,212,1,0,0,0,212,216,1,0,0,0,213,215,3,2,1,0,214,
        213,1,0,0,0,215,218,1,0,0,0,216,214,1,0,0,0,216,217,1,0,0,0,217,
        220,1,0,0,0,218,216,1,0,0,0,219,221,3,22,11,0,220,219,1,0,0,0,221,
        222,1,0,0,0,222,220,1,0,0,0,222,223,1,0,0,0,223,19,1,0,0,0,224,225,
        5,2,0,0,225,226,5,3,0,0,226,227,5,3,0,0,227,228,5,2,0,0,228,21,1,
        0,0,0,229,231,3,2,1,0,230,229,1,0,0,0,231,234,1,0,0,0,232,230,1,
        0,0,0,232,233,1,0,0,0,233,235,1,0,0,0,234,232,1,0,0,0,235,236,5,
        2,0,0,236,237,5,18,0,0,237,238,5,18,0,0,238,239,3,78,39,0,239,240,
        3,78,39,0,240,241,3,78,39,0,241,242,5,2,0,0,242,23,1,0,0,0,243,245,
        3,26,13,0,244,243,1,0,0,0,245,246,1,0,0,0,246,244,1,0,0,0,246,247,
        1,0,0,0,247,25,1,0,0,0,248,249,5,2,0,0,249,251,5,18,0,0,250,252,
        3,2,1,0,251,250,1,0,0,0,251,252,1,0,0,0,252,259,1,0,0,0,253,254,
        5,18,0,0,254,255,5,2,0,0,255,256,5,18,0,0,256,257,5,18,0,0,257,260,
        3,78,39,0,258,260,3,2,1,0,259,253,1,0,0,0,259,258,1,0,0,0,260,261,
        1,0,0,0,261,259,1,0,0,0,261,262,1,0,0,0,262,27,1,0,0,0,263,265,3,
        30,15,0,264,263,1,0,0,0,265,266,1,0,0,0,266,264,1,0,0,0,266,267,
        1,0,0,0,267,29,1,0,0,0,268,269,5,2,0,0,269,271,5,18,0,0,270,272,
        3,2,1,0,271,270,1,0,0,0,271,272,1,0,0,0,272,281,1,0,0,0,273,274,
        5,18,0,0,274,275,5,2,0,0,275,276,5,18,0,0,276,277,5,18,0,0,277,278,
        3,78,39,0,278,279,3,78,39,0,279,282,1,0,0,0,280,282,3,2,1,0,281,
        273,1,0,0,0,281,280,1,0,0,0,282,283,1,0,0,0,283,281,1,0,0,0,283,
        284,1,0,0,0,284,31,1,0,0,0,285,287,3,34,17,0,286,285,1,0,0,0,287,
        288,1,0,0,0,288,286,1,0,0,0,288,289,1,0,0,0,289,33,1,0,0,0,290,291,
        5,2,0,0,291,293,5,18,0,0,292,294,3,2,1,0,293,292,1,0,0,0,293,294,
        1,0,0,0,294,304,1,0,0,0,295,296,5,18,0,0,296,297,5,2,0,0,297,298,
        5,18,0,0,298,299,5,18,0,0,299,300,3,78,39,0,300,301,3,78,39,0,301,
        302,3,78,39,0,302,305,1,0,0,0,303,305,3,2,1,0,304,295,1,0,0,0,304,
        303,1,0,0,0,305,306,1,0,0,0,306,304,1,0,0,0,306,307,1,0,0,0,307,
        35,1,0,0,0,308,310,3,38,19,0,309,308,1,0,0,0,310,311,1,0,0,0,311,
        309,1,0,0,0,311,312,1,0,0,0,312,37,1,0,0,0,313,314,5,2,0,0,314,315,
        5,18,0,0,315,317,5,18,0,0,316,318,3,2,1,0,317,316,1,0,0,0,317,318,
        1,0,0,0,318,324,1,0,0,0,319,320,5,2,0,0,320,321,5,18,0,0,321,322,
        5,18,0,0,322,325,3,78,39,0,323,325,3,2,1,0,324,319,1,0,0,0,324,323,
        1,0,0,0,325,326,1,0,0,0,326,324,1,0,0,0,326,327,1,0,0,0,327,39,1,
        0,0,0,328,330,3,42,21,0,329,328,1,0,0,0,330,331,1,0,0,0,331,329,
        1,0,0,0,331,332,1,0,0,0,332,41,1,0,0,0,333,334,5,2,0,0,334,335,5,
        18,0,0,335,337,5,18,0,0,336,338,3,2,1,0,337,336,1,0,0,0,337,338,
        1,0,0,0,338,346,1,0,0,0,339,340,5,2,0,0,340,341,5,18,0,0,341,342,
        5,18,0,0,342,343,3,78,39,0,343,344,3,78,39,0,344,347,1,0,0,0,345,
        347,3,2,1,0,346,339,1,0,0,0,346,345,1,0,0,0,347,348,1,0,0,0,348,
        346,1,0,0,0,348,349,1,0,0,0,349,43,1,0,0,0,350,352,3,46,23,0,351,
        350,1,0,0,0,352,353,1,0,0,0,353,351,1,0,0,0,353,354,1,0,0,0,354,
        45,1,0,0,0,355,356,5,2,0,0,356,357,5,18,0,0,357,359,5,18,0,0,358,
        360,3,2,1,0,359,358,1,0,0,0,359,360,1,0,0,0,360,369,1,0,0,0,361,
        362,5,2,0,0,362,363,5,18,0,0,363,364,5,18,0,0,364,365,3,78,39,0,
        365,366,3,78,39,0,366,367,3,78,39,0,367,370,1,0,0,0,368,370,3,2,
        1,0,369,361,1,0,0,0,369,368,1,0,0,0,370,371,1,0,0,0,371,369,1,0,
        0,0,371,372,1,0,0,0,372,47,1,0,0,0,373,375,3,50,25,0,374,373,1,0,
        0,0,375,376,1,0,0,0,376,374,1,0,0,0,376,377,1,0,0,0,377,49,1,0,0,
        0,378,379,5,2,0,0,379,380,5,18,0,0,380,381,5,18,0,0,381,382,5,18,
        0,0,382,383,5,2,0,0,383,384,5,18,0,0,384,385,5,18,0,0,385,386,5,
        18,0,0,386,388,3,78,39,0,387,389,3,78,39,0,388,387,1,0,0,0,388,389,
        1,0,0,0,389,391,1,0,0,0,390,392,3,78,39,0,391,390,1,0,0,0,391,392,
        1,0,0,0,392,51,1,0,0,0,393,395,3,54,27,0,394,393,1,0,0,0,395,396,
        1,0,0,0,396,394,1,0,0,0,396,397,1,0,0,0,397,53,1,0,0,0,398,399,5,
        18,0,0,399,400,5,2,0,0,400,401,5,18,0,0,401,402,5,18,0,0,402,403,
        5,18,0,0,403,404,5,2,0,0,404,405,5,18,0,0,405,406,5,18,0,0,406,408,
        3,78,39,0,407,409,3,78,39,0,408,407,1,0,0,0,408,409,1,0,0,0,409,
        411,1,0,0,0,410,412,3,78,39,0,411,410,1,0,0,0,411,412,1,0,0,0,412,
        55,1,0,0,0,413,415,3,58,29,0,414,413,1,0,0,0,415,416,1,0,0,0,416,
        414,1,0,0,0,416,417,1,0,0,0,417,57,1,0,0,0,418,419,5,18,0,0,419,
        420,5,18,0,0,420,421,5,2,0,0,421,422,5,18,0,0,422,423,5,18,0,0,423,
        424,5,18,0,0,424,425,5,2,0,0,425,426,5,18,0,0,426,428,3,78,39,0,
        427,429,3,78,39,0,428,427,1,0,0,0,428,429,1,0,0,0,429,431,1,0,0,
        0,430,432,3,78,39,0,431,430,1,0,0,0,431,432,1,0,0,0,432,59,1,0,0,
        0,433,435,3,62,31,0,434,433,1,0,0,0,435,436,1,0,0,0,436,434,1,0,
        0,0,436,437,1,0,0,0,437,61,1,0,0,0,438,439,5,2,0,0,439,440,5,18,
        0,0,440,441,5,18,0,0,441,442,5,18,0,0,442,444,3,78,39,0,443,445,
        3,78,39,0,444,443,1,0,0,0,444,445,1,0,0,0,445,447,1,0,0,0,446,448,
        3,78,39,0,447,446,1,0,0,0,447,448,1,0,0,0,448,450,1,0,0,0,449,451,
        3,78,39,0,450,449,1,0,0,0,450,451,1,0,0,0,451,453,1,0,0,0,452,454,
        3,78,39,0,453,452,1,0,0,0,453,454,1,0,0,0,454,456,1,0,0,0,455,457,
        3,78,39,0,456,455,1,0,0,0,456,457,1,0,0,0,457,63,1,0,0,0,458,459,
        5,11,0,0,459,460,5,12,0,0,460,65,1,0,0,0,461,462,5,13,0,0,462,463,
        5,26,0,0,463,464,5,30,0,0,464,465,5,32,0,0,465,466,5,28,0,0,466,
        467,5,30,0,0,467,468,5,31,0,0,468,469,5,27,0,0,469,470,5,30,0,0,
        470,471,5,32,0,0,471,472,5,29,0,0,472,473,5,30,0,0,473,474,5,31,
        0,0,474,475,5,34,0,0,475,67,1,0,0,0,476,477,5,14,0,0,477,478,5,18,
        0,0,478,479,5,2,0,0,479,480,5,18,0,0,480,481,5,2,0,0,481,69,1,0,
        0,0,482,483,5,15,0,0,483,485,5,18,0,0,484,486,3,2,1,0,485,484,1,
        0,0,0,485,486,1,0,0,0,486,489,1,0,0,0,487,490,3,72,36,0,488,490,
        3,2,1,0,489,487,1,0,0,0,489,488,1,0,0,0,490,491,1,0,0,0,491,489,
        1,0,0,0,491,492,1,0,0,0,492,71,1,0,0,0,493,494,5,16,0,0,494,495,
        5,39,0,0,495,497,5,40,0,0,496,498,5,39,0,0,497,496,1,0,0,0,498,499,
        1,0,0,0,499,497,1,0,0,0,499,500,1,0,0,0,500,501,1,0,0,0,501,502,
        5,42,0,0,502,73,1,0,0,0,503,504,5,15,0,0,504,506,5,18,0,0,505,507,
        3,2,1,0,506,505,1,0,0,0,506,507,1,0,0,0,507,510,1,0,0,0,508,511,
        3,76,38,0,509,511,3,2,1,0,510,508,1,0,0,0,510,509,1,0,0,0,511,512,
        1,0,0,0,512,510,1,0,0,0,512,513,1,0,0,0,513,75,1,0,0,0,514,515,5,
        17,0,0,515,516,7,0,0,0,516,519,5,40,0,0,517,518,5,39,0,0,518,520,
        5,38,0,0,519,517,1,0,0,0,520,521,1,0,0,0,521,519,1,0,0,0,521,522,
        1,0,0,0,522,523,1,0,0,0,523,524,5,42,0,0,524,77,1,0,0,0,525,526,
        7,1,0,0,526,79,1,0,0,0,527,528,7,2,0,0,528,81,1,0,0,0,69,104,106,
        115,123,133,136,139,142,145,150,158,163,166,171,176,182,192,206,
        211,216,222,232,246,251,259,261,266,271,281,283,288,293,304,306,
        311,317,324,326,331,337,346,348,353,359,369,371,376,388,391,396,
        408,411,416,428,431,436,444,447,450,453,456,485,489,491,499,506,
        510,512,521
    ]

class CyanaMRParser ( Parser ):

    grammarFileName = "CyanaMRParser.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>", 
                     "'TYPE'", "<INVALID>", "'OR'", "'SSBOND'", "<INVALID>", 
                     "'HBOND'", "'LINK'", "'RESIDUE'", "'MAPPING'", "'AMBIG'", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "'ATOM1'", "'ATOM2'", "'RESIDUE1'", "'RESIDUE2'" ]

    symbolicNames = [ "<INVALID>", "Ambig_code", "Integer", "Float", "Orientation_header", 
                      "Tensor_header", "SMCLN_COMMENT", "COMMENT", "Type", 
                      "Equ_op", "Or", "Ssbond", "Ssbond_resids", "Hbond", 
                      "Link", "Residue", "Mapping", "Ambig", "Simple_name", 
                      "SPACE", "ENCLOSE_COMMENT", "SECTION_COMMENT", "LINE_COMMENT", 
                      "Any_name", "SPACE_CM", "RETURN_CM", "Atom1", "Atom2", 
                      "Residue1", "Residue2", "Equ_op_HB", "Integer_HB", 
                      "Simple_name_HB", "SPACE_HB", "RETURN_HB", "SECTION_COMMENT_HB", 
                      "LINE_COMMENT_HB", "Ambig_code_MP", "Integer_MP", 
                      "Simple_name_MP", "Equ_op_MP", "SPACE_MP", "RETURN_MP", 
                      "SECTION_COMMENT_MP", "LINE_COMMENT_MP" ]

    RULE_cyana_mr = 0
    RULE_comment = 1
    RULE_distance_restraints = 2
    RULE_distance_restraint = 3
    RULE_torsion_angle_restraints = 4
    RULE_torsion_angle_restraint = 5
    RULE_rdc_restraints = 6
    RULE_rdc_parameter = 7
    RULE_rdc_restraint = 8
    RULE_pcs_restraints = 9
    RULE_pcs_parameter = 10
    RULE_pcs_restraint = 11
    RULE_fixres_distance_restraints = 12
    RULE_fixres_distance_restraint = 13
    RULE_fixresw_distance_restraints = 14
    RULE_fixresw_distance_restraint = 15
    RULE_fixresw2_distance_restraints = 16
    RULE_fixresw2_distance_restraint = 17
    RULE_fixatm_distance_restraints = 18
    RULE_fixatm_distance_restraint = 19
    RULE_fixatmw_distance_restraints = 20
    RULE_fixatmw_distance_restraint = 21
    RULE_fixatmw2_distance_restraints = 22
    RULE_fixatmw2_distance_restraint = 23
    RULE_distance_w_chain_restraints = 24
    RULE_distance_w_chain_restraint = 25
    RULE_distance_w_chain2_restraints = 26
    RULE_distance_w_chain2_restraint = 27
    RULE_distance_w_chain3_restraints = 28
    RULE_distance_w_chain3_restraint = 29
    RULE_cco_restraints = 30
    RULE_cco_restraint = 31
    RULE_ssbond_macro = 32
    RULE_hbond_macro = 33
    RULE_link_statement = 34
    RULE_unambig_atom_name_mapping = 35
    RULE_mapping_list = 36
    RULE_ambig_atom_name_mapping = 37
    RULE_ambig_list = 38
    RULE_number = 39
    RULE_gen_atom_name = 40

    ruleNames =  [ "cyana_mr", "comment", "distance_restraints", "distance_restraint", 
                   "torsion_angle_restraints", "torsion_angle_restraint", 
                   "rdc_restraints", "rdc_parameter", "rdc_restraint", "pcs_restraints", 
                   "pcs_parameter", "pcs_restraint", "fixres_distance_restraints", 
                   "fixres_distance_restraint", "fixresw_distance_restraints", 
                   "fixresw_distance_restraint", "fixresw2_distance_restraints", 
                   "fixresw2_distance_restraint", "fixatm_distance_restraints", 
                   "fixatm_distance_restraint", "fixatmw_distance_restraints", 
                   "fixatmw_distance_restraint", "fixatmw2_distance_restraints", 
                   "fixatmw2_distance_restraint", "distance_w_chain_restraints", 
                   "distance_w_chain_restraint", "distance_w_chain2_restraints", 
                   "distance_w_chain2_restraint", "distance_w_chain3_restraints", 
                   "distance_w_chain3_restraint", "cco_restraints", "cco_restraint", 
                   "ssbond_macro", "hbond_macro", "link_statement", "unambig_atom_name_mapping", 
                   "mapping_list", "ambig_atom_name_mapping", "ambig_list", 
                   "number", "gen_atom_name" ]

    EOF = Token.EOF
    Ambig_code=1
    Integer=2
    Float=3
    Orientation_header=4
    Tensor_header=5
    SMCLN_COMMENT=6
    COMMENT=7
    Type=8
    Equ_op=9
    Or=10
    Ssbond=11
    Ssbond_resids=12
    Hbond=13
    Link=14
    Residue=15
    Mapping=16
    Ambig=17
    Simple_name=18
    SPACE=19
    ENCLOSE_COMMENT=20
    SECTION_COMMENT=21
    LINE_COMMENT=22
    Any_name=23
    SPACE_CM=24
    RETURN_CM=25
    Atom1=26
    Atom2=27
    Residue1=28
    Residue2=29
    Equ_op_HB=30
    Integer_HB=31
    Simple_name_HB=32
    SPACE_HB=33
    RETURN_HB=34
    SECTION_COMMENT_HB=35
    LINE_COMMENT_HB=36
    Ambig_code_MP=37
    Integer_MP=38
    Simple_name_MP=39
    Equ_op_MP=40
    SPACE_MP=41
    RETURN_MP=42
    SECTION_COMMENT_MP=43
    LINE_COMMENT_MP=44

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




    class Cyana_mrContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def EOF(self):
            return self.getToken(CyanaMRParser.EOF, 0)

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

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

        def comment(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.CommentContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.CommentContext,i)


        def distance_restraints(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Distance_restraintsContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Distance_restraintsContext,i)


        def fixres_distance_restraints(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Fixres_distance_restraintsContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Fixres_distance_restraintsContext,i)


        def fixresw_distance_restraints(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Fixresw_distance_restraintsContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Fixresw_distance_restraintsContext,i)


        def fixresw2_distance_restraints(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Fixresw2_distance_restraintsContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Fixresw2_distance_restraintsContext,i)


        def fixatm_distance_restraints(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Fixatm_distance_restraintsContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Fixatm_distance_restraintsContext,i)


        def fixatmw_distance_restraints(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Fixatmw_distance_restraintsContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Fixatmw_distance_restraintsContext,i)


        def fixatmw2_distance_restraints(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Fixatmw2_distance_restraintsContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Fixatmw2_distance_restraintsContext,i)


        def distance_w_chain_restraints(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Distance_w_chain_restraintsContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Distance_w_chain_restraintsContext,i)


        def distance_w_chain2_restraints(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Distance_w_chain2_restraintsContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Distance_w_chain2_restraintsContext,i)


        def distance_w_chain3_restraints(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Distance_w_chain3_restraintsContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Distance_w_chain3_restraintsContext,i)


        def torsion_angle_restraints(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Torsion_angle_restraintsContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Torsion_angle_restraintsContext,i)


        def rdc_restraints(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Rdc_restraintsContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Rdc_restraintsContext,i)


        def pcs_restraints(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Pcs_restraintsContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Pcs_restraintsContext,i)


        def cco_restraints(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Cco_restraintsContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Cco_restraintsContext,i)


        def ssbond_macro(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Ssbond_macroContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Ssbond_macroContext,i)


        def hbond_macro(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Hbond_macroContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Hbond_macroContext,i)


        def link_statement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Link_statementContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Link_statementContext,i)


        def unambig_atom_name_mapping(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Unambig_atom_name_mappingContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Unambig_atom_name_mappingContext,i)


        def ambig_atom_name_mapping(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Ambig_atom_name_mappingContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Ambig_atom_name_mappingContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_cyana_mr

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

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




    def cyana_mr(self):

        localctx = CyanaMRParser.Cyana_mrContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_cyana_mr)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 106
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << CyanaMRParser.Integer) | (1 << CyanaMRParser.Orientation_header) | (1 << CyanaMRParser.Tensor_header) | (1 << CyanaMRParser.COMMENT) | (1 << CyanaMRParser.Ssbond) | (1 << CyanaMRParser.Hbond) | (1 << CyanaMRParser.Link) | (1 << CyanaMRParser.Residue) | (1 << CyanaMRParser.Simple_name))) != 0):
                self.state = 104
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,0,self._ctx)
                if la_ == 1:
                    self.state = 82
                    self.match(CyanaMRParser.Orientation_header)
                    pass

                elif la_ == 2:
                    self.state = 83
                    self.match(CyanaMRParser.Tensor_header)
                    pass

                elif la_ == 3:
                    self.state = 84
                    self.comment()
                    pass

                elif la_ == 4:
                    self.state = 85
                    self.distance_restraints()
                    pass

                elif la_ == 5:
                    self.state = 86
                    self.fixres_distance_restraints()
                    pass

                elif la_ == 6:
                    self.state = 87
                    self.fixresw_distance_restraints()
                    pass

                elif la_ == 7:
                    self.state = 88
                    self.fixresw2_distance_restraints()
                    pass

                elif la_ == 8:
                    self.state = 89
                    self.fixatm_distance_restraints()
                    pass

                elif la_ == 9:
                    self.state = 90
                    self.fixatmw_distance_restraints()
                    pass

                elif la_ == 10:
                    self.state = 91
                    self.fixatmw2_distance_restraints()
                    pass

                elif la_ == 11:
                    self.state = 92
                    self.distance_w_chain_restraints()
                    pass

                elif la_ == 12:
                    self.state = 93
                    self.distance_w_chain2_restraints()
                    pass

                elif la_ == 13:
                    self.state = 94
                    self.distance_w_chain3_restraints()
                    pass

                elif la_ == 14:
                    self.state = 95
                    self.torsion_angle_restraints()
                    pass

                elif la_ == 15:
                    self.state = 96
                    self.rdc_restraints()
                    pass

                elif la_ == 16:
                    self.state = 97
                    self.pcs_restraints()
                    pass

                elif la_ == 17:
                    self.state = 98
                    self.cco_restraints()
                    pass

                elif la_ == 18:
                    self.state = 99
                    self.ssbond_macro()
                    pass

                elif la_ == 19:
                    self.state = 100
                    self.hbond_macro()
                    pass

                elif la_ == 20:
                    self.state = 101
                    self.link_statement()
                    pass

                elif la_ == 21:
                    self.state = 102
                    self.unambig_atom_name_mapping()
                    pass

                elif la_ == 22:
                    self.state = 103
                    self.ambig_atom_name_mapping()
                    pass


                self.state = 108
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 109
            self.match(CyanaMRParser.EOF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CommentContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def COMMENT(self):
            return self.getToken(CyanaMRParser.COMMENT, 0)

        def RETURN_CM(self):
            return self.getToken(CyanaMRParser.RETURN_CM, 0)

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

        def getRuleIndex(self):
            return CyanaMRParser.RULE_comment

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

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




    def comment(self):

        localctx = CyanaMRParser.CommentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_comment)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 111
            self.match(CyanaMRParser.COMMENT)
            self.state = 115
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==CyanaMRParser.Any_name:
                self.state = 112
                self.match(CyanaMRParser.Any_name)
                self.state = 117
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 118
            self.match(CyanaMRParser.RETURN_CM)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Distance_restraintsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def distance_restraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Distance_restraintContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Distance_restraintContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_distance_restraints

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

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




    def distance_restraints(self):

        localctx = CyanaMRParser.Distance_restraintsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_distance_restraints)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 121 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 120
                    self.distance_restraint()

                else:
                    raise NoViableAltException(self)
                self.state = 123 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,3,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 Distance_restraintContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def gen_atom_name(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Gen_atom_nameContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Gen_atom_nameContext,i)


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


        def getRuleIndex(self):
            return CyanaMRParser.RULE_distance_restraint

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

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




    def distance_restraint(self):

        localctx = CyanaMRParser.Distance_restraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_distance_restraint)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 125
            self.match(CyanaMRParser.Integer)
            self.state = 126
            self.match(CyanaMRParser.Simple_name)
            self.state = 127
            self.gen_atom_name()
            self.state = 128
            self.match(CyanaMRParser.Integer)
            self.state = 129
            self.match(CyanaMRParser.Simple_name)
            self.state = 130
            self.gen_atom_name()
            self.state = 131
            self.number()
            self.state = 133
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,4,self._ctx)
            if la_ == 1:
                self.state = 132
                self.number()


            self.state = 136
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,5,self._ctx)
            if la_ == 1:
                self.state = 135
                self.number()


            self.state = 139
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,6,self._ctx)
            if la_ == 1:
                self.state = 138
                self.number()


            self.state = 142
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,7,self._ctx)
            if la_ == 1:
                self.state = 141
                self.number()


            self.state = 145
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,8,self._ctx)
            if la_ == 1:
                self.state = 144
                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 Torsion_angle_restraintsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def torsion_angle_restraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Torsion_angle_restraintContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Torsion_angle_restraintContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_torsion_angle_restraints

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

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




    def torsion_angle_restraints(self):

        localctx = CyanaMRParser.Torsion_angle_restraintsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_torsion_angle_restraints)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 148 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 147
                    self.torsion_angle_restraint()

                else:
                    raise NoViableAltException(self)
                self.state = 150 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,9,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 Torsion_angle_restraintContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

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


        def Type(self):
            return self.getToken(CyanaMRParser.Type, 0)

        def Equ_op(self):
            return self.getToken(CyanaMRParser.Equ_op, 0)

        def Or(self):
            return self.getToken(CyanaMRParser.Or, 0)

        def getRuleIndex(self):
            return CyanaMRParser.RULE_torsion_angle_restraint

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

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




    def torsion_angle_restraint(self):

        localctx = CyanaMRParser.Torsion_angle_restraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_torsion_angle_restraint)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 152
            self.match(CyanaMRParser.Integer)
            self.state = 153
            self.match(CyanaMRParser.Simple_name)
            self.state = 154
            self.match(CyanaMRParser.Simple_name)
            self.state = 155
            self.number()
            self.state = 156
            self.number()
            self.state = 158
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,10,self._ctx)
            if la_ == 1:
                self.state = 157
                self.number()


            self.state = 163
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==CyanaMRParser.Type:
                self.state = 160
                self.match(CyanaMRParser.Type)
                self.state = 161
                self.match(CyanaMRParser.Equ_op)
                self.state = 162
                self.match(CyanaMRParser.Integer)


            self.state = 166
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==CyanaMRParser.Or:
                self.state = 165
                self.match(CyanaMRParser.Or)


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


    class Rdc_restraintsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def rdc_parameter(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Rdc_parameterContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Rdc_parameterContext,i)


        def comment(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.CommentContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.CommentContext,i)


        def rdc_restraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Rdc_restraintContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Rdc_restraintContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_rdc_restraints

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

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




    def rdc_restraints(self):

        localctx = CyanaMRParser.Rdc_restraintsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_rdc_restraints)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 169 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 168
                    self.rdc_parameter()

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

            self.state = 176
            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 = 173
                    self.comment() 
                self.state = 178
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,14,self._ctx)

            self.state = 180 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 179
                    self.rdc_restraint()

                else:
                    raise NoViableAltException(self)
                self.state = 182 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,15,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 Rdc_parameterContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def getRuleIndex(self):
            return CyanaMRParser.RULE_rdc_parameter

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

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




    def rdc_parameter(self):

        localctx = CyanaMRParser.Rdc_parameterContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_rdc_parameter)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 184
            self.match(CyanaMRParser.Integer)
            self.state = 185
            self.match(CyanaMRParser.Float)
            self.state = 186
            self.match(CyanaMRParser.Float)
            self.state = 187
            self.match(CyanaMRParser.Integer)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Rdc_restraintContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

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


        def comment(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.CommentContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.CommentContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_rdc_restraint

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

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




    def rdc_restraint(self):

        localctx = CyanaMRParser.Rdc_restraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_rdc_restraint)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 192
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==CyanaMRParser.COMMENT:
                self.state = 189
                self.comment()
                self.state = 194
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 195
            self.match(CyanaMRParser.Integer)
            self.state = 196
            self.match(CyanaMRParser.Simple_name)
            self.state = 197
            self.match(CyanaMRParser.Simple_name)
            self.state = 198
            self.match(CyanaMRParser.Integer)
            self.state = 199
            self.match(CyanaMRParser.Simple_name)
            self.state = 200
            self.match(CyanaMRParser.Simple_name)
            self.state = 201
            self.number()
            self.state = 202
            self.number()
            self.state = 203
            self.number()
            self.state = 204
            self.match(CyanaMRParser.Integer)
            self.state = 206
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,17,self._ctx)
            if la_ == 1:
                self.state = 205
                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 Pcs_restraintsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def pcs_parameter(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Pcs_parameterContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Pcs_parameterContext,i)


        def comment(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.CommentContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.CommentContext,i)


        def pcs_restraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Pcs_restraintContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Pcs_restraintContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_pcs_restraints

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

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




    def pcs_restraints(self):

        localctx = CyanaMRParser.Pcs_restraintsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_pcs_restraints)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 209 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 208
                    self.pcs_parameter()

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

            self.state = 216
            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 = 213
                    self.comment() 
                self.state = 218
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,19,self._ctx)

            self.state = 220 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 219
                    self.pcs_restraint()

                else:
                    raise NoViableAltException(self)
                self.state = 222 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,20,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 Pcs_parameterContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def getRuleIndex(self):
            return CyanaMRParser.RULE_pcs_parameter

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

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




    def pcs_parameter(self):

        localctx = CyanaMRParser.Pcs_parameterContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_pcs_parameter)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 224
            self.match(CyanaMRParser.Integer)
            self.state = 225
            self.match(CyanaMRParser.Float)
            self.state = 226
            self.match(CyanaMRParser.Float)
            self.state = 227
            self.match(CyanaMRParser.Integer)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Pcs_restraintContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

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


        def comment(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.CommentContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.CommentContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_pcs_restraint

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

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




    def pcs_restraint(self):

        localctx = CyanaMRParser.Pcs_restraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_pcs_restraint)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 232
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==CyanaMRParser.COMMENT:
                self.state = 229
                self.comment()
                self.state = 234
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 235
            self.match(CyanaMRParser.Integer)
            self.state = 236
            self.match(CyanaMRParser.Simple_name)
            self.state = 237
            self.match(CyanaMRParser.Simple_name)
            self.state = 238
            self.number()
            self.state = 239
            self.number()
            self.state = 240
            self.number()
            self.state = 241
            self.match(CyanaMRParser.Integer)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Fixres_distance_restraintsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def fixres_distance_restraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Fixres_distance_restraintContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Fixres_distance_restraintContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_fixres_distance_restraints

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

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




    def fixres_distance_restraints(self):

        localctx = CyanaMRParser.Fixres_distance_restraintsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_fixres_distance_restraints)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 244 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 243
                    self.fixres_distance_restraint()

                else:
                    raise NoViableAltException(self)
                self.state = 246 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,22,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 Fixres_distance_restraintContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def comment(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.CommentContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.CommentContext,i)


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


        def getRuleIndex(self):
            return CyanaMRParser.RULE_fixres_distance_restraint

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

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




    def fixres_distance_restraint(self):

        localctx = CyanaMRParser.Fixres_distance_restraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_fixres_distance_restraint)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 248
            self.match(CyanaMRParser.Integer)
            self.state = 249
            self.match(CyanaMRParser.Simple_name)
            self.state = 251
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,23,self._ctx)
            if la_ == 1:
                self.state = 250
                self.comment()


            self.state = 259 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 259
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [CyanaMRParser.Simple_name]:
                        self.state = 253
                        self.match(CyanaMRParser.Simple_name)
                        self.state = 254
                        self.match(CyanaMRParser.Integer)
                        self.state = 255
                        self.match(CyanaMRParser.Simple_name)
                        self.state = 256
                        self.match(CyanaMRParser.Simple_name)
                        self.state = 257
                        self.number()
                        pass
                    elif token in [CyanaMRParser.COMMENT]:
                        self.state = 258
                        self.comment()
                        pass
                    else:
                        raise NoViableAltException(self)


                else:
                    raise NoViableAltException(self)
                self.state = 261 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,25,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 Fixresw_distance_restraintsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def fixresw_distance_restraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Fixresw_distance_restraintContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Fixresw_distance_restraintContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_fixresw_distance_restraints

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

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




    def fixresw_distance_restraints(self):

        localctx = CyanaMRParser.Fixresw_distance_restraintsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_fixresw_distance_restraints)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 264 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 263
                    self.fixresw_distance_restraint()

                else:
                    raise NoViableAltException(self)
                self.state = 266 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,26,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 Fixresw_distance_restraintContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def comment(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.CommentContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.CommentContext,i)


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


        def getRuleIndex(self):
            return CyanaMRParser.RULE_fixresw_distance_restraint

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

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




    def fixresw_distance_restraint(self):

        localctx = CyanaMRParser.Fixresw_distance_restraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_fixresw_distance_restraint)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 268
            self.match(CyanaMRParser.Integer)
            self.state = 269
            self.match(CyanaMRParser.Simple_name)
            self.state = 271
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,27,self._ctx)
            if la_ == 1:
                self.state = 270
                self.comment()


            self.state = 281 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 281
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [CyanaMRParser.Simple_name]:
                        self.state = 273
                        self.match(CyanaMRParser.Simple_name)
                        self.state = 274
                        self.match(CyanaMRParser.Integer)
                        self.state = 275
                        self.match(CyanaMRParser.Simple_name)
                        self.state = 276
                        self.match(CyanaMRParser.Simple_name)
                        self.state = 277
                        self.number()
                        self.state = 278
                        self.number()
                        pass
                    elif token in [CyanaMRParser.COMMENT]:
                        self.state = 280
                        self.comment()
                        pass
                    else:
                        raise NoViableAltException(self)


                else:
                    raise NoViableAltException(self)
                self.state = 283 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,29,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 Fixresw2_distance_restraintsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def fixresw2_distance_restraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Fixresw2_distance_restraintContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Fixresw2_distance_restraintContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_fixresw2_distance_restraints

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

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




    def fixresw2_distance_restraints(self):

        localctx = CyanaMRParser.Fixresw2_distance_restraintsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_fixresw2_distance_restraints)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 286 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 285
                    self.fixresw2_distance_restraint()

                else:
                    raise NoViableAltException(self)
                self.state = 288 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,30,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 Fixresw2_distance_restraintContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def comment(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.CommentContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.CommentContext,i)


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


        def getRuleIndex(self):
            return CyanaMRParser.RULE_fixresw2_distance_restraint

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

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




    def fixresw2_distance_restraint(self):

        localctx = CyanaMRParser.Fixresw2_distance_restraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_fixresw2_distance_restraint)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 290
            self.match(CyanaMRParser.Integer)
            self.state = 291
            self.match(CyanaMRParser.Simple_name)
            self.state = 293
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,31,self._ctx)
            if la_ == 1:
                self.state = 292
                self.comment()


            self.state = 304 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 304
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [CyanaMRParser.Simple_name]:
                        self.state = 295
                        self.match(CyanaMRParser.Simple_name)
                        self.state = 296
                        self.match(CyanaMRParser.Integer)
                        self.state = 297
                        self.match(CyanaMRParser.Simple_name)
                        self.state = 298
                        self.match(CyanaMRParser.Simple_name)
                        self.state = 299
                        self.number()
                        self.state = 300
                        self.number()
                        self.state = 301
                        self.number()
                        pass
                    elif token in [CyanaMRParser.COMMENT]:
                        self.state = 303
                        self.comment()
                        pass
                    else:
                        raise NoViableAltException(self)


                else:
                    raise NoViableAltException(self)
                self.state = 306 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,33,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 Fixatm_distance_restraintsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def fixatm_distance_restraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Fixatm_distance_restraintContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Fixatm_distance_restraintContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_fixatm_distance_restraints

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

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




    def fixatm_distance_restraints(self):

        localctx = CyanaMRParser.Fixatm_distance_restraintsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_fixatm_distance_restraints)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 309 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 308
                    self.fixatm_distance_restraint()

                else:
                    raise NoViableAltException(self)
                self.state = 311 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,34,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 Fixatm_distance_restraintContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def comment(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.CommentContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.CommentContext,i)


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


        def getRuleIndex(self):
            return CyanaMRParser.RULE_fixatm_distance_restraint

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

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




    def fixatm_distance_restraint(self):

        localctx = CyanaMRParser.Fixatm_distance_restraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_fixatm_distance_restraint)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 313
            self.match(CyanaMRParser.Integer)
            self.state = 314
            self.match(CyanaMRParser.Simple_name)
            self.state = 315
            self.match(CyanaMRParser.Simple_name)
            self.state = 317
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,35,self._ctx)
            if la_ == 1:
                self.state = 316
                self.comment()


            self.state = 324 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 324
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [CyanaMRParser.Integer]:
                        self.state = 319
                        self.match(CyanaMRParser.Integer)
                        self.state = 320
                        self.match(CyanaMRParser.Simple_name)
                        self.state = 321
                        self.match(CyanaMRParser.Simple_name)
                        self.state = 322
                        self.number()
                        pass
                    elif token in [CyanaMRParser.COMMENT]:
                        self.state = 323
                        self.comment()
                        pass
                    else:
                        raise NoViableAltException(self)


                else:
                    raise NoViableAltException(self)
                self.state = 326 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,37,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 Fixatmw_distance_restraintsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def fixatmw_distance_restraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Fixatmw_distance_restraintContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Fixatmw_distance_restraintContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_fixatmw_distance_restraints

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

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




    def fixatmw_distance_restraints(self):

        localctx = CyanaMRParser.Fixatmw_distance_restraintsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_fixatmw_distance_restraints)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 329 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 328
                    self.fixatmw_distance_restraint()

                else:
                    raise NoViableAltException(self)
                self.state = 331 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,38,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 Fixatmw_distance_restraintContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def comment(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.CommentContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.CommentContext,i)


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


        def getRuleIndex(self):
            return CyanaMRParser.RULE_fixatmw_distance_restraint

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

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




    def fixatmw_distance_restraint(self):

        localctx = CyanaMRParser.Fixatmw_distance_restraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 42, self.RULE_fixatmw_distance_restraint)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 333
            self.match(CyanaMRParser.Integer)
            self.state = 334
            self.match(CyanaMRParser.Simple_name)
            self.state = 335
            self.match(CyanaMRParser.Simple_name)
            self.state = 337
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,39,self._ctx)
            if la_ == 1:
                self.state = 336
                self.comment()


            self.state = 346 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 346
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [CyanaMRParser.Integer]:
                        self.state = 339
                        self.match(CyanaMRParser.Integer)
                        self.state = 340
                        self.match(CyanaMRParser.Simple_name)
                        self.state = 341
                        self.match(CyanaMRParser.Simple_name)
                        self.state = 342
                        self.number()
                        self.state = 343
                        self.number()
                        pass
                    elif token in [CyanaMRParser.COMMENT]:
                        self.state = 345
                        self.comment()
                        pass
                    else:
                        raise NoViableAltException(self)


                else:
                    raise NoViableAltException(self)
                self.state = 348 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,41,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 Fixatmw2_distance_restraintsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def fixatmw2_distance_restraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Fixatmw2_distance_restraintContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Fixatmw2_distance_restraintContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_fixatmw2_distance_restraints

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

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




    def fixatmw2_distance_restraints(self):

        localctx = CyanaMRParser.Fixatmw2_distance_restraintsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_fixatmw2_distance_restraints)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 351 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 350
                    self.fixatmw2_distance_restraint()

                else:
                    raise NoViableAltException(self)
                self.state = 353 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,42,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 Fixatmw2_distance_restraintContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def comment(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.CommentContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.CommentContext,i)


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


        def getRuleIndex(self):
            return CyanaMRParser.RULE_fixatmw2_distance_restraint

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

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




    def fixatmw2_distance_restraint(self):

        localctx = CyanaMRParser.Fixatmw2_distance_restraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 46, self.RULE_fixatmw2_distance_restraint)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 355
            self.match(CyanaMRParser.Integer)
            self.state = 356
            self.match(CyanaMRParser.Simple_name)
            self.state = 357
            self.match(CyanaMRParser.Simple_name)
            self.state = 359
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,43,self._ctx)
            if la_ == 1:
                self.state = 358
                self.comment()


            self.state = 369 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 369
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [CyanaMRParser.Integer]:
                        self.state = 361
                        self.match(CyanaMRParser.Integer)
                        self.state = 362
                        self.match(CyanaMRParser.Simple_name)
                        self.state = 363
                        self.match(CyanaMRParser.Simple_name)
                        self.state = 364
                        self.number()
                        self.state = 365
                        self.number()
                        self.state = 366
                        self.number()
                        pass
                    elif token in [CyanaMRParser.COMMENT]:
                        self.state = 368
                        self.comment()
                        pass
                    else:
                        raise NoViableAltException(self)


                else:
                    raise NoViableAltException(self)
                self.state = 371 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,45,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 Distance_w_chain_restraintsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def distance_w_chain_restraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Distance_w_chain_restraintContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Distance_w_chain_restraintContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_distance_w_chain_restraints

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

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




    def distance_w_chain_restraints(self):

        localctx = CyanaMRParser.Distance_w_chain_restraintsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_distance_w_chain_restraints)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 374 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 373
                    self.distance_w_chain_restraint()

                else:
                    raise NoViableAltException(self)
                self.state = 376 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,46,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 Distance_w_chain_restraintContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

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


        def getRuleIndex(self):
            return CyanaMRParser.RULE_distance_w_chain_restraint

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

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




    def distance_w_chain_restraint(self):

        localctx = CyanaMRParser.Distance_w_chain_restraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 50, self.RULE_distance_w_chain_restraint)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 378
            self.match(CyanaMRParser.Integer)
            self.state = 379
            self.match(CyanaMRParser.Simple_name)
            self.state = 380
            self.match(CyanaMRParser.Simple_name)
            self.state = 381
            self.match(CyanaMRParser.Simple_name)
            self.state = 382
            self.match(CyanaMRParser.Integer)
            self.state = 383
            self.match(CyanaMRParser.Simple_name)
            self.state = 384
            self.match(CyanaMRParser.Simple_name)
            self.state = 385
            self.match(CyanaMRParser.Simple_name)
            self.state = 386
            self.number()
            self.state = 388
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,47,self._ctx)
            if la_ == 1:
                self.state = 387
                self.number()


            self.state = 391
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,48,self._ctx)
            if la_ == 1:
                self.state = 390
                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 Distance_w_chain2_restraintsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def distance_w_chain2_restraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Distance_w_chain2_restraintContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Distance_w_chain2_restraintContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_distance_w_chain2_restraints

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

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




    def distance_w_chain2_restraints(self):

        localctx = CyanaMRParser.Distance_w_chain2_restraintsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 52, self.RULE_distance_w_chain2_restraints)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 394 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 393
                    self.distance_w_chain2_restraint()

                else:
                    raise NoViableAltException(self)
                self.state = 396 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,49,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 Distance_w_chain2_restraintContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

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


        def getRuleIndex(self):
            return CyanaMRParser.RULE_distance_w_chain2_restraint

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

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




    def distance_w_chain2_restraint(self):

        localctx = CyanaMRParser.Distance_w_chain2_restraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 54, self.RULE_distance_w_chain2_restraint)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 398
            self.match(CyanaMRParser.Simple_name)
            self.state = 399
            self.match(CyanaMRParser.Integer)
            self.state = 400
            self.match(CyanaMRParser.Simple_name)
            self.state = 401
            self.match(CyanaMRParser.Simple_name)
            self.state = 402
            self.match(CyanaMRParser.Simple_name)
            self.state = 403
            self.match(CyanaMRParser.Integer)
            self.state = 404
            self.match(CyanaMRParser.Simple_name)
            self.state = 405
            self.match(CyanaMRParser.Simple_name)
            self.state = 406
            self.number()
            self.state = 408
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,50,self._ctx)
            if la_ == 1:
                self.state = 407
                self.number()


            self.state = 411
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,51,self._ctx)
            if la_ == 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 Distance_w_chain3_restraintsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def distance_w_chain3_restraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Distance_w_chain3_restraintContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Distance_w_chain3_restraintContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_distance_w_chain3_restraints

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

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




    def distance_w_chain3_restraints(self):

        localctx = CyanaMRParser.Distance_w_chain3_restraintsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 56, self.RULE_distance_w_chain3_restraints)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 414 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 413
                    self.distance_w_chain3_restraint()

                else:
                    raise NoViableAltException(self)
                self.state = 416 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,52,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 Distance_w_chain3_restraintContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

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


        def getRuleIndex(self):
            return CyanaMRParser.RULE_distance_w_chain3_restraint

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

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




    def distance_w_chain3_restraint(self):

        localctx = CyanaMRParser.Distance_w_chain3_restraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 58, self.RULE_distance_w_chain3_restraint)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 418
            self.match(CyanaMRParser.Simple_name)
            self.state = 419
            self.match(CyanaMRParser.Simple_name)
            self.state = 420
            self.match(CyanaMRParser.Integer)
            self.state = 421
            self.match(CyanaMRParser.Simple_name)
            self.state = 422
            self.match(CyanaMRParser.Simple_name)
            self.state = 423
            self.match(CyanaMRParser.Simple_name)
            self.state = 424
            self.match(CyanaMRParser.Integer)
            self.state = 425
            self.match(CyanaMRParser.Simple_name)
            self.state = 426
            self.number()
            self.state = 428
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,53,self._ctx)
            if la_ == 1:
                self.state = 427
                self.number()


            self.state = 431
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,54,self._ctx)
            if la_ == 1:
                self.state = 430
                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 Cco_restraintsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def cco_restraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Cco_restraintContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Cco_restraintContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_cco_restraints

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

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




    def cco_restraints(self):

        localctx = CyanaMRParser.Cco_restraintsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 60, self.RULE_cco_restraints)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 434 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 433
                    self.cco_restraint()

                else:
                    raise NoViableAltException(self)
                self.state = 436 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,55,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 Cco_restraintContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def Integer(self):
            return self.getToken(CyanaMRParser.Integer, 0)

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

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


        def getRuleIndex(self):
            return CyanaMRParser.RULE_cco_restraint

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

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




    def cco_restraint(self):

        localctx = CyanaMRParser.Cco_restraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 62, self.RULE_cco_restraint)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 438
            self.match(CyanaMRParser.Integer)
            self.state = 439
            self.match(CyanaMRParser.Simple_name)
            self.state = 440
            self.match(CyanaMRParser.Simple_name)
            self.state = 441
            self.match(CyanaMRParser.Simple_name)
            self.state = 442
            self.number()
            self.state = 444
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,56,self._ctx)
            if la_ == 1:
                self.state = 443
                self.number()


            self.state = 447
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,57,self._ctx)
            if la_ == 1:
                self.state = 446
                self.number()


            self.state = 450
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,58,self._ctx)
            if la_ == 1:
                self.state = 449
                self.number()


            self.state = 453
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,59,self._ctx)
            if la_ == 1:
                self.state = 452
                self.number()


            self.state = 456
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,60,self._ctx)
            if la_ == 1:
                self.state = 455
                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 Ssbond_macroContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def Ssbond(self):
            return self.getToken(CyanaMRParser.Ssbond, 0)

        def Ssbond_resids(self):
            return self.getToken(CyanaMRParser.Ssbond_resids, 0)

        def getRuleIndex(self):
            return CyanaMRParser.RULE_ssbond_macro

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

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




    def ssbond_macro(self):

        localctx = CyanaMRParser.Ssbond_macroContext(self, self._ctx, self.state)
        self.enterRule(localctx, 64, self.RULE_ssbond_macro)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 458
            self.match(CyanaMRParser.Ssbond)
            self.state = 459
            self.match(CyanaMRParser.Ssbond_resids)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Hbond_macroContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def Hbond(self):
            return self.getToken(CyanaMRParser.Hbond, 0)

        def Atom1(self):
            return self.getToken(CyanaMRParser.Atom1, 0)

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

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

        def Residue1(self):
            return self.getToken(CyanaMRParser.Residue1, 0)

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

        def Atom2(self):
            return self.getToken(CyanaMRParser.Atom2, 0)

        def Residue2(self):
            return self.getToken(CyanaMRParser.Residue2, 0)

        def RETURN_HB(self):
            return self.getToken(CyanaMRParser.RETURN_HB, 0)

        def getRuleIndex(self):
            return CyanaMRParser.RULE_hbond_macro

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

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




    def hbond_macro(self):

        localctx = CyanaMRParser.Hbond_macroContext(self, self._ctx, self.state)
        self.enterRule(localctx, 66, self.RULE_hbond_macro)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 461
            self.match(CyanaMRParser.Hbond)
            self.state = 462
            self.match(CyanaMRParser.Atom1)
            self.state = 463
            self.match(CyanaMRParser.Equ_op_HB)
            self.state = 464
            self.match(CyanaMRParser.Simple_name_HB)
            self.state = 465
            self.match(CyanaMRParser.Residue1)
            self.state = 466
            self.match(CyanaMRParser.Equ_op_HB)
            self.state = 467
            self.match(CyanaMRParser.Integer_HB)
            self.state = 468
            self.match(CyanaMRParser.Atom2)
            self.state = 469
            self.match(CyanaMRParser.Equ_op_HB)
            self.state = 470
            self.match(CyanaMRParser.Simple_name_HB)
            self.state = 471
            self.match(CyanaMRParser.Residue2)
            self.state = 472
            self.match(CyanaMRParser.Equ_op_HB)
            self.state = 473
            self.match(CyanaMRParser.Integer_HB)
            self.state = 474
            self.match(CyanaMRParser.RETURN_HB)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Link_statementContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def Link(self):
            return self.getToken(CyanaMRParser.Link, 0)

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

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

        def getRuleIndex(self):
            return CyanaMRParser.RULE_link_statement

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

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




    def link_statement(self):

        localctx = CyanaMRParser.Link_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 68, self.RULE_link_statement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 476
            self.match(CyanaMRParser.Link)
            self.state = 477
            self.match(CyanaMRParser.Simple_name)
            self.state = 478
            self.match(CyanaMRParser.Integer)
            self.state = 479
            self.match(CyanaMRParser.Simple_name)
            self.state = 480
            self.match(CyanaMRParser.Integer)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Unambig_atom_name_mappingContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def Residue(self):
            return self.getToken(CyanaMRParser.Residue, 0)

        def Simple_name(self):
            return self.getToken(CyanaMRParser.Simple_name, 0)

        def comment(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.CommentContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.CommentContext,i)


        def mapping_list(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Mapping_listContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Mapping_listContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_unambig_atom_name_mapping

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

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




    def unambig_atom_name_mapping(self):

        localctx = CyanaMRParser.Unambig_atom_name_mappingContext(self, self._ctx, self.state)
        self.enterRule(localctx, 70, self.RULE_unambig_atom_name_mapping)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 482
            self.match(CyanaMRParser.Residue)
            self.state = 483
            self.match(CyanaMRParser.Simple_name)
            self.state = 485
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,61,self._ctx)
            if la_ == 1:
                self.state = 484
                self.comment()


            self.state = 489 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 489
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [CyanaMRParser.Mapping]:
                        self.state = 487
                        self.mapping_list()
                        pass
                    elif token in [CyanaMRParser.COMMENT]:
                        self.state = 488
                        self.comment()
                        pass
                    else:
                        raise NoViableAltException(self)


                else:
                    raise NoViableAltException(self)
                self.state = 491 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,63,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 Mapping_listContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def Mapping(self):
            return self.getToken(CyanaMRParser.Mapping, 0)

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

        def Equ_op_MP(self):
            return self.getToken(CyanaMRParser.Equ_op_MP, 0)

        def RETURN_MP(self):
            return self.getToken(CyanaMRParser.RETURN_MP, 0)

        def getRuleIndex(self):
            return CyanaMRParser.RULE_mapping_list

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

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




    def mapping_list(self):

        localctx = CyanaMRParser.Mapping_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 72, self.RULE_mapping_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 493
            self.match(CyanaMRParser.Mapping)
            self.state = 494
            self.match(CyanaMRParser.Simple_name_MP)
            self.state = 495
            self.match(CyanaMRParser.Equ_op_MP)
            self.state = 497 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 496
                self.match(CyanaMRParser.Simple_name_MP)
                self.state = 499 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==CyanaMRParser.Simple_name_MP):
                    break

            self.state = 501
            self.match(CyanaMRParser.RETURN_MP)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Ambig_atom_name_mappingContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def Residue(self):
            return self.getToken(CyanaMRParser.Residue, 0)

        def Simple_name(self):
            return self.getToken(CyanaMRParser.Simple_name, 0)

        def comment(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.CommentContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.CommentContext,i)


        def ambig_list(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(CyanaMRParser.Ambig_listContext)
            else:
                return self.getTypedRuleContext(CyanaMRParser.Ambig_listContext,i)


        def getRuleIndex(self):
            return CyanaMRParser.RULE_ambig_atom_name_mapping

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

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




    def ambig_atom_name_mapping(self):

        localctx = CyanaMRParser.Ambig_atom_name_mappingContext(self, self._ctx, self.state)
        self.enterRule(localctx, 74, self.RULE_ambig_atom_name_mapping)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 503
            self.match(CyanaMRParser.Residue)
            self.state = 504
            self.match(CyanaMRParser.Simple_name)
            self.state = 506
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,65,self._ctx)
            if la_ == 1:
                self.state = 505
                self.comment()


            self.state = 510 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 510
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [CyanaMRParser.Ambig]:
                        self.state = 508
                        self.ambig_list()
                        pass
                    elif token in [CyanaMRParser.COMMENT]:
                        self.state = 509
                        self.comment()
                        pass
                    else:
                        raise NoViableAltException(self)


                else:
                    raise NoViableAltException(self)
                self.state = 512 
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,67,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 Ambig_listContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def Ambig(self):
            return self.getToken(CyanaMRParser.Ambig, 0)

        def Equ_op_MP(self):
            return self.getToken(CyanaMRParser.Equ_op_MP, 0)

        def RETURN_MP(self):
            return self.getToken(CyanaMRParser.RETURN_MP, 0)

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

        def Ambig_code_MP(self):
            return self.getToken(CyanaMRParser.Ambig_code_MP, 0)

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

        def getRuleIndex(self):
            return CyanaMRParser.RULE_ambig_list

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

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




    def ambig_list(self):

        localctx = CyanaMRParser.Ambig_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 76, self.RULE_ambig_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 514
            self.match(CyanaMRParser.Ambig)
            self.state = 515
            _la = self._input.LA(1)
            if not(_la==CyanaMRParser.Ambig_code_MP or _la==CyanaMRParser.Simple_name_MP):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 516
            self.match(CyanaMRParser.Equ_op_MP)
            self.state = 519 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 517
                self.match(CyanaMRParser.Simple_name_MP)
                self.state = 518
                self.match(CyanaMRParser.Integer_MP)
                self.state = 521 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==CyanaMRParser.Simple_name_MP):
                    break

            self.state = 523
            self.match(CyanaMRParser.RETURN_MP)
        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 Float(self):
            return self.getToken(CyanaMRParser.Float, 0)

        def Integer(self):
            return self.getToken(CyanaMRParser.Integer, 0)

        def getRuleIndex(self):
            return CyanaMRParser.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 = CyanaMRParser.NumberContext(self, self._ctx, self.state)
        self.enterRule(localctx, 78, self.RULE_number)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 525
            _la = self._input.LA(1)
            if not(_la==CyanaMRParser.Integer or _la==CyanaMRParser.Float):
                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 Gen_atom_nameContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def Simple_name(self):
            return self.getToken(CyanaMRParser.Simple_name, 0)

        def Ambig_code(self):
            return self.getToken(CyanaMRParser.Ambig_code, 0)

        def getRuleIndex(self):
            return CyanaMRParser.RULE_gen_atom_name

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

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




    def gen_atom_name(self):

        localctx = CyanaMRParser.Gen_atom_nameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 80, self.RULE_gen_atom_name)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 527
            _la = self._input.LA(1)
            if not(_la==CyanaMRParser.Ambig_code or _la==CyanaMRParser.Simple_name):
                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





