# Generated from Modelica.g4 by ANTLR 4.7
# encoding: utf-8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys

def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3^")
        buf.write("\u03c4\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7")
        buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16")
        buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23")
        buf.write("\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31")
        buf.write("\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36")
        buf.write("\4\37\t\37\4 \t \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t")
        buf.write("&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4,\t,\4-\t-\4.\t.\4")
        buf.write("/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64\t\64")
        buf.write("\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t")
        buf.write(";\4<\t<\4=\t=\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\t")
        buf.write("D\4E\tE\4F\tF\4G\tG\4H\tH\4I\tI\4J\tJ\4K\tK\4L\tL\4M\t")
        buf.write("M\3\2\3\2\5\2\u009d\n\2\3\2\5\2\u00a0\n\2\3\2\7\2\u00a3")
        buf.write("\n\2\f\2\16\2\u00a6\13\2\3\3\5\3\u00a9\n\3\3\3\3\3\3\3")
        buf.write("\3\4\5\4\u00af\n\4\3\4\3\4\3\4\3\5\5\5\u00b5\n\5\3\5\3")
        buf.write("\5\3\6\3\6\3\6\5\6\u00bc\n\6\3\6\3\6\3\6\5\6\u00c1\n\6")
        buf.write("\3\6\3\6\3\6\3\6\5\6\u00c7\n\6\3\6\5\6\u00ca\n\6\3\6\3")
        buf.write("\6\5\6\u00ce\n\6\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3")
        buf.write("\7\3\7\5\7\u00db\n\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\5\7\u00e4")
        buf.write("\n\7\3\7\5\7\u00e7\n\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7")
        buf.write("\3\7\3\7\3\7\7\7\u00f4\n\7\f\7\16\7\u00f7\13\7\3\7\3\7")
        buf.write("\3\7\3\7\3\7\3\7\5\7\u00ff\n\7\3\7\3\7\3\7\3\7\3\7\5\7")
        buf.write("\u0106\n\7\3\b\3\b\3\t\3\t\3\t\7\t\u010d\n\t\f\t\16\t")
        buf.write("\u0110\13\t\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13")
        buf.write("\3\13\7\13\u011c\n\13\f\13\16\13\u011f\13\13\3\13\3\13")
        buf.write("\5\13\u0123\n\13\3\13\5\13\u0126\n\13\3\13\5\13\u0129")
        buf.write("\n\13\3\13\5\13\u012c\n\13\3\13\3\13\3\13\5\13\u0131\n")
        buf.write("\13\3\f\3\f\3\r\3\r\3\r\5\r\u0138\n\r\3\r\3\r\3\r\5\r")
        buf.write("\u013d\n\r\3\r\3\r\3\16\3\16\3\16\7\16\u0144\n\16\f\16")
        buf.write("\16\16\u0147\13\16\3\17\3\17\3\17\3\17\5\17\u014d\n\17")
        buf.write("\3\20\5\20\u0150\n\20\3\20\5\20\u0153\n\20\3\20\5\20\u0156")
        buf.write("\n\20\3\20\5\20\u0159\n\20\3\20\3\20\5\20\u015d\n\20\3")
        buf.write("\21\5\21\u0160\n\21\3\21\5\21\u0163\n\21\3\21\5\21\u0166")
        buf.write("\n\21\3\21\5\21\u0169\n\21\3\21\3\21\3\21\5\21\u016e\n")
        buf.write("\21\3\21\3\21\3\21\5\21\u0173\n\21\3\22\3\22\3\22\3\22")
        buf.write("\3\22\3\22\3\22\3\22\3\22\3\22\3\22\5\22\u0180\n\22\5")
        buf.write("\22\u0182\n\22\5\22\u0184\n\22\3\22\3\22\3\23\3\23\3\23")
        buf.write("\7\23\u018b\n\23\f\23\16\23\u018e\13\23\3\24\3\24\3\24")
        buf.write("\5\24\u0193\n\24\3\24\5\24\u0196\n\24\3\25\3\25\3\25\5")
        buf.write("\25\u019b\n\25\3\26\3\26\3\26\5\26\u01a0\n\26\3\26\3\26")
        buf.write("\3\27\5\27\u01a5\n\27\3\27\5\27\u01a8\n\27\3\27\5\27\u01ab")
        buf.write("\n\27\3\30\3\30\3\31\3\31\3\31\7\31\u01b2\n\31\f\31\16")
        buf.write("\31\u01b5\13\31\3\32\3\32\3\32\7\32\u01ba\n\32\f\32\16")
        buf.write("\32\u01bd\13\32\3\33\3\33\5\33\u01c1\n\33\3\33\3\33\3")
        buf.write("\34\3\34\3\34\3\35\3\35\5\35\u01ca\n\35\3\35\5\35\u01cd")
        buf.write("\n\35\3\36\3\36\3\36\5\36\u01d2\n\36\3\36\3\36\3\36\3")
        buf.write("\36\5\36\u01d8\n\36\3\37\3\37\5\37\u01dc\n\37\3\37\3\37")
        buf.write("\3 \3 \3 \7 \u01e3\n \f \16 \u01e6\13 \3!\3!\5!\u01ea")
        buf.write("\n!\3\"\5\"\u01ed\n\"\3\"\5\"\u01f0\n\"\3\"\3\"\5\"\u01f4")
        buf.write("\n\"\3#\3#\5#\u01f8\n#\3#\3#\3$\3$\5$\u01fe\n$\3$\5$\u0201")
        buf.write("\n$\3$\3$\5$\u0205\n$\3$\5$\u0208\n$\3%\3%\3%\5%\u020d")
        buf.write("\n%\3%\5%\u0210\n%\3&\3&\3&\3&\3\'\3\'\3\'\3(\3(\3(\3")
        buf.write("(\3(\3(\5(\u021f\n(\3(\5(\u0222\n(\3(\3(\3(\3(\3(\5(\u0229")
        buf.write("\n(\3(\5(\u022c\n(\3(\3(\5(\u0230\n(\3)\3)\3)\7)\u0235")
        buf.write("\n)\f)\16)\u0238\13)\3*\5*\u023b\n*\3*\3*\3*\3+\3+\3+")
        buf.write("\7+\u0243\n+\f+\16+\u0246\13+\3,\5,\u0249\n,\3,\3,\3,")
        buf.write("\3-\3-\3-\3-\3-\3-\3-\3-\3-\3-\3-\5-\u0259\n-\3.\3.\3")
        buf.write(".\3/\3/\3/\3/\5/\u0262\n/\3/\3/\3/\3/\7/\u0268\n/\f/\16")
        buf.write("/\u026b\13/\3/\3/\3/\3/\3/\3/\3/\3/\3/\3/\3/\5/\u0278")
        buf.write("\n/\3\60\3\60\3\60\3\61\3\61\3\61\3\61\3\61\3\61\3\61")
        buf.write("\3\61\3\61\7\61\u0286\n\61\f\61\16\61\u0289\13\61\3\61")
        buf.write("\3\61\5\61\u028d\n\61\3\61\3\61\3\61\3\62\3\62\3\62\3")
        buf.write("\62\3\62\3\62\3\62\3\62\3\62\7\62\u029b\n\62\f\62\16\62")
        buf.write("\u029e\13\62\3\62\3\62\5\62\u02a2\n\62\3\62\3\62\3\62")
        buf.write("\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\64\3\64\3\64\3\64")
        buf.write("\3\64\3\64\3\64\3\65\3\65\3\65\7\65\u02b8\n\65\f\65\16")
        buf.write("\65\u02bb\13\65\3\66\3\66\3\66\5\66\u02c0\n\66\3\67\3")
        buf.write("\67\3\67\3\67\3\67\3\67\3\67\38\38\38\38\38\38\38\38\3")
        buf.write("8\78\u02d2\n8\f8\168\u02d5\138\38\38\38\39\39\39\39\3")
        buf.write("9\39\39\39\39\79\u02e3\n9\f9\169\u02e6\139\39\39\39\3")
        buf.write(":\3:\3:\3:\3:\3:\3:\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\7;\u02fc")
        buf.write("\n;\f;\16;\u02ff\13;\3;\3;\3;\5;\u0304\n;\3<\3<\3<\3<")
        buf.write("\3<\5<\u030b\n<\5<\u030d\n<\3=\3=\3=\3=\3=\3=\3=\3=\3")
        buf.write("=\3=\5=\u0319\n=\3=\3=\3=\3=\3=\3=\3=\3=\3=\3=\3=\3=\3")
        buf.write("=\3=\3=\7=\u032a\n=\f=\16=\u032d\13=\3>\3>\3>\3>\3>\3")
        buf.write(">\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\7>\u0343\n")
        buf.write(">\f>\16>\u0346\13>\3>\3>\3>\3>\3>\3>\3>\5>\u034f\n>\3")
        buf.write("?\5?\u0352\n?\3?\3?\3?\7?\u0357\n?\f?\16?\u035a\13?\3")
        buf.write("@\3@\5@\u035e\n@\3A\3A\3A\7A\u0363\nA\fA\16A\u0366\13")
        buf.write("A\3B\3B\5B\u036a\nB\3B\3B\3C\3C\3C\3C\3C\7C\u0373\nC\f")
        buf.write("C\16C\u0376\13C\3C\5C\u0379\nC\3D\3D\3D\7D\u037e\nD\f")
        buf.write("D\16D\u0381\13D\3E\3E\3E\3E\3F\3F\3F\3F\5F\u038b\nF\3")
        buf.write("F\3F\3F\5F\u0390\nF\3G\5G\u0393\nG\3G\3G\7G\u0397\nG\f")
        buf.write("G\16G\u039a\13G\3H\3H\3H\7H\u039f\nH\fH\16H\u03a2\13H")
        buf.write("\3I\3I\3I\3I\7I\u03a8\nI\fI\16I\u03ab\13I\3I\3I\3J\3J")
        buf.write("\5J\u03b1\nJ\3K\3K\5K\u03b5\nK\3L\3L\3L\7L\u03ba\nL\f")
        buf.write("L\16L\u03bd\13L\5L\u03bf\nL\3M\3M\3M\3M\2\3xN\2\4\6\b")
        buf.write("\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668")
        buf.write(":<>@BDFHJLNPRTVXZ\\^`bdfhjlnprtvxz|~\u0080\u0082\u0084")
        buf.write("\u0086\u0088\u008a\u008c\u008e\u0090\u0092\u0094\u0096")
        buf.write("\u0098\2\n\3\2\r\16\3\2#$\3\2%\'\3\2()\3\2;<\4\2\37\37")
        buf.write("=?\4\2::@B\3\2CH\2\u0417\2\u009f\3\2\2\2\4\u00a8\3\2\2")
        buf.write("\2\6\u00ae\3\2\2\2\b\u00b4\3\2\2\2\n\u00cd\3\2\2\2\f\u0105")
        buf.write("\3\2\2\2\16\u0107\3\2\2\2\20\u0109\3\2\2\2\22\u0111\3")
        buf.write("\2\2\2\24\u0114\3\2\2\2\26\u0132\3\2\2\2\30\u0137\3\2")
        buf.write("\2\2\32\u0145\3\2\2\2\34\u014c\3\2\2\2\36\u014f\3\2\2")
        buf.write("\2 \u015f\3\2\2\2\"\u0174\3\2\2\2$\u0187\3\2\2\2&\u018f")
        buf.write("\3\2\2\2(\u0197\3\2\2\2*\u019c\3\2\2\2,\u01a4\3\2\2\2")
        buf.write(".\u01ac\3\2\2\2\60\u01ae\3\2\2\2\62\u01b6\3\2\2\2\64\u01be")
        buf.write("\3\2\2\2\66\u01c4\3\2\2\28\u01c7\3\2\2\2:\u01d7\3\2\2")
        buf.write("\2<\u01d9\3\2\2\2>\u01df\3\2\2\2@\u01e9\3\2\2\2B\u01ec")
        buf.write("\3\2\2\2D\u01f5\3\2\2\2F\u01fb\3\2\2\2H\u0209\3\2\2\2")
        buf.write("J\u0211\3\2\2\2L\u0215\3\2\2\2N\u0218\3\2\2\2P\u0236\3")
        buf.write("\2\2\2R\u023a\3\2\2\2T\u0244\3\2\2\2V\u0248\3\2\2\2X\u0258")
        buf.write("\3\2\2\2Z\u025a\3\2\2\2\\\u0277\3\2\2\2^\u0279\3\2\2\2")
        buf.write("`\u027c\3\2\2\2b\u0291\3\2\2\2d\u02a6\3\2\2\2f\u02ad\3")
        buf.write("\2\2\2h\u02b4\3\2\2\2j\u02bc\3\2\2\2l\u02c1\3\2\2\2n\u02c8")
        buf.write("\3\2\2\2p\u02d9\3\2\2\2r\u02ea\3\2\2\2t\u0303\3\2\2\2")
        buf.write("v\u0305\3\2\2\2x\u0318\3\2\2\2z\u034e\3\2\2\2|\u0351\3")
        buf.write("\2\2\2~\u035b\3\2\2\2\u0080\u035f\3\2\2\2\u0082\u0367")
        buf.write("\3\2\2\2\u0084\u0378\3\2\2\2\u0086\u037a\3\2\2\2\u0088")
        buf.write("\u0382\3\2\2\2\u008a\u038f\3\2\2\2\u008c\u0392\3\2\2\2")
        buf.write("\u008e\u039b\3\2\2\2\u0090\u03a3\3\2\2\2\u0092\u03b0\3")
        buf.write("\2\2\2\u0094\u03b2\3\2\2\2\u0096\u03be\3\2\2\2\u0098\u03c0")
        buf.write("\3\2\2\2\u009a\u009c\7T\2\2\u009b\u009d\5\u0080A\2\u009c")
        buf.write("\u009b\3\2\2\2\u009c\u009d\3\2\2\2\u009d\u009e\3\2\2\2")
        buf.write("\u009e\u00a0\7\3\2\2\u009f\u009a\3\2\2\2\u009f\u00a0\3")
        buf.write("\2\2\2\u00a0\u00a4\3\2\2\2\u00a1\u00a3\5\4\3\2\u00a2\u00a1")
        buf.write("\3\2\2\2\u00a3\u00a6\3\2\2\2\u00a4\u00a2\3\2\2\2\u00a4")
        buf.write("\u00a5\3\2\2\2\u00a5\3\3\2\2\2\u00a6\u00a4\3\2\2\2\u00a7")
        buf.write("\u00a9\7S\2\2\u00a8\u00a7\3\2\2\2\u00a8\u00a9\3\2\2\2")
        buf.write("\u00a9\u00aa\3\2\2\2\u00aa\u00ab\5\6\4\2\u00ab\u00ac\7")
        buf.write("\3\2\2\u00ac\5\3\2\2\2\u00ad\u00af\7U\2\2\u00ae\u00ad")
        buf.write("\3\2\2\2\u00ae\u00af\3\2\2\2\u00af\u00b0\3\2\2\2\u00b0")
        buf.write("\u00b1\5\b\5\2\u00b1\u00b2\5\f\7\2\u00b2\7\3\2\2\2\u00b3")
        buf.write("\u00b5\7R\2\2\u00b4\u00b3\3\2\2\2\u00b4\u00b5\3\2\2\2")
        buf.write("\u00b5\u00b6\3\2\2\2\u00b6\u00b7\5\n\6\2\u00b7\t\3\2\2")
        buf.write("\2\u00b8\u00ce\7\4\2\2\u00b9\u00ce\7\5\2\2\u00ba\u00bc")
        buf.write("\7\6\2\2\u00bb\u00ba\3\2\2\2\u00bb\u00bc\3\2\2\2\u00bc")
        buf.write("\u00bd\3\2\2\2\u00bd\u00ce\7\7\2\2\u00be\u00ce\7\b\2\2")
        buf.write("\u00bf\u00c1\7\t\2\2\u00c0\u00bf\3\2\2\2\u00c0\u00c1\3")
        buf.write("\2\2\2\u00c1\u00c2\3\2\2\2\u00c2\u00ce\7\n\2\2\u00c3\u00ce")
        buf.write("\7\13\2\2\u00c4\u00ce\7\f\2\2\u00c5\u00c7\t\2\2\2\u00c6")
        buf.write("\u00c5\3\2\2\2\u00c6\u00c7\3\2\2\2\u00c7\u00c9\3\2\2\2")
        buf.write("\u00c8\u00ca\7\6\2\2\u00c9\u00c8\3\2\2\2\u00c9\u00ca\3")
        buf.write("\2\2\2\u00ca\u00cb\3\2\2\2\u00cb\u00ce\7\17\2\2\u00cc")
        buf.write("\u00ce\7\6\2\2\u00cd\u00b8\3\2\2\2\u00cd\u00b9\3\2\2\2")
        buf.write("\u00cd\u00bb\3\2\2\2\u00cd\u00be\3\2\2\2\u00cd\u00c0\3")
        buf.write("\2\2\2\u00cd\u00c3\3\2\2\2\u00cd\u00c4\3\2\2\2\u00cd\u00c6")
        buf.write("\3\2\2\2\u00cd\u00cc\3\2\2\2\u00ce\13\3\2\2\2\u00cf\u00d0")
        buf.write("\7Z\2\2\u00d0\u00d1\5\u0096L\2\u00d1\u00d2\5\24\13\2\u00d2")
        buf.write("\u00d3\7\20\2\2\u00d3\u00d4\7Z\2\2\u00d4\u0106\3\2\2\2")
        buf.write("\u00d5\u00d6\7Z\2\2\u00d6\u00d7\7\21\2\2\u00d7\u00d8\5")
        buf.write("\16\b\2\u00d8\u00da\5\u0080A\2\u00d9\u00db\5<\37\2\u00da")
        buf.write("\u00d9\3\2\2\2\u00da\u00db\3\2\2\2\u00db\u00dc\3\2\2\2")
        buf.write("\u00dc\u00dd\5\u0094K\2\u00dd\u0106\3\2\2\2\u00de\u00df")
        buf.write("\7Z\2\2\u00df\u00e0\7\21\2\2\u00e0\u00e1\7\22\2\2\u00e1")
        buf.write("\u00e6\7\23\2\2\u00e2\u00e4\5\20\t\2\u00e3\u00e2\3\2\2")
        buf.write("\2\u00e3\u00e4\3\2\2\2\u00e4\u00e7\3\2\2\2\u00e5\u00e7")
        buf.write("\7\24\2\2\u00e6\u00e3\3\2\2\2\u00e6\u00e5\3\2\2\2\u00e7")
        buf.write("\u00e8\3\2\2\2\u00e8\u00e9\7\25\2\2\u00e9\u0106\5\u0094")
        buf.write("K\2\u00ea\u00eb\7Z\2\2\u00eb\u00ec\7\21\2\2\u00ec\u00ed")
        buf.write("\7\26\2\2\u00ed\u00ee\7\23\2\2\u00ee\u00ef\5|?\2\u00ef")
        buf.write("\u00f0\7\27\2\2\u00f0\u00f5\7Z\2\2\u00f1\u00f2\7\27\2")
        buf.write("\2\u00f2\u00f4\7Z\2\2\u00f3\u00f1\3\2\2\2\u00f4\u00f7")
        buf.write("\3\2\2\2\u00f5\u00f3\3\2\2\2\u00f5\u00f6\3\2\2\2\u00f6")
        buf.write("\u00f8\3\2\2\2\u00f7\u00f5\3\2\2\2\u00f8\u00f9\7\25\2")
        buf.write("\2\u00f9\u00fa\5\u0094K\2\u00fa\u0106\3\2\2\2\u00fb\u00fc")
        buf.write("\7\30\2\2\u00fc\u00fe\7Z\2\2\u00fd\u00ff\5<\37\2\u00fe")
        buf.write("\u00fd\3\2\2\2\u00fe\u00ff\3\2\2\2\u00ff\u0100\3\2\2\2")
        buf.write("\u0100\u0101\5\u0096L\2\u0101\u0102\5\24\13\2\u0102\u0103")
        buf.write("\7\20\2\2\u0103\u0104\7Z\2\2\u0104\u0106\3\2\2\2\u0105")
        buf.write("\u00cf\3\2\2\2\u0105\u00d5\3\2\2\2\u0105\u00de\3\2\2\2")
        buf.write("\u0105\u00ea\3\2\2\2\u0105\u00fb\3\2\2\2\u0106\r\3\2\2")
        buf.write("\2\u0107\u0108\5,\27\2\u0108\17\3\2\2\2\u0109\u010e\5")
        buf.write("\22\n\2\u010a\u010b\7\27\2\2\u010b\u010d\5\22\n\2\u010c")
        buf.write("\u010a\3\2\2\2\u010d\u0110\3\2\2\2\u010e\u010c\3\2\2\2")
        buf.write("\u010e\u010f\3\2\2\2\u010f\21\3\2\2\2\u0110\u010e\3\2")
        buf.write("\2\2\u0111\u0112\7Z\2\2\u0112\u0113\5\u0094K\2\u0113\23")
        buf.write("\3\2\2\2\u0114\u011d\5\32\16\2\u0115\u0116\7\31\2\2\u0116")
        buf.write("\u011c\5\32\16\2\u0117\u0118\7\32\2\2\u0118\u011c\5\32")
        buf.write("\16\2\u0119\u011c\5R*\2\u011a\u011c\5V,\2\u011b\u0115")
        buf.write("\3\2\2\2\u011b\u0117\3\2\2\2\u011b\u0119\3\2\2\2\u011b")
        buf.write("\u011a\3\2\2\2\u011c\u011f\3\2\2\2\u011d\u011b\3\2\2\2")
        buf.write("\u011d\u011e\3\2\2\2\u011e\u012b\3\2\2\2\u011f\u011d\3")
        buf.write("\2\2\2\u0120\u0122\7\33\2\2\u0121\u0123\5\26\f\2\u0122")
        buf.write("\u0121\3\2\2\2\u0122\u0123\3\2\2\2\u0123\u0125\3\2\2\2")
        buf.write("\u0124\u0126\5\30\r\2\u0125\u0124\3\2\2\2\u0125\u0126")
        buf.write("\3\2\2\2\u0126\u0128\3\2\2\2\u0127\u0129\5\u0098M\2\u0128")
        buf.write("\u0127\3\2\2\2\u0128\u0129\3\2\2\2\u0129\u012a\3\2\2\2")
        buf.write("\u012a\u012c\7\3\2\2\u012b\u0120\3\2\2\2\u012b\u012c\3")
        buf.write("\2\2\2\u012c\u0130\3\2\2\2\u012d\u012e\5\u0098M\2\u012e")
        buf.write("\u012f\7\3\2\2\u012f\u0131\3\2\2\2\u0130\u012d\3\2\2\2")
        buf.write("\u0130\u0131\3\2\2\2\u0131\25\3\2\2\2\u0132\u0133\7[\2")
        buf.write("\2\u0133\27\3\2\2\2\u0134\u0135\5\u0080A\2\u0135\u0136")
        buf.write("\7\21\2\2\u0136\u0138\3\2\2\2\u0137\u0134\3\2\2\2\u0137")
        buf.write("\u0138\3\2\2\2\u0138\u0139\3\2\2\2\u0139\u013a\7Z\2\2")
        buf.write("\u013a\u013c\7\23\2\2\u013b\u013d\5\u008eH\2\u013c\u013b")
        buf.write("\3\2\2\2\u013c\u013d\3\2\2\2\u013d\u013e\3\2\2\2\u013e")
        buf.write("\u013f\7\25\2\2\u013f\31\3\2\2\2\u0140\u0141\5\34\17\2")
        buf.write("\u0141\u0142\7\3\2\2\u0142\u0144\3\2\2\2\u0143\u0140\3")
        buf.write("\2\2\2\u0144\u0147\3\2\2\2\u0145\u0143\3\2\2\2\u0145\u0146")
        buf.write("\3\2\2\2\u0146\33\3\2\2\2\u0147\u0145\3\2\2\2\u0148\u014d")
        buf.write("\5\"\22\2\u0149\u014d\5&\24\2\u014a\u014d\5\36\20\2\u014b")
        buf.write("\u014d\5 \21\2\u014c\u0148\3\2\2\2\u014c\u0149\3\2\2\2")
        buf.write("\u014c\u014a\3\2\2\2\u014c\u014b\3\2\2\2\u014d\35\3\2")
        buf.write("\2\2\u014e\u0150\7V\2\2\u014f\u014e\3\2\2\2\u014f\u0150")
        buf.write("\3\2\2\2\u0150\u0152\3\2\2\2\u0151\u0153\7S\2\2\u0152")
        buf.write("\u0151\3\2\2\2\u0152\u0153\3\2\2\2\u0153\u0155\3\2\2\2")
        buf.write("\u0154\u0156\7W\2\2\u0155\u0154\3\2\2\2\u0155\u0156\3")
        buf.write("\2\2\2\u0156\u0158\3\2\2\2\u0157\u0159\7X\2\2\u0158\u0157")
        buf.write("\3\2\2\2\u0158\u0159\3\2\2\2\u0159\u015c\3\2\2\2\u015a")
        buf.write("\u015d\5\6\4\2\u015b\u015d\5*\26\2\u015c\u015a\3\2\2\2")
        buf.write("\u015c\u015b\3\2\2\2\u015d\37\3\2\2\2\u015e\u0160\7V\2")
        buf.write("\2\u015f\u015e\3\2\2\2\u015f\u0160\3\2\2\2\u0160\u0162")
        buf.write("\3\2\2\2\u0161\u0163\7S\2\2\u0162\u0161\3\2\2\2\u0162")
        buf.write("\u0163\3\2\2\2\u0163\u0165\3\2\2\2\u0164\u0166\7W\2\2")
        buf.write("\u0165\u0164\3\2\2\2\u0165\u0166\3\2\2\2\u0166\u0168\3")
        buf.write("\2\2\2\u0167\u0169\7X\2\2\u0168\u0167\3\2\2\2\u0168\u0169")
        buf.write("\3\2\2\2\u0169\u016a\3\2\2\2\u016a\u016d\7\34\2\2\u016b")
        buf.write("\u016e\5\6\4\2\u016c\u016e\5*\26\2\u016d\u016b\3\2\2\2")
        buf.write("\u016d\u016c\3\2\2\2\u016e\u0172\3\2\2\2\u016f\u0170\5")
        buf.write("(\25\2\u0170\u0171\5\u0094K\2\u0171\u0173\3\2\2\2\u0172")
        buf.write("\u016f\3\2\2\2\u0172\u0173\3\2\2\2\u0173!\3\2\2\2\u0174")
        buf.write("\u0183\7\35\2\2\u0175\u0176\7Z\2\2\u0176\u0177\7\21\2")
        buf.write("\2\u0177\u0184\5\u0080A\2\u0178\u0181\5\u0080A\2\u0179")
        buf.write("\u017f\7\36\2\2\u017a\u0180\7\37\2\2\u017b\u017c\7 \2")
        buf.write("\2\u017c\u017d\5$\23\2\u017d\u017e\7!\2\2\u017e\u0180")
        buf.write("\3\2\2\2\u017f\u017a\3\2\2\2\u017f\u017b\3\2\2\2\u0180")
        buf.write("\u0182\3\2\2\2\u0181\u0179\3\2\2\2\u0181\u0182\3\2\2\2")
        buf.write("\u0182\u0184\3\2\2\2\u0183\u0175\3\2\2\2\u0183\u0178\3")
        buf.write("\2\2\2\u0184\u0185\3\2\2\2\u0185\u0186\5\u0094K\2\u0186")
        buf.write("#\3\2\2\2\u0187\u018c\7Z\2\2\u0188\u0189\7\27\2\2\u0189")
        buf.write("\u018b\5$\23\2\u018a\u0188\3\2\2\2\u018b\u018e\3\2\2\2")
        buf.write("\u018c\u018a\3\2\2\2\u018c\u018d\3\2\2\2\u018d%\3\2\2")
        buf.write("\2\u018e\u018c\3\2\2\2\u018f\u0190\7\30\2\2\u0190\u0192")
        buf.write("\5\u0080A\2\u0191\u0193\5<\37\2\u0192\u0191\3\2\2\2\u0192")
        buf.write("\u0193\3\2\2\2\u0193\u0195\3\2\2\2\u0194\u0196\5\u0098")
        buf.write("M\2\u0195\u0194\3\2\2\2\u0195\u0196\3\2\2\2\u0196\'\3")
        buf.write("\2\2\2\u0197\u0198\7\"\2\2\u0198\u019a\5|?\2\u0199\u019b")
        buf.write("\5<\37\2\u019a\u0199\3\2\2\2\u019a\u019b\3\2\2\2\u019b")
        buf.write(")\3\2\2\2\u019c\u019d\5,\27\2\u019d\u019f\5\60\31\2\u019e")
        buf.write("\u01a0\5\u0090I\2\u019f\u019e\3\2\2\2\u019f\u01a0\3\2")
        buf.write("\2\2\u01a0\u01a1\3\2\2\2\u01a1\u01a2\5\62\32\2\u01a2+")
        buf.write("\3\2\2\2\u01a3\u01a5\t\3\2\2\u01a4\u01a3\3\2\2\2\u01a4")
        buf.write("\u01a5\3\2\2\2\u01a5\u01a7\3\2\2\2\u01a6\u01a8\t\4\2\2")
        buf.write("\u01a7\u01a6\3\2\2\2\u01a7\u01a8\3\2\2\2\u01a8\u01aa\3")
        buf.write("\2\2\2\u01a9\u01ab\t\5\2\2\u01aa\u01a9\3\2\2\2\u01aa\u01ab")
        buf.write("\3\2\2\2\u01ab-\3\2\2\2\u01ac\u01ad\7Z\2\2\u01ad/\3\2")
        buf.write("\2\2\u01ae\u01b3\5.\30\2\u01af\u01b0\7\36\2\2\u01b0\u01b2")
        buf.write("\5.\30\2\u01b1\u01af\3\2\2\2\u01b2\u01b5\3\2\2\2\u01b3")
        buf.write("\u01b1\3\2\2\2\u01b3\u01b4\3\2\2\2\u01b4\61\3\2\2\2\u01b5")
        buf.write("\u01b3\3\2\2\2\u01b6\u01bb\5\64\33\2\u01b7\u01b8\7\27")
        buf.write("\2\2\u01b8\u01ba\5\64\33\2\u01b9\u01b7\3\2\2\2\u01ba\u01bd")
        buf.write("\3\2\2\2\u01bb\u01b9\3\2\2\2\u01bb\u01bc\3\2\2\2\u01bc")
        buf.write("\63\3\2\2\2\u01bd\u01bb\3\2\2\2\u01be\u01c0\58\35\2\u01bf")
        buf.write("\u01c1\5\66\34\2\u01c0\u01bf\3\2\2\2\u01c0\u01c1\3\2\2")
        buf.write("\2\u01c1\u01c2\3\2\2\2\u01c2\u01c3\5\u0094K\2\u01c3\65")
        buf.write("\3\2\2\2\u01c4\u01c5\7*\2\2\u01c5\u01c6\5t;\2\u01c6\67")
        buf.write("\3\2\2\2\u01c7\u01c9\7Z\2\2\u01c8\u01ca\5\u0090I\2\u01c9")
        buf.write("\u01c8\3\2\2\2\u01c9\u01ca\3\2\2\2\u01ca\u01cc\3\2\2\2")
        buf.write("\u01cb\u01cd\5:\36\2\u01cc\u01cb\3\2\2\2\u01cc\u01cd\3")
        buf.write("\2\2\2\u01cd9\3\2\2\2\u01ce\u01d1\5<\37\2\u01cf\u01d0")
        buf.write("\7\21\2\2\u01d0\u01d2\5t;\2\u01d1\u01cf\3\2\2\2\u01d1")
        buf.write("\u01d2\3\2\2\2\u01d2\u01d8\3\2\2\2\u01d3\u01d4\7\21\2")
        buf.write("\2\u01d4\u01d8\5t;\2\u01d5\u01d6\7+\2\2\u01d6\u01d8\5")
        buf.write("t;\2\u01d7\u01ce\3\2\2\2\u01d7\u01d3\3\2\2\2\u01d7\u01d5")
        buf.write("\3\2\2\2\u01d8;\3\2\2\2\u01d9\u01db\7\23\2\2\u01da\u01dc")
        buf.write("\5> \2\u01db\u01da\3\2\2\2\u01db\u01dc\3\2\2\2\u01dc\u01dd")
        buf.write("\3\2\2\2\u01dd\u01de\7\25\2\2\u01de=\3\2\2\2\u01df\u01e4")
        buf.write("\5@!\2\u01e0\u01e1\7\27\2\2\u01e1\u01e3\5@!\2\u01e2\u01e0")
        buf.write("\3\2\2\2\u01e3\u01e6\3\2\2\2\u01e4\u01e2\3\2\2\2\u01e4")
        buf.write("\u01e5\3\2\2\2\u01e5?\3\2\2\2\u01e6\u01e4\3\2\2\2\u01e7")
        buf.write("\u01ea\5B\"\2\u01e8\u01ea\5F$\2\u01e9\u01e7\3\2\2\2\u01e9")
        buf.write("\u01e8\3\2\2\2\u01eaA\3\2\2\2\u01eb\u01ed\7Q\2\2\u01ec")
        buf.write("\u01eb\3\2\2\2\u01ec\u01ed\3\2\2\2\u01ed\u01ef\3\2\2\2")
        buf.write("\u01ee\u01f0\7S\2\2\u01ef\u01ee\3\2\2\2\u01ef\u01f0\3")
        buf.write("\2\2\2\u01f0\u01f3\3\2\2\2\u01f1\u01f4\5D#\2\u01f2\u01f4")
        buf.write("\5H%\2\u01f3\u01f1\3\2\2\2\u01f3\u01f2\3\2\2\2\u01f4C")
        buf.write("\3\2\2\2\u01f5\u01f7\5\u0080A\2\u01f6\u01f8\5:\36\2\u01f7")
        buf.write("\u01f6\3\2\2\2\u01f7\u01f8\3\2\2\2\u01f8\u01f9\3\2\2\2")
        buf.write("\u01f9\u01fa\5\u0096L\2\u01faE\3\2\2\2\u01fb\u01fd\7V")
        buf.write("\2\2\u01fc\u01fe\7Q\2\2\u01fd\u01fc\3\2\2\2\u01fd\u01fe")
        buf.write("\3\2\2\2\u01fe\u0200\3\2\2\2\u01ff\u0201\7S\2\2\u0200")
        buf.write("\u01ff\3\2\2\2\u0200\u0201\3\2\2\2\u0201\u0207\3\2\2\2")
        buf.write("\u0202\u0205\5N(\2\u0203\u0205\5J&\2\u0204\u0202\3\2\2")
        buf.write("\2\u0204\u0203\3\2\2\2\u0205\u0208\3\2\2\2\u0206\u0208")
        buf.write("\5H%\2\u0207\u0204\3\2\2\2\u0207\u0206\3\2\2\2\u0208G")
        buf.write("\3\2\2\2\u0209\u020c\7\34\2\2\u020a\u020d\5N(\2\u020b")
        buf.write("\u020d\5J&\2\u020c\u020a\3\2\2\2\u020c\u020b\3\2\2\2\u020d")
        buf.write("\u020f\3\2\2\2\u020e\u0210\5(\25\2\u020f\u020e\3\2\2\2")
        buf.write("\u020f\u0210\3\2\2\2\u0210I\3\2\2\2\u0211\u0212\5,\27")
        buf.write("\2\u0212\u0213\5\60\31\2\u0213\u0214\5L\'\2\u0214K\3\2")
        buf.write("\2\2\u0215\u0216\58\35\2\u0216\u0217\5\u0094K\2\u0217")
        buf.write("M\3\2\2\2\u0218\u0219\5\b\5\2\u0219\u021a\7Z\2\2\u021a")
        buf.write("\u022f\7\21\2\2\u021b\u021c\5\16\b\2\u021c\u021e\5\u0080")
        buf.write("A\2\u021d\u021f\5\u0090I\2\u021e\u021d\3\2\2\2\u021e\u021f")
        buf.write("\3\2\2\2\u021f\u0221\3\2\2\2\u0220\u0222\5<\37\2\u0221")
        buf.write("\u0220\3\2\2\2\u0221\u0222\3\2\2\2\u0222\u0223\3\2\2\2")
        buf.write("\u0223\u0224\5\u0094K\2\u0224\u0230\3\2\2\2\u0225\u0226")
        buf.write("\7\22\2\2\u0226\u022b\7\23\2\2\u0227\u0229\5\20\t\2\u0228")
        buf.write("\u0227\3\2\2\2\u0228\u0229\3\2\2\2\u0229\u022c\3\2\2\2")
        buf.write("\u022a\u022c\7\24\2\2\u022b\u0228\3\2\2\2\u022b\u022a")
        buf.write("\3\2\2\2\u022c\u022d\3\2\2\2\u022d\u022e\7\25\2\2\u022e")
        buf.write("\u0230\5\u0094K\2\u022f\u021b\3\2\2\2\u022f\u0225\3\2")
        buf.write("\2\2\u0230O\3\2\2\2\u0231\u0232\5Z.\2\u0232\u0233\7\3")
        buf.write("\2\2\u0233\u0235\3\2\2\2\u0234\u0231\3\2\2\2\u0235\u0238")
        buf.write("\3\2\2\2\u0236\u0234\3\2\2\2\u0236\u0237\3\2\2\2\u0237")
        buf.write("Q\3\2\2\2\u0238\u0236\3\2\2\2\u0239\u023b\7Y\2\2\u023a")
        buf.write("\u0239\3\2\2\2\u023a\u023b\3\2\2\2\u023b\u023c\3\2\2\2")
        buf.write("\u023c\u023d\7,\2\2\u023d\u023e\5P)\2\u023eS\3\2\2\2\u023f")
        buf.write("\u0240\5^\60\2\u0240\u0241\7\3\2\2\u0241\u0243\3\2\2\2")
        buf.write("\u0242\u023f\3\2\2\2\u0243\u0246\3\2\2\2\u0244\u0242\3")
        buf.write("\2\2\2\u0244\u0245\3\2\2\2\u0245U\3\2\2\2\u0246\u0244")
        buf.write("\3\2\2\2\u0247\u0249\7Y\2\2\u0248\u0247\3\2\2\2\u0248")
        buf.write("\u0249\3\2\2\2\u0249\u024a\3\2\2\2\u024a\u024b\7-\2\2")
        buf.write("\u024b\u024c\5T+\2\u024cW\3\2\2\2\u024d\u024e\5v<\2\u024e")
        buf.write("\u024f\7\21\2\2\u024f\u0250\5t;\2\u0250\u0259\3\2\2\2")
        buf.write("\u0251\u0259\5`\61\2\u0252\u0259\5d\63\2\u0253\u0259\5")
        buf.write("r:\2\u0254\u0259\5n8\2\u0255\u0256\5|?\2\u0256\u0257\5")
        buf.write("\u0082B\2\u0257\u0259\3\2\2\2\u0258\u024d\3\2\2\2\u0258")
        buf.write("\u0251\3\2\2\2\u0258\u0252\3\2\2\2\u0258\u0253\3\2\2\2")
        buf.write("\u0258\u0254\3\2\2\2\u0258\u0255\3\2\2\2\u0259Y\3\2\2")
        buf.write("\2\u025a\u025b\5X-\2\u025b\u025c\5\u0094K\2\u025c[\3\2")
        buf.write("\2\2\u025d\u0261\5\u0080A\2\u025e\u025f\7+\2\2\u025f\u0262")
        buf.write("\5t;\2\u0260\u0262\5\u0082B\2\u0261\u025e\3\2\2\2\u0261")
        buf.write("\u0260\3\2\2\2\u0262\u0278\3\2\2\2\u0263\u0264\7\23\2")
        buf.write("\2\u0264\u0269\5\u0080A\2\u0265\u0266\7\27\2\2\u0266\u0268")
        buf.write("\5\u0080A\2\u0267\u0265\3\2\2\2\u0268\u026b\3\2\2\2\u0269")
        buf.write("\u0267\3\2\2\2\u0269\u026a\3\2\2\2\u026a\u026c\3\2\2\2")
        buf.write("\u026b\u0269\3\2\2\2\u026c\u026d\7\25\2\2\u026d\u026e")
        buf.write("\7+\2\2\u026e\u026f\5\u0080A\2\u026f\u0270\5\u0082B\2")
        buf.write("\u0270\u0278\3\2\2\2\u0271\u0278\7.\2\2\u0272\u0278\7")
        buf.write("/\2\2\u0273\u0278\5b\62\2\u0274\u0278\5f\64\2\u0275\u0278")
        buf.write("\5l\67\2\u0276\u0278\5p9\2\u0277\u025d\3\2\2\2\u0277\u0263")
        buf.write("\3\2\2\2\u0277\u0271\3\2\2\2\u0277\u0272\3\2\2\2\u0277")
        buf.write("\u0273\3\2\2\2\u0277\u0274\3\2\2\2\u0277\u0275\3\2\2\2")
        buf.write("\u0277\u0276\3\2\2\2\u0278]\3\2\2\2\u0279\u027a\5\\/\2")
        buf.write("\u027a\u027b\5\u0094K\2\u027b_\3\2\2\2\u027c\u027d\7*")
        buf.write("\2\2\u027d\u027e\5t;\2\u027e\u027f\7\60\2\2\u027f\u0287")
        buf.write("\5P)\2\u0280\u0281\7\61\2\2\u0281\u0282\5t;\2\u0282\u0283")
        buf.write("\7\60\2\2\u0283\u0284\5P)\2\u0284\u0286\3\2\2\2\u0285")
        buf.write("\u0280\3\2\2\2\u0286\u0289\3\2\2\2\u0287\u0285\3\2\2\2")
        buf.write("\u0287\u0288\3\2\2\2\u0288\u028c\3\2\2\2\u0289\u0287\3")
        buf.write("\2\2\2\u028a\u028b\7\62\2\2\u028b\u028d\5P)\2\u028c\u028a")
        buf.write("\3\2\2\2\u028c\u028d\3\2\2\2\u028d\u028e\3\2\2\2\u028e")
        buf.write("\u028f\7\20\2\2\u028f\u0290\7*\2\2\u0290a\3\2\2\2\u0291")
        buf.write("\u0292\7*\2\2\u0292\u0293\5t;\2\u0293\u0294\7\60\2\2\u0294")
        buf.write("\u029c\5T+\2\u0295\u0296\7\61\2\2\u0296\u0297\5t;\2\u0297")
        buf.write("\u0298\7\60\2\2\u0298\u0299\5T+\2\u0299\u029b\3\2\2\2")
        buf.write("\u029a\u0295\3\2\2\2\u029b\u029e\3\2\2\2\u029c\u029a\3")
        buf.write("\2\2\2\u029c\u029d\3\2\2\2\u029d\u02a1\3\2\2\2\u029e\u029c")
        buf.write("\3\2\2\2\u029f\u02a0\7\62\2\2\u02a0\u02a2\5T+\2\u02a1")
        buf.write("\u029f\3\2\2\2\u02a1\u02a2\3\2\2\2\u02a2\u02a3\3\2\2\2")
        buf.write("\u02a3\u02a4\7\20\2\2\u02a4\u02a5\7*\2\2\u02a5c\3\2\2")
        buf.write("\2\u02a6\u02a7\7\63\2\2\u02a7\u02a8\5h\65\2\u02a8\u02a9")
        buf.write("\7\64\2\2\u02a9\u02aa\5P)\2\u02aa\u02ab\7\20\2\2\u02ab")
        buf.write("\u02ac\7\63\2\2\u02ace\3\2\2\2\u02ad\u02ae\7\63\2\2\u02ae")
        buf.write("\u02af\5h\65\2\u02af\u02b0\7\64\2\2\u02b0\u02b1\5T+\2")
        buf.write("\u02b1\u02b2\7\20\2\2\u02b2\u02b3\7\63\2\2\u02b3g\3\2")
        buf.write("\2\2\u02b4\u02b9\5j\66\2\u02b5\u02b6\7\27\2\2\u02b6\u02b8")
        buf.write("\5j\66\2\u02b7\u02b5\3\2\2\2\u02b8\u02bb\3\2\2\2\u02b9")
        buf.write("\u02b7\3\2\2\2\u02b9\u02ba\3\2\2\2\u02bai\3\2\2\2\u02bb")
        buf.write("\u02b9\3\2\2\2\u02bc\u02bf\7Z\2\2\u02bd\u02be\7\65\2\2")
        buf.write("\u02be\u02c0\5t;\2\u02bf\u02bd\3\2\2\2\u02bf\u02c0\3\2")
        buf.write("\2\2\u02c0k\3\2\2\2\u02c1\u02c2\7\66\2\2\u02c2\u02c3\5")
        buf.write("t;\2\u02c3\u02c4\7\64\2\2\u02c4\u02c5\5T+\2\u02c5\u02c6")
        buf.write("\7\20\2\2\u02c6\u02c7\7\66\2\2\u02c7m\3\2\2\2\u02c8\u02c9")
        buf.write("\7\67\2\2\u02c9\u02ca\5t;\2\u02ca\u02cb\7\60\2\2\u02cb")
        buf.write("\u02d3\5P)\2\u02cc\u02cd\78\2\2\u02cd\u02ce\5t;\2\u02ce")
        buf.write("\u02cf\7\60\2\2\u02cf\u02d0\5P)\2\u02d0\u02d2\3\2\2\2")
        buf.write("\u02d1\u02cc\3\2\2\2\u02d2\u02d5\3\2\2\2\u02d3\u02d1\3")
        buf.write("\2\2\2\u02d3\u02d4\3\2\2\2\u02d4\u02d6\3\2\2\2\u02d5\u02d3")
        buf.write("\3\2\2\2\u02d6\u02d7\7\20\2\2\u02d7\u02d8\7\67\2\2\u02d8")
        buf.write("o\3\2\2\2\u02d9\u02da\7\67\2\2\u02da\u02db\5t;\2\u02db")
        buf.write("\u02dc\7\60\2\2\u02dc\u02e4\5T+\2\u02dd\u02de\78\2\2\u02de")
        buf.write("\u02df\5t;\2\u02df\u02e0\7\60\2\2\u02e0\u02e1\5T+\2\u02e1")
        buf.write("\u02e3\3\2\2\2\u02e2\u02dd\3\2\2\2\u02e3\u02e6\3\2\2\2")
        buf.write("\u02e4\u02e2\3\2\2\2\u02e4\u02e5\3\2\2\2\u02e5\u02e7\3")
        buf.write("\2\2\2\u02e6\u02e4\3\2\2\2\u02e7\u02e8\7\20\2\2\u02e8")
        buf.write("\u02e9\7\67\2\2\u02e9q\3\2\2\2\u02ea\u02eb\79\2\2\u02eb")
        buf.write("\u02ec\7\23\2\2\u02ec\u02ed\5\u0080A\2\u02ed\u02ee\7\27")
        buf.write("\2\2\u02ee\u02ef\5\u0080A\2\u02ef\u02f0\7\25\2\2\u02f0")
        buf.write("s\3\2\2\2\u02f1\u0304\5v<\2\u02f2\u02f3\7*\2\2\u02f3\u02f4")
        buf.write("\5t;\2\u02f4\u02f5\7\60\2\2\u02f5\u02fd\5t;\2\u02f6\u02f7")
        buf.write("\7\61\2\2\u02f7\u02f8\5t;\2\u02f8\u02f9\7\60\2\2\u02f9")
        buf.write("\u02fa\5t;\2\u02fa\u02fc\3\2\2\2\u02fb\u02f6\3\2\2\2\u02fc")
        buf.write("\u02ff\3\2\2\2\u02fd\u02fb\3\2\2\2\u02fd\u02fe\3\2\2\2")
        buf.write("\u02fe\u0300\3\2\2\2\u02ff\u02fd\3\2\2\2\u0300\u0301\7")
        buf.write("\62\2\2\u0301\u0302\5t;\2\u0302\u0304\3\2\2\2\u0303\u02f1")
        buf.write("\3\2\2\2\u0303\u02f2\3\2\2\2\u0304u\3\2\2\2\u0305\u030c")
        buf.write("\5x=\2\u0306\u0307\7\24\2\2\u0307\u030a\5x=\2\u0308\u0309")
        buf.write("\7\24\2\2\u0309\u030b\5x=\2\u030a\u0308\3\2\2\2\u030a")
        buf.write("\u030b\3\2\2\2\u030b\u030d\3\2\2\2\u030c\u0306\3\2\2\2")
        buf.write("\u030c\u030d\3\2\2\2\u030dw\3\2\2\2\u030e\u030f\b=\1\2")
        buf.write("\u030f\u0310\7:\2\2\u0310\u0319\5x=\13\u0311\u0312\5z")
        buf.write(">\2\u0312\u0313\t\6\2\2\u0313\u0314\5z>\2\u0314\u0319")
        buf.write("\3\2\2\2\u0315\u0316\7I\2\2\u0316\u0319\5x=\6\u0317\u0319")
        buf.write("\5z>\2\u0318\u030e\3\2\2\2\u0318\u0311\3\2\2\2\u0318\u0315")
        buf.write("\3\2\2\2\u0318\u0317\3\2\2\2\u0319\u032b\3\2\2\2\u031a")
        buf.write("\u031b\f\t\2\2\u031b\u031c\t\7\2\2\u031c\u032a\5x=\n\u031d")
        buf.write("\u031e\f\b\2\2\u031e\u031f\t\b\2\2\u031f\u032a\5x=\t\u0320")
        buf.write("\u0321\f\7\2\2\u0321\u0322\t\t\2\2\u0322\u032a\5x=\b\u0323")
        buf.write("\u0324\f\5\2\2\u0324\u0325\7J\2\2\u0325\u032a\5x=\6\u0326")
        buf.write("\u0327\f\4\2\2\u0327\u0328\7K\2\2\u0328\u032a\5x=\5\u0329")
        buf.write("\u031a\3\2\2\2\u0329\u031d\3\2\2\2\u0329\u0320\3\2\2\2")
        buf.write("\u0329\u0323\3\2\2\2\u0329\u0326\3\2\2\2\u032a\u032d\3")
        buf.write("\2\2\2\u032b\u0329\3\2\2\2\u032b\u032c\3\2\2\2\u032cy")
        buf.write("\3\2\2\2\u032d\u032b\3\2\2\2\u032e\u034f\7\\\2\2\u032f")
        buf.write("\u034f\7[\2\2\u0330\u034f\7L\2\2\u0331\u034f\7M\2\2\u0332")
        buf.write("\u0333\5\u0080A\2\u0333\u0334\5\u0082B\2\u0334\u034f\3")
        buf.write("\2\2\2\u0335\u0336\7\26\2\2\u0336\u034f\5\u0082B\2\u0337")
        buf.write("\u0338\7Y\2\2\u0338\u034f\5\u0082B\2\u0339\u034f\5\u0080")
        buf.write("A\2\u033a\u033b\7\23\2\2\u033b\u033c\5\u008cG\2\u033c")
        buf.write("\u033d\7\25\2\2\u033d\u034f\3\2\2\2\u033e\u033f\7N\2\2")
        buf.write("\u033f\u0344\5\u008eH\2\u0340\u0341\7\3\2\2\u0341\u0343")
        buf.write("\5\u008eH\2\u0342\u0340\3\2\2\2\u0343\u0346\3\2\2\2\u0344")
        buf.write("\u0342\3\2\2\2\u0344\u0345\3\2\2\2\u0345\u0347\3\2\2\2")
        buf.write("\u0346\u0344\3\2\2\2\u0347\u0348\7O\2\2\u0348\u034f\3")
        buf.write("\2\2\2\u0349\u034a\7 \2\2\u034a\u034b\5\u0084C\2\u034b")
        buf.write("\u034c\7!\2\2\u034c\u034f\3\2\2\2\u034d\u034f\7\20\2\2")
        buf.write("\u034e\u032e\3\2\2\2\u034e\u032f\3\2\2\2\u034e\u0330\3")
        buf.write("\2\2\2\u034e\u0331\3\2\2\2\u034e\u0332\3\2\2\2\u034e\u0335")
        buf.write("\3\2\2\2\u034e\u0337\3\2\2\2\u034e\u0339\3\2\2\2\u034e")
        buf.write("\u033a\3\2\2\2\u034e\u033e\3\2\2\2\u034e\u0349\3\2\2\2")
        buf.write("\u034e\u034d\3\2\2\2\u034f{\3\2\2\2\u0350\u0352\7\36\2")
        buf.write("\2\u0351\u0350\3\2\2\2\u0351\u0352\3\2\2\2\u0352\u0353")
        buf.write("\3\2\2\2\u0353\u0358\7Z\2\2\u0354\u0355\7\36\2\2\u0355")
        buf.write("\u0357\7Z\2\2\u0356\u0354\3\2\2\2\u0357\u035a\3\2\2\2")
        buf.write("\u0358\u0356\3\2\2\2\u0358\u0359\3\2\2\2\u0359}\3\2\2")
        buf.write("\2\u035a\u0358\3\2\2\2\u035b\u035d\7Z\2\2\u035c\u035e")
        buf.write("\5\u0090I\2\u035d\u035c\3\2\2\2\u035d\u035e\3\2\2\2\u035e")
        buf.write("\177\3\2\2\2\u035f\u0364\5~@\2\u0360\u0361\7\36\2\2\u0361")
        buf.write("\u0363\5~@\2\u0362\u0360\3\2\2\2\u0363\u0366\3\2\2\2\u0364")
        buf.write("\u0362\3\2\2\2\u0364\u0365\3\2\2\2\u0365\u0081\3\2\2\2")
        buf.write("\u0366\u0364\3\2\2\2\u0367\u0369\7\23\2\2\u0368\u036a")
        buf.write("\5\u0084C\2\u0369\u0368\3\2\2\2\u0369\u036a\3\2\2\2\u036a")
        buf.write("\u036b\3\2\2\2\u036b\u036c\7\25\2\2\u036c\u0083\3\2\2")
        buf.write("\2\u036d\u0374\5\u008aF\2\u036e\u036f\7\27\2\2\u036f\u0373")
        buf.write("\5\u008aF\2\u0370\u0371\7\63\2\2\u0371\u0373\5h\65\2\u0372")
        buf.write("\u036e\3\2\2\2\u0372\u0370\3\2\2\2\u0373\u0376\3\2\2\2")
        buf.write("\u0374\u0372\3\2\2\2\u0374\u0375\3\2\2\2\u0375\u0379\3")
        buf.write("\2\2\2\u0376\u0374\3\2\2\2\u0377\u0379\5\u0086D\2\u0378")
        buf.write("\u036d\3\2\2\2\u0378\u0377\3\2\2\2\u0379\u0085\3\2\2\2")
        buf.write("\u037a\u037f\5\u0088E\2\u037b\u037c\7\27\2\2\u037c\u037e")
        buf.write("\5\u0088E\2\u037d\u037b\3\2\2\2\u037e\u0381\3\2\2\2\u037f")
        buf.write("\u037d\3\2\2\2\u037f\u0380\3\2\2\2\u0380\u0087\3\2\2\2")
        buf.write("\u0381\u037f\3\2\2\2\u0382\u0383\7Z\2\2\u0383\u0384\7")
        buf.write("\21\2\2\u0384\u0385\5\u008aF\2\u0385\u0089\3\2\2\2\u0386")
        buf.write("\u0387\7\17\2\2\u0387\u0388\5|?\2\u0388\u038a\7\23\2\2")
        buf.write("\u0389\u038b\5\u0086D\2\u038a\u0389\3\2\2\2\u038a\u038b")
        buf.write("\3\2\2\2\u038b\u038c\3\2\2\2\u038c\u038d\7\25\2\2\u038d")
        buf.write("\u0390\3\2\2\2\u038e\u0390\5t;\2\u038f\u0386\3\2\2\2\u038f")
        buf.write("\u038e\3\2\2\2\u0390\u008b\3\2\2\2\u0391\u0393\5t;\2\u0392")
        buf.write("\u0391\3\2\2\2\u0392\u0393\3\2\2\2\u0393\u0398\3\2\2\2")
        buf.write("\u0394\u0395\7\27\2\2\u0395\u0397\5t;\2\u0396\u0394\3")
        buf.write("\2\2\2\u0397\u039a\3\2\2\2\u0398\u0396\3\2\2\2\u0398\u0399")
        buf.write("\3\2\2\2\u0399\u008d\3\2\2\2\u039a\u0398\3\2\2\2\u039b")
        buf.write("\u03a0\5t;\2\u039c\u039d\7\27\2\2\u039d\u039f\5t;\2\u039e")
        buf.write("\u039c\3\2\2\2\u039f\u03a2\3\2\2\2\u03a0\u039e\3\2\2\2")
        buf.write("\u03a0\u03a1\3\2\2\2\u03a1\u008f\3\2\2\2\u03a2\u03a0\3")
        buf.write("\2\2\2\u03a3\u03a4\7N\2\2\u03a4\u03a9\5\u0092J\2\u03a5")
        buf.write("\u03a6\7\27\2\2\u03a6\u03a8\5\u0092J\2\u03a7\u03a5\3\2")
        buf.write("\2\2\u03a8\u03ab\3\2\2\2\u03a9\u03a7\3\2\2\2\u03a9\u03aa")
        buf.write("\3\2\2\2\u03aa\u03ac\3\2\2\2\u03ab\u03a9\3\2\2\2\u03ac")
        buf.write("\u03ad\7O\2\2\u03ad\u0091\3\2\2\2\u03ae\u03b1\7\24\2\2")
        buf.write("\u03af\u03b1\5t;\2\u03b0\u03ae\3\2\2\2\u03b0\u03af\3\2")
        buf.write("\2\2\u03b1\u0093\3\2\2\2\u03b2\u03b4\5\u0096L\2\u03b3")
        buf.write("\u03b5\5\u0098M\2\u03b4\u03b3\3\2\2\2\u03b4\u03b5\3\2")
        buf.write("\2\2\u03b5\u0095\3\2\2\2\u03b6\u03bb\7[\2\2\u03b7\u03b8")
        buf.write("\7@\2\2\u03b8\u03ba\7[\2\2\u03b9\u03b7\3\2\2\2\u03ba\u03bd")
        buf.write("\3\2\2\2\u03bb\u03b9\3\2\2\2\u03bb\u03bc\3\2\2\2\u03bc")
        buf.write("\u03bf\3\2\2\2\u03bd\u03bb\3\2\2\2\u03be\u03b6\3\2\2\2")
        buf.write("\u03be\u03bf\3\2\2\2\u03bf\u0097\3\2\2\2\u03c0\u03c1\7")
        buf.write("P\2\2\u03c1\u03c2\5<\37\2\u03c2\u0099\3\2\2\2z\u009c\u009f")
        buf.write("\u00a4\u00a8\u00ae\u00b4\u00bb\u00c0\u00c6\u00c9\u00cd")
        buf.write("\u00da\u00e3\u00e6\u00f5\u00fe\u0105\u010e\u011b\u011d")
        buf.write("\u0122\u0125\u0128\u012b\u0130\u0137\u013c\u0145\u014c")
        buf.write("\u014f\u0152\u0155\u0158\u015c\u015f\u0162\u0165\u0168")
        buf.write("\u016d\u0172\u017f\u0181\u0183\u018c\u0192\u0195\u019a")
        buf.write("\u019f\u01a4\u01a7\u01aa\u01b3\u01bb\u01c0\u01c9\u01cc")
        buf.write("\u01d1\u01d7\u01db\u01e4\u01e9\u01ec\u01ef\u01f3\u01f7")
        buf.write("\u01fd\u0200\u0204\u0207\u020c\u020f\u021e\u0221\u0228")
        buf.write("\u022b\u022f\u0236\u023a\u0244\u0248\u0258\u0261\u0269")
        buf.write("\u0277\u0287\u028c\u029c\u02a1\u02b9\u02bf\u02d3\u02e4")
        buf.write("\u02fd\u0303\u030a\u030c\u0318\u0329\u032b\u0344\u034e")
        buf.write("\u0351\u0358\u035d\u0364\u0369\u0372\u0374\u0378\u037f")
        buf.write("\u038a\u038f\u0392\u0398\u03a0\u03a9\u03b0\u03b4\u03bb")
        buf.write("\u03be")
        return buf.getvalue()


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

    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>", "EACH", "PARTIAL", 
                      "FINAL", "WITHIN", "ENCAPSULATED", "REDECLARE", "INNER", 
                      "OUTER", "INITIAL", "IDENT", "STRING", "UNSIGNED_NUMBER", 
                      "COMMENT", "WS" ]

    RULE_stored_definition = 0
    RULE_stored_definition_class = 1
    RULE_class_definition = 2
    RULE_class_prefixes = 3
    RULE_class_type = 4
    RULE_class_specifier = 5
    RULE_base_prefix = 6
    RULE_enum_list = 7
    RULE_enumeration_literal = 8
    RULE_composition = 9
    RULE_language_specification = 10
    RULE_external_function_call = 11
    RULE_element_list = 12
    RULE_element = 13
    RULE_regular_element = 14
    RULE_replaceable_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_element = 22
    RULE_type_specifier = 23
    RULE_component_list = 24
    RULE_component_declaration = 25
    RULE_condition_attribute = 26
    RULE_declaration = 27
    RULE_modification = 28
    RULE_class_modification = 29
    RULE_argument_list = 30
    RULE_argument = 31
    RULE_element_modification_or_replaceable = 32
    RULE_element_modification = 33
    RULE_element_redeclaration = 34
    RULE_element_replaceable = 35
    RULE_component_clause1 = 36
    RULE_component_declaration1 = 37
    RULE_short_class_definition = 38
    RULE_equation_block = 39
    RULE_equation_section = 40
    RULE_statement_block = 41
    RULE_algorithm_section = 42
    RULE_equation_options = 43
    RULE_equation = 44
    RULE_statement_options = 45
    RULE_statement = 46
    RULE_if_equation = 47
    RULE_if_statement = 48
    RULE_for_equation = 49
    RULE_for_statement = 50
    RULE_for_indices = 51
    RULE_for_index = 52
    RULE_while_statement = 53
    RULE_when_equation = 54
    RULE_when_statement = 55
    RULE_connect_clause = 56
    RULE_expression = 57
    RULE_simple_expression = 58
    RULE_expr = 59
    RULE_primary = 60
    RULE_name = 61
    RULE_component_reference_element = 62
    RULE_component_reference = 63
    RULE_function_call_args = 64
    RULE_function_arguments = 65
    RULE_named_arguments = 66
    RULE_named_argument = 67
    RULE_function_argument = 68
    RULE_output_expression_list = 69
    RULE_expression_list = 70
    RULE_array_subscripts = 71
    RULE_subscript = 72
    RULE_comment = 73
    RULE_string_comment = 74
    RULE_annotation = 75

    ruleNames =  [ "stored_definition", "stored_definition_class", "class_definition", 
                   "class_prefixes", "class_type", "class_specifier", "base_prefix", 
                   "enum_list", "enumeration_literal", "composition", "language_specification", 
                   "external_function_call", "element_list", "element", 
                   "regular_element", "replaceable_element", "import_clause", 
                   "import_list", "extends_clause", "constraining_clause", 
                   "component_clause", "type_prefix", "type_specifier_element", 
                   "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_block", "equation_section", "statement_block", 
                   "algorithm_section", "equation_options", "equation", 
                   "statement_options", "statement", "if_equation", "if_statement", 
                   "for_equation", "for_statement", "for_indices", "for_index", 
                   "while_statement", "when_equation", "when_statement", 
                   "connect_clause", "expression", "simple_expression", 
                   "expr", "primary", "name", "component_reference_element", 
                   "component_reference", "function_call_args", "function_arguments", 
                   "named_arguments", "named_argument", "function_argument", 
                   "output_expression_list", "expression_list", "array_subscripts", 
                   "subscript", "comment", "string_comment", "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
    EACH=79
    PARTIAL=80
    FINAL=81
    WITHIN=82
    ENCAPSULATED=83
    REDECLARE=84
    INNER=85
    OUTER=86
    INITIAL=87
    IDENT=88
    STRING=89
    UNSIGNED_NUMBER=90
    COMMENT=91
    WS=92

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



    class Stored_definitionContext(ParserRuleContext):

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

        def WITHIN(self):
            return self.getToken(ModelicaParser.WITHIN, 0)

        def stored_definition_class(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ModelicaParser.Stored_definition_classContext)
            else:
                return self.getTypedRuleContext(ModelicaParser.Stored_definition_classContext,i)


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


        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitStored_definition" ):
                return visitor.visitStored_definition(self)
            else:
                return visitor.visitChildren(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 = 157
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.WITHIN:
                self.state = 152
                self.match(ModelicaParser.WITHIN)
                self.state = 154
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.IDENT:
                    self.state = 153
                    self.component_reference()


                self.state = 156
                self.match(ModelicaParser.T__0)


            self.state = 162
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ModelicaParser.T__1) | (1 << ModelicaParser.T__2) | (1 << ModelicaParser.T__3) | (1 << ModelicaParser.T__4) | (1 << ModelicaParser.T__5) | (1 << ModelicaParser.T__6) | (1 << ModelicaParser.T__7) | (1 << ModelicaParser.T__8) | (1 << ModelicaParser.T__9) | (1 << ModelicaParser.T__10) | (1 << ModelicaParser.T__11) | (1 << ModelicaParser.T__12))) != 0) or ((((_la - 80)) & ~0x3f) == 0 and ((1 << (_la - 80)) & ((1 << (ModelicaParser.PARTIAL - 80)) | (1 << (ModelicaParser.FINAL - 80)) | (1 << (ModelicaParser.ENCAPSULATED - 80)))) != 0):
                self.state = 159
                self.stored_definition_class()
                self.state = 164
                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 Stored_definition_classContext(ParserRuleContext):

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

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


        def FINAL(self):
            return self.getToken(ModelicaParser.FINAL, 0)

        def getRuleIndex(self):
            return ModelicaParser.RULE_stored_definition_class

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitStored_definition_class" ):
                return visitor.visitStored_definition_class(self)
            else:
                return visitor.visitChildren(self)




    def stored_definition_class(self):

        localctx = ModelicaParser.Stored_definition_classContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_stored_definition_class)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 166
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.FINAL:
                self.state = 165
                self.match(ModelicaParser.FINAL)


            self.state = 168
            self.class_definition()
            self.state = 169
            self.match(ModelicaParser.T__0)
        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):

        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 ENCAPSULATED(self):
            return self.getToken(ModelicaParser.ENCAPSULATED, 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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitClass_definition" ):
                return visitor.visitClass_definition(self)
            else:
                return visitor.visitChildren(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 = 172
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.ENCAPSULATED:
                self.state = 171
                self.match(ModelicaParser.ENCAPSULATED)


            self.state = 174
            self.class_prefixes()
            self.state = 175
            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_prefixesContext(ParserRuleContext):

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

        def class_type(self):
            return self.getTypedRuleContext(ModelicaParser.Class_typeContext,0)


        def PARTIAL(self):
            return self.getToken(ModelicaParser.PARTIAL, 0)

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitClass_prefixes" ):
                return visitor.visitClass_prefixes(self)
            else:
                return visitor.visitChildren(self)




    def class_prefixes(self):

        localctx = ModelicaParser.Class_prefixesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_class_prefixes)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 178
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.PARTIAL:
                self.state = 177
                self.match(ModelicaParser.PARTIAL)


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

    class Class_typeContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return ModelicaParser.RULE_class_type

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitClass_type" ):
                return visitor.visitClass_type(self)
            else:
                return visitor.visitChildren(self)




    def class_type(self):

        localctx = ModelicaParser.Class_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_class_type)
        self._la = 0 # Token type
        try:
            self.state = 203
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,10,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 182
                self.match(ModelicaParser.T__1)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 183
                self.match(ModelicaParser.T__2)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 185
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.T__3:
                    self.state = 184
                    self.match(ModelicaParser.T__3)


                self.state = 187
                self.match(ModelicaParser.T__4)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 188
                self.match(ModelicaParser.T__5)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 190
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.T__6:
                    self.state = 189
                    self.match(ModelicaParser.T__6)


                self.state = 192
                self.match(ModelicaParser.T__7)
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 193
                self.match(ModelicaParser.T__8)
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 194
                self.match(ModelicaParser.T__9)
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 196
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.T__10 or _la==ModelicaParser.T__11:
                    self.state = 195
                    _la = self._input.LA(1)
                    if not(_la==ModelicaParser.T__10 or _la==ModelicaParser.T__11):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 199
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.T__3:
                    self.state = 198
                    self.match(ModelicaParser.T__3)


                self.state = 201
                self.match(ModelicaParser.T__12)
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 202
                self.match(ModelicaParser.T__3)
                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_specifierContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return ModelicaParser.RULE_class_specifier

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



    class Class_spec_derContext(Class_specifierContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Class_specifierContext
            super().__init__(parser)
            self.copyFrom(ctx)

        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 enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterClass_spec_der" ):
                listener.enterClass_spec_der(self)

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitClass_spec_der" ):
                return visitor.visitClass_spec_der(self)
            else:
                return visitor.visitChildren(self)


    class Class_spec_enumContext(Class_specifierContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Class_specifierContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def IDENT(self):
            return self.getToken(ModelicaParser.IDENT, 0)
        def comment(self):
            return self.getTypedRuleContext(ModelicaParser.CommentContext,0)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitClass_spec_enum" ):
                return visitor.visitClass_spec_enum(self)
            else:
                return visitor.visitChildren(self)


    class Class_spec_baseContext(Class_specifierContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Class_specifierContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def IDENT(self):
            return self.getToken(ModelicaParser.IDENT, 0)
        def base_prefix(self):
            return self.getTypedRuleContext(ModelicaParser.Base_prefixContext,0)

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

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

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitClass_spec_base" ):
                return visitor.visitClass_spec_base(self)
            else:
                return visitor.visitChildren(self)


    class Class_spec_compContext(Class_specifierContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Class_specifierContext
            super().__init__(parser)
            self.copyFrom(ctx)

        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 enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterClass_spec_comp" ):
                listener.enterClass_spec_comp(self)

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitClass_spec_comp" ):
                return visitor.visitClass_spec_comp(self)
            else:
                return visitor.visitChildren(self)


    class Class_spec_extendsContext(Class_specifierContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Class_specifierContext
            super().__init__(parser)
            self.copyFrom(ctx)

        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 enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterClass_spec_extends" ):
                listener.enterClass_spec_extends(self)

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitClass_spec_extends" ):
                return visitor.visitClass_spec_extends(self)
            else:
                return visitor.visitChildren(self)



    def class_specifier(self):

        localctx = ModelicaParser.Class_specifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_class_specifier)
        self._la = 0 # Token type
        try:
            self.state = 259
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,16,self._ctx)
            if la_ == 1:
                localctx = ModelicaParser.Class_spec_compContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 205
                self.match(ModelicaParser.IDENT)
                self.state = 206
                self.string_comment()
                self.state = 207
                self.composition()
                self.state = 208
                self.match(ModelicaParser.T__13)
                self.state = 209
                self.match(ModelicaParser.IDENT)
                pass

            elif la_ == 2:
                localctx = ModelicaParser.Class_spec_baseContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 211
                self.match(ModelicaParser.IDENT)
                self.state = 212
                self.match(ModelicaParser.T__14)
                self.state = 213
                self.base_prefix()
                self.state = 214
                self.component_reference()
                self.state = 216
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.T__16:
                    self.state = 215
                    self.class_modification()


                self.state = 218
                self.comment()
                pass

            elif la_ == 3:
                localctx = ModelicaParser.Class_spec_enumContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 220
                self.match(ModelicaParser.IDENT)
                self.state = 221
                self.match(ModelicaParser.T__14)
                self.state = 222
                self.match(ModelicaParser.T__15)
                self.state = 223
                self.match(ModelicaParser.T__16)
                self.state = 228
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [ModelicaParser.T__18, ModelicaParser.IDENT]:
                    self.state = 225
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==ModelicaParser.IDENT:
                        self.state = 224
                        self.enum_list()


                    pass
                elif token in [ModelicaParser.T__17]:
                    self.state = 227
                    self.match(ModelicaParser.T__17)
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 230
                self.match(ModelicaParser.T__18)
                self.state = 231
                self.comment()
                pass

            elif la_ == 4:
                localctx = ModelicaParser.Class_spec_derContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 232
                self.match(ModelicaParser.IDENT)
                self.state = 233
                self.match(ModelicaParser.T__14)
                self.state = 234
                self.match(ModelicaParser.T__19)
                self.state = 235
                self.match(ModelicaParser.T__16)
                self.state = 236
                self.name()
                self.state = 237
                self.match(ModelicaParser.T__20)
                self.state = 238
                self.match(ModelicaParser.IDENT)
                self.state = 243
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==ModelicaParser.T__20:
                    self.state = 239
                    self.match(ModelicaParser.T__20)
                    self.state = 240
                    self.match(ModelicaParser.IDENT)
                    self.state = 245
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 246
                self.match(ModelicaParser.T__18)
                self.state = 247
                self.comment()
                pass

            elif la_ == 5:
                localctx = ModelicaParser.Class_spec_extendsContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 249
                self.match(ModelicaParser.T__21)
                self.state = 250
                self.match(ModelicaParser.IDENT)
                self.state = 252
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.T__16:
                    self.state = 251
                    self.class_modification()


                self.state = 254
                self.string_comment()
                self.state = 255
                self.composition()
                self.state = 256
                self.match(ModelicaParser.T__13)
                self.state = 257
                self.match(ModelicaParser.IDENT)
                pass


        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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitBase_prefix" ):
                return visitor.visitBase_prefix(self)
            else:
                return visitor.visitChildren(self)




    def base_prefix(self):

        localctx = ModelicaParser.Base_prefixContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_base_prefix)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 261
            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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitEnum_list" ):
                return visitor.visitEnum_list(self)
            else:
                return visitor.visitChildren(self)




    def enum_list(self):

        localctx = ModelicaParser.Enum_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_enum_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 263
            self.enumeration_literal()
            self.state = 268
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__20:
                self.state = 264
                self.match(ModelicaParser.T__20)
                self.state = 265
                self.enumeration_literal()
                self.state = 270
                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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitEnumeration_literal" ):
                return visitor.visitEnumeration_literal(self)
            else:
                return visitor.visitChildren(self)




    def enumeration_literal(self):

        localctx = ModelicaParser.Enumeration_literalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_enumeration_literal)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 271
            self.match(ModelicaParser.IDENT)
            self.state = 272
            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):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.epriv = None # Element_listContext
            self.epub = None # Element_listContext
            self.epro = None # Element_listContext
            self.ext_annotation = None # AnnotationContext
            self.comp_annotation = None # AnnotationContext

        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 annotation(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ModelicaParser.AnnotationContext)
            else:
                return self.getTypedRuleContext(ModelicaParser.AnnotationContext,i)


        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 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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitComposition" ):
                return visitor.visitComposition(self)
            else:
                return visitor.visitChildren(self)




    def composition(self):

        localctx = ModelicaParser.CompositionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_composition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 274
            localctx.epriv = self.element_list()
            self.state = 283
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ModelicaParser.T__22) | (1 << ModelicaParser.T__23) | (1 << ModelicaParser.T__41) | (1 << ModelicaParser.T__42))) != 0) or _la==ModelicaParser.INITIAL:
                self.state = 281
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,18,self._ctx)
                if la_ == 1:
                    self.state = 275
                    self.match(ModelicaParser.T__22)
                    self.state = 276
                    localctx.epub = self.element_list()
                    pass

                elif la_ == 2:
                    self.state = 277
                    self.match(ModelicaParser.T__23)
                    self.state = 278
                    localctx.epro = self.element_list()
                    pass

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

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


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

            self.state = 297
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__24:
                self.state = 286
                self.match(ModelicaParser.T__24)
                self.state = 288
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.STRING:
                    self.state = 287
                    self.language_specification()


                self.state = 291
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.IDENT:
                    self.state = 290
                    self.external_function_call()


                self.state = 294
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.T__77:
                    self.state = 293
                    localctx.ext_annotation = self.annotation()


                self.state = 296
                self.match(ModelicaParser.T__0)


            self.state = 302
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__77:
                self.state = 299
                localctx.comp_annotation = self.annotation()
                self.state = 300
                self.match(ModelicaParser.T__0)


        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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitLanguage_specification" ):
                return visitor.visitLanguage_specification(self)
            else:
                return visitor.visitChildren(self)




    def language_specification(self):

        localctx = ModelicaParser.Language_specificationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_language_specification)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 304
            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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExternal_function_call" ):
                return visitor.visitExternal_function_call(self)
            else:
                return visitor.visitChildren(self)




    def external_function_call(self):

        localctx = ModelicaParser.External_function_callContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_external_function_call)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 309
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,25,self._ctx)
            if la_ == 1:
                self.state = 306
                self.component_reference()
                self.state = 307
                self.match(ModelicaParser.T__14)


            self.state = 311
            self.match(ModelicaParser.IDENT)
            self.state = 312
            self.match(ModelicaParser.T__16)
            self.state = 314
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ModelicaParser.T__13) | (1 << ModelicaParser.T__16) | (1 << ModelicaParser.T__19) | (1 << ModelicaParser.T__29) | (1 << ModelicaParser.T__39) | (1 << ModelicaParser.T__55))) != 0) or ((((_la - 71)) & ~0x3f) == 0 and ((1 << (_la - 71)) & ((1 << (ModelicaParser.T__70 - 71)) | (1 << (ModelicaParser.T__73 - 71)) | (1 << (ModelicaParser.T__74 - 71)) | (1 << (ModelicaParser.T__75 - 71)) | (1 << (ModelicaParser.INITIAL - 71)) | (1 << (ModelicaParser.IDENT - 71)) | (1 << (ModelicaParser.STRING - 71)) | (1 << (ModelicaParser.UNSIGNED_NUMBER - 71)))) != 0):
                self.state = 313
                self.expression_list()


            self.state = 316
            self.match(ModelicaParser.T__18)
        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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitElement_list" ):
                return visitor.visitElement_list(self)
            else:
                return visitor.visitChildren(self)




    def element_list(self):

        localctx = ModelicaParser.Element_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_element_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 323
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ModelicaParser.T__1) | (1 << ModelicaParser.T__2) | (1 << ModelicaParser.T__3) | (1 << ModelicaParser.T__4) | (1 << ModelicaParser.T__5) | (1 << ModelicaParser.T__6) | (1 << ModelicaParser.T__7) | (1 << ModelicaParser.T__8) | (1 << ModelicaParser.T__9) | (1 << ModelicaParser.T__10) | (1 << ModelicaParser.T__11) | (1 << ModelicaParser.T__12) | (1 << ModelicaParser.T__21) | (1 << ModelicaParser.T__25) | (1 << ModelicaParser.T__26) | (1 << ModelicaParser.T__32) | (1 << ModelicaParser.T__33) | (1 << ModelicaParser.T__34) | (1 << ModelicaParser.T__35) | (1 << ModelicaParser.T__36) | (1 << ModelicaParser.T__37) | (1 << ModelicaParser.T__38))) != 0) or ((((_la - 80)) & ~0x3f) == 0 and ((1 << (_la - 80)) & ((1 << (ModelicaParser.PARTIAL - 80)) | (1 << (ModelicaParser.FINAL - 80)) | (1 << (ModelicaParser.ENCAPSULATED - 80)) | (1 << (ModelicaParser.REDECLARE - 80)) | (1 << (ModelicaParser.INNER - 80)) | (1 << (ModelicaParser.OUTER - 80)) | (1 << (ModelicaParser.IDENT - 80)))) != 0):
                self.state = 318
                self.element()
                self.state = 319
                self.match(ModelicaParser.T__0)
                self.state = 325
                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):

        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 regular_element(self):
            return self.getTypedRuleContext(ModelicaParser.Regular_elementContext,0)


        def replaceable_element(self):
            return self.getTypedRuleContext(ModelicaParser.Replaceable_elementContext,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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitElement" ):
                return visitor.visitElement(self)
            else:
                return visitor.visitChildren(self)




    def element(self):

        localctx = ModelicaParser.ElementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_element)
        try:
            self.state = 330
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,28,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 326
                self.import_clause()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 327
                self.extends_clause()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 328
                self.regular_element()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 329
                self.replaceable_element()
                pass


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

    class Regular_elementContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.class_elem = None # Class_definitionContext
            self.comp_elem = None # Component_clauseContext

        def REDECLARE(self):
            return self.getToken(ModelicaParser.REDECLARE, 0)

        def FINAL(self):
            return self.getToken(ModelicaParser.FINAL, 0)

        def INNER(self):
            return self.getToken(ModelicaParser.INNER, 0)

        def OUTER(self):
            return self.getToken(ModelicaParser.OUTER, 0)

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


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


        def getRuleIndex(self):
            return ModelicaParser.RULE_regular_element

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitRegular_element" ):
                return visitor.visitRegular_element(self)
            else:
                return visitor.visitChildren(self)




    def regular_element(self):

        localctx = ModelicaParser.Regular_elementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_regular_element)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 333
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.REDECLARE:
                self.state = 332
                self.match(ModelicaParser.REDECLARE)


            self.state = 336
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.FINAL:
                self.state = 335
                self.match(ModelicaParser.FINAL)


            self.state = 339
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.INNER:
                self.state = 338
                self.match(ModelicaParser.INNER)


            self.state = 342
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.OUTER:
                self.state = 341
                self.match(ModelicaParser.OUTER)


            self.state = 346
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [ModelicaParser.T__1, ModelicaParser.T__2, ModelicaParser.T__3, ModelicaParser.T__4, ModelicaParser.T__5, ModelicaParser.T__6, ModelicaParser.T__7, ModelicaParser.T__8, ModelicaParser.T__9, ModelicaParser.T__10, ModelicaParser.T__11, ModelicaParser.T__12, ModelicaParser.PARTIAL, ModelicaParser.ENCAPSULATED]:
                self.state = 344
                localctx.class_elem = self.class_definition()
                pass
            elif token in [ModelicaParser.T__32, ModelicaParser.T__33, ModelicaParser.T__34, ModelicaParser.T__35, ModelicaParser.T__36, ModelicaParser.T__37, ModelicaParser.T__38, ModelicaParser.IDENT]:
                self.state = 345
                localctx.comp_elem = self.component_clause()
                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 Replaceable_elementContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.class_elem = None # Class_definitionContext
            self.comp_elem = None # Component_clauseContext

        def REDECLARE(self):
            return self.getToken(ModelicaParser.REDECLARE, 0)

        def FINAL(self):
            return self.getToken(ModelicaParser.FINAL, 0)

        def INNER(self):
            return self.getToken(ModelicaParser.INNER, 0)

        def OUTER(self):
            return self.getToken(ModelicaParser.OUTER, 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_replaceable_element

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitReplaceable_element" ):
                return visitor.visitReplaceable_element(self)
            else:
                return visitor.visitChildren(self)




    def replaceable_element(self):

        localctx = ModelicaParser.Replaceable_elementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_replaceable_element)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 349
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.REDECLARE:
                self.state = 348
                self.match(ModelicaParser.REDECLARE)


            self.state = 352
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.FINAL:
                self.state = 351
                self.match(ModelicaParser.FINAL)


            self.state = 355
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.INNER:
                self.state = 354
                self.match(ModelicaParser.INNER)


            self.state = 358
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.OUTER:
                self.state = 357
                self.match(ModelicaParser.OUTER)


            self.state = 360
            self.match(ModelicaParser.T__25)
            self.state = 363
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [ModelicaParser.T__1, ModelicaParser.T__2, ModelicaParser.T__3, ModelicaParser.T__4, ModelicaParser.T__5, ModelicaParser.T__6, ModelicaParser.T__7, ModelicaParser.T__8, ModelicaParser.T__9, ModelicaParser.T__10, ModelicaParser.T__11, ModelicaParser.T__12, ModelicaParser.PARTIAL, ModelicaParser.ENCAPSULATED]:
                self.state = 361
                localctx.class_elem = self.class_definition()
                pass
            elif token in [ModelicaParser.T__32, ModelicaParser.T__33, ModelicaParser.T__34, ModelicaParser.T__35, ModelicaParser.T__36, ModelicaParser.T__37, ModelicaParser.T__38, ModelicaParser.IDENT]:
                self.state = 362
                localctx.comp_elem = self.component_clause()
                pass
            else:
                raise NoViableAltException(self)

            self.state = 368
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__31:
                self.state = 365
                self.constraining_clause()
                self.state = 366
                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_clauseContext(ParserRuleContext):

        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 component_reference(self):
            return self.getTypedRuleContext(ModelicaParser.Component_referenceContext,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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitImport_clause" ):
                return visitor.visitImport_clause(self)
            else:
                return visitor.visitChildren(self)




    def import_clause(self):

        localctx = ModelicaParser.Import_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_import_clause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 370
            self.match(ModelicaParser.T__26)
            self.state = 385
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,42,self._ctx)
            if la_ == 1:
                self.state = 371
                self.match(ModelicaParser.IDENT)
                self.state = 372
                self.match(ModelicaParser.T__14)
                self.state = 373
                self.component_reference()
                pass

            elif la_ == 2:
                self.state = 374
                self.component_reference()
                self.state = 383
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.T__27:
                    self.state = 375
                    self.match(ModelicaParser.T__27)
                    self.state = 381
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [ModelicaParser.T__28]:
                        self.state = 376
                        self.match(ModelicaParser.T__28)
                        pass
                    elif token in [ModelicaParser.T__29]:
                        self.state = 377
                        self.match(ModelicaParser.T__29)
                        self.state = 378
                        self.import_list()
                        self.state = 379
                        self.match(ModelicaParser.T__30)
                        pass
                    else:
                        raise NoViableAltException(self)



                pass


            self.state = 387
            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):

        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 import_list(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ModelicaParser.Import_listContext)
            else:
                return self.getTypedRuleContext(ModelicaParser.Import_listContext,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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitImport_list" ):
                return visitor.visitImport_list(self)
            else:
                return visitor.visitChildren(self)




    def import_list(self):

        localctx = ModelicaParser.Import_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_import_list)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 389
            self.match(ModelicaParser.IDENT)
            self.state = 394
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,43,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 390
                    self.match(ModelicaParser.T__20)
                    self.state = 391
                    self.import_list() 
                self.state = 396
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,43,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 Extends_clauseContext(ParserRuleContext):

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

        def component_reference(self):
            return self.getTypedRuleContext(ModelicaParser.Component_referenceContext,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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExtends_clause" ):
                return visitor.visitExtends_clause(self)
            else:
                return visitor.visitChildren(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 = 397
            self.match(ModelicaParser.T__21)
            self.state = 398
            self.component_reference()
            self.state = 400
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__16:
                self.state = 399
                self.class_modification()


            self.state = 403
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__77:
                self.state = 402
                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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitConstraining_clause" ):
                return visitor.visitConstraining_clause(self)
            else:
                return visitor.visitChildren(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 = 405
            self.match(ModelicaParser.T__31)
            self.state = 406
            self.name()
            self.state = 408
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__16:
                self.state = 407
                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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitComponent_clause" ):
                return visitor.visitComponent_clause(self)
            else:
                return visitor.visitChildren(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 = 410
            self.type_prefix()
            self.state = 411
            self.type_specifier()
            self.state = 413
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__75:
                self.state = 412
                self.array_subscripts()


            self.state = 415
            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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitType_prefix" ):
                return visitor.visitType_prefix(self)
            else:
                return visitor.visitChildren(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 = 418
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__32 or _la==ModelicaParser.T__33:
                self.state = 417
                _la = self._input.LA(1)
                if not(_la==ModelicaParser.T__32 or _la==ModelicaParser.T__33):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


            self.state = 421
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ModelicaParser.T__34) | (1 << ModelicaParser.T__35) | (1 << ModelicaParser.T__36))) != 0):
                self.state = 420
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ModelicaParser.T__34) | (1 << ModelicaParser.T__35) | (1 << ModelicaParser.T__36))) != 0)):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


            self.state = 424
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__37 or _la==ModelicaParser.T__38:
                self.state = 423
                _la = self._input.LA(1)
                if not(_la==ModelicaParser.T__37 or _la==ModelicaParser.T__38):
                    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_specifier_elementContext(ParserRuleContext):

        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 getRuleIndex(self):
            return ModelicaParser.RULE_type_specifier_element

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitType_specifier_element" ):
                return visitor.visitType_specifier_element(self)
            else:
                return visitor.visitChildren(self)




    def type_specifier_element(self):

        localctx = ModelicaParser.Type_specifier_elementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_type_specifier_element)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 426
            self.match(ModelicaParser.IDENT)
        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):

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

        def type_specifier_element(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ModelicaParser.Type_specifier_elementContext)
            else:
                return self.getTypedRuleContext(ModelicaParser.Type_specifier_elementContext,i)


        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitType_specifier" ):
                return visitor.visitType_specifier(self)
            else:
                return visitor.visitChildren(self)




    def type_specifier(self):

        localctx = ModelicaParser.Type_specifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 46, self.RULE_type_specifier)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 428
            self.type_specifier_element()
            self.state = 433
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__27:
                self.state = 429
                self.match(ModelicaParser.T__27)
                self.state = 430
                self.type_specifier_element()
                self.state = 435
                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_listContext(ParserRuleContext):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitComponent_list" ):
                return visitor.visitComponent_list(self)
            else:
                return visitor.visitChildren(self)




    def component_list(self):

        localctx = ModelicaParser.Component_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_component_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 436
            self.component_declaration()
            self.state = 441
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__20:
                self.state = 437
                self.match(ModelicaParser.T__20)
                self.state = 438
                self.component_declaration()
                self.state = 443
                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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitComponent_declaration" ):
                return visitor.visitComponent_declaration(self)
            else:
                return visitor.visitChildren(self)




    def component_declaration(self):

        localctx = ModelicaParser.Component_declarationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 50, self.RULE_component_declaration)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 444
            self.declaration()
            self.state = 446
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__39:
                self.state = 445
                self.condition_attribute()


            self.state = 448
            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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitCondition_attribute" ):
                return visitor.visitCondition_attribute(self)
            else:
                return visitor.visitChildren(self)




    def condition_attribute(self):

        localctx = ModelicaParser.Condition_attributeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 52, self.RULE_condition_attribute)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 450
            self.match(ModelicaParser.T__39)
            self.state = 451
            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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitDeclaration" ):
                return visitor.visitDeclaration(self)
            else:
                return visitor.visitChildren(self)




    def declaration(self):

        localctx = ModelicaParser.DeclarationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 54, self.RULE_declaration)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 453
            self.match(ModelicaParser.IDENT)
            self.state = 455
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__75:
                self.state = 454
                self.array_subscripts()


            self.state = 458
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ModelicaParser.T__14) | (1 << ModelicaParser.T__16) | (1 << ModelicaParser.T__40))) != 0):
                self.state = 457
                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):

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


        def getRuleIndex(self):
            return ModelicaParser.RULE_modification

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



    class Modification_classContext(ModificationContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.ModificationContext
            super().__init__(parser)
            self.copyFrom(ctx)

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

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitModification_class" ):
                return visitor.visitModification_class(self)
            else:
                return visitor.visitChildren(self)


    class Modification_assignment2Context(ModificationContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.ModificationContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitModification_assignment2" ):
                return visitor.visitModification_assignment2(self)
            else:
                return visitor.visitChildren(self)


    class Modification_assignmentContext(ModificationContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.ModificationContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitModification_assignment" ):
                return visitor.visitModification_assignment(self)
            else:
                return visitor.visitChildren(self)



    def modification(self):

        localctx = ModelicaParser.ModificationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 56, self.RULE_modification)
        self._la = 0 # Token type
        try:
            self.state = 469
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [ModelicaParser.T__16]:
                localctx = ModelicaParser.Modification_classContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 460
                self.class_modification()
                self.state = 463
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.T__14:
                    self.state = 461
                    self.match(ModelicaParser.T__14)
                    self.state = 462
                    self.expression()


                pass
            elif token in [ModelicaParser.T__14]:
                localctx = ModelicaParser.Modification_assignmentContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 465
                self.match(ModelicaParser.T__14)
                self.state = 466
                self.expression()
                pass
            elif token in [ModelicaParser.T__40]:
                localctx = ModelicaParser.Modification_assignment2Context(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 467
                self.match(ModelicaParser.T__40)
                self.state = 468
                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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitClass_modification" ):
                return visitor.visitClass_modification(self)
            else:
                return visitor.visitChildren(self)




    def class_modification(self):

        localctx = ModelicaParser.Class_modificationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 58, self.RULE_class_modification)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 471
            self.match(ModelicaParser.T__16)
            self.state = 473
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if ((((_la - 26)) & ~0x3f) == 0 and ((1 << (_la - 26)) & ((1 << (ModelicaParser.T__25 - 26)) | (1 << (ModelicaParser.EACH - 26)) | (1 << (ModelicaParser.FINAL - 26)) | (1 << (ModelicaParser.REDECLARE - 26)) | (1 << (ModelicaParser.IDENT - 26)))) != 0):
                self.state = 472
                self.argument_list()


            self.state = 475
            self.match(ModelicaParser.T__18)
        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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitArgument_list" ):
                return visitor.visitArgument_list(self)
            else:
                return visitor.visitChildren(self)




    def argument_list(self):

        localctx = ModelicaParser.Argument_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 60, self.RULE_argument_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 477
            self.argument()
            self.state = 482
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__20:
                self.state = 478
                self.match(ModelicaParser.T__20)
                self.state = 479
                self.argument()
                self.state = 484
                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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitArgument" ):
                return visitor.visitArgument(self)
            else:
                return visitor.visitChildren(self)




    def argument(self):

        localctx = ModelicaParser.ArgumentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 62, self.RULE_argument)
        try:
            self.state = 487
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [ModelicaParser.T__25, ModelicaParser.EACH, ModelicaParser.FINAL, ModelicaParser.IDENT]:
                self.enterOuterAlt(localctx, 1)
                self.state = 485
                self.element_modification_or_replaceable()
                pass
            elif token in [ModelicaParser.REDECLARE]:
                self.enterOuterAlt(localctx, 2)
                self.state = 486
                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):

        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 EACH(self):
            return self.getToken(ModelicaParser.EACH, 0)

        def FINAL(self):
            return self.getToken(ModelicaParser.FINAL, 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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitElement_modification_or_replaceable" ):
                return visitor.visitElement_modification_or_replaceable(self)
            else:
                return visitor.visitChildren(self)




    def element_modification_or_replaceable(self):

        localctx = ModelicaParser.Element_modification_or_replaceableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 64, self.RULE_element_modification_or_replaceable)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 490
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.EACH:
                self.state = 489
                self.match(ModelicaParser.EACH)


            self.state = 493
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.FINAL:
                self.state = 492
                self.match(ModelicaParser.FINAL)


            self.state = 497
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [ModelicaParser.IDENT]:
                self.state = 495
                self.element_modification()
                pass
            elif token in [ModelicaParser.T__25]:
                self.state = 496
                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):

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

        def component_reference(self):
            return self.getTypedRuleContext(ModelicaParser.Component_referenceContext,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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitElement_modification" ):
                return visitor.visitElement_modification(self)
            else:
                return visitor.visitChildren(self)




    def element_modification(self):

        localctx = ModelicaParser.Element_modificationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 66, self.RULE_element_modification)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 499
            self.component_reference()
            self.state = 501
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ModelicaParser.T__14) | (1 << ModelicaParser.T__16) | (1 << ModelicaParser.T__40))) != 0):
                self.state = 500
                self.modification()


            self.state = 503
            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):

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

        def REDECLARE(self):
            return self.getToken(ModelicaParser.REDECLARE, 0)

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


        def EACH(self):
            return self.getToken(ModelicaParser.EACH, 0)

        def FINAL(self):
            return self.getToken(ModelicaParser.FINAL, 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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitElement_redeclaration" ):
                return visitor.visitElement_redeclaration(self)
            else:
                return visitor.visitChildren(self)




    def element_redeclaration(self):

        localctx = ModelicaParser.Element_redeclarationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 68, self.RULE_element_redeclaration)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 505
            self.match(ModelicaParser.REDECLARE)
            self.state = 507
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.EACH:
                self.state = 506
                self.match(ModelicaParser.EACH)


            self.state = 510
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.FINAL:
                self.state = 509
                self.match(ModelicaParser.FINAL)


            self.state = 517
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [ModelicaParser.T__1, ModelicaParser.T__2, ModelicaParser.T__3, ModelicaParser.T__4, ModelicaParser.T__5, ModelicaParser.T__6, ModelicaParser.T__7, ModelicaParser.T__8, ModelicaParser.T__9, ModelicaParser.T__10, ModelicaParser.T__11, ModelicaParser.T__12, ModelicaParser.T__32, ModelicaParser.T__33, ModelicaParser.T__34, ModelicaParser.T__35, ModelicaParser.T__36, ModelicaParser.T__37, ModelicaParser.T__38, ModelicaParser.PARTIAL, ModelicaParser.IDENT]:
                self.state = 514
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [ModelicaParser.T__1, ModelicaParser.T__2, ModelicaParser.T__3, ModelicaParser.T__4, ModelicaParser.T__5, ModelicaParser.T__6, ModelicaParser.T__7, ModelicaParser.T__8, ModelicaParser.T__9, ModelicaParser.T__10, ModelicaParser.T__11, ModelicaParser.T__12, ModelicaParser.PARTIAL]:
                    self.state = 512
                    self.short_class_definition()
                    pass
                elif token in [ModelicaParser.T__32, ModelicaParser.T__33, ModelicaParser.T__34, ModelicaParser.T__35, ModelicaParser.T__36, ModelicaParser.T__37, ModelicaParser.T__38, ModelicaParser.IDENT]:
                    self.state = 513
                    self.component_clause1()
                    pass
                else:
                    raise NoViableAltException(self)

                pass
            elif token in [ModelicaParser.T__25]:
                self.state = 516
                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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitElement_replaceable" ):
                return visitor.visitElement_replaceable(self)
            else:
                return visitor.visitChildren(self)




    def element_replaceable(self):

        localctx = ModelicaParser.Element_replaceableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 70, self.RULE_element_replaceable)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 519
            self.match(ModelicaParser.T__25)
            self.state = 522
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [ModelicaParser.T__1, ModelicaParser.T__2, ModelicaParser.T__3, ModelicaParser.T__4, ModelicaParser.T__5, ModelicaParser.T__6, ModelicaParser.T__7, ModelicaParser.T__8, ModelicaParser.T__9, ModelicaParser.T__10, ModelicaParser.T__11, ModelicaParser.T__12, ModelicaParser.PARTIAL]:
                self.state = 520
                self.short_class_definition()
                pass
            elif token in [ModelicaParser.T__32, ModelicaParser.T__33, ModelicaParser.T__34, ModelicaParser.T__35, ModelicaParser.T__36, ModelicaParser.T__37, ModelicaParser.T__38, ModelicaParser.IDENT]:
                self.state = 521
                self.component_clause1()
                pass
            else:
                raise NoViableAltException(self)

            self.state = 525
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__31:
                self.state = 524
                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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitComponent_clause1" ):
                return visitor.visitComponent_clause1(self)
            else:
                return visitor.visitChildren(self)




    def component_clause1(self):

        localctx = ModelicaParser.Component_clause1Context(self, self._ctx, self.state)
        self.enterRule(localctx, 72, self.RULE_component_clause1)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 527
            self.type_prefix()
            self.state = 528
            self.type_specifier()
            self.state = 529
            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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitComponent_declaration1" ):
                return visitor.visitComponent_declaration1(self)
            else:
                return visitor.visitChildren(self)




    def component_declaration1(self):

        localctx = ModelicaParser.Component_declaration1Context(self, self._ctx, self.state)
        self.enterRule(localctx, 74, self.RULE_component_declaration1)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 531
            self.declaration()
            self.state = 532
            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):

        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 IDENT(self):
            return self.getToken(ModelicaParser.IDENT, 0)

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


        def component_reference(self):
            return self.getTypedRuleContext(ModelicaParser.Component_referenceContext,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_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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitShort_class_definition" ):
                return visitor.visitShort_class_definition(self)
            else:
                return visitor.visitChildren(self)




    def short_class_definition(self):

        localctx = ModelicaParser.Short_class_definitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 76, self.RULE_short_class_definition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 534
            self.class_prefixes()
            self.state = 535
            self.match(ModelicaParser.IDENT)
            self.state = 536
            self.match(ModelicaParser.T__14)
            self.state = 557
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [ModelicaParser.T__32, ModelicaParser.T__33, ModelicaParser.T__34, ModelicaParser.T__35, ModelicaParser.T__36, ModelicaParser.T__37, ModelicaParser.T__38, ModelicaParser.IDENT]:
                self.state = 537
                self.base_prefix()
                self.state = 538
                self.component_reference()
                self.state = 540
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.T__75:
                    self.state = 539
                    self.array_subscripts()


                self.state = 543
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.T__16:
                    self.state = 542
                    self.class_modification()


                self.state = 545
                self.comment()
                pass
            elif token in [ModelicaParser.T__15]:
                self.state = 547
                self.match(ModelicaParser.T__15)
                self.state = 548
                self.match(ModelicaParser.T__16)
                self.state = 553
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [ModelicaParser.T__18, ModelicaParser.IDENT]:
                    self.state = 550
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==ModelicaParser.IDENT:
                        self.state = 549
                        self.enum_list()


                    pass
                elif token in [ModelicaParser.T__17]:
                    self.state = 552
                    self.match(ModelicaParser.T__17)
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 555
                self.match(ModelicaParser.T__18)
                self.state = 556
                self.comment()
                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 Equation_blockContext(ParserRuleContext):

        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_block

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitEquation_block" ):
                return visitor.visitEquation_block(self)
            else:
                return visitor.visitChildren(self)




    def equation_block(self):

        localctx = ModelicaParser.Equation_blockContext(self, self._ctx, self.state)
        self.enterRule(localctx, 78, self.RULE_equation_block)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 564
            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 = 559
                    self.equation()
                    self.state = 560
                    self.match(ModelicaParser.T__0) 
                self.state = 566
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,76,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 Equation_sectionContext(ParserRuleContext):

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

        def equation_block(self):
            return self.getTypedRuleContext(ModelicaParser.Equation_blockContext,0)


        def INITIAL(self):
            return self.getToken(ModelicaParser.INITIAL, 0)

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitEquation_section" ):
                return visitor.visitEquation_section(self)
            else:
                return visitor.visitChildren(self)




    def equation_section(self):

        localctx = ModelicaParser.Equation_sectionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 80, self.RULE_equation_section)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 568
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.INITIAL:
                self.state = 567
                self.match(ModelicaParser.INITIAL)


            self.state = 570
            self.match(ModelicaParser.T__41)
            self.state = 571
            self.equation_block()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Statement_blockContext(ParserRuleContext):

        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_statement_block

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitStatement_block" ):
                return visitor.visitStatement_block(self)
            else:
                return visitor.visitChildren(self)




    def statement_block(self):

        localctx = ModelicaParser.Statement_blockContext(self, self._ctx, self.state)
        self.enterRule(localctx, 82, self.RULE_statement_block)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 578
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ModelicaParser.T__16) | (1 << ModelicaParser.T__39) | (1 << ModelicaParser.T__43) | (1 << ModelicaParser.T__44) | (1 << ModelicaParser.T__48) | (1 << ModelicaParser.T__51) | (1 << ModelicaParser.T__52))) != 0) or _la==ModelicaParser.IDENT:
                self.state = 573
                self.statement()
                self.state = 574
                self.match(ModelicaParser.T__0)
                self.state = 580
                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 Algorithm_sectionContext(ParserRuleContext):

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

        def statement_block(self):
            return self.getTypedRuleContext(ModelicaParser.Statement_blockContext,0)


        def INITIAL(self):
            return self.getToken(ModelicaParser.INITIAL, 0)

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitAlgorithm_section" ):
                return visitor.visitAlgorithm_section(self)
            else:
                return visitor.visitChildren(self)




    def algorithm_section(self):

        localctx = ModelicaParser.Algorithm_sectionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 84, self.RULE_algorithm_section)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 582
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.INITIAL:
                self.state = 581
                self.match(ModelicaParser.INITIAL)


            self.state = 584
            self.match(ModelicaParser.T__42)
            self.state = 585
            self.statement_block()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Equation_optionsContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return ModelicaParser.RULE_equation_options

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



    class Equation_whenContext(Equation_optionsContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Equation_optionsContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitEquation_when" ):
                return visitor.visitEquation_when(self)
            else:
                return visitor.visitChildren(self)


    class Equation_connect_clauseContext(Equation_optionsContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Equation_optionsContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitEquation_connect_clause" ):
                return visitor.visitEquation_connect_clause(self)
            else:
                return visitor.visitChildren(self)


    class Equation_forContext(Equation_optionsContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Equation_optionsContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitEquation_for" ):
                return visitor.visitEquation_for(self)
            else:
                return visitor.visitChildren(self)


    class Equation_functionContext(Equation_optionsContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Equation_optionsContext
            super().__init__(parser)
            self.copyFrom(ctx)

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

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitEquation_function" ):
                return visitor.visitEquation_function(self)
            else:
                return visitor.visitChildren(self)


    class Equation_simpleContext(Equation_optionsContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Equation_optionsContext
            super().__init__(parser)
            self.copyFrom(ctx)

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

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitEquation_simple" ):
                return visitor.visitEquation_simple(self)
            else:
                return visitor.visitChildren(self)


    class Equation_ifContext(Equation_optionsContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Equation_optionsContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitEquation_if" ):
                return visitor.visitEquation_if(self)
            else:
                return visitor.visitChildren(self)



    def equation_options(self):

        localctx = ModelicaParser.Equation_optionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 86, self.RULE_equation_options)
        try:
            self.state = 598
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,80,self._ctx)
            if la_ == 1:
                localctx = ModelicaParser.Equation_simpleContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 587
                self.simple_expression()
                self.state = 588
                self.match(ModelicaParser.T__14)
                self.state = 589
                self.expression()
                pass

            elif la_ == 2:
                localctx = ModelicaParser.Equation_ifContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 591
                self.if_equation()
                pass

            elif la_ == 3:
                localctx = ModelicaParser.Equation_forContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 592
                self.for_equation()
                pass

            elif la_ == 4:
                localctx = ModelicaParser.Equation_connect_clauseContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 593
                self.connect_clause()
                pass

            elif la_ == 5:
                localctx = ModelicaParser.Equation_whenContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 594
                self.when_equation()
                pass

            elif la_ == 6:
                localctx = ModelicaParser.Equation_functionContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 595
                self.name()
                self.state = 596
                self.function_call_args()
                pass


        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):

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

        def equation_options(self):
            return self.getTypedRuleContext(ModelicaParser.Equation_optionsContext,0)


        def comment(self):
            return self.getTypedRuleContext(ModelicaParser.CommentContext,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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitEquation" ):
                return visitor.visitEquation(self)
            else:
                return visitor.visitChildren(self)




    def equation(self):

        localctx = ModelicaParser.EquationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 88, self.RULE_equation)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 600
            self.equation_options()
            self.state = 601
            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 Statement_optionsContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return ModelicaParser.RULE_statement_options

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



    class Statement_breakContext(Statement_optionsContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Statement_optionsContext
            super().__init__(parser)
            self.copyFrom(ctx)


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitStatement_break" ):
                return visitor.visitStatement_break(self)
            else:
                return visitor.visitChildren(self)


    class Statement_whileContext(Statement_optionsContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Statement_optionsContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitStatement_while" ):
                return visitor.visitStatement_while(self)
            else:
                return visitor.visitChildren(self)


    class Statement_component_functionContext(Statement_optionsContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Statement_optionsContext
            super().__init__(parser)
            self.copyFrom(ctx)

        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 function_call_args(self):
            return self.getTypedRuleContext(ModelicaParser.Function_call_argsContext,0)


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitStatement_component_function" ):
                return visitor.visitStatement_component_function(self)
            else:
                return visitor.visitChildren(self)


    class Statement_returnContext(Statement_optionsContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Statement_optionsContext
            super().__init__(parser)
            self.copyFrom(ctx)


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitStatement_return" ):
                return visitor.visitStatement_return(self)
            else:
                return visitor.visitChildren(self)


    class Statement_forContext(Statement_optionsContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Statement_optionsContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitStatement_for" ):
                return visitor.visitStatement_for(self)
            else:
                return visitor.visitChildren(self)


    class Statement_whenContext(Statement_optionsContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Statement_optionsContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitStatement_when" ):
                return visitor.visitStatement_when(self)
            else:
                return visitor.visitChildren(self)


    class Statement_ifContext(Statement_optionsContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Statement_optionsContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitStatement_if" ):
                return visitor.visitStatement_if(self)
            else:
                return visitor.visitChildren(self)


    class Statement_component_referenceContext(Statement_optionsContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Statement_optionsContext
            super().__init__(parser)
            self.copyFrom(ctx)

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

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

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitStatement_component_reference" ):
                return visitor.visitStatement_component_reference(self)
            else:
                return visitor.visitChildren(self)



    def statement_options(self):

        localctx = ModelicaParser.Statement_optionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 90, self.RULE_statement_options)
        self._la = 0 # Token type
        try:
            self.state = 629
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [ModelicaParser.IDENT]:
                localctx = ModelicaParser.Statement_component_referenceContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 603
                self.component_reference()
                self.state = 607
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [ModelicaParser.T__40]:
                    self.state = 604
                    self.match(ModelicaParser.T__40)
                    self.state = 605
                    self.expression()
                    pass
                elif token in [ModelicaParser.T__16]:
                    self.state = 606
                    self.function_call_args()
                    pass
                else:
                    raise NoViableAltException(self)

                pass
            elif token in [ModelicaParser.T__16]:
                localctx = ModelicaParser.Statement_component_functionContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 609
                self.match(ModelicaParser.T__16)
                self.state = 610
                self.component_reference()
                self.state = 615
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==ModelicaParser.T__20:
                    self.state = 611
                    self.match(ModelicaParser.T__20)
                    self.state = 612
                    self.component_reference()
                    self.state = 617
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 618
                self.match(ModelicaParser.T__18)
                self.state = 619
                self.match(ModelicaParser.T__40)
                self.state = 620
                self.component_reference()
                self.state = 621
                self.function_call_args()
                pass
            elif token in [ModelicaParser.T__43]:
                localctx = ModelicaParser.Statement_breakContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 623
                self.match(ModelicaParser.T__43)
                pass
            elif token in [ModelicaParser.T__44]:
                localctx = ModelicaParser.Statement_returnContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 624
                self.match(ModelicaParser.T__44)
                pass
            elif token in [ModelicaParser.T__39]:
                localctx = ModelicaParser.Statement_ifContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 625
                self.if_statement()
                pass
            elif token in [ModelicaParser.T__48]:
                localctx = ModelicaParser.Statement_forContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 626
                self.for_statement()
                pass
            elif token in [ModelicaParser.T__51]:
                localctx = ModelicaParser.Statement_whileContext(self, localctx)
                self.enterOuterAlt(localctx, 7)
                self.state = 627
                self.while_statement()
                pass
            elif token in [ModelicaParser.T__52]:
                localctx = ModelicaParser.Statement_whenContext(self, localctx)
                self.enterOuterAlt(localctx, 8)
                self.state = 628
                self.when_statement()
                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 StatementContext(ParserRuleContext):

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

        def statement_options(self):
            return self.getTypedRuleContext(ModelicaParser.Statement_optionsContext,0)


        def comment(self):
            return self.getTypedRuleContext(ModelicaParser.CommentContext,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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitStatement" ):
                return visitor.visitStatement(self)
            else:
                return visitor.visitChildren(self)




    def statement(self):

        localctx = ModelicaParser.StatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 92, self.RULE_statement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 631
            self.statement_options()
            self.state = 632
            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):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self._expression = None # ExpressionContext
            self.conditions = list() # of ExpressionContexts
            self._equation_block = None # Equation_blockContext
            self.blocks = list() # of Equation_blockContexts

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


        def equation_block(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ModelicaParser.Equation_blockContext)
            else:
                return self.getTypedRuleContext(ModelicaParser.Equation_blockContext,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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitIf_equation" ):
                return visitor.visitIf_equation(self)
            else:
                return visitor.visitChildren(self)




    def if_equation(self):

        localctx = ModelicaParser.If_equationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 94, self.RULE_if_equation)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 634
            self.match(ModelicaParser.T__39)
            self.state = 635
            localctx._expression = self.expression()
            localctx.conditions.append(localctx._expression)
            self.state = 636
            self.match(ModelicaParser.T__45)
            self.state = 637
            localctx._equation_block = self.equation_block()
            localctx.blocks.append(localctx._equation_block)
            self.state = 645
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__46:
                self.state = 638
                self.match(ModelicaParser.T__46)
                self.state = 639
                localctx._expression = self.expression()
                localctx.conditions.append(localctx._expression)
                self.state = 640
                self.match(ModelicaParser.T__45)
                self.state = 641
                localctx._equation_block = self.equation_block()
                localctx.blocks.append(localctx._equation_block)
                self.state = 647
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 650
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__47:
                self.state = 648
                self.match(ModelicaParser.T__47)
                self.state = 649
                localctx._equation_block = self.equation_block()
                localctx.blocks.append(localctx._equation_block)


            self.state = 652
            self.match(ModelicaParser.T__13)
            self.state = 653
            self.match(ModelicaParser.T__39)
        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):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self._expression = None # ExpressionContext
            self.conditions = list() # of ExpressionContexts
            self._statement_block = None # Statement_blockContext
            self.blocks = list() # of Statement_blockContexts

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


        def statement_block(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ModelicaParser.Statement_blockContext)
            else:
                return self.getTypedRuleContext(ModelicaParser.Statement_blockContext,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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitIf_statement" ):
                return visitor.visitIf_statement(self)
            else:
                return visitor.visitChildren(self)




    def if_statement(self):

        localctx = ModelicaParser.If_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 96, self.RULE_if_statement)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 655
            self.match(ModelicaParser.T__39)
            self.state = 656
            localctx._expression = self.expression()
            localctx.conditions.append(localctx._expression)
            self.state = 657
            self.match(ModelicaParser.T__45)
            self.state = 658
            localctx._statement_block = self.statement_block()
            localctx.blocks.append(localctx._statement_block)
            self.state = 666
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__46:
                self.state = 659
                self.match(ModelicaParser.T__46)
                self.state = 660
                localctx._expression = self.expression()
                localctx.conditions.append(localctx._expression)
                self.state = 661
                self.match(ModelicaParser.T__45)
                self.state = 662
                localctx._statement_block = self.statement_block()
                localctx.blocks.append(localctx._statement_block)
                self.state = 668
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 671
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__47:
                self.state = 669
                self.match(ModelicaParser.T__47)
                self.state = 670
                localctx._statement_block = self.statement_block()
                localctx.blocks.append(localctx._statement_block)


            self.state = 673
            self.match(ModelicaParser.T__13)
            self.state = 674
            self.match(ModelicaParser.T__39)
        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):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.indices = None # For_indicesContext
            self.block = None # Equation_blockContext

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


        def equation_block(self):
            return self.getTypedRuleContext(ModelicaParser.Equation_blockContext,0)


        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitFor_equation" ):
                return visitor.visitFor_equation(self)
            else:
                return visitor.visitChildren(self)




    def for_equation(self):

        localctx = ModelicaParser.For_equationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 98, self.RULE_for_equation)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 676
            self.match(ModelicaParser.T__48)
            self.state = 677
            localctx.indices = self.for_indices()
            self.state = 678
            self.match(ModelicaParser.T__49)
            self.state = 679
            localctx.block = self.equation_block()
            self.state = 680
            self.match(ModelicaParser.T__13)
            self.state = 681
            self.match(ModelicaParser.T__48)
        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):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.indices = None # For_indicesContext
            self.block = None # Statement_blockContext

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


        def statement_block(self):
            return self.getTypedRuleContext(ModelicaParser.Statement_blockContext,0)


        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitFor_statement" ):
                return visitor.visitFor_statement(self)
            else:
                return visitor.visitChildren(self)




    def for_statement(self):

        localctx = ModelicaParser.For_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 100, self.RULE_for_statement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 683
            self.match(ModelicaParser.T__48)
            self.state = 684
            localctx.indices = self.for_indices()
            self.state = 685
            self.match(ModelicaParser.T__49)
            self.state = 686
            localctx.block = self.statement_block()
            self.state = 687
            self.match(ModelicaParser.T__13)
            self.state = 688
            self.match(ModelicaParser.T__48)
        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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitFor_indices" ):
                return visitor.visitFor_indices(self)
            else:
                return visitor.visitChildren(self)




    def for_indices(self):

        localctx = ModelicaParser.For_indicesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 102, self.RULE_for_indices)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 690
            self.for_index()
            self.state = 695
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,88,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 691
                    self.match(ModelicaParser.T__20)
                    self.state = 692
                    self.for_index() 
                self.state = 697
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,88,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 For_indexContext(ParserRuleContext):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitFor_index" ):
                return visitor.visitFor_index(self)
            else:
                return visitor.visitChildren(self)




    def for_index(self):

        localctx = ModelicaParser.For_indexContext(self, self._ctx, self.state)
        self.enterRule(localctx, 104, self.RULE_for_index)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 698
            self.match(ModelicaParser.IDENT)
            self.state = 701
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__50:
                self.state = 699
                self.match(ModelicaParser.T__50)
                self.state = 700
                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):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.condition = None # ExpressionContext
            self.block = None # Statement_blockContext

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


        def statement_block(self):
            return self.getTypedRuleContext(ModelicaParser.Statement_blockContext,0)


        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitWhile_statement" ):
                return visitor.visitWhile_statement(self)
            else:
                return visitor.visitChildren(self)




    def while_statement(self):

        localctx = ModelicaParser.While_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 106, self.RULE_while_statement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 703
            self.match(ModelicaParser.T__51)
            self.state = 704
            localctx.condition = self.expression()
            self.state = 705
            self.match(ModelicaParser.T__49)
            self.state = 706
            localctx.block = self.statement_block()
            self.state = 707
            self.match(ModelicaParser.T__13)
            self.state = 708
            self.match(ModelicaParser.T__51)
        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):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self._expression = None # ExpressionContext
            self.conditions = list() # of ExpressionContexts
            self._equation_block = None # Equation_blockContext
            self.blocks = list() # of Equation_blockContexts

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


        def equation_block(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ModelicaParser.Equation_blockContext)
            else:
                return self.getTypedRuleContext(ModelicaParser.Equation_blockContext,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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitWhen_equation" ):
                return visitor.visitWhen_equation(self)
            else:
                return visitor.visitChildren(self)




    def when_equation(self):

        localctx = ModelicaParser.When_equationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 108, self.RULE_when_equation)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 710
            self.match(ModelicaParser.T__52)
            self.state = 711
            localctx._expression = self.expression()
            localctx.conditions.append(localctx._expression)
            self.state = 712
            self.match(ModelicaParser.T__45)
            self.state = 713
            localctx._equation_block = self.equation_block()
            localctx.blocks.append(localctx._equation_block)
            self.state = 721
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__53:
                self.state = 714
                self.match(ModelicaParser.T__53)
                self.state = 715
                localctx._expression = self.expression()
                localctx.conditions.append(localctx._expression)
                self.state = 716
                self.match(ModelicaParser.T__45)
                self.state = 717
                localctx._equation_block = self.equation_block()
                localctx.blocks.append(localctx._equation_block)
                self.state = 723
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 724
            self.match(ModelicaParser.T__13)
            self.state = 725
            self.match(ModelicaParser.T__52)
        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):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self._expression = None # ExpressionContext
            self.conditions = list() # of ExpressionContexts
            self._statement_block = None # Statement_blockContext
            self.blocks = list() # of Statement_blockContexts

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


        def statement_block(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ModelicaParser.Statement_blockContext)
            else:
                return self.getTypedRuleContext(ModelicaParser.Statement_blockContext,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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitWhen_statement" ):
                return visitor.visitWhen_statement(self)
            else:
                return visitor.visitChildren(self)




    def when_statement(self):

        localctx = ModelicaParser.When_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 110, self.RULE_when_statement)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 727
            self.match(ModelicaParser.T__52)
            self.state = 728
            localctx._expression = self.expression()
            localctx.conditions.append(localctx._expression)
            self.state = 729
            self.match(ModelicaParser.T__45)
            self.state = 730
            localctx._statement_block = self.statement_block()
            localctx.blocks.append(localctx._statement_block)
            self.state = 738
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__53:
                self.state = 731
                self.match(ModelicaParser.T__53)
                self.state = 732
                localctx._expression = self.expression()
                localctx.conditions.append(localctx._expression)
                self.state = 733
                self.match(ModelicaParser.T__45)
                self.state = 734
                localctx._statement_block = self.statement_block()
                localctx.blocks.append(localctx._statement_block)
                self.state = 740
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 741
            self.match(ModelicaParser.T__13)
            self.state = 742
            self.match(ModelicaParser.T__52)
        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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitConnect_clause" ):
                return visitor.visitConnect_clause(self)
            else:
                return visitor.visitChildren(self)




    def connect_clause(self):

        localctx = ModelicaParser.Connect_clauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 112, self.RULE_connect_clause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 744
            self.match(ModelicaParser.T__54)
            self.state = 745
            self.match(ModelicaParser.T__16)
            self.state = 746
            self.component_reference()
            self.state = 747
            self.match(ModelicaParser.T__20)
            self.state = 748
            self.component_reference()
            self.state = 749
            self.match(ModelicaParser.T__18)
        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):

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


        def getRuleIndex(self):
            return ModelicaParser.RULE_expression

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



    class Expression_ifContext(ExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.ExpressionContext
            super().__init__(parser)
            self._expression = None # ExpressionContext
            self.conditions = list() # of ExpressionContexts
            self.blocks = list() # of ExpressionContexts
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpression_if" ):
                return visitor.visitExpression_if(self)
            else:
                return visitor.visitChildren(self)


    class Expression_simpleContext(ExpressionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.ExpressionContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpression_simple" ):
                return visitor.visitExpression_simple(self)
            else:
                return visitor.visitChildren(self)



    def expression(self):

        localctx = ModelicaParser.ExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 114, self.RULE_expression)
        self._la = 0 # Token type
        try:
            self.state = 769
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [ModelicaParser.T__13, ModelicaParser.T__16, ModelicaParser.T__19, ModelicaParser.T__29, ModelicaParser.T__55, ModelicaParser.T__70, ModelicaParser.T__73, ModelicaParser.T__74, ModelicaParser.T__75, ModelicaParser.INITIAL, ModelicaParser.IDENT, ModelicaParser.STRING, ModelicaParser.UNSIGNED_NUMBER]:
                localctx = ModelicaParser.Expression_simpleContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 751
                self.simple_expression()
                pass
            elif token in [ModelicaParser.T__39]:
                localctx = ModelicaParser.Expression_ifContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 752
                self.match(ModelicaParser.T__39)
                self.state = 753
                localctx._expression = self.expression()
                localctx.conditions.append(localctx._expression)
                self.state = 754
                self.match(ModelicaParser.T__45)
                self.state = 755
                localctx._expression = self.expression()
                localctx.blocks.append(localctx._expression)
                self.state = 763
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==ModelicaParser.T__46:
                    self.state = 756
                    self.match(ModelicaParser.T__46)
                    self.state = 757
                    localctx._expression = self.expression()
                    localctx.conditions.append(localctx._expression)
                    self.state = 758
                    self.match(ModelicaParser.T__45)
                    self.state = 759
                    localctx._expression = self.expression()
                    localctx.blocks.append(localctx._expression)
                    self.state = 765
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 766
                self.match(ModelicaParser.T__47)
                self.state = 767
                localctx._expression = self.expression()
                localctx.blocks.append(localctx._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):

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

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ModelicaParser.ExprContext)
            else:
                return self.getTypedRuleContext(ModelicaParser.ExprContext,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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitSimple_expression" ):
                return visitor.visitSimple_expression(self)
            else:
                return visitor.visitChildren(self)




    def simple_expression(self):

        localctx = ModelicaParser.Simple_expressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 116, self.RULE_simple_expression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 771
            self.expr(0)
            self.state = 778
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__17:
                self.state = 772
                self.match(ModelicaParser.T__17)
                self.state = 773
                self.expr(0)
                self.state = 776
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.T__17:
                    self.state = 774
                    self.match(ModelicaParser.T__17)
                    self.state = 775
                    self.expr(0)




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

    class ExprContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return ModelicaParser.RULE_expr

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


    class Expr_negContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.ExprContext
            super().__init__(parser)
            self.op = None # Token
            self.copyFrom(ctx)

        def expr(self):
            return self.getTypedRuleContext(ModelicaParser.ExprContext,0)


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpr_neg" ):
                return visitor.visitExpr_neg(self)
            else:
                return visitor.visitChildren(self)


    class Expr_addContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.ExprContext
            super().__init__(parser)
            self.op = None # Token
            self.copyFrom(ctx)

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ModelicaParser.ExprContext)
            else:
                return self.getTypedRuleContext(ModelicaParser.ExprContext,i)


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpr_add" ):
                return visitor.visitExpr_add(self)
            else:
                return visitor.visitChildren(self)


    class Expr_expContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.ExprContext
            super().__init__(parser)
            self.op = None # Token
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpr_exp" ):
                return visitor.visitExpr_exp(self)
            else:
                return visitor.visitChildren(self)


    class Expr_orContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ModelicaParser.ExprContext)
            else:
                return self.getTypedRuleContext(ModelicaParser.ExprContext,i)


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpr_or" ):
                return visitor.visitExpr_or(self)
            else:
                return visitor.visitChildren(self)


    class Expr_primaryContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def primary(self):
            return self.getTypedRuleContext(ModelicaParser.PrimaryContext,0)


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpr_primary" ):
                return visitor.visitExpr_primary(self)
            else:
                return visitor.visitChildren(self)


    class Expr_andContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ModelicaParser.ExprContext)
            else:
                return self.getTypedRuleContext(ModelicaParser.ExprContext,i)


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpr_and" ):
                return visitor.visitExpr_and(self)
            else:
                return visitor.visitChildren(self)


    class Expr_relContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.ExprContext
            super().__init__(parser)
            self.op = None # Token
            self.copyFrom(ctx)

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ModelicaParser.ExprContext)
            else:
                return self.getTypedRuleContext(ModelicaParser.ExprContext,i)


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpr_rel" ):
                return visitor.visitExpr_rel(self)
            else:
                return visitor.visitChildren(self)


    class Expr_notContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.ExprContext
            super().__init__(parser)
            self.copyFrom(ctx)

        def expr(self):
            return self.getTypedRuleContext(ModelicaParser.ExprContext,0)


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpr_not" ):
                return visitor.visitExpr_not(self)
            else:
                return visitor.visitChildren(self)


    class Expr_mulContext(ExprContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.ExprContext
            super().__init__(parser)
            self.op = None # Token
            self.copyFrom(ctx)

        def expr(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ModelicaParser.ExprContext)
            else:
                return self.getTypedRuleContext(ModelicaParser.ExprContext,i)


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpr_mul" ):
                return visitor.visitExpr_mul(self)
            else:
                return visitor.visitChildren(self)



    def expr(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = ModelicaParser.ExprContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 118
        self.enterRecursionRule(localctx, 118, self.RULE_expr, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 790
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,96,self._ctx)
            if la_ == 1:
                localctx = ModelicaParser.Expr_negContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 781
                localctx.op = self.match(ModelicaParser.T__55)
                self.state = 782
                self.expr(9)
                pass

            elif la_ == 2:
                localctx = ModelicaParser.Expr_expContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 783
                self.primary()
                self.state = 784
                localctx.op = self._input.LT(1)
                _la = self._input.LA(1)
                if not(_la==ModelicaParser.T__56 or _la==ModelicaParser.T__57):
                    localctx.op = self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 785
                self.primary()
                pass

            elif la_ == 3:
                localctx = ModelicaParser.Expr_notContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 787
                self.match(ModelicaParser.T__70)
                self.state = 788
                self.expr(4)
                pass

            elif la_ == 4:
                localctx = ModelicaParser.Expr_primaryContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 789
                self.primary()
                pass


            self._ctx.stop = self._input.LT(-1)
            self.state = 809
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,98,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    self.state = 807
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,97,self._ctx)
                    if la_ == 1:
                        localctx = ModelicaParser.Expr_mulContext(self, ModelicaParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 792
                        if not self.precpred(self._ctx, 7):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 7)")
                        self.state = 793
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ModelicaParser.T__28) | (1 << ModelicaParser.T__58) | (1 << ModelicaParser.T__59) | (1 << ModelicaParser.T__60))) != 0)):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 794
                        self.expr(8)
                        pass

                    elif la_ == 2:
                        localctx = ModelicaParser.Expr_addContext(self, ModelicaParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 795
                        if not self.precpred(self._ctx, 6):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
                        self.state = 796
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not(((((_la - 56)) & ~0x3f) == 0 and ((1 << (_la - 56)) & ((1 << (ModelicaParser.T__55 - 56)) | (1 << (ModelicaParser.T__61 - 56)) | (1 << (ModelicaParser.T__62 - 56)) | (1 << (ModelicaParser.T__63 - 56)))) != 0)):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 797
                        self.expr(7)
                        pass

                    elif la_ == 3:
                        localctx = ModelicaParser.Expr_relContext(self, ModelicaParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 798
                        if not self.precpred(self._ctx, 5):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
                        self.state = 799
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not(((((_la - 65)) & ~0x3f) == 0 and ((1 << (_la - 65)) & ((1 << (ModelicaParser.T__64 - 65)) | (1 << (ModelicaParser.T__65 - 65)) | (1 << (ModelicaParser.T__66 - 65)) | (1 << (ModelicaParser.T__67 - 65)) | (1 << (ModelicaParser.T__68 - 65)) | (1 << (ModelicaParser.T__69 - 65)))) != 0)):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 800
                        self.expr(6)
                        pass

                    elif la_ == 4:
                        localctx = ModelicaParser.Expr_andContext(self, ModelicaParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 801
                        if not self.precpred(self._ctx, 3):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 3)")
                        self.state = 802
                        self.match(ModelicaParser.T__71)
                        self.state = 803
                        self.expr(4)
                        pass

                    elif la_ == 5:
                        localctx = ModelicaParser.Expr_orContext(self, ModelicaParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 804
                        if not self.precpred(self._ctx, 2):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                        self.state = 805
                        self.match(ModelicaParser.T__72)
                        self.state = 806
                        self.expr(3)
                        pass

             
                self.state = 811
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,98,self._ctx)

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

    class PrimaryContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return ModelicaParser.RULE_primary

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



    class Primary_stringContext(PrimaryContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.PrimaryContext
            super().__init__(parser)
            self.copyFrom(ctx)

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

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitPrimary_string" ):
                return visitor.visitPrimary_string(self)
            else:
                return visitor.visitChildren(self)


    class Primary_endContext(PrimaryContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.PrimaryContext
            super().__init__(parser)
            self.copyFrom(ctx)


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitPrimary_end" ):
                return visitor.visitPrimary_end(self)
            else:
                return visitor.visitChildren(self)


    class Primary_output_expression_listContext(PrimaryContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.PrimaryContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitPrimary_output_expression_list" ):
                return visitor.visitPrimary_output_expression_list(self)
            else:
                return visitor.visitChildren(self)


    class Primary_unsigned_numberContext(PrimaryContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.PrimaryContext
            super().__init__(parser)
            self.copyFrom(ctx)

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

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitPrimary_unsigned_number" ):
                return visitor.visitPrimary_unsigned_number(self)
            else:
                return visitor.visitChildren(self)


    class Primary_function_argumentsContext(PrimaryContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.PrimaryContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitPrimary_function_arguments" ):
                return visitor.visitPrimary_function_arguments(self)
            else:
                return visitor.visitChildren(self)


    class Primary_falseContext(PrimaryContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.PrimaryContext
            super().__init__(parser)
            self.copyFrom(ctx)


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitPrimary_false" ):
                return visitor.visitPrimary_false(self)
            else:
                return visitor.visitChildren(self)


    class Primary_derivativeContext(PrimaryContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.PrimaryContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitPrimary_derivative" ):
                return visitor.visitPrimary_derivative(self)
            else:
                return visitor.visitChildren(self)


    class Primary_component_referenceContext(PrimaryContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.PrimaryContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitPrimary_component_reference" ):
                return visitor.visitPrimary_component_reference(self)
            else:
                return visitor.visitChildren(self)


    class Primary_expression_listContext(PrimaryContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.PrimaryContext
            super().__init__(parser)
            self.copyFrom(ctx)

        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 enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPrimary_expression_list" ):
                listener.enterPrimary_expression_list(self)

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitPrimary_expression_list" ):
                return visitor.visitPrimary_expression_list(self)
            else:
                return visitor.visitChildren(self)


    class Primary_trueContext(PrimaryContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.PrimaryContext
            super().__init__(parser)
            self.copyFrom(ctx)


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitPrimary_true" ):
                return visitor.visitPrimary_true(self)
            else:
                return visitor.visitChildren(self)


    class Primary_functionContext(PrimaryContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.PrimaryContext
            super().__init__(parser)
            self.copyFrom(ctx)

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

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitPrimary_function" ):
                return visitor.visitPrimary_function(self)
            else:
                return visitor.visitChildren(self)


    class Primary_initialContext(PrimaryContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.PrimaryContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitPrimary_initial" ):
                return visitor.visitPrimary_initial(self)
            else:
                return visitor.visitChildren(self)



    def primary(self):

        localctx = ModelicaParser.PrimaryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 120, self.RULE_primary)
        self._la = 0 # Token type
        try:
            self.state = 844
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,100,self._ctx)
            if la_ == 1:
                localctx = ModelicaParser.Primary_unsigned_numberContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 812
                self.match(ModelicaParser.UNSIGNED_NUMBER)
                pass

            elif la_ == 2:
                localctx = ModelicaParser.Primary_stringContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 813
                self.match(ModelicaParser.STRING)
                pass

            elif la_ == 3:
                localctx = ModelicaParser.Primary_falseContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 814
                self.match(ModelicaParser.T__73)
                pass

            elif la_ == 4:
                localctx = ModelicaParser.Primary_trueContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 815
                self.match(ModelicaParser.T__74)
                pass

            elif la_ == 5:
                localctx = ModelicaParser.Primary_functionContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 816
                self.component_reference()
                self.state = 817
                self.function_call_args()
                pass

            elif la_ == 6:
                localctx = ModelicaParser.Primary_derivativeContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 819
                self.match(ModelicaParser.T__19)
                self.state = 820
                self.function_call_args()
                pass

            elif la_ == 7:
                localctx = ModelicaParser.Primary_initialContext(self, localctx)
                self.enterOuterAlt(localctx, 7)
                self.state = 821
                self.match(ModelicaParser.INITIAL)
                self.state = 822
                self.function_call_args()
                pass

            elif la_ == 8:
                localctx = ModelicaParser.Primary_component_referenceContext(self, localctx)
                self.enterOuterAlt(localctx, 8)
                self.state = 823
                self.component_reference()
                pass

            elif la_ == 9:
                localctx = ModelicaParser.Primary_output_expression_listContext(self, localctx)
                self.enterOuterAlt(localctx, 9)
                self.state = 824
                self.match(ModelicaParser.T__16)
                self.state = 825
                self.output_expression_list()
                self.state = 826
                self.match(ModelicaParser.T__18)
                pass

            elif la_ == 10:
                localctx = ModelicaParser.Primary_expression_listContext(self, localctx)
                self.enterOuterAlt(localctx, 10)
                self.state = 828
                self.match(ModelicaParser.T__75)
                self.state = 829
                self.expression_list()
                self.state = 834
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==ModelicaParser.T__0:
                    self.state = 830
                    self.match(ModelicaParser.T__0)
                    self.state = 831
                    self.expression_list()
                    self.state = 836
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 837
                self.match(ModelicaParser.T__76)
                pass

            elif la_ == 11:
                localctx = ModelicaParser.Primary_function_argumentsContext(self, localctx)
                self.enterOuterAlt(localctx, 11)
                self.state = 839
                self.match(ModelicaParser.T__29)
                self.state = 840
                self.function_arguments()
                self.state = 841
                self.match(ModelicaParser.T__30)
                pass

            elif la_ == 12:
                localctx = ModelicaParser.Primary_endContext(self, localctx)
                self.enterOuterAlt(localctx, 12)
                self.state = 843
                self.match(ModelicaParser.T__13)
                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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitName" ):
                return visitor.visitName(self)
            else:
                return visitor.visitChildren(self)




    def name(self):

        localctx = ModelicaParser.NameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 122, self.RULE_name)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 847
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__27:
                self.state = 846
                self.match(ModelicaParser.T__27)


            self.state = 849
            self.match(ModelicaParser.IDENT)
            self.state = 854
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__27:
                self.state = 850
                self.match(ModelicaParser.T__27)
                self.state = 851
                self.match(ModelicaParser.IDENT)
                self.state = 856
                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_reference_elementContext(ParserRuleContext):

        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 getRuleIndex(self):
            return ModelicaParser.RULE_component_reference_element

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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitComponent_reference_element" ):
                return visitor.visitComponent_reference_element(self)
            else:
                return visitor.visitChildren(self)




    def component_reference_element(self):

        localctx = ModelicaParser.Component_reference_elementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 124, self.RULE_component_reference_element)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 857
            self.match(ModelicaParser.IDENT)
            self.state = 859
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,103,self._ctx)
            if la_ == 1:
                self.state = 858
                self.array_subscripts()


        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):

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

        def component_reference_element(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ModelicaParser.Component_reference_elementContext)
            else:
                return self.getTypedRuleContext(ModelicaParser.Component_reference_elementContext,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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitComponent_reference" ):
                return visitor.visitComponent_reference(self)
            else:
                return visitor.visitChildren(self)




    def component_reference(self):

        localctx = ModelicaParser.Component_referenceContext(self, self._ctx, self.state)
        self.enterRule(localctx, 126, self.RULE_component_reference)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 861
            self.component_reference_element()
            self.state = 866
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,104,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 862
                    self.match(ModelicaParser.T__27)
                    self.state = 863
                    self.component_reference_element() 
                self.state = 868
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,104,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 Function_call_argsContext(ParserRuleContext):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitFunction_call_args" ):
                return visitor.visitFunction_call_args(self)
            else:
                return visitor.visitChildren(self)




    def function_call_args(self):

        localctx = ModelicaParser.Function_call_argsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 128, self.RULE_function_call_args)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 869
            self.match(ModelicaParser.T__16)
            self.state = 871
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ModelicaParser.T__12) | (1 << ModelicaParser.T__13) | (1 << ModelicaParser.T__16) | (1 << ModelicaParser.T__19) | (1 << ModelicaParser.T__29) | (1 << ModelicaParser.T__39) | (1 << ModelicaParser.T__55))) != 0) or ((((_la - 71)) & ~0x3f) == 0 and ((1 << (_la - 71)) & ((1 << (ModelicaParser.T__70 - 71)) | (1 << (ModelicaParser.T__73 - 71)) | (1 << (ModelicaParser.T__74 - 71)) | (1 << (ModelicaParser.T__75 - 71)) | (1 << (ModelicaParser.INITIAL - 71)) | (1 << (ModelicaParser.IDENT - 71)) | (1 << (ModelicaParser.STRING - 71)) | (1 << (ModelicaParser.UNSIGNED_NUMBER - 71)))) != 0):
                self.state = 870
                self.function_arguments()


            self.state = 873
            self.match(ModelicaParser.T__18)
        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):

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

        def function_argument(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ModelicaParser.Function_argumentContext)
            else:
                return self.getTypedRuleContext(ModelicaParser.Function_argumentContext,i)


        def for_indices(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ModelicaParser.For_indicesContext)
            else:
                return self.getTypedRuleContext(ModelicaParser.For_indicesContext,i)


        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitFunction_arguments" ):
                return visitor.visitFunction_arguments(self)
            else:
                return visitor.visitChildren(self)




    def function_arguments(self):

        localctx = ModelicaParser.Function_argumentsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 130, self.RULE_function_arguments)
        self._la = 0 # Token type
        try:
            self.state = 886
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,108,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 875
                self.function_argument()
                self.state = 882
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==ModelicaParser.T__20 or _la==ModelicaParser.T__48:
                    self.state = 880
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [ModelicaParser.T__20]:
                        self.state = 876
                        self.match(ModelicaParser.T__20)
                        self.state = 877
                        self.function_argument()
                        pass
                    elif token in [ModelicaParser.T__48]:
                        self.state = 878
                        self.match(ModelicaParser.T__48)
                        self.state = 879
                        self.for_indices()
                        pass
                    else:
                        raise NoViableAltException(self)

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

                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 885
                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):

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

        def named_argument(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(ModelicaParser.Named_argumentContext)
            else:
                return self.getTypedRuleContext(ModelicaParser.Named_argumentContext,i)


        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitNamed_arguments" ):
                return visitor.visitNamed_arguments(self)
            else:
                return visitor.visitChildren(self)




    def named_arguments(self):

        localctx = ModelicaParser.Named_argumentsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 132, self.RULE_named_arguments)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 888
            self.named_argument()
            self.state = 893
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__20:
                self.state = 889
                self.match(ModelicaParser.T__20)
                self.state = 890
                self.named_argument()
                self.state = 895
                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 Named_argumentContext(ParserRuleContext):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitNamed_argument" ):
                return visitor.visitNamed_argument(self)
            else:
                return visitor.visitChildren(self)




    def named_argument(self):

        localctx = ModelicaParser.Named_argumentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 134, self.RULE_named_argument)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 896
            self.match(ModelicaParser.IDENT)
            self.state = 897
            self.match(ModelicaParser.T__14)
            self.state = 898
            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):

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


        def getRuleIndex(self):
            return ModelicaParser.RULE_function_argument

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



    class Argument_expressionContext(Function_argumentContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Function_argumentContext
            super().__init__(parser)
            self.copyFrom(ctx)

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitArgument_expression" ):
                return visitor.visitArgument_expression(self)
            else:
                return visitor.visitChildren(self)


    class Argument_functionContext(Function_argumentContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a ModelicaParser.Function_argumentContext
            super().__init__(parser)
            self.copyFrom(ctx)

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

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


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

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitArgument_function" ):
                return visitor.visitArgument_function(self)
            else:
                return visitor.visitChildren(self)



    def function_argument(self):

        localctx = ModelicaParser.Function_argumentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 136, self.RULE_function_argument)
        self._la = 0 # Token type
        try:
            self.state = 909
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [ModelicaParser.T__12]:
                localctx = ModelicaParser.Argument_functionContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 900
                self.match(ModelicaParser.T__12)
                self.state = 901
                self.name()
                self.state = 902
                self.match(ModelicaParser.T__16)
                self.state = 904
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.IDENT:
                    self.state = 903
                    self.named_arguments()


                self.state = 906
                self.match(ModelicaParser.T__18)
                pass
            elif token in [ModelicaParser.T__13, ModelicaParser.T__16, ModelicaParser.T__19, ModelicaParser.T__29, ModelicaParser.T__39, ModelicaParser.T__55, ModelicaParser.T__70, ModelicaParser.T__73, ModelicaParser.T__74, ModelicaParser.T__75, ModelicaParser.INITIAL, ModelicaParser.IDENT, ModelicaParser.STRING, ModelicaParser.UNSIGNED_NUMBER]:
                localctx = ModelicaParser.Argument_expressionContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 908
                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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitOutput_expression_list" ):
                return visitor.visitOutput_expression_list(self)
            else:
                return visitor.visitChildren(self)




    def output_expression_list(self):

        localctx = ModelicaParser.Output_expression_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 138, self.RULE_output_expression_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 912
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ModelicaParser.T__13) | (1 << ModelicaParser.T__16) | (1 << ModelicaParser.T__19) | (1 << ModelicaParser.T__29) | (1 << ModelicaParser.T__39) | (1 << ModelicaParser.T__55))) != 0) or ((((_la - 71)) & ~0x3f) == 0 and ((1 << (_la - 71)) & ((1 << (ModelicaParser.T__70 - 71)) | (1 << (ModelicaParser.T__73 - 71)) | (1 << (ModelicaParser.T__74 - 71)) | (1 << (ModelicaParser.T__75 - 71)) | (1 << (ModelicaParser.INITIAL - 71)) | (1 << (ModelicaParser.IDENT - 71)) | (1 << (ModelicaParser.STRING - 71)) | (1 << (ModelicaParser.UNSIGNED_NUMBER - 71)))) != 0):
                self.state = 911
                self.expression()


            self.state = 918
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__20:
                self.state = 914
                self.match(ModelicaParser.T__20)
                self.state = 915
                self.expression()
                self.state = 920
                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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpression_list" ):
                return visitor.visitExpression_list(self)
            else:
                return visitor.visitChildren(self)




    def expression_list(self):

        localctx = ModelicaParser.Expression_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 140, self.RULE_expression_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 921
            self.expression()
            self.state = 926
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__20:
                self.state = 922
                self.match(ModelicaParser.T__20)
                self.state = 923
                self.expression()
                self.state = 928
                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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitArray_subscripts" ):
                return visitor.visitArray_subscripts(self)
            else:
                return visitor.visitChildren(self)




    def array_subscripts(self):

        localctx = ModelicaParser.Array_subscriptsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 142, self.RULE_array_subscripts)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 929
            self.match(ModelicaParser.T__75)
            self.state = 930
            self.subscript()
            self.state = 935
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__20:
                self.state = 931
                self.match(ModelicaParser.T__20)
                self.state = 932
                self.subscript()
                self.state = 937
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 938
            self.match(ModelicaParser.T__76)
        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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitSubscript" ):
                return visitor.visitSubscript(self)
            else:
                return visitor.visitChildren(self)




    def subscript(self):

        localctx = ModelicaParser.SubscriptContext(self, self._ctx, self.state)
        self.enterRule(localctx, 144, self.RULE_subscript)
        try:
            self.state = 942
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [ModelicaParser.T__17]:
                self.enterOuterAlt(localctx, 1)
                self.state = 940
                self.match(ModelicaParser.T__17)
                pass
            elif token in [ModelicaParser.T__13, ModelicaParser.T__16, ModelicaParser.T__19, ModelicaParser.T__29, ModelicaParser.T__39, ModelicaParser.T__55, ModelicaParser.T__70, ModelicaParser.T__73, ModelicaParser.T__74, ModelicaParser.T__75, ModelicaParser.INITIAL, ModelicaParser.IDENT, ModelicaParser.STRING, ModelicaParser.UNSIGNED_NUMBER]:
                self.enterOuterAlt(localctx, 2)
                self.state = 941
                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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitComment" ):
                return visitor.visitComment(self)
            else:
                return visitor.visitChildren(self)




    def comment(self):

        localctx = ModelicaParser.CommentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 146, self.RULE_comment)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 944
            self.string_comment()
            self.state = 946
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__77:
                self.state = 945
                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):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitString_comment" ):
                return visitor.visitString_comment(self)
            else:
                return visitor.visitChildren(self)




    def string_comment(self):

        localctx = ModelicaParser.String_commentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 148, self.RULE_string_comment)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 956
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.STRING:
                self.state = 948
                self.match(ModelicaParser.STRING)
                self.state = 953
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==ModelicaParser.T__61:
                    self.state = 949
                    self.match(ModelicaParser.T__61)
                    self.state = 950
                    self.match(ModelicaParser.STRING)
                    self.state = 955
                    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 AnnotationContext(ParserRuleContext):

        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 accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitAnnotation" ):
                return visitor.visitAnnotation(self)
            else:
                return visitor.visitChildren(self)




    def annotation(self):

        localctx = ModelicaParser.AnnotationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 150, self.RULE_annotation)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 958
            self.match(ModelicaParser.T__77)
            self.state = 959
            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



    def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int):
        if self._predicates == None:
            self._predicates = dict()
        self._predicates[59] = self.expr_sempred
        pred = self._predicates.get(ruleIndex, None)
        if pred is None:
            raise Exception("No predicate with index:" + str(ruleIndex))
        else:
            return pred(localctx, predIndex)

    def expr_sempred(self, localctx:ExprContext, predIndex:int):
            if predIndex == 0:
                return self.precpred(self._ctx, 7)
         

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

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

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

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




