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

    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 - 81)) & ~0x3f) == 0 and ((1 << (_la - 81)) & ((1 << (ModelicaParser.PARTIAL - 81)) | (1 << (ModelicaParser.FINAL - 81)) | (1 << (ModelicaParser.ENCAPSULATED - 81)))) != 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__78:
                    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__78:
                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__39) | (1 << ModelicaParser.T__55) | (1 << ModelicaParser.T__56))) != 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.T__77 - 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__31) | (1 << ModelicaParser.T__32) | (1 << ModelicaParser.T__33) | (1 << ModelicaParser.T__34) | (1 << ModelicaParser.T__35) | (1 << ModelicaParser.T__36) | (1 << ModelicaParser.T__37))) != 0) or ((((_la - 81)) & ~0x3f) == 0 and ((1 << (_la - 81)) & ((1 << (ModelicaParser.PARTIAL - 81)) | (1 << (ModelicaParser.FINAL - 81)) | (1 << (ModelicaParser.ENCAPSULATED - 81)) | (1 << (ModelicaParser.REDECLARE - 81)) | (1 << (ModelicaParser.INNER - 81)) | (1 << (ModelicaParser.OUTER - 81)) | (1 << (ModelicaParser.IDENT - 81)))) != 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__31, ModelicaParser.T__32, ModelicaParser.T__33, ModelicaParser.T__34, ModelicaParser.T__35, ModelicaParser.T__36, ModelicaParser.T__37, 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__31, ModelicaParser.T__32, ModelicaParser.T__33, ModelicaParser.T__34, ModelicaParser.T__35, ModelicaParser.T__36, ModelicaParser.T__37, 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__30:
                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)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 370
            self.match(ModelicaParser.T__26)
            self.state = 382
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,41,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 = 380
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [ModelicaParser.T__27]:
                    self.state = 375
                    self.match(ModelicaParser.T__27)
                    pass
                elif token in [ModelicaParser.T__28]:
                    self.state = 376
                    self.match(ModelicaParser.T__28)
                    self.state = 377
                    self.import_list()
                    self.state = 378
                    self.match(ModelicaParser.T__29)
                    pass
                elif token in [ModelicaParser.T__0, ModelicaParser.T__78, ModelicaParser.STRING]:
                    pass
                else:
                    pass
                pass


            self.state = 384
            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 = 386
            self.match(ModelicaParser.IDENT)
            self.state = 391
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,42,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 387
                    self.match(ModelicaParser.T__20)
                    self.state = 388
                    self.import_list() 
                self.state = 393
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,42,self._ctx)

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

    class 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 = 394
            self.match(ModelicaParser.T__21)
            self.state = 395
            self.component_reference()
            self.state = 397
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__16:
                self.state = 396
                self.class_modification()


            self.state = 400
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__78:
                self.state = 399
                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 = 402
            self.match(ModelicaParser.T__30)
            self.state = 403
            self.name()
            self.state = 405
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__16:
                self.state = 404
                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 = 407
            self.type_prefix()
            self.state = 408
            self.type_specifier()
            self.state = 410
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__75:
                self.state = 409
                self.array_subscripts()


            self.state = 412
            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 = 415
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__31 or _la==ModelicaParser.T__32:
                self.state = 414
                _la = self._input.LA(1)
                if not(_la==ModelicaParser.T__31 or _la==ModelicaParser.T__32):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


            self.state = 418
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ModelicaParser.T__33) | (1 << ModelicaParser.T__34) | (1 << ModelicaParser.T__35))) != 0):
                self.state = 417
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ModelicaParser.T__33) | (1 << ModelicaParser.T__34) | (1 << ModelicaParser.T__35))) != 0)):
                    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==ModelicaParser.T__36 or _la==ModelicaParser.T__37:
                self.state = 420
                _la = self._input.LA(1)
                if not(_la==ModelicaParser.T__36 or _la==ModelicaParser.T__37):
                    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 = 423
            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 = 425
            self.type_specifier_element()
            self.state = 430
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__38:
                self.state = 426
                self.match(ModelicaParser.T__38)
                self.state = 427
                self.type_specifier_element()
                self.state = 432
                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 = 433
            self.component_declaration()
            self.state = 438
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__20:
                self.state = 434
                self.match(ModelicaParser.T__20)
                self.state = 435
                self.component_declaration()
                self.state = 440
                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 = 441
            self.declaration()
            self.state = 443
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__39:
                self.state = 442
                self.condition_attribute()


            self.state = 445
            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 = 447
            self.match(ModelicaParser.T__39)
            self.state = 448
            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 = 450
            self.match(ModelicaParser.IDENT)
            self.state = 452
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__75:
                self.state = 451
                self.array_subscripts()


            self.state = 455
            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 = 454
                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 = 466
            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 = 457
                self.class_modification()
                self.state = 460
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.T__14:
                    self.state = 458
                    self.match(ModelicaParser.T__14)
                    self.state = 459
                    self.expression()


                pass
            elif token in [ModelicaParser.T__14]:
                localctx = ModelicaParser.Modification_assignmentContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 462
                self.match(ModelicaParser.T__14)
                self.state = 463
                self.expression()
                pass
            elif token in [ModelicaParser.T__40]:
                localctx = ModelicaParser.Modification_assignment2Context(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 464
                self.match(ModelicaParser.T__40)
                self.state = 465
                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 = 468
            self.match(ModelicaParser.T__16)
            self.state = 470
            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 = 469
                self.argument_list()


            self.state = 472
            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 = 474
            self.argument()
            self.state = 479
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__20:
                self.state = 475
                self.match(ModelicaParser.T__20)
                self.state = 476
                self.argument()
                self.state = 481
                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 = 484
            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 = 482
                self.element_modification_or_replaceable()
                pass
            elif token in [ModelicaParser.REDECLARE]:
                self.enterOuterAlt(localctx, 2)
                self.state = 483
                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 = 487
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.EACH:
                self.state = 486
                self.match(ModelicaParser.EACH)


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


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


            self.state = 500
            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 = 502
            self.match(ModelicaParser.REDECLARE)
            self.state = 504
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.EACH:
                self.state = 503
                self.match(ModelicaParser.EACH)


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


            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.T__31, ModelicaParser.T__32, ModelicaParser.T__33, ModelicaParser.T__34, ModelicaParser.T__35, ModelicaParser.T__36, ModelicaParser.T__37, ModelicaParser.PARTIAL, ModelicaParser.IDENT]:
                self.state = 511
                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 = 509
                    self.short_class_definition()
                    pass
                elif token in [ModelicaParser.T__31, ModelicaParser.T__32, ModelicaParser.T__33, ModelicaParser.T__34, ModelicaParser.T__35, ModelicaParser.T__36, ModelicaParser.T__37, ModelicaParser.IDENT]:
                    self.state = 510
                    self.component_clause1()
                    pass
                else:
                    raise NoViableAltException(self)

                pass
            elif token in [ModelicaParser.T__25]:
                self.state = 513
                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 = 516
            self.match(ModelicaParser.T__25)
            self.state = 519
            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 = 517
                self.short_class_definition()
                pass
            elif token in [ModelicaParser.T__31, ModelicaParser.T__32, ModelicaParser.T__33, ModelicaParser.T__34, ModelicaParser.T__35, ModelicaParser.T__36, ModelicaParser.T__37, ModelicaParser.IDENT]:
                self.state = 518
                self.component_clause1()
                pass
            else:
                raise NoViableAltException(self)

            self.state = 522
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__30:
                self.state = 521
                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 = 524
            self.type_prefix()
            self.state = 525
            self.type_specifier()
            self.state = 526
            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 = 528
            self.declaration()
            self.state = 529
            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 = 531
            self.class_prefixes()
            self.state = 532
            self.match(ModelicaParser.IDENT)
            self.state = 533
            self.match(ModelicaParser.T__14)
            self.state = 554
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [ModelicaParser.T__31, ModelicaParser.T__32, ModelicaParser.T__33, ModelicaParser.T__34, ModelicaParser.T__35, ModelicaParser.T__36, ModelicaParser.T__37, ModelicaParser.IDENT]:
                self.state = 534
                self.base_prefix()
                self.state = 535
                self.component_reference()
                self.state = 537
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.T__75:
                    self.state = 536
                    self.array_subscripts()


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


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


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

                self.state = 552
                self.match(ModelicaParser.T__18)
                self.state = 553
                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 = 561
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,75,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 556
                    self.equation()
                    self.state = 557
                    self.match(ModelicaParser.T__0) 
                self.state = 563
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,75,self._ctx)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.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 = 565
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.INITIAL:
                self.state = 564
                self.match(ModelicaParser.INITIAL)


            self.state = 567
            self.match(ModelicaParser.T__41)
            self.state = 568
            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 = 575
            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 = 570
                self.statement()
                self.state = 571
                self.match(ModelicaParser.T__0)
                self.state = 577
                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 = 579
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.INITIAL:
                self.state = 578
                self.match(ModelicaParser.INITIAL)


            self.state = 581
            self.match(ModelicaParser.T__42)
            self.state = 582
            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 = 595
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,79,self._ctx)
            if la_ == 1:
                localctx = ModelicaParser.Equation_simpleContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 584
                self.simple_expression()
                self.state = 585
                self.match(ModelicaParser.T__14)
                self.state = 586
                self.expression()
                pass

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

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

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

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

            elif la_ == 6:
                localctx = ModelicaParser.Equation_functionContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 592
                self.name()
                self.state = 593
                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 = 597
            self.equation_options()
            self.state = 598
            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 = 626
            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 = 600
                self.component_reference()
                self.state = 604
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [ModelicaParser.T__40]:
                    self.state = 601
                    self.match(ModelicaParser.T__40)
                    self.state = 602
                    self.expression()
                    pass
                elif token in [ModelicaParser.T__16]:
                    self.state = 603
                    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 = 606
                self.match(ModelicaParser.T__16)
                self.state = 607
                self.component_reference()
                self.state = 612
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==ModelicaParser.T__20:
                    self.state = 608
                    self.match(ModelicaParser.T__20)
                    self.state = 609
                    self.component_reference()
                    self.state = 614
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 615
                self.match(ModelicaParser.T__18)
                self.state = 616
                self.match(ModelicaParser.T__40)
                self.state = 617
                self.component_reference()
                self.state = 618
                self.function_call_args()
                pass
            elif token in [ModelicaParser.T__43]:
                localctx = ModelicaParser.Statement_breakContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 620
                self.match(ModelicaParser.T__43)
                pass
            elif token in [ModelicaParser.T__44]:
                localctx = ModelicaParser.Statement_returnContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 621
                self.match(ModelicaParser.T__44)
                pass
            elif token in [ModelicaParser.T__39]:
                localctx = ModelicaParser.Statement_ifContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 622
                self.if_statement()
                pass
            elif token in [ModelicaParser.T__48]:
                localctx = ModelicaParser.Statement_forContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 623
                self.for_statement()
                pass
            elif token in [ModelicaParser.T__51]:
                localctx = ModelicaParser.Statement_whileContext(self, localctx)
                self.enterOuterAlt(localctx, 7)
                self.state = 624
                self.while_statement()
                pass
            elif token in [ModelicaParser.T__52]:
                localctx = ModelicaParser.Statement_whenContext(self, localctx)
                self.enterOuterAlt(localctx, 8)
                self.state = 625
                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 = 628
            self.statement_options()
            self.state = 629
            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 = 631
            self.match(ModelicaParser.T__39)
            self.state = 632
            localctx._expression = self.expression()
            localctx.conditions.append(localctx._expression)
            self.state = 633
            self.match(ModelicaParser.T__45)
            self.state = 634
            localctx._equation_block = self.equation_block()
            localctx.blocks.append(localctx._equation_block)
            self.state = 642
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__46:
                self.state = 635
                self.match(ModelicaParser.T__46)
                self.state = 636
                localctx._expression = self.expression()
                localctx.conditions.append(localctx._expression)
                self.state = 637
                self.match(ModelicaParser.T__45)
                self.state = 638
                localctx._equation_block = self.equation_block()
                localctx.blocks.append(localctx._equation_block)
                self.state = 644
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 647
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__47:
                self.state = 645
                self.match(ModelicaParser.T__47)
                self.state = 646
                localctx._equation_block = self.equation_block()
                localctx.blocks.append(localctx._equation_block)


            self.state = 649
            self.match(ModelicaParser.T__13)
            self.state = 650
            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 = 652
            self.match(ModelicaParser.T__39)
            self.state = 653
            localctx._expression = self.expression()
            localctx.conditions.append(localctx._expression)
            self.state = 654
            self.match(ModelicaParser.T__45)
            self.state = 655
            localctx._statement_block = self.statement_block()
            localctx.blocks.append(localctx._statement_block)
            self.state = 663
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__46:
                self.state = 656
                self.match(ModelicaParser.T__46)
                self.state = 657
                localctx._expression = self.expression()
                localctx.conditions.append(localctx._expression)
                self.state = 658
                self.match(ModelicaParser.T__45)
                self.state = 659
                localctx._statement_block = self.statement_block()
                localctx.blocks.append(localctx._statement_block)
                self.state = 665
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 668
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__47:
                self.state = 666
                self.match(ModelicaParser.T__47)
                self.state = 667
                localctx._statement_block = self.statement_block()
                localctx.blocks.append(localctx._statement_block)


            self.state = 670
            self.match(ModelicaParser.T__13)
            self.state = 671
            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 = 673
            self.match(ModelicaParser.T__48)
            self.state = 674
            localctx.indices = self.for_indices()
            self.state = 675
            self.match(ModelicaParser.T__49)
            self.state = 676
            localctx.block = self.equation_block()
            self.state = 677
            self.match(ModelicaParser.T__13)
            self.state = 678
            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 = 680
            self.match(ModelicaParser.T__48)
            self.state = 681
            localctx.indices = self.for_indices()
            self.state = 682
            self.match(ModelicaParser.T__49)
            self.state = 683
            localctx.block = self.statement_block()
            self.state = 684
            self.match(ModelicaParser.T__13)
            self.state = 685
            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 = 687
            self.for_index()
            self.state = 692
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,87,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 688
                    self.match(ModelicaParser.T__20)
                    self.state = 689
                    self.for_index() 
                self.state = 694
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,87,self._ctx)

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

    class 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 = 695
            self.match(ModelicaParser.IDENT)
            self.state = 698
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__50:
                self.state = 696
                self.match(ModelicaParser.T__50)
                self.state = 697
                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 = 700
            self.match(ModelicaParser.T__51)
            self.state = 701
            localctx.condition = self.expression()
            self.state = 702
            self.match(ModelicaParser.T__49)
            self.state = 703
            localctx.block = self.statement_block()
            self.state = 704
            self.match(ModelicaParser.T__13)
            self.state = 705
            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 = 707
            self.match(ModelicaParser.T__52)
            self.state = 708
            localctx._expression = self.expression()
            localctx.conditions.append(localctx._expression)
            self.state = 709
            self.match(ModelicaParser.T__45)
            self.state = 710
            localctx._equation_block = self.equation_block()
            localctx.blocks.append(localctx._equation_block)
            self.state = 718
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__53:
                self.state = 711
                self.match(ModelicaParser.T__53)
                self.state = 712
                localctx._expression = self.expression()
                localctx.conditions.append(localctx._expression)
                self.state = 713
                self.match(ModelicaParser.T__45)
                self.state = 714
                localctx._equation_block = self.equation_block()
                localctx.blocks.append(localctx._equation_block)
                self.state = 720
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 721
            self.match(ModelicaParser.T__13)
            self.state = 722
            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 = 724
            self.match(ModelicaParser.T__52)
            self.state = 725
            localctx._expression = self.expression()
            localctx.conditions.append(localctx._expression)
            self.state = 726
            self.match(ModelicaParser.T__45)
            self.state = 727
            localctx._statement_block = self.statement_block()
            localctx.blocks.append(localctx._statement_block)
            self.state = 735
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__53:
                self.state = 728
                self.match(ModelicaParser.T__53)
                self.state = 729
                localctx._expression = self.expression()
                localctx.conditions.append(localctx._expression)
                self.state = 730
                self.match(ModelicaParser.T__45)
                self.state = 731
                localctx._statement_block = self.statement_block()
                localctx.blocks.append(localctx._statement_block)
                self.state = 737
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 738
            self.match(ModelicaParser.T__13)
            self.state = 739
            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 = 741
            self.match(ModelicaParser.T__54)
            self.state = 742
            self.match(ModelicaParser.T__16)
            self.state = 743
            self.component_reference()
            self.state = 744
            self.match(ModelicaParser.T__20)
            self.state = 745
            self.component_reference()
            self.state = 746
            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 = 766
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [ModelicaParser.T__13, ModelicaParser.T__16, ModelicaParser.T__19, ModelicaParser.T__55, ModelicaParser.T__56, ModelicaParser.T__70, ModelicaParser.T__73, ModelicaParser.T__74, ModelicaParser.T__75, ModelicaParser.T__77, ModelicaParser.INITIAL, ModelicaParser.IDENT, ModelicaParser.STRING, ModelicaParser.UNSIGNED_NUMBER]:
                localctx = ModelicaParser.Expression_simpleContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 748
                self.simple_expression()
                pass
            elif token in [ModelicaParser.T__39]:
                localctx = ModelicaParser.Expression_ifContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 749
                self.match(ModelicaParser.T__39)
                self.state = 750
                localctx._expression = self.expression()
                localctx.conditions.append(localctx._expression)
                self.state = 751
                self.match(ModelicaParser.T__45)
                self.state = 752
                localctx._expression = self.expression()
                localctx.blocks.append(localctx._expression)
                self.state = 760
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==ModelicaParser.T__46:
                    self.state = 753
                    self.match(ModelicaParser.T__46)
                    self.state = 754
                    localctx._expression = self.expression()
                    localctx.conditions.append(localctx._expression)
                    self.state = 755
                    self.match(ModelicaParser.T__45)
                    self.state = 756
                    localctx._expression = self.expression()
                    localctx.blocks.append(localctx._expression)
                    self.state = 762
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 763
                self.match(ModelicaParser.T__47)
                self.state = 764
                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 = 768
            self.expr(0)
            self.state = 775
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__17:
                self.state = 769
                self.match(ModelicaParser.T__17)
                self.state = 770
                self.expr(0)
                self.state = 773
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.T__17:
                    self.state = 771
                    self.match(ModelicaParser.T__17)
                    self.state = 772
                    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_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_signedContext(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_signed" ):
                listener.enterExpr_signed(self)

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

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpr_signed" ):
                return visitor.visitExpr_signed(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 = 787
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,95,self._ctx)
            if la_ == 1:
                localctx = ModelicaParser.Expr_signedContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 778
                localctx.op = self._input.LT(1)
                _la = self._input.LA(1)
                if not(_la==ModelicaParser.T__55 or _la==ModelicaParser.T__56):
                    localctx.op = self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 779
                self.expr(9)
                pass

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

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

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


            self._ctx.stop = self._input.LT(-1)
            self.state = 806
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,97,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    self.state = 804
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,96,self._ctx)
                    if la_ == 1:
                        localctx = ModelicaParser.Expr_mulContext(self, ModelicaParser.ExprContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expr)
                        self.state = 789
                        if not self.precpred(self._ctx, 7):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 7)")
                        self.state = 790
                        localctx.op = self._input.LT(1)
                        _la = self._input.LA(1)
                        if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << ModelicaParser.T__27) | (1 << ModelicaParser.T__59) | (1 << ModelicaParser.T__60) | (1 << ModelicaParser.T__61))) != 0)):
                            localctx.op = self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
                        self.state = 791
                        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 = 792
                        if not self.precpred(self._ctx, 6):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
                        self.state = 793
                        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__56 - 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 = 794
                        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 = 795
                        if not self.precpred(self._ctx, 5):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
                        self.state = 796
                        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 = 797
                        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 = 798
                        if not self.precpred(self._ctx, 3):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 3)")
                        self.state = 799
                        self.match(ModelicaParser.T__71)
                        self.state = 800
                        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 = 801
                        if not self.precpred(self._ctx, 2):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                        self.state = 802
                        self.match(ModelicaParser.T__72)
                        self.state = 803
                        self.expr(3)
                        pass

             
                self.state = 808
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,97,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 = 841
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,99,self._ctx)
            if la_ == 1:
                localctx = ModelicaParser.Primary_unsigned_numberContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 809
                self.match(ModelicaParser.UNSIGNED_NUMBER)
                pass

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

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

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

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

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

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

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

            elif la_ == 9:
                localctx = ModelicaParser.Primary_output_expression_listContext(self, localctx)
                self.enterOuterAlt(localctx, 9)
                self.state = 821
                self.match(ModelicaParser.T__16)
                self.state = 822
                self.output_expression_list()
                self.state = 823
                self.match(ModelicaParser.T__18)
                pass

            elif la_ == 10:
                localctx = ModelicaParser.Primary_expression_listContext(self, localctx)
                self.enterOuterAlt(localctx, 10)
                self.state = 825
                self.match(ModelicaParser.T__75)
                self.state = 826
                self.expression_list()
                self.state = 831
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==ModelicaParser.T__0:
                    self.state = 827
                    self.match(ModelicaParser.T__0)
                    self.state = 828
                    self.expression_list()
                    self.state = 833
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

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

            elif la_ == 11:
                localctx = ModelicaParser.Primary_function_argumentsContext(self, localctx)
                self.enterOuterAlt(localctx, 11)
                self.state = 836
                self.match(ModelicaParser.T__77)
                self.state = 837
                self.function_arguments()
                self.state = 838
                self.match(ModelicaParser.T__29)
                pass

            elif la_ == 12:
                localctx = ModelicaParser.Primary_endContext(self, localctx)
                self.enterOuterAlt(localctx, 12)
                self.state = 840
                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 = 844
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__38:
                self.state = 843
                self.match(ModelicaParser.T__38)


            self.state = 846
            self.match(ModelicaParser.IDENT)
            self.state = 851
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__38:
                self.state = 847
                self.match(ModelicaParser.T__38)
                self.state = 848
                self.match(ModelicaParser.IDENT)
                self.state = 853
                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 = 854
            self.match(ModelicaParser.IDENT)
            self.state = 856
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,102,self._ctx)
            if la_ == 1:
                self.state = 855
                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 = 858
            self.component_reference_element()
            self.state = 863
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,103,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 859
                    self.match(ModelicaParser.T__38)
                    self.state = 860
                    self.component_reference_element() 
                self.state = 865
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,103,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 = 866
            self.match(ModelicaParser.T__16)
            self.state = 868
            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__39) | (1 << ModelicaParser.T__55) | (1 << ModelicaParser.T__56))) != 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.T__77 - 71)) | (1 << (ModelicaParser.INITIAL - 71)) | (1 << (ModelicaParser.IDENT - 71)) | (1 << (ModelicaParser.STRING - 71)) | (1 << (ModelicaParser.UNSIGNED_NUMBER - 71)))) != 0):
                self.state = 867
                self.function_arguments()


            self.state = 870
            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 = 883
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,107,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 872
                self.function_argument()
                self.state = 879
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==ModelicaParser.T__20 or _la==ModelicaParser.T__48:
                    self.state = 877
                    self._errHandler.sync(self)
                    token = self._input.LA(1)
                    if token in [ModelicaParser.T__20]:
                        self.state = 873
                        self.match(ModelicaParser.T__20)
                        self.state = 874
                        self.function_argument()
                        pass
                    elif token in [ModelicaParser.T__48]:
                        self.state = 875
                        self.match(ModelicaParser.T__48)
                        self.state = 876
                        self.for_indices()
                        pass
                    else:
                        raise NoViableAltException(self)

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

                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 882
                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 = 885
            self.named_argument()
            self.state = 890
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__20:
                self.state = 886
                self.match(ModelicaParser.T__20)
                self.state = 887
                self.named_argument()
                self.state = 892
                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 = 893
            self.match(ModelicaParser.IDENT)
            self.state = 894
            self.match(ModelicaParser.T__14)
            self.state = 895
            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 = 906
            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 = 897
                self.match(ModelicaParser.T__12)
                self.state = 898
                self.name()
                self.state = 899
                self.match(ModelicaParser.T__16)
                self.state = 901
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==ModelicaParser.IDENT:
                    self.state = 900
                    self.named_arguments()


                self.state = 903
                self.match(ModelicaParser.T__18)
                pass
            elif token in [ModelicaParser.T__13, ModelicaParser.T__16, ModelicaParser.T__19, ModelicaParser.T__39, ModelicaParser.T__55, ModelicaParser.T__56, ModelicaParser.T__70, ModelicaParser.T__73, ModelicaParser.T__74, ModelicaParser.T__75, ModelicaParser.T__77, ModelicaParser.INITIAL, ModelicaParser.IDENT, ModelicaParser.STRING, ModelicaParser.UNSIGNED_NUMBER]:
                localctx = ModelicaParser.Argument_expressionContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 905
                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 = 909
            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__39) | (1 << ModelicaParser.T__55) | (1 << ModelicaParser.T__56))) != 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.T__77 - 71)) | (1 << (ModelicaParser.INITIAL - 71)) | (1 << (ModelicaParser.IDENT - 71)) | (1 << (ModelicaParser.STRING - 71)) | (1 << (ModelicaParser.UNSIGNED_NUMBER - 71)))) != 0):
                self.state = 908
                self.expression()


            self.state = 915
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__20:
                self.state = 911
                self.match(ModelicaParser.T__20)
                self.state = 912
                self.expression()
                self.state = 917
                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 = 918
            self.expression()
            self.state = 923
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__20:
                self.state = 919
                self.match(ModelicaParser.T__20)
                self.state = 920
                self.expression()
                self.state = 925
                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 = 926
            self.match(ModelicaParser.T__75)
            self.state = 927
            self.subscript()
            self.state = 932
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==ModelicaParser.T__20:
                self.state = 928
                self.match(ModelicaParser.T__20)
                self.state = 929
                self.subscript()
                self.state = 934
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 935
            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 = 939
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [ModelicaParser.T__17]:
                self.enterOuterAlt(localctx, 1)
                self.state = 937
                self.match(ModelicaParser.T__17)
                pass
            elif token in [ModelicaParser.T__13, ModelicaParser.T__16, ModelicaParser.T__19, ModelicaParser.T__39, ModelicaParser.T__55, ModelicaParser.T__56, ModelicaParser.T__70, ModelicaParser.T__73, ModelicaParser.T__74, ModelicaParser.T__75, ModelicaParser.T__77, ModelicaParser.INITIAL, ModelicaParser.IDENT, ModelicaParser.STRING, ModelicaParser.UNSIGNED_NUMBER]:
                self.enterOuterAlt(localctx, 2)
                self.state = 938
                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 = 941
            self.string_comment()
            self.state = 943
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.T__78:
                self.state = 942
                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 = 953
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==ModelicaParser.STRING:
                self.state = 945
                self.match(ModelicaParser.STRING)
                self.state = 950
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==ModelicaParser.T__55:
                    self.state = 946
                    self.match(ModelicaParser.T__55)
                    self.state = 947
                    self.match(ModelicaParser.STRING)
                    self.state = 952
                    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 = 955
            self.match(ModelicaParser.T__78)
            self.state = 956
            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)
         




