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

class TaiheParser ( Parser ):

    grammarFileName = "Taihe.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "';'", "':'", "'.'", "'=>'", "','", "'{'", 
                     "'}'", "'('", "')'", "'['", "']'", "'='", "'+'", "'-'", 
                     "'*'", "'/'", "'%'", "'@'", "'$'", "'?'", "'~'", "'&'", 
                     "'|'", "'^'", "'!'", "'&&'", "'||'", "'<'", "'>'", 
                     "'<='", "'>='", "'=='", "'!='", "'if'", "'then'", "'else'", 
                     "'use'", "'as'", "'from'", "'enum'", "'union'", "'struct'", 
                     "'interface'", "'function'", "'true'", "'false'", "'void'" ]

    symbolicNames = [ "<INVALID>", "SEMICOLON", "COLON", "DOT", "ARROW", 
                      "COMMA", "LEFT_BRACE", "RIGHT_BRACE", "LEFT_PARENTHESIS", 
                      "RIGHT_PARENTHESIS", "LEFT_BRACKET", "RIGHT_BRACKET", 
                      "ASSIGN_TO", "PLUS", "MINUS", "STAR", "SLASH", "PERCENT", 
                      "AT", "DOLLAR", "QUESTION_MARK", "TILDE", "AMPERSAND", 
                      "PIPE", "CARET", "EXCLAMATION", "AND", "OR", "LESS_THAN", 
                      "GREATER_THAN", "LESS_EQUAL_TO", "GREATER_EQUAL_TO", 
                      "EQUAL_TO", "NOT_EQUAL_TO", "KW_IF", "KW_THEN", "KW_ELSE", 
                      "KW_USE", "KW_AS", "KW_FROM", "KW_ENUM", "KW_UNION", 
                      "KW_STRUCT", "KW_INTERFACE", "KW_FUNCTION", "KW_TRUE", 
                      "KW_FALSE", "KW_VOID", "STRING_LITERAL", "DOCSTRING_LITERAL", 
                      "DEC_LITERAL", "HEX_LITERAL", "OCT_LITERAL", "BIN_LITERAL", 
                      "FLOAT_LITERAL", "ID", "WS", "MULTI_LINE_COMMENT", 
                      "SINGLE_LINE_COMMENT", "ERROR_CHAR" ]

    RULE_spec = 0
    RULE_use = 1
    RULE_pkgName = 2
    RULE_declAliasPair = 3
    RULE_specField = 4
    RULE_enumItem = 5
    RULE_structField = 6
    RULE_unionField = 7
    RULE_interfaceField = 8
    RULE_interfaceParent = 9
    RULE_parameter = 10
    RULE_scopeAttr = 11
    RULE_declAttr = 12
    RULE_attrArg = 13
    RULE_type = 14
    RULE_anyExpr = 15
    RULE_floatExpr = 16
    RULE_intExpr = 17
    RULE_boolExpr = 18
    RULE_stringExpr = 19

    ruleNames =  [ "spec", "use", "pkgName", "declAliasPair", "specField", 
                   "enumItem", "structField", "unionField", "interfaceField", 
                   "interfaceParent", "parameter", "scopeAttr", "declAttr", 
                   "attrArg", "type", "anyExpr", "floatExpr", "intExpr", 
                   "boolExpr", "stringExpr" ]

    EOF = Token.EOF
    SEMICOLON=1
    COLON=2
    DOT=3
    ARROW=4
    COMMA=5
    LEFT_BRACE=6
    RIGHT_BRACE=7
    LEFT_PARENTHESIS=8
    RIGHT_PARENTHESIS=9
    LEFT_BRACKET=10
    RIGHT_BRACKET=11
    ASSIGN_TO=12
    PLUS=13
    MINUS=14
    STAR=15
    SLASH=16
    PERCENT=17
    AT=18
    DOLLAR=19
    QUESTION_MARK=20
    TILDE=21
    AMPERSAND=22
    PIPE=23
    CARET=24
    EXCLAMATION=25
    AND=26
    OR=27
    LESS_THAN=28
    GREATER_THAN=29
    LESS_EQUAL_TO=30
    GREATER_EQUAL_TO=31
    EQUAL_TO=32
    NOT_EQUAL_TO=33
    KW_IF=34
    KW_THEN=35
    KW_ELSE=36
    KW_USE=37
    KW_AS=38
    KW_FROM=39
    KW_ENUM=40
    KW_UNION=41
    KW_STRUCT=42
    KW_INTERFACE=43
    KW_FUNCTION=44
    KW_TRUE=45
    KW_FALSE=46
    KW_VOID=47
    STRING_LITERAL=48
    DOCSTRING_LITERAL=49
    DEC_LITERAL=50
    HEX_LITERAL=51
    OCT_LITERAL=52
    BIN_LITERAL=53
    FLOAT_LITERAL=54
    ID=55
    WS=56
    MULTI_LINE_COMMENT=57
    SINGLE_LINE_COMMENT=58
    ERROR_CHAR=59

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




    class SpecContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self._use = None # UseContext
            self.UseLst_uses = list() # of UseContexts
            self._specField = None # SpecFieldContext
            self.SpecFieldLst_fields = list() # of SpecFieldContexts
            self._scopeAttr = None # ScopeAttrContext
            self.ScopeAttrLst_inner_attrs = list() # of ScopeAttrContexts

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

        def use(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.UseContext)
            else:
                return self.getTypedRuleContext(TaiheParser.UseContext,i)


        def specField(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.SpecFieldContext)
            else:
                return self.getTypedRuleContext(TaiheParser.SpecFieldContext,i)


        def scopeAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.ScopeAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.ScopeAttrContext,i)


        def getRuleIndex(self):
            return TaiheParser.RULE_spec




    def spec(self):

        localctx = TaiheParser.SpecContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_spec)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 45
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & 34772055490560) != 0):
                self.state = 43
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,0,self._ctx)
                if la_ == 1:
                    self.state = 40
                    localctx._use = self.use()
                    localctx.UseLst_uses.append(localctx._use)
                    pass

                elif la_ == 2:
                    self.state = 41
                    localctx._specField = self.specField()
                    localctx.SpecFieldLst_fields.append(localctx._specField)
                    pass

                elif la_ == 3:
                    self.state = 42
                    localctx._scopeAttr = self.scopeAttr()
                    localctx.ScopeAttrLst_inner_attrs.append(localctx._scopeAttr)
                    pass


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

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


    class UseContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return TaiheParser.RULE_use

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class UsePackageContext(UseContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.UseContext
            super().__init__(parser)
            self.PkgName_pkg_name = None # PkgNameContext
            self.TOKENOpt_pkg_alias = None # Token
            self.copyFrom(ctx)

        def KW_USE(self):
            return self.getToken(TaiheParser.KW_USE, 0)
        def SEMICOLON(self):
            return self.getToken(TaiheParser.SEMICOLON, 0)
        def pkgName(self):
            return self.getTypedRuleContext(TaiheParser.PkgNameContext,0)

        def KW_AS(self):
            return self.getToken(TaiheParser.KW_AS, 0)
        def ID(self):
            return self.getToken(TaiheParser.ID, 0)


    class UseSymbolContext(UseContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.UseContext
            super().__init__(parser)
            self.PkgName_pkg_name = None # PkgNameContext
            self._declAliasPair = None # DeclAliasPairContext
            self.DeclAliasPairLst_decl_alias_pairs = list() # of DeclAliasPairContexts
            self.copyFrom(ctx)

        def KW_FROM(self):
            return self.getToken(TaiheParser.KW_FROM, 0)
        def KW_USE(self):
            return self.getToken(TaiheParser.KW_USE, 0)
        def SEMICOLON(self):
            return self.getToken(TaiheParser.SEMICOLON, 0)
        def pkgName(self):
            return self.getTypedRuleContext(TaiheParser.PkgNameContext,0)

        def declAliasPair(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.DeclAliasPairContext)
            else:
                return self.getTypedRuleContext(TaiheParser.DeclAliasPairContext,i)

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



    def use(self):

        localctx = TaiheParser.UseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_use)
        self._la = 0 # Token type
        try:
            self.state = 71
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [37]:
                localctx = TaiheParser.UsePackageContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 50
                self.match(TaiheParser.KW_USE)
                self.state = 51
                localctx.PkgName_pkg_name = self.pkgName()
                self.state = 54
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==38:
                    self.state = 52
                    self.match(TaiheParser.KW_AS)
                    self.state = 53
                    localctx.TOKENOpt_pkg_alias = self.match(TaiheParser.ID)


                self.state = 56
                self.match(TaiheParser.SEMICOLON)
                pass
            elif token in [39]:
                localctx = TaiheParser.UseSymbolContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 58
                self.match(TaiheParser.KW_FROM)
                self.state = 59
                localctx.PkgName_pkg_name = self.pkgName()
                self.state = 60
                self.match(TaiheParser.KW_USE)
                self.state = 61
                localctx._declAliasPair = self.declAliasPair()
                localctx.DeclAliasPairLst_decl_alias_pairs.append(localctx._declAliasPair)
                self.state = 66
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==5:
                    self.state = 62
                    self.match(TaiheParser.COMMA)
                    self.state = 63
                    localctx._declAliasPair = self.declAliasPair()
                    localctx.DeclAliasPairLst_decl_alias_pairs.append(localctx._declAliasPair)
                    self.state = 68
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 69
                self.match(TaiheParser.SEMICOLON)
                pass
            else:
                raise NoViableAltException(self)

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


    class PkgNameContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self._ID = None # Token
            self.TOKENLst_parts = list() # of Tokens

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

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

        def getRuleIndex(self):
            return TaiheParser.RULE_pkgName




    def pkgName(self):

        localctx = TaiheParser.PkgNameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_pkgName)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 77
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,5,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 73
                    localctx._ID = self.match(TaiheParser.ID)
                    localctx.TOKENLst_parts.append(localctx._ID)
                    self.state = 74
                    self.match(TaiheParser.DOT) 
                self.state = 79
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,5,self._ctx)

            self.state = 80
            localctx._ID = self.match(TaiheParser.ID)
            localctx.TOKENLst_parts.append(localctx._ID)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DeclAliasPairContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def KW_AS(self):
            return self.getToken(TaiheParser.KW_AS, 0)

        def getRuleIndex(self):
            return TaiheParser.RULE_declAliasPair




    def declAliasPair(self):

        localctx = TaiheParser.DeclAliasPairContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_declAliasPair)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 82
            localctx.TOKEN_decl_name = self.match(TaiheParser.ID)
            self.state = 85
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==38:
                self.state = 83
                self.match(TaiheParser.KW_AS)
                self.state = 84
                localctx.TOKENOpt_decl_alias = self.match(TaiheParser.ID)


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


    class SpecFieldContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return TaiheParser.RULE_specField

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class StructContext(SpecFieldContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.SpecFieldContext
            super().__init__(parser)
            self._declAttr = None # DeclAttrContext
            self.DeclAttrLst_forward_attrs = list() # of DeclAttrContexts
            self.TOKEN_name = None # Token
            self._structField = None # StructFieldContext
            self.StructFieldLst_fields = list() # of StructFieldContexts
            self._scopeAttr = None # ScopeAttrContext
            self.ScopeAttrLst_inner_attrs = list() # of ScopeAttrContexts
            self.copyFrom(ctx)

        def KW_STRUCT(self):
            return self.getToken(TaiheParser.KW_STRUCT, 0)
        def LEFT_BRACE(self):
            return self.getToken(TaiheParser.LEFT_BRACE, 0)
        def RIGHT_BRACE(self):
            return self.getToken(TaiheParser.RIGHT_BRACE, 0)
        def ID(self):
            return self.getToken(TaiheParser.ID, 0)
        def declAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.DeclAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.DeclAttrContext,i)

        def structField(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.StructFieldContext)
            else:
                return self.getTypedRuleContext(TaiheParser.StructFieldContext,i)

        def scopeAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.ScopeAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.ScopeAttrContext,i)



    class GlobalFunctionContext(SpecFieldContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.SpecFieldContext
            super().__init__(parser)
            self._declAttr = None # DeclAttrContext
            self.DeclAttrLst_forward_attrs = list() # of DeclAttrContexts
            self.TOKEN_name = None # Token
            self._parameter = None # ParameterContext
            self.ParameterLst_parameters = list() # of ParameterContexts
            self.TypeOpt_return_ty = None # TypeContext
            self.copyFrom(ctx)

        def KW_FUNCTION(self):
            return self.getToken(TaiheParser.KW_FUNCTION, 0)
        def LEFT_PARENTHESIS(self):
            return self.getToken(TaiheParser.LEFT_PARENTHESIS, 0)
        def RIGHT_PARENTHESIS(self):
            return self.getToken(TaiheParser.RIGHT_PARENTHESIS, 0)
        def SEMICOLON(self):
            return self.getToken(TaiheParser.SEMICOLON, 0)
        def ID(self):
            return self.getToken(TaiheParser.ID, 0)
        def COLON(self):
            return self.getToken(TaiheParser.COLON, 0)
        def declAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.DeclAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.DeclAttrContext,i)

        def parameter(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.ParameterContext)
            else:
                return self.getTypedRuleContext(TaiheParser.ParameterContext,i)

        def KW_VOID(self):
            return self.getToken(TaiheParser.KW_VOID, 0)
        def COMMA(self, i:int=None):
            if i is None:
                return self.getTokens(TaiheParser.COMMA)
            else:
                return self.getToken(TaiheParser.COMMA, i)
        def type_(self):
            return self.getTypedRuleContext(TaiheParser.TypeContext,0)



    class UnionContext(SpecFieldContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.SpecFieldContext
            super().__init__(parser)
            self._declAttr = None # DeclAttrContext
            self.DeclAttrLst_forward_attrs = list() # of DeclAttrContexts
            self.TOKEN_name = None # Token
            self._unionField = None # UnionFieldContext
            self.UnionFieldLst_fields = list() # of UnionFieldContexts
            self._scopeAttr = None # ScopeAttrContext
            self.ScopeAttrLst_inner_attrs = list() # of ScopeAttrContexts
            self.copyFrom(ctx)

        def KW_UNION(self):
            return self.getToken(TaiheParser.KW_UNION, 0)
        def LEFT_BRACE(self):
            return self.getToken(TaiheParser.LEFT_BRACE, 0)
        def RIGHT_BRACE(self):
            return self.getToken(TaiheParser.RIGHT_BRACE, 0)
        def ID(self):
            return self.getToken(TaiheParser.ID, 0)
        def declAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.DeclAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.DeclAttrContext,i)

        def unionField(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.UnionFieldContext)
            else:
                return self.getTypedRuleContext(TaiheParser.UnionFieldContext,i)

        def scopeAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.ScopeAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.ScopeAttrContext,i)



    class InterfaceContext(SpecFieldContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.SpecFieldContext
            super().__init__(parser)
            self._declAttr = None # DeclAttrContext
            self.DeclAttrLst_forward_attrs = list() # of DeclAttrContexts
            self.TOKEN_name = None # Token
            self._interfaceParent = None # InterfaceParentContext
            self.InterfaceParentLst_extends = list() # of InterfaceParentContexts
            self._interfaceField = None # InterfaceFieldContext
            self.InterfaceFieldLst_fields = list() # of InterfaceFieldContexts
            self._scopeAttr = None # ScopeAttrContext
            self.ScopeAttrLst_inner_attrs = list() # of ScopeAttrContexts
            self.copyFrom(ctx)

        def KW_INTERFACE(self):
            return self.getToken(TaiheParser.KW_INTERFACE, 0)
        def LEFT_BRACE(self):
            return self.getToken(TaiheParser.LEFT_BRACE, 0)
        def RIGHT_BRACE(self):
            return self.getToken(TaiheParser.RIGHT_BRACE, 0)
        def ID(self):
            return self.getToken(TaiheParser.ID, 0)
        def COLON(self):
            return self.getToken(TaiheParser.COLON, 0)
        def declAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.DeclAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.DeclAttrContext,i)

        def interfaceParent(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.InterfaceParentContext)
            else:
                return self.getTypedRuleContext(TaiheParser.InterfaceParentContext,i)

        def interfaceField(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.InterfaceFieldContext)
            else:
                return self.getTypedRuleContext(TaiheParser.InterfaceFieldContext,i)

        def scopeAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.ScopeAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.ScopeAttrContext,i)

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


    class EnumContext(SpecFieldContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.SpecFieldContext
            super().__init__(parser)
            self._declAttr = None # DeclAttrContext
            self.DeclAttrLst_forward_attrs = list() # of DeclAttrContexts
            self.TOKEN_name = None # Token
            self.Type_enum_ty = None # TypeContext
            self._enumItem = None # EnumItemContext
            self.EnumItemLst_fields = list() # of EnumItemContexts
            self.copyFrom(ctx)

        def KW_ENUM(self):
            return self.getToken(TaiheParser.KW_ENUM, 0)
        def COLON(self):
            return self.getToken(TaiheParser.COLON, 0)
        def LEFT_BRACE(self):
            return self.getToken(TaiheParser.LEFT_BRACE, 0)
        def RIGHT_BRACE(self):
            return self.getToken(TaiheParser.RIGHT_BRACE, 0)
        def ID(self):
            return self.getToken(TaiheParser.ID, 0)
        def type_(self):
            return self.getTypedRuleContext(TaiheParser.TypeContext,0)

        def declAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.DeclAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.DeclAttrContext,i)

        def enumItem(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.EnumItemContext)
            else:
                return self.getTypedRuleContext(TaiheParser.EnumItemContext,i)

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



    def specField(self):

        localctx = TaiheParser.SpecFieldContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_specField)
        self._la = 0 # Token type
        try:
            self.state = 209
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,29,self._ctx)
            if la_ == 1:
                localctx = TaiheParser.EnumContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 90
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==18:
                    self.state = 87
                    localctx._declAttr = self.declAttr()
                    localctx.DeclAttrLst_forward_attrs.append(localctx._declAttr)
                    self.state = 92
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 93
                self.match(TaiheParser.KW_ENUM)
                self.state = 94
                localctx.TOKEN_name = self.match(TaiheParser.ID)
                self.state = 95
                self.match(TaiheParser.COLON)
                self.state = 96
                localctx.Type_enum_ty = self.type_()
                self.state = 97
                self.match(TaiheParser.LEFT_BRACE)
                self.state = 109
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==18 or _la==55:
                    self.state = 98
                    localctx._enumItem = self.enumItem()
                    localctx.EnumItemLst_fields.append(localctx._enumItem)
                    self.state = 103
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,8,self._ctx)
                    while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                        if _alt==1:
                            self.state = 99
                            self.match(TaiheParser.COMMA)
                            self.state = 100
                            localctx._enumItem = self.enumItem()
                            localctx.EnumItemLst_fields.append(localctx._enumItem) 
                        self.state = 105
                        self._errHandler.sync(self)
                        _alt = self._interp.adaptivePredict(self._input,8,self._ctx)

                    self.state = 107
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==5:
                        self.state = 106
                        self.match(TaiheParser.COMMA)




                self.state = 111
                self.match(TaiheParser.RIGHT_BRACE)
                pass

            elif la_ == 2:
                localctx = TaiheParser.StructContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 116
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==18:
                    self.state = 113
                    localctx._declAttr = self.declAttr()
                    localctx.DeclAttrLst_forward_attrs.append(localctx._declAttr)
                    self.state = 118
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 119
                self.match(TaiheParser.KW_STRUCT)
                self.state = 120
                localctx.TOKEN_name = self.match(TaiheParser.ID)
                self.state = 121
                self.match(TaiheParser.LEFT_BRACE)
                self.state = 126
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==18 or _la==55:
                    self.state = 124
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,12,self._ctx)
                    if la_ == 1:
                        self.state = 122
                        localctx._structField = self.structField()
                        localctx.StructFieldLst_fields.append(localctx._structField)
                        pass

                    elif la_ == 2:
                        self.state = 123
                        localctx._scopeAttr = self.scopeAttr()
                        localctx.ScopeAttrLst_inner_attrs.append(localctx._scopeAttr)
                        pass


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

                self.state = 129
                self.match(TaiheParser.RIGHT_BRACE)
                pass

            elif la_ == 3:
                localctx = TaiheParser.UnionContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 133
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==18:
                    self.state = 130
                    localctx._declAttr = self.declAttr()
                    localctx.DeclAttrLst_forward_attrs.append(localctx._declAttr)
                    self.state = 135
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 136
                self.match(TaiheParser.KW_UNION)
                self.state = 137
                localctx.TOKEN_name = self.match(TaiheParser.ID)
                self.state = 138
                self.match(TaiheParser.LEFT_BRACE)
                self.state = 143
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==18 or _la==55:
                    self.state = 141
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,15,self._ctx)
                    if la_ == 1:
                        self.state = 139
                        localctx._unionField = self.unionField()
                        localctx.UnionFieldLst_fields.append(localctx._unionField)
                        pass

                    elif la_ == 2:
                        self.state = 140
                        localctx._scopeAttr = self.scopeAttr()
                        localctx.ScopeAttrLst_inner_attrs.append(localctx._scopeAttr)
                        pass


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

                self.state = 146
                self.match(TaiheParser.RIGHT_BRACE)
                pass

            elif la_ == 4:
                localctx = TaiheParser.InterfaceContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 150
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==18:
                    self.state = 147
                    localctx._declAttr = self.declAttr()
                    localctx.DeclAttrLst_forward_attrs.append(localctx._declAttr)
                    self.state = 152
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 153
                self.match(TaiheParser.KW_INTERFACE)
                self.state = 154
                localctx.TOKEN_name = self.match(TaiheParser.ID)
                self.state = 167
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==2:
                    self.state = 155
                    self.match(TaiheParser.COLON)
                    self.state = 156
                    localctx._interfaceParent = self.interfaceParent()
                    localctx.InterfaceParentLst_extends.append(localctx._interfaceParent)
                    self.state = 161
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,18,self._ctx)
                    while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                        if _alt==1:
                            self.state = 157
                            self.match(TaiheParser.COMMA)
                            self.state = 158
                            localctx._interfaceParent = self.interfaceParent()
                            localctx.InterfaceParentLst_extends.append(localctx._interfaceParent) 
                        self.state = 163
                        self._errHandler.sync(self)
                        _alt = self._interp.adaptivePredict(self._input,18,self._ctx)

                    self.state = 165
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==5:
                        self.state = 164
                        self.match(TaiheParser.COMMA)




                self.state = 169
                self.match(TaiheParser.LEFT_BRACE)
                self.state = 174
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==18 or _la==55:
                    self.state = 172
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,21,self._ctx)
                    if la_ == 1:
                        self.state = 170
                        localctx._interfaceField = self.interfaceField()
                        localctx.InterfaceFieldLst_fields.append(localctx._interfaceField)
                        pass

                    elif la_ == 2:
                        self.state = 171
                        localctx._scopeAttr = self.scopeAttr()
                        localctx.ScopeAttrLst_inner_attrs.append(localctx._scopeAttr)
                        pass


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

                self.state = 177
                self.match(TaiheParser.RIGHT_BRACE)
                pass

            elif la_ == 5:
                localctx = TaiheParser.GlobalFunctionContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 181
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==18:
                    self.state = 178
                    localctx._declAttr = self.declAttr()
                    localctx.DeclAttrLst_forward_attrs.append(localctx._declAttr)
                    self.state = 183
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 184
                self.match(TaiheParser.KW_FUNCTION)
                self.state = 185
                localctx.TOKEN_name = self.match(TaiheParser.ID)
                self.state = 186
                self.match(TaiheParser.LEFT_PARENTHESIS)
                self.state = 198
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==18 or _la==55:
                    self.state = 187
                    localctx._parameter = self.parameter()
                    localctx.ParameterLst_parameters.append(localctx._parameter)
                    self.state = 192
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,24,self._ctx)
                    while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                        if _alt==1:
                            self.state = 188
                            self.match(TaiheParser.COMMA)
                            self.state = 189
                            localctx._parameter = self.parameter()
                            localctx.ParameterLst_parameters.append(localctx._parameter) 
                        self.state = 194
                        self._errHandler.sync(self)
                        _alt = self._interp.adaptivePredict(self._input,24,self._ctx)

                    self.state = 196
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==5:
                        self.state = 195
                        self.match(TaiheParser.COMMA)




                self.state = 200
                self.match(TaiheParser.RIGHT_PARENTHESIS)
                self.state = 206
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==2:
                    self.state = 201
                    self.match(TaiheParser.COLON)
                    self.state = 204
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [8, 18, 55]:
                        self.state = 202
                        localctx.TypeOpt_return_ty = self.type_()
                        pass
                    elif token in [47]:
                        self.state = 203
                        self.match(TaiheParser.KW_VOID)
                        pass
                    else:
                        raise NoViableAltException(self)



                self.state = 208
                self.match(TaiheParser.SEMICOLON)
                pass


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


    class EnumItemContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return TaiheParser.RULE_enumItem

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class EnumPropertyContext(EnumItemContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.EnumItemContext
            super().__init__(parser)
            self._declAttr = None # DeclAttrContext
            self.DeclAttrLst_forward_attrs = list() # of DeclAttrContexts
            self.TOKEN_name = None # Token
            self.AnyExprOpt_val = None # AnyExprContext
            self.copyFrom(ctx)

        def ID(self):
            return self.getToken(TaiheParser.ID, 0)
        def ASSIGN_TO(self):
            return self.getToken(TaiheParser.ASSIGN_TO, 0)
        def declAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.DeclAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.DeclAttrContext,i)

        def anyExpr(self):
            return self.getTypedRuleContext(TaiheParser.AnyExprContext,0)




    def enumItem(self):

        localctx = TaiheParser.EnumItemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_enumItem)
        self._la = 0 # Token type
        try:
            localctx = TaiheParser.EnumPropertyContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 214
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==18:
                self.state = 211
                localctx._declAttr = self.declAttr()
                localctx.DeclAttrLst_forward_attrs.append(localctx._declAttr)
                self.state = 216
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 217
            localctx.TOKEN_name = self.match(TaiheParser.ID)
            self.state = 220
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==12:
                self.state = 218
                self.match(TaiheParser.ASSIGN_TO)
                self.state = 219
                localctx.AnyExprOpt_val = self.anyExpr()


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


    class StructFieldContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return TaiheParser.RULE_structField

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class StructPropertyContext(StructFieldContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.StructFieldContext
            super().__init__(parser)
            self._declAttr = None # DeclAttrContext
            self.DeclAttrLst_forward_attrs = list() # of DeclAttrContexts
            self.TOKEN_name = None # Token
            self.Type_ty = None # TypeContext
            self.copyFrom(ctx)

        def COLON(self):
            return self.getToken(TaiheParser.COLON, 0)
        def SEMICOLON(self):
            return self.getToken(TaiheParser.SEMICOLON, 0)
        def ID(self):
            return self.getToken(TaiheParser.ID, 0)
        def type_(self):
            return self.getTypedRuleContext(TaiheParser.TypeContext,0)

        def declAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.DeclAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.DeclAttrContext,i)




    def structField(self):

        localctx = TaiheParser.StructFieldContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_structField)
        self._la = 0 # Token type
        try:
            localctx = TaiheParser.StructPropertyContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 225
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==18:
                self.state = 222
                localctx._declAttr = self.declAttr()
                localctx.DeclAttrLst_forward_attrs.append(localctx._declAttr)
                self.state = 227
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 228
            localctx.TOKEN_name = self.match(TaiheParser.ID)
            self.state = 229
            self.match(TaiheParser.COLON)
            self.state = 230
            localctx.Type_ty = self.type_()
            self.state = 231
            self.match(TaiheParser.SEMICOLON)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class UnionFieldContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return TaiheParser.RULE_unionField

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class UnionPropertyContext(UnionFieldContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.UnionFieldContext
            super().__init__(parser)
            self._declAttr = None # DeclAttrContext
            self.DeclAttrLst_forward_attrs = list() # of DeclAttrContexts
            self.TOKEN_name = None # Token
            self.TypeOpt_ty = None # TypeContext
            self.copyFrom(ctx)

        def SEMICOLON(self):
            return self.getToken(TaiheParser.SEMICOLON, 0)
        def ID(self):
            return self.getToken(TaiheParser.ID, 0)
        def COLON(self):
            return self.getToken(TaiheParser.COLON, 0)
        def declAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.DeclAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.DeclAttrContext,i)

        def type_(self):
            return self.getTypedRuleContext(TaiheParser.TypeContext,0)




    def unionField(self):

        localctx = TaiheParser.UnionFieldContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_unionField)
        self._la = 0 # Token type
        try:
            localctx = TaiheParser.UnionPropertyContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 236
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==18:
                self.state = 233
                localctx._declAttr = self.declAttr()
                localctx.DeclAttrLst_forward_attrs.append(localctx._declAttr)
                self.state = 238
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 239
            localctx.TOKEN_name = self.match(TaiheParser.ID)
            self.state = 242
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==2:
                self.state = 240
                self.match(TaiheParser.COLON)
                self.state = 241
                localctx.TypeOpt_ty = self.type_()


            self.state = 244
            self.match(TaiheParser.SEMICOLON)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class InterfaceFieldContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return TaiheParser.RULE_interfaceField

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class InterfaceFunctionContext(InterfaceFieldContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.InterfaceFieldContext
            super().__init__(parser)
            self._declAttr = None # DeclAttrContext
            self.DeclAttrLst_forward_attrs = list() # of DeclAttrContexts
            self.TOKEN_name = None # Token
            self._parameter = None # ParameterContext
            self.ParameterLst_parameters = list() # of ParameterContexts
            self.TypeOpt_return_ty = None # TypeContext
            self.copyFrom(ctx)

        def LEFT_PARENTHESIS(self):
            return self.getToken(TaiheParser.LEFT_PARENTHESIS, 0)
        def RIGHT_PARENTHESIS(self):
            return self.getToken(TaiheParser.RIGHT_PARENTHESIS, 0)
        def SEMICOLON(self):
            return self.getToken(TaiheParser.SEMICOLON, 0)
        def ID(self):
            return self.getToken(TaiheParser.ID, 0)
        def COLON(self):
            return self.getToken(TaiheParser.COLON, 0)
        def declAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.DeclAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.DeclAttrContext,i)

        def parameter(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.ParameterContext)
            else:
                return self.getTypedRuleContext(TaiheParser.ParameterContext,i)

        def KW_VOID(self):
            return self.getToken(TaiheParser.KW_VOID, 0)
        def COMMA(self, i:int=None):
            if i is None:
                return self.getTokens(TaiheParser.COMMA)
            else:
                return self.getToken(TaiheParser.COMMA, i)
        def type_(self):
            return self.getTypedRuleContext(TaiheParser.TypeContext,0)




    def interfaceField(self):

        localctx = TaiheParser.InterfaceFieldContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_interfaceField)
        self._la = 0 # Token type
        try:
            localctx = TaiheParser.InterfaceFunctionContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 249
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==18:
                self.state = 246
                localctx._declAttr = self.declAttr()
                localctx.DeclAttrLst_forward_attrs.append(localctx._declAttr)
                self.state = 251
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 252
            localctx.TOKEN_name = self.match(TaiheParser.ID)
            self.state = 253
            self.match(TaiheParser.LEFT_PARENTHESIS)
            self.state = 265
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==18 or _la==55:
                self.state = 254
                localctx._parameter = self.parameter()
                localctx.ParameterLst_parameters.append(localctx._parameter)
                self.state = 259
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,36,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 255
                        self.match(TaiheParser.COMMA)
                        self.state = 256
                        localctx._parameter = self.parameter()
                        localctx.ParameterLst_parameters.append(localctx._parameter) 
                    self.state = 261
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,36,self._ctx)

                self.state = 263
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==5:
                    self.state = 262
                    self.match(TaiheParser.COMMA)




            self.state = 267
            self.match(TaiheParser.RIGHT_PARENTHESIS)
            self.state = 273
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==2:
                self.state = 268
                self.match(TaiheParser.COLON)
                self.state = 271
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [8, 18, 55]:
                    self.state = 269
                    localctx.TypeOpt_return_ty = self.type_()
                    pass
                elif token in [47]:
                    self.state = 270
                    self.match(TaiheParser.KW_VOID)
                    pass
                else:
                    raise NoViableAltException(self)



            self.state = 275
            self.match(TaiheParser.SEMICOLON)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class InterfaceParentContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self._declAttr = None # DeclAttrContext
            self.DeclAttrLst_forward_attrs = list() # of DeclAttrContexts
            self.Type_ty = None # TypeContext

        def type_(self):
            return self.getTypedRuleContext(TaiheParser.TypeContext,0)


        def declAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.DeclAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.DeclAttrContext,i)


        def getRuleIndex(self):
            return TaiheParser.RULE_interfaceParent




    def interfaceParent(self):

        localctx = TaiheParser.InterfaceParentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_interfaceParent)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 280
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,41,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 277
                    localctx._declAttr = self.declAttr()
                    localctx.DeclAttrLst_forward_attrs.append(localctx._declAttr) 
                self.state = 282
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,41,self._ctx)

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


    class ParameterContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self._declAttr = None # DeclAttrContext
            self.DeclAttrLst_forward_attrs = list() # of DeclAttrContexts
            self.TOKEN_name = None # Token
            self.Type_ty = None # TypeContext

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

        def ID(self):
            return self.getToken(TaiheParser.ID, 0)

        def type_(self):
            return self.getTypedRuleContext(TaiheParser.TypeContext,0)


        def declAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.DeclAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.DeclAttrContext,i)


        def getRuleIndex(self):
            return TaiheParser.RULE_parameter




    def parameter(self):

        localctx = TaiheParser.ParameterContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_parameter)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 288
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==18:
                self.state = 285
                localctx._declAttr = self.declAttr()
                localctx.DeclAttrLst_forward_attrs.append(localctx._declAttr)
                self.state = 290
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 291
            localctx.TOKEN_name = self.match(TaiheParser.ID)
            self.state = 292
            self.match(TaiheParser.COLON)
            self.state = 293
            localctx.Type_ty = self.type_()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ScopeAttrContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.TOKEN_name = None # Token
            self._attrArg = None # AttrArgContext
            self.AttrArgLst_args = list() # of AttrArgContexts

        def AT(self):
            return self.getToken(TaiheParser.AT, 0)

        def EXCLAMATION(self):
            return self.getToken(TaiheParser.EXCLAMATION, 0)

        def ID(self):
            return self.getToken(TaiheParser.ID, 0)

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

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

        def attrArg(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.AttrArgContext)
            else:
                return self.getTypedRuleContext(TaiheParser.AttrArgContext,i)


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

        def getRuleIndex(self):
            return TaiheParser.RULE_scopeAttr




    def scopeAttr(self):

        localctx = TaiheParser.ScopeAttrContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_scopeAttr)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 295
            self.match(TaiheParser.AT)
            self.state = 296
            self.match(TaiheParser.EXCLAMATION)
            self.state = 297
            localctx.TOKEN_name = self.match(TaiheParser.ID)
            self.state = 313
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==8:
                self.state = 298
                self.match(TaiheParser.LEFT_PARENTHESIS)
                self.state = 310
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & 71881689393029376) != 0):
                    self.state = 299
                    localctx._attrArg = self.attrArg()
                    localctx.AttrArgLst_args.append(localctx._attrArg)
                    self.state = 304
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,43,self._ctx)
                    while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                        if _alt==1:
                            self.state = 300
                            self.match(TaiheParser.COMMA)
                            self.state = 301
                            localctx._attrArg = self.attrArg()
                            localctx.AttrArgLst_args.append(localctx._attrArg) 
                        self.state = 306
                        self._errHandler.sync(self)
                        _alt = self._interp.adaptivePredict(self._input,43,self._ctx)

                    self.state = 308
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==5:
                        self.state = 307
                        self.match(TaiheParser.COMMA)




                self.state = 312
                self.match(TaiheParser.RIGHT_PARENTHESIS)


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


    class DeclAttrContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.TOKEN_name = None # Token
            self._attrArg = None # AttrArgContext
            self.AttrArgLst_args = list() # of AttrArgContexts

        def AT(self):
            return self.getToken(TaiheParser.AT, 0)

        def ID(self):
            return self.getToken(TaiheParser.ID, 0)

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

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

        def attrArg(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.AttrArgContext)
            else:
                return self.getTypedRuleContext(TaiheParser.AttrArgContext,i)


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

        def getRuleIndex(self):
            return TaiheParser.RULE_declAttr




    def declAttr(self):

        localctx = TaiheParser.DeclAttrContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_declAttr)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 315
            self.match(TaiheParser.AT)
            self.state = 316
            localctx.TOKEN_name = self.match(TaiheParser.ID)
            self.state = 332
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,50,self._ctx)
            if la_ == 1:
                self.state = 317
                self.match(TaiheParser.LEFT_PARENTHESIS)
                self.state = 329
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & 71881689393029376) != 0):
                    self.state = 318
                    localctx._attrArg = self.attrArg()
                    localctx.AttrArgLst_args.append(localctx._attrArg)
                    self.state = 323
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,47,self._ctx)
                    while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                        if _alt==1:
                            self.state = 319
                            self.match(TaiheParser.COMMA)
                            self.state = 320
                            localctx._attrArg = self.attrArg()
                            localctx.AttrArgLst_args.append(localctx._attrArg) 
                        self.state = 325
                        self._errHandler.sync(self)
                        _alt = self._interp.adaptivePredict(self._input,47,self._ctx)

                    self.state = 327
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==5:
                        self.state = 326
                        self.match(TaiheParser.COMMA)




                self.state = 331
                self.match(TaiheParser.RIGHT_PARENTHESIS)


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


    class AttrArgContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return TaiheParser.RULE_attrArg

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class NamedAttrArgContext(AttrArgContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.AttrArgContext
            super().__init__(parser)
            self.TOKEN_name = None # Token
            self.AnyExpr_val = None # AnyExprContext
            self.copyFrom(ctx)

        def ASSIGN_TO(self):
            return self.getToken(TaiheParser.ASSIGN_TO, 0)
        def ID(self):
            return self.getToken(TaiheParser.ID, 0)
        def anyExpr(self):
            return self.getTypedRuleContext(TaiheParser.AnyExprContext,0)



    class UnnamedAttrArgContext(AttrArgContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.AttrArgContext
            super().__init__(parser)
            self.AnyExpr_val = None # AnyExprContext
            self.copyFrom(ctx)

        def anyExpr(self):
            return self.getTypedRuleContext(TaiheParser.AnyExprContext,0)




    def attrArg(self):

        localctx = TaiheParser.AttrArgContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_attrArg)
        try:
            self.state = 338
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [8, 13, 14, 21, 25, 34, 45, 46, 48, 49, 50, 51, 52, 53, 54]:
                localctx = TaiheParser.UnnamedAttrArgContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 334
                localctx.AnyExpr_val = self.anyExpr()
                pass
            elif token in [55]:
                localctx = TaiheParser.NamedAttrArgContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 335
                localctx.TOKEN_name = self.match(TaiheParser.ID)
                self.state = 336
                self.match(TaiheParser.ASSIGN_TO)
                self.state = 337
                localctx.AnyExpr_val = self.anyExpr()
                pass
            else:
                raise NoViableAltException(self)

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


    class TypeContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return TaiheParser.RULE_type

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class ShortTypeContext(TypeContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.TypeContext
            super().__init__(parser)
            self._declAttr = None # DeclAttrContext
            self.DeclAttrLst_forward_attrs = list() # of DeclAttrContexts
            self.TOKEN_decl_name = None # Token
            self.copyFrom(ctx)

        def ID(self):
            return self.getToken(TaiheParser.ID, 0)
        def declAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.DeclAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.DeclAttrContext,i)



    class GenericTypeContext(TypeContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.TypeContext
            super().__init__(parser)
            self._declAttr = None # DeclAttrContext
            self.DeclAttrLst_forward_attrs = list() # of DeclAttrContexts
            self.TOKEN_decl_name = None # Token
            self._type = None # TypeContext
            self.TypeLst_args = list() # of TypeContexts
            self.copyFrom(ctx)

        def LESS_THAN(self):
            return self.getToken(TaiheParser.LESS_THAN, 0)
        def GREATER_THAN(self):
            return self.getToken(TaiheParser.GREATER_THAN, 0)
        def ID(self):
            return self.getToken(TaiheParser.ID, 0)
        def declAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.DeclAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.DeclAttrContext,i)

        def type_(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.TypeContext)
            else:
                return self.getTypedRuleContext(TaiheParser.TypeContext,i)

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


    class LongTypeContext(TypeContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.TypeContext
            super().__init__(parser)
            self._declAttr = None # DeclAttrContext
            self.DeclAttrLst_forward_attrs = list() # of DeclAttrContexts
            self.PkgName_pkg_name = None # PkgNameContext
            self.TOKEN_decl_name = None # Token
            self.copyFrom(ctx)

        def DOT(self):
            return self.getToken(TaiheParser.DOT, 0)
        def pkgName(self):
            return self.getTypedRuleContext(TaiheParser.PkgNameContext,0)

        def ID(self):
            return self.getToken(TaiheParser.ID, 0)
        def declAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.DeclAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.DeclAttrContext,i)



    class CallbackTypeContext(TypeContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.TypeContext
            super().__init__(parser)
            self._declAttr = None # DeclAttrContext
            self.DeclAttrLst_forward_attrs = list() # of DeclAttrContexts
            self._parameter = None # ParameterContext
            self.ParameterLst_parameters = list() # of ParameterContexts
            self.TypeOpt_return_ty = None # TypeContext
            self.copyFrom(ctx)

        def LEFT_PARENTHESIS(self):
            return self.getToken(TaiheParser.LEFT_PARENTHESIS, 0)
        def RIGHT_PARENTHESIS(self):
            return self.getToken(TaiheParser.RIGHT_PARENTHESIS, 0)
        def ARROW(self):
            return self.getToken(TaiheParser.ARROW, 0)
        def KW_VOID(self):
            return self.getToken(TaiheParser.KW_VOID, 0)
        def type_(self):
            return self.getTypedRuleContext(TaiheParser.TypeContext,0)

        def declAttr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.DeclAttrContext)
            else:
                return self.getTypedRuleContext(TaiheParser.DeclAttrContext,i)

        def parameter(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.ParameterContext)
            else:
                return self.getTypedRuleContext(TaiheParser.ParameterContext,i)

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



    def type_(self):

        localctx = TaiheParser.TypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_type)
        self._la = 0 # Token type
        try:
            self.state = 405
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,63,self._ctx)
            if la_ == 1:
                localctx = TaiheParser.LongTypeContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 343
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==18:
                    self.state = 340
                    localctx._declAttr = self.declAttr()
                    localctx.DeclAttrLst_forward_attrs.append(localctx._declAttr)
                    self.state = 345
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 346
                localctx.PkgName_pkg_name = self.pkgName()
                self.state = 347
                self.match(TaiheParser.DOT)
                self.state = 348
                localctx.TOKEN_decl_name = self.match(TaiheParser.ID)
                pass

            elif la_ == 2:
                localctx = TaiheParser.ShortTypeContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 353
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==18:
                    self.state = 350
                    localctx._declAttr = self.declAttr()
                    localctx.DeclAttrLst_forward_attrs.append(localctx._declAttr)
                    self.state = 355
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 356
                localctx.TOKEN_decl_name = self.match(TaiheParser.ID)
                pass

            elif la_ == 3:
                localctx = TaiheParser.GenericTypeContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 360
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==18:
                    self.state = 357
                    localctx._declAttr = self.declAttr()
                    localctx.DeclAttrLst_forward_attrs.append(localctx._declAttr)
                    self.state = 362
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 363
                localctx.TOKEN_decl_name = self.match(TaiheParser.ID)
                self.state = 364
                self.match(TaiheParser.LESS_THAN)
                self.state = 376
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & 36028797019226368) != 0):
                    self.state = 365
                    localctx._type = self.type_()
                    localctx.TypeLst_args.append(localctx._type)
                    self.state = 370
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,55,self._ctx)
                    while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                        if _alt==1:
                            self.state = 366
                            self.match(TaiheParser.COMMA)
                            self.state = 367
                            localctx._type = self.type_()
                            localctx.TypeLst_args.append(localctx._type) 
                        self.state = 372
                        self._errHandler.sync(self)
                        _alt = self._interp.adaptivePredict(self._input,55,self._ctx)

                    self.state = 374
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==5:
                        self.state = 373
                        self.match(TaiheParser.COMMA)




                self.state = 378
                self.match(TaiheParser.GREATER_THAN)
                pass

            elif la_ == 4:
                localctx = TaiheParser.CallbackTypeContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 382
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==18:
                    self.state = 379
                    localctx._declAttr = self.declAttr()
                    localctx.DeclAttrLst_forward_attrs.append(localctx._declAttr)
                    self.state = 384
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 385
                self.match(TaiheParser.LEFT_PARENTHESIS)
                self.state = 397
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==18 or _la==55:
                    self.state = 386
                    localctx._parameter = self.parameter()
                    localctx.ParameterLst_parameters.append(localctx._parameter)
                    self.state = 391
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,59,self._ctx)
                    while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                        if _alt==1:
                            self.state = 387
                            self.match(TaiheParser.COMMA)
                            self.state = 388
                            localctx._parameter = self.parameter()
                            localctx.ParameterLst_parameters.append(localctx._parameter) 
                        self.state = 393
                        self._errHandler.sync(self)
                        _alt = self._interp.adaptivePredict(self._input,59,self._ctx)

                    self.state = 395
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==5:
                        self.state = 394
                        self.match(TaiheParser.COMMA)




                self.state = 399
                self.match(TaiheParser.RIGHT_PARENTHESIS)
                self.state = 400
                self.match(TaiheParser.ARROW)
                self.state = 403
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [8, 18, 55]:
                    self.state = 401
                    localctx.TypeOpt_return_ty = self.type_()
                    pass
                elif token in [47]:
                    self.state = 402
                    self.match(TaiheParser.KW_VOID)
                    pass
                else:
                    raise NoViableAltException(self)

                pass


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


    class AnyExprContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return TaiheParser.RULE_anyExpr

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)



    class IntAnyExprContext(AnyExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.AnyExprContext
            super().__init__(parser)
            self.IntExpr_expr = None # IntExprContext
            self.copyFrom(ctx)

        def intExpr(self):
            return self.getTypedRuleContext(TaiheParser.IntExprContext,0)



    class FloatAnyExprContext(AnyExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.AnyExprContext
            super().__init__(parser)
            self.FloatExpr_expr = None # FloatExprContext
            self.copyFrom(ctx)

        def floatExpr(self):
            return self.getTypedRuleContext(TaiheParser.FloatExprContext,0)



    class BoolAnyExprContext(AnyExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.AnyExprContext
            super().__init__(parser)
            self.BoolExpr_expr = None # BoolExprContext
            self.copyFrom(ctx)

        def boolExpr(self):
            return self.getTypedRuleContext(TaiheParser.BoolExprContext,0)



    class StringAnyExprContext(AnyExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.AnyExprContext
            super().__init__(parser)
            self.StringExpr_expr = None # StringExprContext
            self.copyFrom(ctx)

        def stringExpr(self):
            return self.getTypedRuleContext(TaiheParser.StringExprContext,0)




    def anyExpr(self):

        localctx = TaiheParser.AnyExprContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_anyExpr)
        try:
            self.state = 411
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,64,self._ctx)
            if la_ == 1:
                localctx = TaiheParser.StringAnyExprContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 407
                localctx.StringExpr_expr = self.stringExpr(0)
                pass

            elif la_ == 2:
                localctx = TaiheParser.IntAnyExprContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 408
                localctx.IntExpr_expr = self.intExpr(0)
                pass

            elif la_ == 3:
                localctx = TaiheParser.FloatAnyExprContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 409
                localctx.FloatExpr_expr = self.floatExpr(0)
                pass

            elif la_ == 4:
                localctx = TaiheParser.BoolAnyExprContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 410
                localctx.BoolExpr_expr = self.boolExpr(0)
                pass


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


    class FloatExprContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return TaiheParser.RULE_floatExpr

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)


    class ParenthesisFloatExprContext(FloatExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.FloatExprContext
            super().__init__(parser)
            self.FloatExpr_expr = None # FloatExprContext
            self.copyFrom(ctx)

        def LEFT_PARENTHESIS(self):
            return self.getToken(TaiheParser.LEFT_PARENTHESIS, 0)
        def RIGHT_PARENTHESIS(self):
            return self.getToken(TaiheParser.RIGHT_PARENTHESIS, 0)
        def floatExpr(self):
            return self.getTypedRuleContext(TaiheParser.FloatExprContext,0)



    class BinaryFloatExprContext(FloatExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.FloatExprContext
            super().__init__(parser)
            self.FloatExpr_left = None # FloatExprContext
            self.TOKEN_op = None # Token
            self.FloatExpr_right = None # FloatExprContext
            self.copyFrom(ctx)

        def floatExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.FloatExprContext)
            else:
                return self.getTypedRuleContext(TaiheParser.FloatExprContext,i)

        def STAR(self):
            return self.getToken(TaiheParser.STAR, 0)
        def SLASH(self):
            return self.getToken(TaiheParser.SLASH, 0)
        def PLUS(self):
            return self.getToken(TaiheParser.PLUS, 0)
        def MINUS(self):
            return self.getToken(TaiheParser.MINUS, 0)


    class UnaryFloatExprContext(FloatExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.FloatExprContext
            super().__init__(parser)
            self.TOKEN_op = None # Token
            self.FloatExpr_expr = None # FloatExprContext
            self.copyFrom(ctx)

        def floatExpr(self):
            return self.getTypedRuleContext(TaiheParser.FloatExprContext,0)

        def PLUS(self):
            return self.getToken(TaiheParser.PLUS, 0)
        def MINUS(self):
            return self.getToken(TaiheParser.MINUS, 0)
        def TILDE(self):
            return self.getToken(TaiheParser.TILDE, 0)


    class ConditionalFloatExprContext(FloatExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.FloatExprContext
            super().__init__(parser)
            self.BoolExpr_cond = None # BoolExprContext
            self.FloatExpr_then_expr = None # FloatExprContext
            self.FloatExpr_else_expr = None # FloatExprContext
            self.copyFrom(ctx)

        def KW_IF(self):
            return self.getToken(TaiheParser.KW_IF, 0)
        def KW_THEN(self):
            return self.getToken(TaiheParser.KW_THEN, 0)
        def KW_ELSE(self):
            return self.getToken(TaiheParser.KW_ELSE, 0)
        def boolExpr(self):
            return self.getTypedRuleContext(TaiheParser.BoolExprContext,0)

        def floatExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.FloatExprContext)
            else:
                return self.getTypedRuleContext(TaiheParser.FloatExprContext,i)



    class LiteralFloatExprContext(FloatExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.FloatExprContext
            super().__init__(parser)
            self.TOKEN_val = None # Token
            self.copyFrom(ctx)

        def FLOAT_LITERAL(self):
            return self.getToken(TaiheParser.FLOAT_LITERAL, 0)



    def floatExpr(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = TaiheParser.FloatExprContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 32
        self.enterRecursionRule(localctx, 32, self.RULE_floatExpr, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 428
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [54]:
                localctx = TaiheParser.LiteralFloatExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 414
                localctx.TOKEN_val = self.match(TaiheParser.FLOAT_LITERAL)
                pass
            elif token in [8]:
                localctx = TaiheParser.ParenthesisFloatExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 415
                self.match(TaiheParser.LEFT_PARENTHESIS)
                self.state = 416
                localctx.FloatExpr_expr = self.floatExpr(0)
                self.state = 417
                self.match(TaiheParser.RIGHT_PARENTHESIS)
                pass
            elif token in [13, 14, 21]:
                localctx = TaiheParser.UnaryFloatExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 419
                localctx.TOKEN_op = self._input.LT(1)
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 2121728) != 0)):
                    localctx.TOKEN_op = self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 420
                localctx.FloatExpr_expr = self.floatExpr(4)
                pass
            elif token in [34]:
                localctx = TaiheParser.ConditionalFloatExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 421
                self.match(TaiheParser.KW_IF)
                self.state = 422
                localctx.BoolExpr_cond = self.boolExpr(0)
                self.state = 423
                self.match(TaiheParser.KW_THEN)
                self.state = 424
                localctx.FloatExpr_then_expr = self.floatExpr(0)
                self.state = 425
                self.match(TaiheParser.KW_ELSE)
                self.state = 426
                localctx.FloatExpr_else_expr = self.floatExpr(1)
                pass
            else:
                raise NoViableAltException(self)

            self._ctx.stop = self._input.LT(-1)
            self.state = 438
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,67,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    self.state = 436
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,66,self._ctx)
                    if la_ == 1:
                        localctx = TaiheParser.BinaryFloatExprContext(self, TaiheParser.FloatExprContext(self, _parentctx, _parentState))
                        localctx.FloatExpr_left = _prevctx
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_floatExpr)
                        self.state = 430
                        if not self.precpred(self._ctx, 3):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 3)")
                        self.state = 431
                        localctx.TOKEN_op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not(_la==15 or _la==16):
                            localctx.TOKEN_op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 432
                        localctx.FloatExpr_right = self.floatExpr(4)
                        pass

                    elif la_ == 2:
                        localctx = TaiheParser.BinaryFloatExprContext(self, TaiheParser.FloatExprContext(self, _parentctx, _parentState))
                        localctx.FloatExpr_left = _prevctx
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_floatExpr)
                        self.state = 433
                        if not self.precpred(self._ctx, 2):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                        self.state = 434
                        localctx.TOKEN_op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not(_la==13 or _la==14):
                            localctx.TOKEN_op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 435
                        localctx.FloatExpr_right = self.floatExpr(3)
                        pass

             
                self.state = 440
                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.unrollRecursionContexts(_parentctx)
        return localctx


    class IntExprContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return TaiheParser.RULE_intExpr

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)


    class ConditionalIntExprContext(IntExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.IntExprContext
            super().__init__(parser)
            self.BoolExpr_cond = None # BoolExprContext
            self.IntExpr_then_expr = None # IntExprContext
            self.IntExpr_else_expr = None # IntExprContext
            self.copyFrom(ctx)

        def KW_IF(self):
            return self.getToken(TaiheParser.KW_IF, 0)
        def KW_THEN(self):
            return self.getToken(TaiheParser.KW_THEN, 0)
        def KW_ELSE(self):
            return self.getToken(TaiheParser.KW_ELSE, 0)
        def boolExpr(self):
            return self.getTypedRuleContext(TaiheParser.BoolExprContext,0)

        def intExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.IntExprContext)
            else:
                return self.getTypedRuleContext(TaiheParser.IntExprContext,i)



    class ParenthesisIntExprContext(IntExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.IntExprContext
            super().__init__(parser)
            self.IntExpr_expr = None # IntExprContext
            self.copyFrom(ctx)

        def LEFT_PARENTHESIS(self):
            return self.getToken(TaiheParser.LEFT_PARENTHESIS, 0)
        def RIGHT_PARENTHESIS(self):
            return self.getToken(TaiheParser.RIGHT_PARENTHESIS, 0)
        def intExpr(self):
            return self.getTypedRuleContext(TaiheParser.IntExprContext,0)



    class UnaryIntExprContext(IntExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.IntExprContext
            super().__init__(parser)
            self.TOKEN_op = None # Token
            self.IntExpr_expr = None # IntExprContext
            self.copyFrom(ctx)

        def intExpr(self):
            return self.getTypedRuleContext(TaiheParser.IntExprContext,0)

        def PLUS(self):
            return self.getToken(TaiheParser.PLUS, 0)
        def MINUS(self):
            return self.getToken(TaiheParser.MINUS, 0)
        def TILDE(self):
            return self.getToken(TaiheParser.TILDE, 0)


    class BinaryIntExprContext(IntExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.IntExprContext
            super().__init__(parser)
            self.IntExpr_left = None # IntExprContext
            self.TOKEN_op = None # Token
            self.IntExpr_right = None # IntExprContext
            self.copyFrom(ctx)

        def intExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.IntExprContext)
            else:
                return self.getTypedRuleContext(TaiheParser.IntExprContext,i)

        def STAR(self):
            return self.getToken(TaiheParser.STAR, 0)
        def SLASH(self):
            return self.getToken(TaiheParser.SLASH, 0)
        def PERCENT(self):
            return self.getToken(TaiheParser.PERCENT, 0)
        def PLUS(self):
            return self.getToken(TaiheParser.PLUS, 0)
        def MINUS(self):
            return self.getToken(TaiheParser.MINUS, 0)
        def AMPERSAND(self):
            return self.getToken(TaiheParser.AMPERSAND, 0)
        def CARET(self):
            return self.getToken(TaiheParser.CARET, 0)
        def PIPE(self):
            return self.getToken(TaiheParser.PIPE, 0)


    class LiteralIntExprContext(IntExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.IntExprContext
            super().__init__(parser)
            self.TOKEN_val = None # Token
            self.copyFrom(ctx)

        def DEC_LITERAL(self):
            return self.getToken(TaiheParser.DEC_LITERAL, 0)
        def OCT_LITERAL(self):
            return self.getToken(TaiheParser.OCT_LITERAL, 0)
        def HEX_LITERAL(self):
            return self.getToken(TaiheParser.HEX_LITERAL, 0)
        def BIN_LITERAL(self):
            return self.getToken(TaiheParser.BIN_LITERAL, 0)


    class BinaryIntShiftExprContext(IntExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.IntExprContext
            super().__init__(parser)
            self.IntExpr_left = None # IntExprContext
            self.TOKEN_ch = None # Token
            self.IntExpr_right = None # IntExprContext
            self.copyFrom(ctx)

        def intExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.IntExprContext)
            else:
                return self.getTypedRuleContext(TaiheParser.IntExprContext,i)

        def LESS_THAN(self, i:int=None):
            if i is None:
                return self.getTokens(TaiheParser.LESS_THAN)
            else:
                return self.getToken(TaiheParser.LESS_THAN, i)
        def GREATER_THAN(self, i:int=None):
            if i is None:
                return self.getTokens(TaiheParser.GREATER_THAN)
            else:
                return self.getToken(TaiheParser.GREATER_THAN, i)



    def intExpr(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = TaiheParser.IntExprContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 34
        self.enterRecursionRule(localctx, 34, self.RULE_intExpr, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 456
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [50, 51, 52, 53]:
                localctx = TaiheParser.LiteralIntExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 442
                localctx.TOKEN_val = self._input.LT(1)
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 16888498602639360) != 0)):
                    localctx.TOKEN_val = self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                pass
            elif token in [8]:
                localctx = TaiheParser.ParenthesisIntExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 443
                self.match(TaiheParser.LEFT_PARENTHESIS)
                self.state = 444
                localctx.IntExpr_expr = self.intExpr(0)
                self.state = 445
                self.match(TaiheParser.RIGHT_PARENTHESIS)
                pass
            elif token in [13, 14, 21]:
                localctx = TaiheParser.UnaryIntExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 447
                localctx.TOKEN_op = self._input.LT(1)
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 2121728) != 0)):
                    localctx.TOKEN_op = self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 448
                localctx.IntExpr_expr = self.intExpr(8)
                pass
            elif token in [34]:
                localctx = TaiheParser.ConditionalIntExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 449
                self.match(TaiheParser.KW_IF)
                self.state = 450
                localctx.BoolExpr_cond = self.boolExpr(0)
                self.state = 451
                self.match(TaiheParser.KW_THEN)
                self.state = 452
                localctx.IntExpr_then_expr = self.intExpr(0)
                self.state = 453
                self.match(TaiheParser.KW_ELSE)
                self.state = 454
                localctx.IntExpr_else_expr = self.intExpr(1)
                pass
            else:
                raise NoViableAltException(self)

            self._ctx.stop = self._input.LT(-1)
            self.state = 483
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,71,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    self.state = 481
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,70,self._ctx)
                    if la_ == 1:
                        localctx = TaiheParser.BinaryIntExprContext(self, TaiheParser.IntExprContext(self, _parentctx, _parentState))
                        localctx.IntExpr_left = _prevctx
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_intExpr)
                        self.state = 458
                        if not self.precpred(self._ctx, 7):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 7)")
                        self.state = 459
                        localctx.TOKEN_op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 229376) != 0)):
                            localctx.TOKEN_op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 460
                        localctx.IntExpr_right = self.intExpr(8)
                        pass

                    elif la_ == 2:
                        localctx = TaiheParser.BinaryIntExprContext(self, TaiheParser.IntExprContext(self, _parentctx, _parentState))
                        localctx.IntExpr_left = _prevctx
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_intExpr)
                        self.state = 461
                        if not self.precpred(self._ctx, 6):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
                        self.state = 462
                        localctx.TOKEN_op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not(_la==13 or _la==14):
                            localctx.TOKEN_op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 463
                        localctx.IntExpr_right = self.intExpr(7)
                        pass

                    elif la_ == 3:
                        localctx = TaiheParser.BinaryIntShiftExprContext(self, TaiheParser.IntExprContext(self, _parentctx, _parentState))
                        localctx.IntExpr_left = _prevctx
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_intExpr)
                        self.state = 464
                        if not self.precpred(self._ctx, 5):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
                        self.state = 469
                        self._errHandler.sync(self)
                        token = self._input.LA(1)
                        if token in [28]:
                            self.state = 465
                            localctx.TOKEN_ch = self.match(TaiheParser.LESS_THAN)
                            self.state = 466
                            self.match(TaiheParser.LESS_THAN)
                            pass
                        elif token in [29]:
                            self.state = 467
                            localctx.TOKEN_ch = self.match(TaiheParser.GREATER_THAN)
                            self.state = 468
                            self.match(TaiheParser.GREATER_THAN)
                            pass
                        else:
                            raise NoViableAltException(self)

                        self.state = 471
                        localctx.IntExpr_right = self.intExpr(6)
                        pass

                    elif la_ == 4:
                        localctx = TaiheParser.BinaryIntExprContext(self, TaiheParser.IntExprContext(self, _parentctx, _parentState))
                        localctx.IntExpr_left = _prevctx
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_intExpr)
                        self.state = 472
                        if not self.precpred(self._ctx, 4):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 4)")
                        self.state = 473
                        localctx.TOKEN_op = self.match(TaiheParser.AMPERSAND)
                        self.state = 474
                        localctx.IntExpr_right = self.intExpr(5)
                        pass

                    elif la_ == 5:
                        localctx = TaiheParser.BinaryIntExprContext(self, TaiheParser.IntExprContext(self, _parentctx, _parentState))
                        localctx.IntExpr_left = _prevctx
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_intExpr)
                        self.state = 475
                        if not self.precpred(self._ctx, 3):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 3)")
                        self.state = 476
                        localctx.TOKEN_op = self.match(TaiheParser.CARET)
                        self.state = 477
                        localctx.IntExpr_right = self.intExpr(4)
                        pass

                    elif la_ == 6:
                        localctx = TaiheParser.BinaryIntExprContext(self, TaiheParser.IntExprContext(self, _parentctx, _parentState))
                        localctx.IntExpr_left = _prevctx
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_intExpr)
                        self.state = 478
                        if not self.precpred(self._ctx, 2):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                        self.state = 479
                        localctx.TOKEN_op = self.match(TaiheParser.PIPE)
                        self.state = 480
                        localctx.IntExpr_right = self.intExpr(3)
                        pass

             
                self.state = 485
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,71,self._ctx)

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


    class BoolExprContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return TaiheParser.RULE_boolExpr

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)


    class ConditionalBoolExprContext(BoolExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.BoolExprContext
            super().__init__(parser)
            self.BoolExpr_cond = None # BoolExprContext
            self.BoolExpr_then_expr = None # BoolExprContext
            self.BoolExpr_else_expr = None # BoolExprContext
            self.copyFrom(ctx)

        def KW_IF(self):
            return self.getToken(TaiheParser.KW_IF, 0)
        def KW_THEN(self):
            return self.getToken(TaiheParser.KW_THEN, 0)
        def KW_ELSE(self):
            return self.getToken(TaiheParser.KW_ELSE, 0)
        def boolExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.BoolExprContext)
            else:
                return self.getTypedRuleContext(TaiheParser.BoolExprContext,i)



    class IntComparisonBoolExprContext(BoolExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.BoolExprContext
            super().__init__(parser)
            self.IntExpr_left = None # IntExprContext
            self.TOKEN_op = None # Token
            self.IntExpr_right = None # IntExprContext
            self.copyFrom(ctx)

        def intExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.IntExprContext)
            else:
                return self.getTypedRuleContext(TaiheParser.IntExprContext,i)

        def EQUAL_TO(self):
            return self.getToken(TaiheParser.EQUAL_TO, 0)
        def NOT_EQUAL_TO(self):
            return self.getToken(TaiheParser.NOT_EQUAL_TO, 0)
        def LESS_EQUAL_TO(self):
            return self.getToken(TaiheParser.LESS_EQUAL_TO, 0)
        def GREATER_EQUAL_TO(self):
            return self.getToken(TaiheParser.GREATER_EQUAL_TO, 0)
        def LESS_THAN(self):
            return self.getToken(TaiheParser.LESS_THAN, 0)
        def GREATER_THAN(self):
            return self.getToken(TaiheParser.GREATER_THAN, 0)


    class ParenthesisBoolExprContext(BoolExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.BoolExprContext
            super().__init__(parser)
            self.BoolExpr_expr = None # BoolExprContext
            self.copyFrom(ctx)

        def LEFT_PARENTHESIS(self):
            return self.getToken(TaiheParser.LEFT_PARENTHESIS, 0)
        def RIGHT_PARENTHESIS(self):
            return self.getToken(TaiheParser.RIGHT_PARENTHESIS, 0)
        def boolExpr(self):
            return self.getTypedRuleContext(TaiheParser.BoolExprContext,0)



    class UnaryBoolExprContext(BoolExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.BoolExprContext
            super().__init__(parser)
            self.TOKEN_op = None # Token
            self.BoolExpr_expr = None # BoolExprContext
            self.copyFrom(ctx)

        def EXCLAMATION(self):
            return self.getToken(TaiheParser.EXCLAMATION, 0)
        def boolExpr(self):
            return self.getTypedRuleContext(TaiheParser.BoolExprContext,0)



    class LiteralBoolExprContext(BoolExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.BoolExprContext
            super().__init__(parser)
            self.TOKEN_val = None # Token
            self.copyFrom(ctx)

        def KW_TRUE(self):
            return self.getToken(TaiheParser.KW_TRUE, 0)
        def KW_FALSE(self):
            return self.getToken(TaiheParser.KW_FALSE, 0)


    class FloatComparisonBoolExprContext(BoolExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.BoolExprContext
            super().__init__(parser)
            self.FloatExpr_left = None # FloatExprContext
            self.TOKEN_op = None # Token
            self.FloatExpr_right = None # FloatExprContext
            self.copyFrom(ctx)

        def floatExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.FloatExprContext)
            else:
                return self.getTypedRuleContext(TaiheParser.FloatExprContext,i)

        def EQUAL_TO(self):
            return self.getToken(TaiheParser.EQUAL_TO, 0)
        def NOT_EQUAL_TO(self):
            return self.getToken(TaiheParser.NOT_EQUAL_TO, 0)
        def LESS_EQUAL_TO(self):
            return self.getToken(TaiheParser.LESS_EQUAL_TO, 0)
        def GREATER_EQUAL_TO(self):
            return self.getToken(TaiheParser.GREATER_EQUAL_TO, 0)
        def LESS_THAN(self):
            return self.getToken(TaiheParser.LESS_THAN, 0)
        def GREATER_THAN(self):
            return self.getToken(TaiheParser.GREATER_THAN, 0)


    class BinaryBoolExprContext(BoolExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.BoolExprContext
            super().__init__(parser)
            self.BoolExpr_left = None # BoolExprContext
            self.TOKEN_op = None # Token
            self.BoolExpr_right = None # BoolExprContext
            self.copyFrom(ctx)

        def boolExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.BoolExprContext)
            else:
                return self.getTypedRuleContext(TaiheParser.BoolExprContext,i)

        def AND(self):
            return self.getToken(TaiheParser.AND, 0)
        def OR(self):
            return self.getToken(TaiheParser.OR, 0)



    def boolExpr(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = TaiheParser.BoolExprContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 36
        self.enterRecursionRule(localctx, 36, self.RULE_boolExpr, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 509
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,72,self._ctx)
            if la_ == 1:
                localctx = TaiheParser.LiteralBoolExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 487
                localctx.TOKEN_val = self._input.LT(1)
                _la = self._input.LA(1)
                if not(_la==45 or _la==46):
                    localctx.TOKEN_val = self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                pass

            elif la_ == 2:
                localctx = TaiheParser.ParenthesisBoolExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 488
                self.match(TaiheParser.LEFT_PARENTHESIS)
                self.state = 489
                localctx.BoolExpr_expr = self.boolExpr(0)
                self.state = 490
                self.match(TaiheParser.RIGHT_PARENTHESIS)
                pass

            elif la_ == 3:
                localctx = TaiheParser.UnaryBoolExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 492
                localctx.TOKEN_op = self.match(TaiheParser.EXCLAMATION)
                self.state = 493
                localctx.BoolExpr_expr = self.boolExpr(5)
                pass

            elif la_ == 4:
                localctx = TaiheParser.IntComparisonBoolExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 494
                localctx.IntExpr_left = self.intExpr(0)
                self.state = 495
                localctx.TOKEN_op = self._input.LT(1)
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 16911433728) != 0)):
                    localctx.TOKEN_op = self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 496
                localctx.IntExpr_right = self.intExpr(0)
                pass

            elif la_ == 5:
                localctx = TaiheParser.FloatComparisonBoolExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 498
                localctx.FloatExpr_left = self.floatExpr(0)
                self.state = 499
                localctx.TOKEN_op = self._input.LT(1)
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 16911433728) != 0)):
                    localctx.TOKEN_op = self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 500
                localctx.FloatExpr_right = self.floatExpr(0)
                pass

            elif la_ == 6:
                localctx = TaiheParser.ConditionalBoolExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 502
                self.match(TaiheParser.KW_IF)
                self.state = 503
                localctx.BoolExpr_cond = self.boolExpr(0)
                self.state = 504
                self.match(TaiheParser.KW_THEN)
                self.state = 505
                localctx.BoolExpr_then_expr = self.boolExpr(0)
                self.state = 506
                self.match(TaiheParser.KW_ELSE)
                self.state = 507
                localctx.BoolExpr_else_expr = self.boolExpr(1)
                pass


            self._ctx.stop = self._input.LT(-1)
            self.state = 516
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,73,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    localctx = TaiheParser.BinaryBoolExprContext(self, TaiheParser.BoolExprContext(self, _parentctx, _parentState))
                    localctx.BoolExpr_left = _prevctx
                    self.pushNewRecursionContext(localctx, _startState, self.RULE_boolExpr)
                    self.state = 511
                    if not self.precpred(self._ctx, 2):
                        from antlr4.error.Errors import FailedPredicateException
                        raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                    self.state = 512
                    localctx.TOKEN_op = self._input.LT(1)
                    _la = self._input.LA(1)
                    if not(_la==26 or _la==27):
                        localctx.TOKEN_op = self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()
                    self.state = 513
                    localctx.BoolExpr_right = self.boolExpr(3) 
                self.state = 518
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,73,self._ctx)

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


    class StringExprContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return TaiheParser.RULE_stringExpr

     
        def copyFrom(self, ctx:ParserRuleContext):
            super().copyFrom(ctx)


    class LiteralDocStringExprContext(StringExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.StringExprContext
            super().__init__(parser)
            self.TOKEN_val = None # Token
            self.copyFrom(ctx)

        def DOCSTRING_LITERAL(self):
            return self.getToken(TaiheParser.DOCSTRING_LITERAL, 0)


    class LiteralStringExprContext(StringExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.StringExprContext
            super().__init__(parser)
            self.TOKEN_val = None # Token
            self.copyFrom(ctx)

        def STRING_LITERAL(self):
            return self.getToken(TaiheParser.STRING_LITERAL, 0)


    class BinaryStringExprContext(StringExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a TaiheParser.StringExprContext
            super().__init__(parser)
            self.StringExpr_left = None # StringExprContext
            self.StringExpr_right = None # StringExprContext
            self.copyFrom(ctx)

        def stringExpr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TaiheParser.StringExprContext)
            else:
                return self.getTypedRuleContext(TaiheParser.StringExprContext,i)




    def stringExpr(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = TaiheParser.StringExprContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 38
        self.enterRecursionRule(localctx, 38, self.RULE_stringExpr, _p)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 522
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [48]:
                localctx = TaiheParser.LiteralStringExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 520
                localctx.TOKEN_val = self.match(TaiheParser.STRING_LITERAL)
                pass
            elif token in [49]:
                localctx = TaiheParser.LiteralDocStringExprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 521
                localctx.TOKEN_val = self.match(TaiheParser.DOCSTRING_LITERAL)
                pass
            else:
                raise NoViableAltException(self)

            self._ctx.stop = self._input.LT(-1)
            self.state = 528
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,75,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    localctx = TaiheParser.BinaryStringExprContext(self, TaiheParser.StringExprContext(self, _parentctx, _parentState))
                    localctx.StringExpr_left = _prevctx
                    self.pushNewRecursionContext(localctx, _startState, self.RULE_stringExpr)
                    self.state = 524
                    if not self.precpred(self._ctx, 1):
                        from antlr4.error.Errors import FailedPredicateException
                        raise FailedPredicateException(self, "self.precpred(self._ctx, 1)")
                    self.state = 525
                    localctx.StringExpr_right = self.stringExpr(2) 
                self.state = 530
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,75,self._ctx)

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



    def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int):
        if self._predicates == None:
            self._predicates = dict()
        self._predicates[16] = self.floatExpr_sempred
        self._predicates[17] = self.intExpr_sempred
        self._predicates[18] = self.boolExpr_sempred
        self._predicates[19] = self.stringExpr_sempred
        pred = self._predicates.get(ruleIndex, None)
        if pred is None:
            raise Exception("No predicate with index:" + str(ruleIndex))
        else:
            return pred(localctx, predIndex)

    def floatExpr_sempred(self, localctx:FloatExprContext, predIndex:int):
            if predIndex == 0:
                return self.precpred(self._ctx, 3)
         

            if predIndex == 1:
                return self.precpred(self._ctx, 2)
         

    def intExpr_sempred(self, localctx:IntExprContext, predIndex:int):
            if predIndex == 2:
                return self.precpred(self._ctx, 7)
         

            if predIndex == 3:
                return self.precpred(self._ctx, 6)
         

            if predIndex == 4:
                return self.precpred(self._ctx, 5)
         

            if predIndex == 5:
                return self.precpred(self._ctx, 4)
         

            if predIndex == 6:
                return self.precpred(self._ctx, 3)
         

            if predIndex == 7:
                return self.precpred(self._ctx, 2)
         

    def boolExpr_sempred(self, localctx:BoolExprContext, predIndex:int):
            if predIndex == 8:
                return self.precpred(self._ctx, 2)
         

    def stringExpr_sempred(self, localctx:StringExprContext, predIndex:int):
            if predIndex == 9:
                return self.precpred(self._ctx, 1)
         




