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

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

class modelicaParser ( Parser ):

    grammarFileName = "modelica.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "'final'", "';'", "'within'", "'encapsulated'", 
                     "'partial'", "'class'", "'model'", "'operator'", "'record'", 
                     "'block'", "'expandable'", "'connector'", "'type'", 
                     "'package'", "'pure'", "'impure'", "'function'", "'end'", 
                     "'extends'", "'='", "'enumeration'", "'('", "':'", 
                     "')'", "'der'", "','", "'public'", "'protected'", "'external'", 
                     "'redeclare'", "'inner'", "'outer'", "'replaceable'", 
                     "'import'", "'.*'", "'.{'", "'}'", "'constrainedby'", 
                     "'flow'", "'stream'", "'discrete'", "'parameter'", 
                     "'constant'", "'input'", "'output'", "'if'", "':='", 
                     "'each'", "'initial'", "'equation'", "'algorithm'", 
                     "'break'", "'return'", "'then'", "'elseif'", "'else'", 
                     "'for'", "'loop'", "'in'", "'while'", "'when'", "'elsewhen'", 
                     "'connect'", "'or'", "'and'", "'not'", "'<'", "'<='", 
                     "'>'", "'>='", "'=='", "'<>'", "'+'", "'-'", "'.+'", 
                     "'.-'", "'*'", "'/'", "'./'", "'^'", "'.^'", "'false'", 
                     "'true'", "'['", "']'", "'{'", "'.'", "'annotation'" ]

    symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "IDENT", "STRING", "UNSIGNED_NUMBER", 
                      "WS", "COMMENT", "LINE_COMMENT" ]

    RULE_stored_definition = 0
    RULE_within_statement = 1
    RULE_class_definition = 2
    RULE_class_specifier = 3
    RULE_class_prefixes = 4
    RULE_long_class_specifier = 5
    RULE_short_class_specifier = 6
    RULE_der_class_specifier = 7
    RULE_base_prefix = 8
    RULE_enum_list = 9
    RULE_enumeration_literal = 10
    RULE_composition = 11
    RULE_language_specification = 12
    RULE_external_function_call = 13
    RULE_element_list = 14
    RULE_element = 15
    RULE_import_clause = 16
    RULE_import_list = 17
    RULE_extends_clause = 18
    RULE_constraining_clause = 19
    RULE_component_clause = 20
    RULE_type_prefix = 21
    RULE_type_specifier = 22
    RULE_component_list = 23
    RULE_component_declaration = 24
    RULE_condition_attribute = 25
    RULE_declaration = 26
    RULE_modification = 27
    RULE_class_modification = 28
    RULE_argument_list = 29
    RULE_argument = 30
    RULE_element_modification_or_replaceable = 31
    RULE_element_modification = 32
    RULE_element_redeclaration = 33
    RULE_element_replaceable = 34
    RULE_component_clause1 = 35
    RULE_component_declaration1 = 36
    RULE_short_class_definition = 37
    RULE_equation_section = 38
    RULE_algorithm_section = 39
    RULE_equation = 40
    RULE_statement = 41
    RULE_if_equation = 42
    RULE_if_statement = 43
    RULE_for_equation = 44
    RULE_for_statement = 45
    RULE_for_indices = 46
    RULE_for_index = 47
    RULE_while_statement = 48
    RULE_when_equation = 49
    RULE_when_statement = 50
    RULE_connect_clause = 51
    RULE_expression = 52
    RULE_simple_expression = 53
    RULE_logical_expression = 54
    RULE_logical_term = 55
    RULE_logical_factor = 56
    RULE_relation = 57
    RULE_rel_op = 58
    RULE_arithmetic_expression = 59
    RULE_add_op = 60
    RULE_term = 61
    RULE_mul_op = 62
    RULE_factor = 63
    RULE_primary = 64
    RULE_name = 65
    RULE_component_reference = 66
    RULE_function_call_args = 67
    RULE_function_arguments = 68
    RULE_named_arguments = 69
    RULE_named_argument = 70
    RULE_function_argument = 71
    RULE_output_expression_list = 72
    RULE_expression_list = 73
    RULE_array_subscripts = 74
    RULE_subscript = 75
    RULE_comment = 76
    RULE_string_comment = 77
    RULE_model_annotation = 78
    RULE_annotation = 79

    ruleNames =  [ "stored_definition", "within_statement", "class_definition", 
                   "class_specifier", "class_prefixes", "long_class_specifier", 
                   "short_class_specifier", "der_class_specifier", "base_prefix", 
                   "enum_list", "enumeration_literal", "composition", "language_specification", 
                   "external_function_call", "element_list", "element", 
                   "import_clause", "import_list", "extends_clause", "constraining_clause", 
                   "component_clause", "type_prefix", "type_specifier", 
                   "component_list", "component_declaration", "condition_attribute", 
                   "declaration", "modification", "class_modification", 
                   "argument_list", "argument", "element_modification_or_replaceable", 
                   "element_modification", "element_redeclaration", "element_replaceable", 
                   "component_clause1", "component_declaration1", "short_class_definition", 
                   "equation_section", "algorithm_section", "equation", 
                   "statement", "if_equation", "if_statement", "for_equation", 
                   "for_statement", "for_indices", "for_index", "while_statement", 
                   "when_equation", "when_statement", "connect_clause", 
                   "expression", "simple_expression", "logical_expression", 
                   "logical_term", "logical_factor", "relation", "rel_op", 
                   "arithmetic_expression", "add_op", "term", "mul_op", 
                   "factor", "primary", "name", "component_reference", "function_call_args", 
                   "function_arguments", "named_arguments", "named_argument", 
                   "function_argument", "output_expression_list", "expression_list", 
                   "array_subscripts", "subscript", "comment", "string_comment", 
                   "model_annotation", "annotation" ]

    EOF = Token.EOF
    T__0=1
    T__1=2
    T__2=3
    T__3=4
    T__4=5
    T__5=6
    T__6=7
    T__7=8
    T__8=9
    T__9=10
    T__10=11
    T__11=12
    T__12=13
    T__13=14
    T__14=15
    T__15=16
    T__16=17
    T__17=18
    T__18=19
    T__19=20
    T__20=21
    T__21=22
    T__22=23
    T__23=24
    T__24=25
    T__25=26
    T__26=27
    T__27=28
    T__28=29
    T__29=30
    T__30=31
    T__31=32
    T__32=33
    T__33=34
    T__34=35
    T__35=36
    T__36=37
    T__37=38
    T__38=39
    T__39=40
    T__40=41
    T__41=42
    T__42=43
    T__43=44
    T__44=45
    T__45=46
    T__46=47
    T__47=48
    T__48=49
    T__49=50
    T__50=51
    T__51=52
    T__52=53
    T__53=54
    T__54=55
    T__55=56
    T__56=57
    T__57=58
    T__58=59
    T__59=60
    T__60=61
    T__61=62
    T__62=63
    T__63=64
    T__64=65
    T__65=66
    T__66=67
    T__67=68
    T__68=69
    T__69=70
    T__70=71
    T__71=72
    T__72=73
    T__73=74
    T__74=75
    T__75=76
    T__76=77
    T__77=78
    T__78=79
    T__79=80
    T__80=81
    T__81=82
    T__82=83
    T__83=84
    T__84=85
    T__85=86
    T__86=87
    T__87=88
    IDENT=89
    STRING=90
    UNSIGNED_NUMBER=91
    WS=92
    COMMENT=93
    LINE_COMMENT=94

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




    class Stored_definitionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def within_statement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.Within_statementContext)
            else:
                return self.getTypedRuleContext(modelicaParser.Within_statementContext,i)


        def class_definition(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.Class_definitionContext)
            else:
                return self.getTypedRuleContext(modelicaParser.Class_definitionContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_stored_definition

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

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




    def stored_definition(self):

        localctx = modelicaParser.Stored_definitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_stored_definition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 163
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==3:
                self.state = 160
                self.within_statement()
                self.state = 165
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 174
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & 262130) != 0):
                self.state = 167
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==1:
                    self.state = 166
                    self.match(modelicaParser.T__0)


                self.state = 169
                self.class_definition()
                self.state = 170
                self.match(modelicaParser.T__1)
                self.state = 176
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class Within_statementContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def name(self):
            return self.getTypedRuleContext(modelicaParser.NameContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_within_statement

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

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




    def within_statement(self):

        localctx = modelicaParser.Within_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_within_statement)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 177
            self.match(modelicaParser.T__2)
            self.state = 179
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==87 or _la==89:
                self.state = 178
                self.name()


            self.state = 181
            self.match(modelicaParser.T__1)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Class_definitionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def class_prefixes(self):
            return self.getTypedRuleContext(modelicaParser.Class_prefixesContext,0)


        def class_specifier(self):
            return self.getTypedRuleContext(modelicaParser.Class_specifierContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_class_definition

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

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




    def class_definition(self):

        localctx = modelicaParser.Class_definitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_class_definition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 184
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==4:
                self.state = 183
                self.match(modelicaParser.T__3)


            self.state = 186
            self.class_prefixes()
            self.state = 187
            self.class_specifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Class_specifierContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def long_class_specifier(self):
            return self.getTypedRuleContext(modelicaParser.Long_class_specifierContext,0)


        def short_class_specifier(self):
            return self.getTypedRuleContext(modelicaParser.Short_class_specifierContext,0)


        def der_class_specifier(self):
            return self.getTypedRuleContext(modelicaParser.Der_class_specifierContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_class_specifier

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

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




    def class_specifier(self):

        localctx = modelicaParser.Class_specifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_class_specifier)
        try:
            self.state = 192
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,5,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 189
                self.long_class_specifier()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 190
                self.short_class_specifier()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 191
                self.der_class_specifier()
                pass


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


    class Class_prefixesContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return modelicaParser.RULE_class_prefixes

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

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




    def class_prefixes(self):

        localctx = modelicaParser.Class_prefixesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_class_prefixes)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 195
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==5:
                self.state = 194
                self.match(modelicaParser.T__4)


            self.state = 218
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,11,self._ctx)
            if la_ == 1:
                self.state = 197
                self.match(modelicaParser.T__5)
                pass

            elif la_ == 2:
                self.state = 198
                self.match(modelicaParser.T__6)
                pass

            elif la_ == 3:
                self.state = 200
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==8:
                    self.state = 199
                    self.match(modelicaParser.T__7)


                self.state = 202
                self.match(modelicaParser.T__8)
                pass

            elif la_ == 4:
                self.state = 203
                self.match(modelicaParser.T__9)
                pass

            elif la_ == 5:
                self.state = 205
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==11:
                    self.state = 204
                    self.match(modelicaParser.T__10)


                self.state = 207
                self.match(modelicaParser.T__11)
                pass

            elif la_ == 6:
                self.state = 208
                self.match(modelicaParser.T__12)
                pass

            elif la_ == 7:
                self.state = 209
                self.match(modelicaParser.T__13)
                pass

            elif la_ == 8:
                self.state = 211
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==15 or _la==16:
                    self.state = 210
                    _la = self._input.LA(1)
                    if not(_la==15 or _la==16):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 214
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==8:
                    self.state = 213
                    self.match(modelicaParser.T__7)


                self.state = 216
                self.match(modelicaParser.T__16)
                pass

            elif la_ == 9:
                self.state = 217
                self.match(modelicaParser.T__7)
                pass


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


    class Long_class_specifierContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def string_comment(self):
            return self.getTypedRuleContext(modelicaParser.String_commentContext,0)


        def composition(self):
            return self.getTypedRuleContext(modelicaParser.CompositionContext,0)


        def class_modification(self):
            return self.getTypedRuleContext(modelicaParser.Class_modificationContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_long_class_specifier

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

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




    def long_class_specifier(self):

        localctx = modelicaParser.Long_class_specifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_long_class_specifier)
        self._la = 0 # Token type
        try:
            self.state = 236
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [89]:
                self.enterOuterAlt(localctx, 1)
                self.state = 220
                self.match(modelicaParser.IDENT)
                self.state = 221
                self.string_comment()
                self.state = 222
                self.composition()
                self.state = 223
                self.match(modelicaParser.T__17)
                self.state = 224
                self.match(modelicaParser.IDENT)
                pass
            elif token in [19]:
                self.enterOuterAlt(localctx, 2)
                self.state = 226
                self.match(modelicaParser.T__18)
                self.state = 227
                self.match(modelicaParser.IDENT)
                self.state = 229
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==22:
                    self.state = 228
                    self.class_modification()


                self.state = 231
                self.string_comment()
                self.state = 232
                self.composition()
                self.state = 233
                self.match(modelicaParser.T__17)
                self.state = 234
                self.match(modelicaParser.IDENT)
                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 Short_class_specifierContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def IDENT(self):
            return self.getToken(modelicaParser.IDENT, 0)

        def base_prefix(self):
            return self.getTypedRuleContext(modelicaParser.Base_prefixContext,0)


        def name(self):
            return self.getTypedRuleContext(modelicaParser.NameContext,0)


        def comment(self):
            return self.getTypedRuleContext(modelicaParser.CommentContext,0)


        def array_subscripts(self):
            return self.getTypedRuleContext(modelicaParser.Array_subscriptsContext,0)


        def class_modification(self):
            return self.getTypedRuleContext(modelicaParser.Class_modificationContext,0)


        def enum_list(self):
            return self.getTypedRuleContext(modelicaParser.Enum_listContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_short_class_specifier

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

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




    def short_class_specifier(self):

        localctx = modelicaParser.Short_class_specifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_short_class_specifier)
        self._la = 0 # Token type
        try:
            self.state = 262
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,18,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 238
                self.match(modelicaParser.IDENT)
                self.state = 239
                self.match(modelicaParser.T__19)
                self.state = 240
                self.base_prefix()
                self.state = 241
                self.name()
                self.state = 243
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==84:
                    self.state = 242
                    self.array_subscripts()


                self.state = 246
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==22:
                    self.state = 245
                    self.class_modification()


                self.state = 248
                self.comment()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 250
                self.match(modelicaParser.IDENT)
                self.state = 251
                self.match(modelicaParser.T__19)
                self.state = 252
                self.match(modelicaParser.T__20)
                self.state = 253
                self.match(modelicaParser.T__21)
                self.state = 258
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [24, 89]:
                    self.state = 255
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==89:
                        self.state = 254
                        self.enum_list()


                    pass
                elif token in [23]:
                    self.state = 257
                    self.match(modelicaParser.T__22)
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 260
                self.match(modelicaParser.T__23)
                self.state = 261
                self.comment()
                pass


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


    class Der_class_specifierContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def name(self):
            return self.getTypedRuleContext(modelicaParser.NameContext,0)


        def comment(self):
            return self.getTypedRuleContext(modelicaParser.CommentContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_der_class_specifier

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

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




    def der_class_specifier(self):

        localctx = modelicaParser.Der_class_specifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_der_class_specifier)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 264
            self.match(modelicaParser.IDENT)
            self.state = 265
            self.match(modelicaParser.T__19)
            self.state = 266
            self.match(modelicaParser.T__24)
            self.state = 267
            self.match(modelicaParser.T__21)
            self.state = 268
            self.name()
            self.state = 269
            self.match(modelicaParser.T__25)
            self.state = 270
            self.match(modelicaParser.IDENT)
            self.state = 275
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==26:
                self.state = 271
                self.match(modelicaParser.T__25)
                self.state = 272
                self.match(modelicaParser.IDENT)
                self.state = 277
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 278
            self.match(modelicaParser.T__23)
            self.state = 279
            self.comment()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Base_prefixContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def type_prefix(self):
            return self.getTypedRuleContext(modelicaParser.Type_prefixContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_base_prefix

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

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




    def base_prefix(self):

        localctx = modelicaParser.Base_prefixContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_base_prefix)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 281
            self.type_prefix()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Enum_listContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def enumeration_literal(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.Enumeration_literalContext)
            else:
                return self.getTypedRuleContext(modelicaParser.Enumeration_literalContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_enum_list

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

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




    def enum_list(self):

        localctx = modelicaParser.Enum_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_enum_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 283
            self.enumeration_literal()
            self.state = 288
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==26:
                self.state = 284
                self.match(modelicaParser.T__25)
                self.state = 285
                self.enumeration_literal()
                self.state = 290
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class Enumeration_literalContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def IDENT(self):
            return self.getToken(modelicaParser.IDENT, 0)

        def comment(self):
            return self.getTypedRuleContext(modelicaParser.CommentContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_enumeration_literal

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

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




    def enumeration_literal(self):

        localctx = modelicaParser.Enumeration_literalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_enumeration_literal)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 291
            self.match(modelicaParser.IDENT)
            self.state = 292
            self.comment()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CompositionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def element_list(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.Element_listContext)
            else:
                return self.getTypedRuleContext(modelicaParser.Element_listContext,i)


        def equation_section(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.Equation_sectionContext)
            else:
                return self.getTypedRuleContext(modelicaParser.Equation_sectionContext,i)


        def algorithm_section(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.Algorithm_sectionContext)
            else:
                return self.getTypedRuleContext(modelicaParser.Algorithm_sectionContext,i)


        def model_annotation(self):
            return self.getTypedRuleContext(modelicaParser.Model_annotationContext,0)


        def language_specification(self):
            return self.getTypedRuleContext(modelicaParser.Language_specificationContext,0)


        def external_function_call(self):
            return self.getTypedRuleContext(modelicaParser.External_function_callContext,0)


        def annotation(self):
            return self.getTypedRuleContext(modelicaParser.AnnotationContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_composition

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

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




    def composition(self):

        localctx = modelicaParser.CompositionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_composition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 294
            self.element_list()
            self.state = 303
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & 3940650076602368) != 0):
                self.state = 301
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,21,self._ctx)
                if la_ == 1:
                    self.state = 295
                    self.match(modelicaParser.T__26)
                    self.state = 296
                    self.element_list()
                    pass

                elif la_ == 2:
                    self.state = 297
                    self.match(modelicaParser.T__27)
                    self.state = 298
                    self.element_list()
                    pass

                elif la_ == 3:
                    self.state = 299
                    self.equation_section()
                    pass

                elif la_ == 4:
                    self.state = 300
                    self.algorithm_section()
                    pass


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

            self.state = 317
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==29:
                self.state = 306
                self.match(modelicaParser.T__28)
                self.state = 308
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==90:
                    self.state = 307
                    self.language_specification()


                self.state = 311
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==87 or _la==89:
                    self.state = 310
                    self.external_function_call()


                self.state = 314
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==88:
                    self.state = 313
                    self.annotation()


                self.state = 316
                self.match(modelicaParser.T__1)


            self.state = 322
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==88:
                self.state = 319
                self.model_annotation()
                self.state = 320
                self.match(modelicaParser.T__1)


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


    class Language_specificationContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def STRING(self):
            return self.getToken(modelicaParser.STRING, 0)

        def getRuleIndex(self):
            return modelicaParser.RULE_language_specification

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

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




    def language_specification(self):

        localctx = modelicaParser.Language_specificationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_language_specification)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 324
            self.match(modelicaParser.STRING)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class External_function_callContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def IDENT(self):
            return self.getToken(modelicaParser.IDENT, 0)

        def component_reference(self):
            return self.getTypedRuleContext(modelicaParser.Component_referenceContext,0)


        def expression_list(self):
            return self.getTypedRuleContext(modelicaParser.Expression_listContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_external_function_call

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

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




    def external_function_call(self):

        localctx = modelicaParser.External_function_callContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_external_function_call)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 329
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,28,self._ctx)
            if la_ == 1:
                self.state = 326
                self.component_reference()
                self.state = 327
                self.match(modelicaParser.T__19)


            self.state = 331
            self.match(modelicaParser.IDENT)
            self.state = 332
            self.match(modelicaParser.T__21)
            self.state = 334
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & 633318735609856) != 0) or ((((_la - 66)) & ~0x3f) == 0 and ((1 << (_la - 66)) & 62326657) != 0):
                self.state = 333
                self.expression_list()


            self.state = 336
            self.match(modelicaParser.T__23)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Element_listContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def element(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.ElementContext)
            else:
                return self.getTypedRuleContext(modelicaParser.ElementContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_element_list

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

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




    def element_list(self):

        localctx = modelicaParser.Element_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_element_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 341
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & 69852275146738) != 0) or _la==87 or _la==89:
                self.state = 338
                self.element()
                self.state = 343
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class ElementContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def import_clause(self):
            return self.getTypedRuleContext(modelicaParser.Import_clauseContext,0)


        def extends_clause(self):
            return self.getTypedRuleContext(modelicaParser.Extends_clauseContext,0)


        def class_definition(self):
            return self.getTypedRuleContext(modelicaParser.Class_definitionContext,0)


        def component_clause(self):
            return self.getTypedRuleContext(modelicaParser.Component_clauseContext,0)


        def constraining_clause(self):
            return self.getTypedRuleContext(modelicaParser.Constraining_clauseContext,0)


        def comment(self):
            return self.getTypedRuleContext(modelicaParser.CommentContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_element

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

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




    def element(self):

        localctx = modelicaParser.ElementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_element)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 374
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [34]:
                self.state = 344
                self.import_clause()
                pass
            elif token in [19]:
                self.state = 345
                self.extends_clause()
                pass
            elif token in [1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 30, 31, 32, 33, 39, 40, 41, 42, 43, 44, 45, 87, 89]:
                self.state = 347
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==30:
                    self.state = 346
                    self.match(modelicaParser.T__29)


                self.state = 350
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==1:
                    self.state = 349
                    self.match(modelicaParser.T__0)


                self.state = 353
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==31:
                    self.state = 352
                    self.match(modelicaParser.T__30)


                self.state = 356
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==32:
                    self.state = 355
                    self.match(modelicaParser.T__31)


                self.state = 372
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 39, 40, 41, 42, 43, 44, 45, 87, 89]:
                    self.state = 360
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]:
                        self.state = 358
                        self.class_definition()
                        pass
                    elif token in [39, 40, 41, 42, 43, 44, 45, 87, 89]:
                        self.state = 359
                        self.component_clause()
                        pass
                    else:
                        raise NoViableAltException(self)

                    pass
                elif token in [33]:
                    self.state = 362
                    self.match(modelicaParser.T__32)
                    self.state = 365
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]:
                        self.state = 363
                        self.class_definition()
                        pass
                    elif token in [39, 40, 41, 42, 43, 44, 45, 87, 89]:
                        self.state = 364
                        self.component_clause()
                        pass
                    else:
                        raise NoViableAltException(self)

                    self.state = 370
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==38:
                        self.state = 367
                        self.constraining_clause()
                        self.state = 368
                        self.comment()


                    pass
                else:
                    raise NoViableAltException(self)

                pass
            else:
                raise NoViableAltException(self)

            self.state = 376
            self.match(modelicaParser.T__1)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Import_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def comment(self):
            return self.getTypedRuleContext(modelicaParser.CommentContext,0)


        def IDENT(self):
            return self.getToken(modelicaParser.IDENT, 0)

        def name(self):
            return self.getTypedRuleContext(modelicaParser.NameContext,0)


        def import_list(self):
            return self.getTypedRuleContext(modelicaParser.Import_listContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_import_clause

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

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




    def import_clause(self):

        localctx = modelicaParser.Import_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_import_clause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 378
            self.match(modelicaParser.T__33)
            self.state = 391
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,40,self._ctx)
            if la_ == 1:
                self.state = 379
                self.match(modelicaParser.IDENT)
                self.state = 380
                self.match(modelicaParser.T__19)
                self.state = 381
                self.name()
                pass

            elif la_ == 2:
                self.state = 382
                self.name()
                self.state = 383
                self.match(modelicaParser.T__34)
                pass

            elif la_ == 3:
                self.state = 385
                self.name()
                self.state = 386
                self.match(modelicaParser.T__35)
                self.state = 387
                self.import_list()
                self.state = 388
                self.match(modelicaParser.T__36)
                pass

            elif la_ == 4:
                self.state = 390
                self.name()
                pass


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


    class Import_listContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def getRuleIndex(self):
            return modelicaParser.RULE_import_list

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

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




    def import_list(self):

        localctx = modelicaParser.Import_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_import_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 395
            self.match(modelicaParser.IDENT)
            self.state = 400
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==26:
                self.state = 396
                self.match(modelicaParser.T__25)
                self.state = 397
                self.match(modelicaParser.IDENT)
                self.state = 402
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class Extends_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def name(self):
            return self.getTypedRuleContext(modelicaParser.NameContext,0)


        def class_modification(self):
            return self.getTypedRuleContext(modelicaParser.Class_modificationContext,0)


        def annotation(self):
            return self.getTypedRuleContext(modelicaParser.AnnotationContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_extends_clause

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

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




    def extends_clause(self):

        localctx = modelicaParser.Extends_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_extends_clause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 403
            self.match(modelicaParser.T__18)
            self.state = 404
            self.name()
            self.state = 406
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==22:
                self.state = 405
                self.class_modification()


            self.state = 409
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==88:
                self.state = 408
                self.annotation()


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


    class Constraining_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def name(self):
            return self.getTypedRuleContext(modelicaParser.NameContext,0)


        def class_modification(self):
            return self.getTypedRuleContext(modelicaParser.Class_modificationContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_constraining_clause

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

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




    def constraining_clause(self):

        localctx = modelicaParser.Constraining_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_constraining_clause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 411
            self.match(modelicaParser.T__37)
            self.state = 412
            self.name()
            self.state = 414
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==22:
                self.state = 413
                self.class_modification()


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


    class Component_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def type_prefix(self):
            return self.getTypedRuleContext(modelicaParser.Type_prefixContext,0)


        def type_specifier(self):
            return self.getTypedRuleContext(modelicaParser.Type_specifierContext,0)


        def component_list(self):
            return self.getTypedRuleContext(modelicaParser.Component_listContext,0)


        def array_subscripts(self):
            return self.getTypedRuleContext(modelicaParser.Array_subscriptsContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_component_clause

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

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




    def component_clause(self):

        localctx = modelicaParser.Component_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_component_clause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 416
            self.type_prefix()
            self.state = 417
            self.type_specifier()
            self.state = 419
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==84:
                self.state = 418
                self.array_subscripts()


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


    class Type_prefixContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return modelicaParser.RULE_type_prefix

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

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




    def type_prefix(self):

        localctx = modelicaParser.Type_prefixContext(self, self._ctx, self.state)
        self.enterRule(localctx, 42, self.RULE_type_prefix)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 424
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==39 or _la==40:
                self.state = 423
                _la = self._input.LA(1)
                if not(_la==39 or _la==40):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


            self.state = 427
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & 15393162788864) != 0):
                self.state = 426
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 15393162788864) != 0)):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


            self.state = 430
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==44 or _la==45:
                self.state = 429
                _la = self._input.LA(1)
                if not(_la==44 or _la==45):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


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


    class Type_specifierContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def name(self):
            return self.getTypedRuleContext(modelicaParser.NameContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_type_specifier

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

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




    def type_specifier(self):

        localctx = modelicaParser.Type_specifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_type_specifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 432
            self.name()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Component_listContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def component_declaration(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.Component_declarationContext)
            else:
                return self.getTypedRuleContext(modelicaParser.Component_declarationContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_component_list

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

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




    def component_list(self):

        localctx = modelicaParser.Component_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 46, self.RULE_component_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 434
            self.component_declaration()
            self.state = 439
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==26:
                self.state = 435
                self.match(modelicaParser.T__25)
                self.state = 436
                self.component_declaration()
                self.state = 441
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class Component_declarationContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def declaration(self):
            return self.getTypedRuleContext(modelicaParser.DeclarationContext,0)


        def comment(self):
            return self.getTypedRuleContext(modelicaParser.CommentContext,0)


        def condition_attribute(self):
            return self.getTypedRuleContext(modelicaParser.Condition_attributeContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_component_declaration

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

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




    def component_declaration(self):

        localctx = modelicaParser.Component_declarationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_component_declaration)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 442
            self.declaration()
            self.state = 444
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==46:
                self.state = 443
                self.condition_attribute()


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


    class Condition_attributeContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def expression(self):
            return self.getTypedRuleContext(modelicaParser.ExpressionContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_condition_attribute

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

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




    def condition_attribute(self):

        localctx = modelicaParser.Condition_attributeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 50, self.RULE_condition_attribute)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 448
            self.match(modelicaParser.T__45)
            self.state = 449
            self.expression()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DeclarationContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def IDENT(self):
            return self.getToken(modelicaParser.IDENT, 0)

        def array_subscripts(self):
            return self.getTypedRuleContext(modelicaParser.Array_subscriptsContext,0)


        def modification(self):
            return self.getTypedRuleContext(modelicaParser.ModificationContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_declaration

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

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




    def declaration(self):

        localctx = modelicaParser.DeclarationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 52, self.RULE_declaration)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 451
            self.match(modelicaParser.IDENT)
            self.state = 453
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==84:
                self.state = 452
                self.array_subscripts()


            self.state = 456
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & 140737493598208) != 0):
                self.state = 455
                self.modification()


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


    class ModificationContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def class_modification(self):
            return self.getTypedRuleContext(modelicaParser.Class_modificationContext,0)


        def expression(self):
            return self.getTypedRuleContext(modelicaParser.ExpressionContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_modification

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

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




    def modification(self):

        localctx = modelicaParser.ModificationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 54, self.RULE_modification)
        self._la = 0 # Token type
        try:
            self.state = 467
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [22]:
                self.enterOuterAlt(localctx, 1)
                self.state = 458
                self.class_modification()
                self.state = 461
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==20:
                    self.state = 459
                    self.match(modelicaParser.T__19)
                    self.state = 460
                    self.expression()


                pass
            elif token in [20]:
                self.enterOuterAlt(localctx, 2)
                self.state = 463
                self.match(modelicaParser.T__19)
                self.state = 464
                self.expression()
                pass
            elif token in [47]:
                self.enterOuterAlt(localctx, 3)
                self.state = 465
                self.match(modelicaParser.T__46)
                self.state = 466
                self.expression()
                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 Class_modificationContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def argument_list(self):
            return self.getTypedRuleContext(modelicaParser.Argument_listContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_class_modification

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

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




    def class_modification(self):

        localctx = modelicaParser.Class_modificationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 56, self.RULE_class_modification)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 469
            self.match(modelicaParser.T__21)
            self.state = 471
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & 281484640387074) != 0) or _la==87 or _la==89:
                self.state = 470
                self.argument_list()


            self.state = 473
            self.match(modelicaParser.T__23)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Argument_listContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def argument(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.ArgumentContext)
            else:
                return self.getTypedRuleContext(modelicaParser.ArgumentContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_argument_list

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

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




    def argument_list(self):

        localctx = modelicaParser.Argument_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 58, self.RULE_argument_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 475
            self.argument()
            self.state = 480
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==26:
                self.state = 476
                self.match(modelicaParser.T__25)
                self.state = 477
                self.argument()
                self.state = 482
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class ArgumentContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def element_modification_or_replaceable(self):
            return self.getTypedRuleContext(modelicaParser.Element_modification_or_replaceableContext,0)


        def element_redeclaration(self):
            return self.getTypedRuleContext(modelicaParser.Element_redeclarationContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_argument

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

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




    def argument(self):

        localctx = modelicaParser.ArgumentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 60, self.RULE_argument)
        try:
            self.state = 485
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [1, 33, 48, 87, 89]:
                self.enterOuterAlt(localctx, 1)
                self.state = 483
                self.element_modification_or_replaceable()
                pass
            elif token in [30]:
                self.enterOuterAlt(localctx, 2)
                self.state = 484
                self.element_redeclaration()
                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 Element_modification_or_replaceableContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def element_modification(self):
            return self.getTypedRuleContext(modelicaParser.Element_modificationContext,0)


        def element_replaceable(self):
            return self.getTypedRuleContext(modelicaParser.Element_replaceableContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_element_modification_or_replaceable

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

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




    def element_modification_or_replaceable(self):

        localctx = modelicaParser.Element_modification_or_replaceableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 62, self.RULE_element_modification_or_replaceable)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 488
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==48:
                self.state = 487
                self.match(modelicaParser.T__47)


            self.state = 491
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==1:
                self.state = 490
                self.match(modelicaParser.T__0)


            self.state = 495
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [87, 89]:
                self.state = 493
                self.element_modification()
                pass
            elif token in [33]:
                self.state = 494
                self.element_replaceable()
                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 Element_modificationContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def name(self):
            return self.getTypedRuleContext(modelicaParser.NameContext,0)


        def string_comment(self):
            return self.getTypedRuleContext(modelicaParser.String_commentContext,0)


        def modification(self):
            return self.getTypedRuleContext(modelicaParser.ModificationContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_element_modification

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

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




    def element_modification(self):

        localctx = modelicaParser.Element_modificationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 64, self.RULE_element_modification)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 497
            self.name()
            self.state = 499
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & 140737493598208) != 0):
                self.state = 498
                self.modification()


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


    class Element_redeclarationContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def element_replaceable(self):
            return self.getTypedRuleContext(modelicaParser.Element_replaceableContext,0)


        def short_class_definition(self):
            return self.getTypedRuleContext(modelicaParser.Short_class_definitionContext,0)


        def component_clause1(self):
            return self.getTypedRuleContext(modelicaParser.Component_clause1Context,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_element_redeclaration

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

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




    def element_redeclaration(self):

        localctx = modelicaParser.Element_redeclarationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 66, self.RULE_element_redeclaration)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 503
            self.match(modelicaParser.T__29)
            self.state = 505
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==48:
                self.state = 504
                self.match(modelicaParser.T__47)


            self.state = 508
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==1:
                self.state = 507
                self.match(modelicaParser.T__0)


            self.state = 515
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 39, 40, 41, 42, 43, 44, 45, 87, 89]:
                self.state = 512
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]:
                    self.state = 510
                    self.short_class_definition()
                    pass
                elif token in [39, 40, 41, 42, 43, 44, 45, 87, 89]:
                    self.state = 511
                    self.component_clause1()
                    pass
                else:
                    raise NoViableAltException(self)

                pass
            elif token in [33]:
                self.state = 514
                self.element_replaceable()
                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 Element_replaceableContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def short_class_definition(self):
            return self.getTypedRuleContext(modelicaParser.Short_class_definitionContext,0)


        def component_clause1(self):
            return self.getTypedRuleContext(modelicaParser.Component_clause1Context,0)


        def constraining_clause(self):
            return self.getTypedRuleContext(modelicaParser.Constraining_clauseContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_element_replaceable

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

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




    def element_replaceable(self):

        localctx = modelicaParser.Element_replaceableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 68, self.RULE_element_replaceable)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 517
            self.match(modelicaParser.T__32)
            self.state = 520
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]:
                self.state = 518
                self.short_class_definition()
                pass
            elif token in [39, 40, 41, 42, 43, 44, 45, 87, 89]:
                self.state = 519
                self.component_clause1()
                pass
            else:
                raise NoViableAltException(self)

            self.state = 523
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==38:
                self.state = 522
                self.constraining_clause()


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


    class Component_clause1Context(ParserRuleContext):
        __slots__ = 'parser'

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

        def type_prefix(self):
            return self.getTypedRuleContext(modelicaParser.Type_prefixContext,0)


        def type_specifier(self):
            return self.getTypedRuleContext(modelicaParser.Type_specifierContext,0)


        def component_declaration1(self):
            return self.getTypedRuleContext(modelicaParser.Component_declaration1Context,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_component_clause1

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

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




    def component_clause1(self):

        localctx = modelicaParser.Component_clause1Context(self, self._ctx, self.state)
        self.enterRule(localctx, 70, self.RULE_component_clause1)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 525
            self.type_prefix()
            self.state = 526
            self.type_specifier()
            self.state = 527
            self.component_declaration1()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Component_declaration1Context(ParserRuleContext):
        __slots__ = 'parser'

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

        def declaration(self):
            return self.getTypedRuleContext(modelicaParser.DeclarationContext,0)


        def comment(self):
            return self.getTypedRuleContext(modelicaParser.CommentContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_component_declaration1

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

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




    def component_declaration1(self):

        localctx = modelicaParser.Component_declaration1Context(self, self._ctx, self.state)
        self.enterRule(localctx, 72, self.RULE_component_declaration1)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 529
            self.declaration()
            self.state = 530
            self.comment()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Short_class_definitionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def class_prefixes(self):
            return self.getTypedRuleContext(modelicaParser.Class_prefixesContext,0)


        def short_class_specifier(self):
            return self.getTypedRuleContext(modelicaParser.Short_class_specifierContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_short_class_definition

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

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




    def short_class_definition(self):

        localctx = modelicaParser.Short_class_definitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 74, self.RULE_short_class_definition)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 532
            self.class_prefixes()
            self.state = 533
            self.short_class_specifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Equation_sectionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def equation(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.EquationContext)
            else:
                return self.getTypedRuleContext(modelicaParser.EquationContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_equation_section

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

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




    def equation_section(self):

        localctx = modelicaParser.Equation_sectionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 76, self.RULE_equation_section)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 536
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==49:
                self.state = 535
                self.match(modelicaParser.T__48)


            self.state = 538
            self.match(modelicaParser.T__49)
            self.state = 542
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,69,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 539
                    self.equation() 
                self.state = 544
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,69,self._ctx)

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


    class Algorithm_sectionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def statement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.StatementContext)
            else:
                return self.getTypedRuleContext(modelicaParser.StatementContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_algorithm_section

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

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




    def algorithm_section(self):

        localctx = modelicaParser.Algorithm_sectionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 78, self.RULE_algorithm_section)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 546
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==49:
                self.state = 545
                self.match(modelicaParser.T__48)


            self.state = 548
            self.match(modelicaParser.T__50)
            self.state = 554
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & 3616460869526880256) != 0) or _la==87 or _la==89:
                self.state = 549
                self.statement()
                self.state = 550
                self.match(modelicaParser.T__1)
                self.state = 556
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class EquationContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def comment(self):
            return self.getTypedRuleContext(modelicaParser.CommentContext,0)


        def simple_expression(self):
            return self.getTypedRuleContext(modelicaParser.Simple_expressionContext,0)


        def expression(self):
            return self.getTypedRuleContext(modelicaParser.ExpressionContext,0)


        def if_equation(self):
            return self.getTypedRuleContext(modelicaParser.If_equationContext,0)


        def for_equation(self):
            return self.getTypedRuleContext(modelicaParser.For_equationContext,0)


        def connect_clause(self):
            return self.getTypedRuleContext(modelicaParser.Connect_clauseContext,0)


        def when_equation(self):
            return self.getTypedRuleContext(modelicaParser.When_equationContext,0)


        def name(self):
            return self.getTypedRuleContext(modelicaParser.NameContext,0)


        def function_call_args(self):
            return self.getTypedRuleContext(modelicaParser.Function_call_argsContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_equation

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

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




    def equation(self):

        localctx = modelicaParser.EquationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 80, self.RULE_equation)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 568
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,72,self._ctx)
            if la_ == 1:
                self.state = 557
                self.simple_expression()
                self.state = 558
                self.match(modelicaParser.T__19)
                self.state = 559
                self.expression()
                pass

            elif la_ == 2:
                self.state = 561
                self.if_equation()
                pass

            elif la_ == 3:
                self.state = 562
                self.for_equation()
                pass

            elif la_ == 4:
                self.state = 563
                self.connect_clause()
                pass

            elif la_ == 5:
                self.state = 564
                self.when_equation()
                pass

            elif la_ == 6:
                self.state = 565
                self.name()
                self.state = 566
                self.function_call_args()
                pass


            self.state = 570
            self.comment()
            self.state = 571
            self.match(modelicaParser.T__1)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class StatementContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def comment(self):
            return self.getTypedRuleContext(modelicaParser.CommentContext,0)


        def component_reference(self):
            return self.getTypedRuleContext(modelicaParser.Component_referenceContext,0)


        def output_expression_list(self):
            return self.getTypedRuleContext(modelicaParser.Output_expression_listContext,0)


        def function_call_args(self):
            return self.getTypedRuleContext(modelicaParser.Function_call_argsContext,0)


        def if_statement(self):
            return self.getTypedRuleContext(modelicaParser.If_statementContext,0)


        def for_statement(self):
            return self.getTypedRuleContext(modelicaParser.For_statementContext,0)


        def while_statement(self):
            return self.getTypedRuleContext(modelicaParser.While_statementContext,0)


        def when_statement(self):
            return self.getTypedRuleContext(modelicaParser.When_statementContext,0)


        def expression(self):
            return self.getTypedRuleContext(modelicaParser.ExpressionContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_statement

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

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




    def statement(self):

        localctx = modelicaParser.StatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 82, self.RULE_statement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 592
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [87, 89]:
                self.state = 573
                self.component_reference()
                self.state = 577
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [47]:
                    self.state = 574
                    self.match(modelicaParser.T__46)
                    self.state = 575
                    self.expression()
                    pass
                elif token in [22]:
                    self.state = 576
                    self.function_call_args()
                    pass
                else:
                    raise NoViableAltException(self)

                pass
            elif token in [22]:
                self.state = 579
                self.match(modelicaParser.T__21)
                self.state = 580
                self.output_expression_list()
                self.state = 581
                self.match(modelicaParser.T__23)
                self.state = 582
                self.match(modelicaParser.T__46)
                self.state = 583
                self.component_reference()
                self.state = 584
                self.function_call_args()
                pass
            elif token in [52]:
                self.state = 586
                self.match(modelicaParser.T__51)
                pass
            elif token in [53]:
                self.state = 587
                self.match(modelicaParser.T__52)
                pass
            elif token in [46]:
                self.state = 588
                self.if_statement()
                pass
            elif token in [57]:
                self.state = 589
                self.for_statement()
                pass
            elif token in [60]:
                self.state = 590
                self.while_statement()
                pass
            elif token in [61]:
                self.state = 591
                self.when_statement()
                pass
            else:
                raise NoViableAltException(self)

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


    class If_equationContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(modelicaParser.ExpressionContext,i)


        def equation(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.EquationContext)
            else:
                return self.getTypedRuleContext(modelicaParser.EquationContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_if_equation

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

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




    def if_equation(self):

        localctx = modelicaParser.If_equationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 84, self.RULE_if_equation)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 596
            self.match(modelicaParser.T__45)
            self.state = 597
            self.expression()
            self.state = 598
            self.match(modelicaParser.T__53)
            self.state = 602
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,75,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 599
                    self.equation() 
                self.state = 604
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,75,self._ctx)

            self.state = 616
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==55:
                self.state = 605
                self.match(modelicaParser.T__54)
                self.state = 606
                self.expression()
                self.state = 607
                self.match(modelicaParser.T__53)
                self.state = 611
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,76,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 608
                        self.equation() 
                    self.state = 613
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,76,self._ctx)

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

            self.state = 626
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==56:
                self.state = 619
                self.match(modelicaParser.T__55)
                self.state = 623
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,78,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 620
                        self.equation() 
                    self.state = 625
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,78,self._ctx)



            self.state = 628
            self.match(modelicaParser.T__17)
            self.state = 629
            self.match(modelicaParser.T__45)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class If_statementContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(modelicaParser.ExpressionContext,i)


        def statement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.StatementContext)
            else:
                return self.getTypedRuleContext(modelicaParser.StatementContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_if_statement

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

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




    def if_statement(self):

        localctx = modelicaParser.If_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 86, self.RULE_if_statement)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 631
            self.match(modelicaParser.T__45)
            self.state = 632
            self.expression()
            self.state = 633
            self.match(modelicaParser.T__53)
            self.state = 639
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & 3616460869526880256) != 0) or _la==87 or _la==89:
                self.state = 634
                self.statement()
                self.state = 635
                self.match(modelicaParser.T__1)
                self.state = 641
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 655
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==55:
                self.state = 642
                self.match(modelicaParser.T__54)
                self.state = 643
                self.expression()
                self.state = 644
                self.match(modelicaParser.T__53)
                self.state = 650
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & 3616460869526880256) != 0) or _la==87 or _la==89:
                    self.state = 645
                    self.statement()
                    self.state = 646
                    self.match(modelicaParser.T__1)
                    self.state = 652
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

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

            self.state = 667
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==56:
                self.state = 658
                self.match(modelicaParser.T__55)
                self.state = 664
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & 3616460869526880256) != 0) or _la==87 or _la==89:
                    self.state = 659
                    self.statement()
                    self.state = 660
                    self.match(modelicaParser.T__1)
                    self.state = 666
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



            self.state = 669
            self.match(modelicaParser.T__17)
            self.state = 670
            self.match(modelicaParser.T__45)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class For_equationContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def for_indices(self):
            return self.getTypedRuleContext(modelicaParser.For_indicesContext,0)


        def equation(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.EquationContext)
            else:
                return self.getTypedRuleContext(modelicaParser.EquationContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_for_equation

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

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




    def for_equation(self):

        localctx = modelicaParser.For_equationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 88, self.RULE_for_equation)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 672
            self.match(modelicaParser.T__56)
            self.state = 673
            self.for_indices()
            self.state = 674
            self.match(modelicaParser.T__57)
            self.state = 678
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,85,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 675
                    self.equation() 
                self.state = 680
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,85,self._ctx)

            self.state = 681
            self.match(modelicaParser.T__17)
            self.state = 682
            self.match(modelicaParser.T__56)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class For_statementContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def for_indices(self):
            return self.getTypedRuleContext(modelicaParser.For_indicesContext,0)


        def statement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.StatementContext)
            else:
                return self.getTypedRuleContext(modelicaParser.StatementContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_for_statement

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

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




    def for_statement(self):

        localctx = modelicaParser.For_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 90, self.RULE_for_statement)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 684
            self.match(modelicaParser.T__56)
            self.state = 685
            self.for_indices()
            self.state = 686
            self.match(modelicaParser.T__57)
            self.state = 692
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & 3616460869526880256) != 0) or _la==87 or _la==89:
                self.state = 687
                self.statement()
                self.state = 688
                self.match(modelicaParser.T__1)
                self.state = 694
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 695
            self.match(modelicaParser.T__17)
            self.state = 696
            self.match(modelicaParser.T__56)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class For_indicesContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def for_index(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.For_indexContext)
            else:
                return self.getTypedRuleContext(modelicaParser.For_indexContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_for_indices

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

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




    def for_indices(self):

        localctx = modelicaParser.For_indicesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 92, self.RULE_for_indices)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 698
            self.for_index()
            self.state = 703
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==26:
                self.state = 699
                self.match(modelicaParser.T__25)
                self.state = 700
                self.for_index()
                self.state = 705
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class For_indexContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def IDENT(self):
            return self.getToken(modelicaParser.IDENT, 0)

        def expression(self):
            return self.getTypedRuleContext(modelicaParser.ExpressionContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_for_index

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

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




    def for_index(self):

        localctx = modelicaParser.For_indexContext(self, self._ctx, self.state)
        self.enterRule(localctx, 94, self.RULE_for_index)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 706
            self.match(modelicaParser.IDENT)
            self.state = 709
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==59:
                self.state = 707
                self.match(modelicaParser.T__58)
                self.state = 708
                self.expression()


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


    class While_statementContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def expression(self):
            return self.getTypedRuleContext(modelicaParser.ExpressionContext,0)


        def statement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.StatementContext)
            else:
                return self.getTypedRuleContext(modelicaParser.StatementContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_while_statement

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

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




    def while_statement(self):

        localctx = modelicaParser.While_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 96, self.RULE_while_statement)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 711
            self.match(modelicaParser.T__59)
            self.state = 712
            self.expression()
            self.state = 713
            self.match(modelicaParser.T__57)
            self.state = 719
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & 3616460869526880256) != 0) or _la==87 or _la==89:
                self.state = 714
                self.statement()
                self.state = 715
                self.match(modelicaParser.T__1)
                self.state = 721
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 722
            self.match(modelicaParser.T__17)
            self.state = 723
            self.match(modelicaParser.T__59)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class When_equationContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(modelicaParser.ExpressionContext,i)


        def equation(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.EquationContext)
            else:
                return self.getTypedRuleContext(modelicaParser.EquationContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_when_equation

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

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




    def when_equation(self):

        localctx = modelicaParser.When_equationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 98, self.RULE_when_equation)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 725
            self.match(modelicaParser.T__60)
            self.state = 726
            self.expression()
            self.state = 727
            self.match(modelicaParser.T__53)
            self.state = 731
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,90,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 728
                    self.equation() 
                self.state = 733
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,90,self._ctx)

            self.state = 745
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==62:
                self.state = 734
                self.match(modelicaParser.T__61)
                self.state = 735
                self.expression()
                self.state = 736
                self.match(modelicaParser.T__53)
                self.state = 740
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,91,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 737
                        self.equation() 
                    self.state = 742
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,91,self._ctx)

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

            self.state = 748
            self.match(modelicaParser.T__17)
            self.state = 749
            self.match(modelicaParser.T__60)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class When_statementContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(modelicaParser.ExpressionContext,i)


        def statement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.StatementContext)
            else:
                return self.getTypedRuleContext(modelicaParser.StatementContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_when_statement

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

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




    def when_statement(self):

        localctx = modelicaParser.When_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 100, self.RULE_when_statement)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 751
            self.match(modelicaParser.T__60)
            self.state = 752
            self.expression()
            self.state = 753
            self.match(modelicaParser.T__53)
            self.state = 759
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & 3616460869526880256) != 0) or _la==87 or _la==89:
                self.state = 754
                self.statement()
                self.state = 755
                self.match(modelicaParser.T__1)
                self.state = 761
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 775
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==62:
                self.state = 762
                self.match(modelicaParser.T__61)
                self.state = 763
                self.expression()
                self.state = 764
                self.match(modelicaParser.T__53)
                self.state = 770
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & 3616460869526880256) != 0) or _la==87 or _la==89:
                    self.state = 765
                    self.statement()
                    self.state = 766
                    self.match(modelicaParser.T__1)
                    self.state = 772
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

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

            self.state = 778
            self.match(modelicaParser.T__17)
            self.state = 779
            self.match(modelicaParser.T__60)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Connect_clauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def component_reference(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.Component_referenceContext)
            else:
                return self.getTypedRuleContext(modelicaParser.Component_referenceContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_connect_clause

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

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




    def connect_clause(self):

        localctx = modelicaParser.Connect_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 102, self.RULE_connect_clause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 781
            self.match(modelicaParser.T__62)
            self.state = 782
            self.match(modelicaParser.T__21)
            self.state = 783
            self.component_reference()
            self.state = 784
            self.match(modelicaParser.T__25)
            self.state = 785
            self.component_reference()
            self.state = 786
            self.match(modelicaParser.T__23)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def simple_expression(self):
            return self.getTypedRuleContext(modelicaParser.Simple_expressionContext,0)


        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(modelicaParser.ExpressionContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_expression

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

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




    def expression(self):

        localctx = modelicaParser.ExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 104, self.RULE_expression)
        self._la = 0 # Token type
        try:
            self.state = 806
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [18, 22, 25, 49, 66, 73, 74, 75, 76, 82, 83, 84, 86, 87, 89, 90, 91]:
                self.enterOuterAlt(localctx, 1)
                self.state = 788
                self.simple_expression()
                pass
            elif token in [46]:
                self.enterOuterAlt(localctx, 2)
                self.state = 789
                self.match(modelicaParser.T__45)
                self.state = 790
                self.expression()
                self.state = 791
                self.match(modelicaParser.T__53)
                self.state = 792
                self.expression()
                self.state = 800
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==55:
                    self.state = 793
                    self.match(modelicaParser.T__54)
                    self.state = 794
                    self.expression()
                    self.state = 795
                    self.match(modelicaParser.T__53)
                    self.state = 796
                    self.expression()
                    self.state = 802
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 803
                self.match(modelicaParser.T__55)
                self.state = 804
                self.expression()
                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 Simple_expressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def logical_expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.Logical_expressionContext)
            else:
                return self.getTypedRuleContext(modelicaParser.Logical_expressionContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_simple_expression

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

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




    def simple_expression(self):

        localctx = modelicaParser.Simple_expressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 106, self.RULE_simple_expression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 808
            self.logical_expression()
            self.state = 815
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==23:
                self.state = 809
                self.match(modelicaParser.T__22)
                self.state = 810
                self.logical_expression()
                self.state = 813
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==23:
                    self.state = 811
                    self.match(modelicaParser.T__22)
                    self.state = 812
                    self.logical_expression()




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


    class Logical_expressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def logical_term(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.Logical_termContext)
            else:
                return self.getTypedRuleContext(modelicaParser.Logical_termContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_logical_expression

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

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




    def logical_expression(self):

        localctx = modelicaParser.Logical_expressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 108, self.RULE_logical_expression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 817
            self.logical_term()
            self.state = 822
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==64:
                self.state = 818
                self.match(modelicaParser.T__63)
                self.state = 819
                self.logical_term()
                self.state = 824
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class Logical_termContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def logical_factor(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.Logical_factorContext)
            else:
                return self.getTypedRuleContext(modelicaParser.Logical_factorContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_logical_term

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

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




    def logical_term(self):

        localctx = modelicaParser.Logical_termContext(self, self._ctx, self.state)
        self.enterRule(localctx, 110, self.RULE_logical_term)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 825
            self.logical_factor()
            self.state = 830
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==65:
                self.state = 826
                self.match(modelicaParser.T__64)
                self.state = 827
                self.logical_factor()
                self.state = 832
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class Logical_factorContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def relation(self):
            return self.getTypedRuleContext(modelicaParser.RelationContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_logical_factor

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

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




    def logical_factor(self):

        localctx = modelicaParser.Logical_factorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 112, self.RULE_logical_factor)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 834
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==66:
                self.state = 833
                self.match(modelicaParser.T__65)


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


    class RelationContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def arithmetic_expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.Arithmetic_expressionContext)
            else:
                return self.getTypedRuleContext(modelicaParser.Arithmetic_expressionContext,i)


        def rel_op(self):
            return self.getTypedRuleContext(modelicaParser.Rel_opContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_relation

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

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




    def relation(self):

        localctx = modelicaParser.RelationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 114, self.RULE_relation)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 838
            self.arithmetic_expression()
            self.state = 842
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if ((((_la - 67)) & ~0x3f) == 0 and ((1 << (_la - 67)) & 63) != 0):
                self.state = 839
                self.rel_op()
                self.state = 840
                self.arithmetic_expression()


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


    class Rel_opContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return modelicaParser.RULE_rel_op

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

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




    def rel_op(self):

        localctx = modelicaParser.Rel_opContext(self, self._ctx, self.state)
        self.enterRule(localctx, 116, self.RULE_rel_op)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 844
            _la = self._input.LA(1)
            if not(((((_la - 67)) & ~0x3f) == 0 and ((1 << (_la - 67)) & 63) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Arithmetic_expressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def term(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.TermContext)
            else:
                return self.getTypedRuleContext(modelicaParser.TermContext,i)


        def add_op(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.Add_opContext)
            else:
                return self.getTypedRuleContext(modelicaParser.Add_opContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_arithmetic_expression

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

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




    def arithmetic_expression(self):

        localctx = modelicaParser.Arithmetic_expressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 118, self.RULE_arithmetic_expression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 847
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if ((((_la - 73)) & ~0x3f) == 0 and ((1 << (_la - 73)) & 15) != 0):
                self.state = 846
                self.add_op()


            self.state = 849
            self.term()
            self.state = 855
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 73)) & ~0x3f) == 0 and ((1 << (_la - 73)) & 15) != 0):
                self.state = 850
                self.add_op()
                self.state = 851
                self.term()
                self.state = 857
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class Add_opContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return modelicaParser.RULE_add_op

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

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




    def add_op(self):

        localctx = modelicaParser.Add_opContext(self, self._ctx, self.state)
        self.enterRule(localctx, 120, self.RULE_add_op)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 858
            _la = self._input.LA(1)
            if not(((((_la - 73)) & ~0x3f) == 0 and ((1 << (_la - 73)) & 15) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TermContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def factor(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.FactorContext)
            else:
                return self.getTypedRuleContext(modelicaParser.FactorContext,i)


        def mul_op(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.Mul_opContext)
            else:
                return self.getTypedRuleContext(modelicaParser.Mul_opContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_term

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

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




    def term(self):

        localctx = modelicaParser.TermContext(self, self._ctx, self.state)
        self.enterRule(localctx, 122, self.RULE_term)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 860
            self.factor()
            self.state = 866
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 35)) & ~0x3f) == 0 and ((1 << (_la - 35)) & 30786325577729) != 0):
                self.state = 861
                self.mul_op()
                self.state = 862
                self.factor()
                self.state = 868
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class Mul_opContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return modelicaParser.RULE_mul_op

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

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




    def mul_op(self):

        localctx = modelicaParser.Mul_opContext(self, self._ctx, self.state)
        self.enterRule(localctx, 124, self.RULE_mul_op)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 869
            _la = self._input.LA(1)
            if not(((((_la - 35)) & ~0x3f) == 0 and ((1 << (_la - 35)) & 30786325577729) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class FactorContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def primary(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.PrimaryContext)
            else:
                return self.getTypedRuleContext(modelicaParser.PrimaryContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_factor

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

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




    def factor(self):

        localctx = modelicaParser.FactorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 126, self.RULE_factor)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 871
            self.primary()
            self.state = 874
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==80 or _la==81:
                self.state = 872
                _la = self._input.LA(1)
                if not(_la==80 or _la==81):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 873
                self.primary()


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


    class PrimaryContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def UNSIGNED_NUMBER(self):
            return self.getToken(modelicaParser.UNSIGNED_NUMBER, 0)

        def STRING(self):
            return self.getToken(modelicaParser.STRING, 0)

        def function_call_args(self):
            return self.getTypedRuleContext(modelicaParser.Function_call_argsContext,0)


        def name(self):
            return self.getTypedRuleContext(modelicaParser.NameContext,0)


        def component_reference(self):
            return self.getTypedRuleContext(modelicaParser.Component_referenceContext,0)


        def output_expression_list(self):
            return self.getTypedRuleContext(modelicaParser.Output_expression_listContext,0)


        def expression_list(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.Expression_listContext)
            else:
                return self.getTypedRuleContext(modelicaParser.Expression_listContext,i)


        def function_arguments(self):
            return self.getTypedRuleContext(modelicaParser.Function_argumentsContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_primary

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

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




    def primary(self):

        localctx = modelicaParser.PrimaryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 128, self.RULE_primary)
        self._la = 0 # Token type
        try:
            self.state = 907
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,110,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 876
                self.match(modelicaParser.UNSIGNED_NUMBER)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 877
                self.match(modelicaParser.STRING)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 878
                self.match(modelicaParser.T__81)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 879
                self.match(modelicaParser.T__82)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 883
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [87, 89]:
                    self.state = 880
                    self.name()
                    pass
                elif token in [25]:
                    self.state = 881
                    self.match(modelicaParser.T__24)
                    pass
                elif token in [49]:
                    self.state = 882
                    self.match(modelicaParser.T__48)
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 885
                self.function_call_args()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 886
                self.component_reference()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 887
                self.match(modelicaParser.T__21)
                self.state = 888
                self.output_expression_list()
                self.state = 889
                self.match(modelicaParser.T__23)
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 891
                self.match(modelicaParser.T__83)
                self.state = 892
                self.expression_list()
                self.state = 897
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==2:
                    self.state = 893
                    self.match(modelicaParser.T__1)
                    self.state = 894
                    self.expression_list()
                    self.state = 899
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 900
                self.match(modelicaParser.T__84)
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 902
                self.match(modelicaParser.T__85)
                self.state = 903
                self.function_arguments()
                self.state = 904
                self.match(modelicaParser.T__36)
                pass

            elif la_ == 10:
                self.enterOuterAlt(localctx, 10)
                self.state = 906
                self.match(modelicaParser.T__17)
                pass


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


    class NameContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def getRuleIndex(self):
            return modelicaParser.RULE_name

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

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




    def name(self):

        localctx = modelicaParser.NameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 130, self.RULE_name)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 910
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==87:
                self.state = 909
                self.match(modelicaParser.T__86)


            self.state = 912
            self.match(modelicaParser.IDENT)
            self.state = 917
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==87:
                self.state = 913
                self.match(modelicaParser.T__86)
                self.state = 914
                self.match(modelicaParser.IDENT)
                self.state = 919
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class Component_referenceContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def array_subscripts(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.Array_subscriptsContext)
            else:
                return self.getTypedRuleContext(modelicaParser.Array_subscriptsContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_component_reference

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

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




    def component_reference(self):

        localctx = modelicaParser.Component_referenceContext(self, self._ctx, self.state)
        self.enterRule(localctx, 132, self.RULE_component_reference)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 921
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==87:
                self.state = 920
                self.match(modelicaParser.T__86)


            self.state = 923
            self.match(modelicaParser.IDENT)
            self.state = 925
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==84:
                self.state = 924
                self.array_subscripts()


            self.state = 934
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==87:
                self.state = 927
                self.match(modelicaParser.T__86)
                self.state = 928
                self.match(modelicaParser.IDENT)
                self.state = 930
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==84:
                    self.state = 929
                    self.array_subscripts()


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

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


    class Function_call_argsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def function_arguments(self):
            return self.getTypedRuleContext(modelicaParser.Function_argumentsContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_function_call_args

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

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




    def function_call_args(self):

        localctx = modelicaParser.Function_call_argsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 134, self.RULE_function_call_args)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 937
            self.match(modelicaParser.T__21)
            self.state = 939
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & 633318735740928) != 0) or ((((_la - 66)) & ~0x3f) == 0 and ((1 << (_la - 66)) & 62326657) != 0):
                self.state = 938
                self.function_arguments()


            self.state = 941
            self.match(modelicaParser.T__23)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Function_argumentsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def function_argument(self):
            return self.getTypedRuleContext(modelicaParser.Function_argumentContext,0)


        def function_arguments(self):
            return self.getTypedRuleContext(modelicaParser.Function_argumentsContext,0)


        def for_indices(self):
            return self.getTypedRuleContext(modelicaParser.For_indicesContext,0)


        def named_arguments(self):
            return self.getTypedRuleContext(modelicaParser.Named_argumentsContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_function_arguments

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

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




    def function_arguments(self):

        localctx = modelicaParser.Function_argumentsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 136, self.RULE_function_arguments)
        try:
            self.state = 951
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,119,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 943
                self.function_argument()
                self.state = 948
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [26]:
                    self.state = 944
                    self.match(modelicaParser.T__25)
                    self.state = 945
                    self.function_arguments()
                    pass
                elif token in [57]:
                    self.state = 946
                    self.match(modelicaParser.T__56)
                    self.state = 947
                    self.for_indices()
                    pass
                elif token in [24, 37]:
                    pass
                else:
                    pass
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 950
                self.named_arguments()
                pass


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


    class Named_argumentsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def named_argument(self):
            return self.getTypedRuleContext(modelicaParser.Named_argumentContext,0)


        def named_arguments(self):
            return self.getTypedRuleContext(modelicaParser.Named_argumentsContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_named_arguments

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

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




    def named_arguments(self):

        localctx = modelicaParser.Named_argumentsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 138, self.RULE_named_arguments)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 953
            self.named_argument()
            self.state = 956
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==26:
                self.state = 954
                self.match(modelicaParser.T__25)
                self.state = 955
                self.named_arguments()


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


    class Named_argumentContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def IDENT(self):
            return self.getToken(modelicaParser.IDENT, 0)

        def function_argument(self):
            return self.getTypedRuleContext(modelicaParser.Function_argumentContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_named_argument

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

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




    def named_argument(self):

        localctx = modelicaParser.Named_argumentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 140, self.RULE_named_argument)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 958
            self.match(modelicaParser.IDENT)
            self.state = 959
            self.match(modelicaParser.T__19)
            self.state = 960
            self.function_argument()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Function_argumentContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def name(self):
            return self.getTypedRuleContext(modelicaParser.NameContext,0)


        def named_arguments(self):
            return self.getTypedRuleContext(modelicaParser.Named_argumentsContext,0)


        def expression(self):
            return self.getTypedRuleContext(modelicaParser.ExpressionContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_function_argument

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

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




    def function_argument(self):

        localctx = modelicaParser.Function_argumentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 142, self.RULE_function_argument)
        self._la = 0 # Token type
        try:
            self.state = 971
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [17]:
                self.enterOuterAlt(localctx, 1)
                self.state = 962
                self.match(modelicaParser.T__16)
                self.state = 963
                self.name()
                self.state = 964
                self.match(modelicaParser.T__21)
                self.state = 966
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==89:
                    self.state = 965
                    self.named_arguments()


                self.state = 968
                self.match(modelicaParser.T__23)
                pass
            elif token in [18, 22, 25, 46, 49, 66, 73, 74, 75, 76, 82, 83, 84, 86, 87, 89, 90, 91]:
                self.enterOuterAlt(localctx, 2)
                self.state = 970
                self.expression()
                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 Output_expression_listContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(modelicaParser.ExpressionContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_output_expression_list

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

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




    def output_expression_list(self):

        localctx = modelicaParser.Output_expression_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 144, self.RULE_output_expression_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 974
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & 633318735609856) != 0) or ((((_la - 66)) & ~0x3f) == 0 and ((1 << (_la - 66)) & 62326657) != 0):
                self.state = 973
                self.expression()


            self.state = 982
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==26:
                self.state = 976
                self.match(modelicaParser.T__25)
                self.state = 978
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & 633318735609856) != 0) or ((((_la - 66)) & ~0x3f) == 0 and ((1 << (_la - 66)) & 62326657) != 0):
                    self.state = 977
                    self.expression()


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

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


    class Expression_listContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(modelicaParser.ExpressionContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_expression_list

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

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




    def expression_list(self):

        localctx = modelicaParser.Expression_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 146, self.RULE_expression_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 985
            self.expression()
            self.state = 990
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==26:
                self.state = 986
                self.match(modelicaParser.T__25)
                self.state = 987
                self.expression()
                self.state = 992
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class Array_subscriptsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def subscript(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(modelicaParser.SubscriptContext)
            else:
                return self.getTypedRuleContext(modelicaParser.SubscriptContext,i)


        def getRuleIndex(self):
            return modelicaParser.RULE_array_subscripts

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

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




    def array_subscripts(self):

        localctx = modelicaParser.Array_subscriptsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 148, self.RULE_array_subscripts)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 993
            self.match(modelicaParser.T__83)
            self.state = 994
            self.subscript()
            self.state = 999
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==26:
                self.state = 995
                self.match(modelicaParser.T__25)
                self.state = 996
                self.subscript()
                self.state = 1001
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 1002
            self.match(modelicaParser.T__84)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SubscriptContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def expression(self):
            return self.getTypedRuleContext(modelicaParser.ExpressionContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_subscript

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

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




    def subscript(self):

        localctx = modelicaParser.SubscriptContext(self, self._ctx, self.state)
        self.enterRule(localctx, 150, self.RULE_subscript)
        try:
            self.state = 1006
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [23]:
                self.enterOuterAlt(localctx, 1)
                self.state = 1004
                self.match(modelicaParser.T__22)
                pass
            elif token in [18, 22, 25, 46, 49, 66, 73, 74, 75, 76, 82, 83, 84, 86, 87, 89, 90, 91]:
                self.enterOuterAlt(localctx, 2)
                self.state = 1005
                self.expression()
                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 CommentContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def string_comment(self):
            return self.getTypedRuleContext(modelicaParser.String_commentContext,0)


        def annotation(self):
            return self.getTypedRuleContext(modelicaParser.AnnotationContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_comment

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

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




    def comment(self):

        localctx = modelicaParser.CommentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 152, self.RULE_comment)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1008
            self.string_comment()
            self.state = 1010
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==88:
                self.state = 1009
                self.annotation()


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


    class String_commentContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def getRuleIndex(self):
            return modelicaParser.RULE_string_comment

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

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




    def string_comment(self):

        localctx = modelicaParser.String_commentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 154, self.RULE_string_comment)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1020
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==90:
                self.state = 1012
                self.match(modelicaParser.STRING)
                self.state = 1017
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==73:
                    self.state = 1013
                    self.match(modelicaParser.T__72)
                    self.state = 1014
                    self.match(modelicaParser.STRING)
                    self.state = 1019
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)



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


    class Model_annotationContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def annotation(self):
            return self.getTypedRuleContext(modelicaParser.AnnotationContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_model_annotation

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

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




    def model_annotation(self):

        localctx = modelicaParser.Model_annotationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 156, self.RULE_model_annotation)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1022
            self.annotation()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AnnotationContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def class_modification(self):
            return self.getTypedRuleContext(modelicaParser.Class_modificationContext,0)


        def getRuleIndex(self):
            return modelicaParser.RULE_annotation

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

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




    def annotation(self):

        localctx = modelicaParser.AnnotationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 158, self.RULE_annotation)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 1024
            self.match(modelicaParser.T__87)
            self.state = 1025
            self.class_modification()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx





