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


def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3R")
        buf.write("\u0321\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\4N\tN\4O\tO\4P\tP\4Q\tQ\4R\tR\4S\tS\4T\tT\4U\tU\4V\t")
        buf.write("V\4W\tW\4X\tX\4Y\tY\4Z\tZ\4[\t[\4\\\t\\\4]\t]\4^\t^\4")
        buf.write("_\t_\4`\t`\4a\ta\4b\tb\3\2\3\2\5\2\u00c7\n\2\3\2\3\2\3")
        buf.write("\2\3\3\3\3\3\3\3\3\3\3\3\3\5\3\u00d2\n\3\3\3\3\3\3\3\3")
        buf.write("\3\3\3\3\3\5\3\u00da\n\3\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3")
        buf.write("\5\3\5\7\5\u00e5\n\5\f\5\16\5\u00e8\13\5\3\5\3\5\3\6\3")
        buf.write("\6\3\6\3\6\3\7\3\7\3\7\3\7\7\7\u00f4\n\7\f\7\16\7\u00f7")
        buf.write("\13\7\3\7\3\7\3\b\3\b\3\t\3\t\3\t\3\t\6\t\u0101\n\t\r")
        buf.write("\t\16\t\u0102\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13")
        buf.write("\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\5\f\u0118\n\f")
        buf.write("\3\r\3\r\5\r\u011c\n\r\3\16\3\16\3\17\3\17\3\20\3\20\3")
        buf.write("\21\3\21\3\22\3\22\3\23\3\23\3\23\3\23\6\23\u012c\n\23")
        buf.write("\r\23\16\23\u012d\3\24\3\24\3\24\3\24\3\24\5\24\u0135")
        buf.write("\n\24\3\25\3\25\5\25\u0139\n\25\3\25\3\25\3\25\3\26\3")
        buf.write("\26\5\26\u0140\n\26\3\27\3\27\3\27\5\27\u0145\n\27\3\30")
        buf.write("\3\30\3\30\3\30\5\30\u014b\n\30\3\31\3\31\3\31\3\31\3")
        buf.write("\32\3\32\3\32\3\32\3\33\3\33\5\33\u0157\n\33\3\34\3\34")
        buf.write("\3\34\5\34\u015c\n\34\3\35\3\35\3\35\3\35\5\35\u0162\n")
        buf.write("\35\3\36\3\36\3\36\3\36\5\36\u0168\n\36\3\36\3\36\3\37")
        buf.write("\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37")
        buf.write("\3\37\3\37\5\37\u017a\n\37\3 \3 \3 \7 \u017f\n \f \16")
        buf.write(" \u0182\13 \3!\3!\3\"\3\"\3#\3#\5#\u018a\n#\3#\3#\3$\3")
        buf.write("$\3$\5$\u0191\n$\3$\5$\u0194\n$\3%\3%\3%\7%\u0199\n%\f")
        buf.write("%\16%\u019c\13%\3&\3&\3&\3&\3\'\3\'\3\'\3\'\3\'\3\'\7")
        buf.write("\'\u01a8\n\'\f\'\16\'\u01ab\13\'\3(\3(\3(\3(\3(\5(\u01b2")
        buf.write("\n(\3)\3)\3)\3)\3)\3)\3*\3*\3*\3*\3+\3+\3,\3,\3,\3,\5")
        buf.write(",\u01c4\n,\3-\3-\3-\3.\3.\3.\3.\7.\u01cd\n.\f.\16.\u01d0")
        buf.write("\13.\3.\3.\3/\3/\3/\3/\3\60\3\60\3\60\3\61\3\61\5\61\u01dd")
        buf.write("\n\61\3\62\3\62\3\62\5\62\u01e2\n\62\3\62\3\62\3\62\3")
        buf.write("\63\3\63\3\63\3\63\7\63\u01eb\n\63\f\63\16\63\u01ee\13")
        buf.write("\63\3\63\3\63\3\64\3\64\3\64\3\64\3\64\3\64\3\64\5\64")
        buf.write("\u01f9\n\64\3\65\3\65\3\65\3\65\3\66\3\66\3\66\7\66\u0202")
        buf.write("\n\66\f\66\16\66\u0205\13\66\3\67\3\67\3\67\7\67\u020a")
        buf.write("\n\67\f\67\16\67\u020d\13\67\38\38\38\58\u0212\n8\38\3")
        buf.write("8\38\38\38\39\39\3:\3:\3:\3:\3:\5:\u0220\n:\3;\3;\5;\u0224")
        buf.write("\n;\3<\3<\3<\3<\5<\u022a\n<\3=\3=\3=\3=\3>\3>\3>\5>\u0233")
        buf.write("\n>\3>\3>\3>\3>\7>\u0239\n>\f>\16>\u023c\13>\3>\3>\3>")
        buf.write("\3>\3>\3>\7>\u0244\n>\f>\16>\u0247\13>\3>\3>\3>\3>\3>")
        buf.write("\7>\u024e\n>\f>\16>\u0251\13>\3?\3?\3?\3?\5?\u0257\n?")
        buf.write("\3@\3@\3A\3A\3A\3A\5A\u025f\nA\3B\3B\3C\3C\3C\3C\5C\u0267")
        buf.write("\nC\3D\3D\3E\5E\u026c\nE\3E\3E\3F\3F\3F\3F\3F\3F\3F\3")
        buf.write("F\3F\3F\3F\5F\u027b\nF\3G\3G\3G\3G\5G\u0281\nG\3H\3H\3")
        buf.write("H\3H\3H\3I\3I\3I\7I\u028b\nI\fI\16I\u028e\13I\3J\3J\3")
        buf.write("J\3J\3J\3J\3J\3J\5J\u0298\nJ\3K\3K\3K\7K\u029d\nK\fK\16")
        buf.write("K\u02a0\13K\3K\5K\u02a3\nK\3L\3L\3L\5L\u02a8\nL\3M\3M")
        buf.write("\3M\3M\3M\5M\u02af\nM\3N\3N\7N\u02b3\nN\fN\16N\u02b6\13")
        buf.write("N\3O\3O\3O\3P\3P\3P\3Q\3Q\3R\3R\3S\3S\3S\3S\5S\u02c6\n")
        buf.write("S\3T\3T\3T\3T\3U\3U\3U\7U\u02cf\nU\fU\16U\u02d2\13U\3")
        buf.write("V\3V\5V\u02d6\nV\3W\3W\3W\3W\3W\3W\5W\u02de\nW\3X\3X\3")
        buf.write("X\3X\3X\3X\7X\u02e6\nX\fX\16X\u02e9\13X\3X\3X\3X\5X\u02ee")
        buf.write("\nX\3X\3X\3Y\3Y\3Y\3Y\3Z\3Z\3Z\5Z\u02f9\nZ\3[\3[\3[\3")
        buf.write("[\3[\3\\\3\\\3\\\3\\\3\\\3]\3]\3]\3]\3]\3]\3]\3^\3^\3")
        buf.write("^\3^\3_\3_\3`\3`\3a\3a\3a\3a\3a\3b\3b\3b\7b\u031c\nb\f")
        buf.write("b\16b\u031f\13b\3b\2\2c\2\4\6\b\n\f\16\20\22\24\26\30")
        buf.write("\32\34\36 \"$&(*,.\60\62\64\668:<>@BDFHJLNPRTVXZ\\^`b")
        buf.write("dfhjlnprtvxz|~\u0080\u0082\u0084\u0086\u0088\u008a\u008c")
        buf.write("\u008e\u0090\u0092\u0094\u0096\u0098\u009a\u009c\u009e")
        buf.write("\u00a0\u00a2\u00a4\u00a6\u00a8\u00aa\u00ac\u00ae\u00b0")
        buf.write("\u00b2\u00b4\u00b6\u00b8\u00ba\u00bc\u00be\u00c0\u00c2")
        buf.write("\2\t\3\2+,\3\2JK\7\2\6\6\b\b\26\26  HH\4\2\25\25\638\4")
        buf.write("\2\34\34+,\6\2\3\3\13\13\30\30-.\4\2\r\r%%\2\u031f\2\u00c4")
        buf.write("\3\2\2\2\4\u00d9\3\2\2\2\6\u00db\3\2\2\2\b\u00e6\3\2\2")
        buf.write("\2\n\u00eb\3\2\2\2\f\u00ef\3\2\2\2\16\u00fa\3\2\2\2\20")
        buf.write("\u00fc\3\2\2\2\22\u0104\3\2\2\2\24\u0108\3\2\2\2\26\u0117")
        buf.write("\3\2\2\2\30\u011b\3\2\2\2\32\u011d\3\2\2\2\34\u011f\3")
        buf.write("\2\2\2\36\u0121\3\2\2\2 \u0123\3\2\2\2\"\u0125\3\2\2\2")
        buf.write("$\u0127\3\2\2\2&\u012f\3\2\2\2(\u0136\3\2\2\2*\u013d\3")
        buf.write("\2\2\2,\u0144\3\2\2\2.\u014a\3\2\2\2\60\u014c\3\2\2\2")
        buf.write("\62\u0150\3\2\2\2\64\u0156\3\2\2\2\66\u015b\3\2\2\28\u0161")
        buf.write("\3\2\2\2:\u0163\3\2\2\2<\u0179\3\2\2\2>\u017b\3\2\2\2")
        buf.write("@\u0183\3\2\2\2B\u0185\3\2\2\2D\u0187\3\2\2\2F\u0193\3")
        buf.write("\2\2\2H\u0195\3\2\2\2J\u019d\3\2\2\2L\u01a1\3\2\2\2N\u01b1")
        buf.write("\3\2\2\2P\u01b3\3\2\2\2R\u01b9\3\2\2\2T\u01bd\3\2\2\2")
        buf.write("V\u01c3\3\2\2\2X\u01c5\3\2\2\2Z\u01c8\3\2\2\2\\\u01d3")
        buf.write("\3\2\2\2^\u01d7\3\2\2\2`\u01dc\3\2\2\2b\u01de\3\2\2\2")
        buf.write("d\u01e6\3\2\2\2f\u01f8\3\2\2\2h\u01fa\3\2\2\2j\u01fe\3")
        buf.write("\2\2\2l\u0206\3\2\2\2n\u020e\3\2\2\2p\u0218\3\2\2\2r\u021f")
        buf.write("\3\2\2\2t\u0223\3\2\2\2v\u0229\3\2\2\2x\u022b\3\2\2\2")
        buf.write("z\u0232\3\2\2\2|\u0252\3\2\2\2~\u0258\3\2\2\2\u0080\u025a")
        buf.write("\3\2\2\2\u0082\u0260\3\2\2\2\u0084\u0262\3\2\2\2\u0086")
        buf.write("\u0268\3\2\2\2\u0088\u026b\3\2\2\2\u008a\u027a\3\2\2\2")
        buf.write("\u008c\u0280\3\2\2\2\u008e\u0282\3\2\2\2\u0090\u0287\3")
        buf.write("\2\2\2\u0092\u0297\3\2\2\2\u0094\u02a2\3\2\2\2\u0096\u02a4")
        buf.write("\3\2\2\2\u0098\u02a9\3\2\2\2\u009a\u02b0\3\2\2\2\u009c")
        buf.write("\u02b7\3\2\2\2\u009e\u02ba\3\2\2\2\u00a0\u02bd\3\2\2\2")
        buf.write("\u00a2\u02bf\3\2\2\2\u00a4\u02c5\3\2\2\2\u00a6\u02c7\3")
        buf.write("\2\2\2\u00a8\u02cb\3\2\2\2\u00aa\u02d5\3\2\2\2\u00ac\u02d7")
        buf.write("\3\2\2\2\u00ae\u02df\3\2\2\2\u00b0\u02f1\3\2\2\2\u00b2")
        buf.write("\u02f8\3\2\2\2\u00b4\u02fa\3\2\2\2\u00b6\u02ff\3\2\2\2")
        buf.write("\u00b8\u0304\3\2\2\2\u00ba\u030b\3\2\2\2\u00bc\u030f\3")
        buf.write("\2\2\2\u00be\u0311\3\2\2\2\u00c0\u0313\3\2\2\2\u00c2\u0318")
        buf.write("\3\2\2\2\u00c4\u00c6\5\4\3\2\u00c5\u00c7\7F\2\2\u00c6")
        buf.write("\u00c5\3\2\2\2\u00c6\u00c7\3\2\2\2\u00c7\u00c8\3\2\2\2")
        buf.write("\u00c8\u00c9\5\b\5\2\u00c9\u00ca\7A\2\2\u00ca\3\3\2\2")
        buf.write("\2\u00cb\u00cc\7\37\2\2\u00cc\u00d1\5\6\4\2\u00cd\u00ce")
        buf.write("\79\2\2\u00ce\u00cf\5j\66\2\u00cf\u00d0\7:\2\2\u00d0\u00d2")
        buf.write("\3\2\2\2\u00d1\u00cd\3\2\2\2\u00d1\u00d2\3\2\2\2\u00d2")
        buf.write("\u00d3\3\2\2\2\u00d3\u00d4\7\61\2\2\u00d4\u00da\3\2\2")
        buf.write("\2\u00d5\u00d6\7E\2\2\u00d6\u00d7\5\6\4\2\u00d7\u00d8")
        buf.write("\7\61\2\2\u00d8\u00da\3\2\2\2\u00d9\u00cb\3\2\2\2\u00d9")
        buf.write("\u00d5\3\2\2\2\u00da\5\3\2\2\2\u00db\u00dc\7O\2\2\u00dc")
        buf.write("\7\3\2\2\2\u00dd\u00e5\5\f\7\2\u00de\u00e5\5\20\t\2\u00df")
        buf.write("\u00e5\5$\23\2\u00e0\u00e5\5Z.\2\u00e1\u00e5\5^\60\2\u00e2")
        buf.write("\u00e5\5\n\6\2\u00e3\u00e5\7I\2\2\u00e4\u00dd\3\2\2\2")
        buf.write("\u00e4\u00de\3\2\2\2\u00e4\u00df\3\2\2\2\u00e4\u00e0\3")
        buf.write("\2\2\2\u00e4\u00e1\3\2\2\2\u00e4\u00e2\3\2\2\2\u00e4\u00e3")
        buf.write("\3\2\2\2\u00e5\u00e8\3\2\2\2\u00e6\u00e4\3\2\2\2\u00e6")
        buf.write("\u00e7\3\2\2\2\u00e7\u00e9\3\2\2\2\u00e8\u00e6\3\2\2\2")
        buf.write("\u00e9\u00ea\5\u00a6T\2\u00ea\t\3\2\2\2\u00eb\u00ec\7")
        buf.write("G\2\2\u00ec\u00ed\5j\66\2\u00ed\u00ee\7\61\2\2\u00ee\13")
        buf.write("\3\2\2\2\u00ef\u00f0\7\27\2\2\u00f0\u00f5\5\16\b\2\u00f1")
        buf.write("\u00f2\7\60\2\2\u00f2\u00f4\5\16\b\2\u00f3\u00f1\3\2\2")
        buf.write("\2\u00f4\u00f7\3\2\2\2\u00f5\u00f3\3\2\2\2\u00f5\u00f6")
        buf.write("\3\2\2\2\u00f6\u00f8\3\2\2\2\u00f7\u00f5\3\2\2\2\u00f8")
        buf.write("\u00f9\7\61\2\2\u00f9\r\3\2\2\2\u00fa\u00fb\5\32\16\2")
        buf.write("\u00fb\17\3\2\2\2\u00fc\u0100\7\n\2\2\u00fd\u00fe\5\22")
        buf.write("\n\2\u00fe\u00ff\7\61\2\2\u00ff\u0101\3\2\2\2\u0100\u00fd")
        buf.write("\3\2\2\2\u0101\u0102\3\2\2\2\u0102\u0100\3\2\2\2\u0102")
        buf.write("\u0103\3\2\2\2\u0103\21\3\2\2\2\u0104\u0105\5\6\4\2\u0105")
        buf.write("\u0106\7\63\2\2\u0106\u0107\5\26\f\2\u0107\23\3\2\2\2")
        buf.write("\u0108\u0109\7\t\2\2\u0109\u010a\79\2\2\u010a\u010b\5")
        buf.write("\32\16\2\u010b\u010c\7:\2\2\u010c\25\3\2\2\2\u010d\u0118")
        buf.write("\5\30\r\2\u010e\u010f\5\36\20\2\u010f\u0110\5\30\r\2\u0110")
        buf.write("\u0118\3\2\2\2\u0111\u0118\5\6\4\2\u0112\u0113\5\36\20")
        buf.write("\2\u0113\u0114\5\6\4\2\u0114\u0118\3\2\2\2\u0115\u0118")
        buf.write("\5\"\22\2\u0116\u0118\5\24\13\2\u0117\u010d\3\2\2\2\u0117")
        buf.write("\u010e\3\2\2\2\u0117\u0111\3\2\2\2\u0117\u0112\3\2\2\2")
        buf.write("\u0117\u0115\3\2\2\2\u0117\u0116\3\2\2\2\u0118\27\3\2")
        buf.write("\2\2\u0119\u011c\5\32\16\2\u011a\u011c\5\34\17\2\u011b")
        buf.write("\u0119\3\2\2\2\u011b\u011a\3\2\2\2\u011c\31\3\2\2\2\u011d")
        buf.write("\u011e\7Q\2\2\u011e\33\3\2\2\2\u011f\u0120\7R\2\2\u0120")
        buf.write("\35\3\2\2\2\u0121\u0122\t\2\2\2\u0122\37\3\2\2\2\u0123")
        buf.write("\u0124\t\3\2\2\u0124!\3\2\2\2\u0125\u0126\7P\2\2\u0126")
        buf.write("#\3\2\2\2\u0127\u012b\7&\2\2\u0128\u0129\5&\24\2\u0129")
        buf.write("\u012a\7\61\2\2\u012a\u012c\3\2\2\2\u012b\u0128\3\2\2")
        buf.write("\2\u012c\u012d\3\2\2\2\u012d\u012b\3\2\2\2\u012d\u012e")
        buf.write("\3\2\2\2\u012e%\3\2\2\2\u012f\u0130\5\6\4\2\u0130\u0134")
        buf.write("\7\63\2\2\u0131\u0135\5,\27\2\u0132\u0135\5(\25\2\u0133")
        buf.write("\u0135\5*\26\2\u0134\u0131\3\2\2\2\u0134\u0132\3\2\2\2")
        buf.write("\u0134\u0133\3\2\2\2\u0135\'\3\2\2\2\u0136\u0138\7\22")
        buf.write("\2\2\u0137\u0139\5d\63\2\u0138\u0137\3\2\2\2\u0138\u0139")
        buf.write("\3\2\2\2\u0139\u013a\3\2\2\2\u013a\u013b\7\62\2\2\u013b")
        buf.write("\u013c\5p9\2\u013c)\3\2\2\2\u013d\u013f\7\36\2\2\u013e")
        buf.write("\u0140\5d\63\2\u013f\u013e\3\2\2\2\u013f\u0140\3\2\2\2")
        buf.write("\u0140+\3\2\2\2\u0141\u0145\5.\30\2\u0142\u0145\5\66\34")
        buf.write("\2\u0143\u0145\5X-\2\u0144\u0141\3\2\2\2\u0144\u0142\3")
        buf.write("\2\2\2\u0144\u0143\3\2\2\2\u0145-\3\2\2\2\u0146\u014b")
        buf.write("\5\60\31\2\u0147\u014b\5\62\32\2\u0148\u014b\5\64\33\2")
        buf.write("\u0149\u014b\5:\36\2\u014a\u0146\3\2\2\2\u014a\u0147\3")
        buf.write("\2\2\2\u014a\u0148\3\2\2\2\u014a\u0149\3\2\2\2\u014b/")
        buf.write("\3\2\2\2\u014c\u014d\79\2\2\u014d\u014e\5j\66\2\u014e")
        buf.write("\u014f\7:\2\2\u014f\61\3\2\2\2\u0150\u0151\5\26\f\2\u0151")
        buf.write("\u0152\7B\2\2\u0152\u0153\5\26\f\2\u0153\63\3\2\2\2\u0154")
        buf.write("\u0157\5\6\4\2\u0155\u0157\t\4\2\2\u0156\u0154\3\2\2\2")
        buf.write("\u0156\u0155\3\2\2\2\u0157\65\3\2\2\2\u0158\u0159\7\35")
        buf.write("\2\2\u0159\u015c\58\35\2\u015a\u015c\58\35\2\u015b\u0158")
        buf.write("\3\2\2\2\u015b\u015a\3\2\2\2\u015c\67\3\2\2\2\u015d\u0162")
        buf.write("\5<\37\2\u015e\u0162\5D#\2\u015f\u0162\5R*\2\u0160\u0162")
        buf.write("\5V,\2\u0161\u015d\3\2\2\2\u0161\u015e\3\2\2\2\u0161\u015f")
        buf.write("\3\2\2\2\u0161\u0160\3\2\2\2\u01629\3\2\2\2\u0163\u0164")
        buf.write("\7H\2\2\u0164\u0167\7;\2\2\u0165\u0168\5\6\4\2\u0166\u0168")
        buf.write("\5\30\r\2\u0167\u0165\3\2\2\2\u0167\u0166\3\2\2\2\u0168")
        buf.write("\u0169\3\2\2\2\u0169\u016a\7=\2\2\u016a;\3\2\2\2\u016b")
        buf.write("\u016c\7\4\2\2\u016c\u016d\7;\2\2\u016d\u016e\5> \2\u016e")
        buf.write("\u016f\7=\2\2\u016f\u0170\7\33\2\2\u0170\u0171\5B\"\2")
        buf.write("\u0171\u017a\3\2\2\2\u0172\u0173\7\4\2\2\u0173\u0174\7")
        buf.write("<\2\2\u0174\u0175\5> \2\u0175\u0176\7>\2\2\u0176\u0177")
        buf.write("\7\33\2\2\u0177\u0178\5B\"\2\u0178\u017a\3\2\2\2\u0179")
        buf.write("\u016b\3\2\2\2\u0179\u0172\3\2\2\2\u017a=\3\2\2\2\u017b")
        buf.write("\u0180\5@!\2\u017c\u017d\7\60\2\2\u017d\u017f\5@!\2\u017e")
        buf.write("\u017c\3\2\2\2\u017f\u0182\3\2\2\2\u0180\u017e\3\2\2\2")
        buf.write("\u0180\u0181\3\2\2\2\u0181?\3\2\2\2\u0182\u0180\3\2\2")
        buf.write("\2\u0183\u0184\5.\30\2\u0184A\3\2\2\2\u0185\u0186\5,\27")
        buf.write("\2\u0186C\3\2\2\2\u0187\u0189\7!\2\2\u0188\u018a\5F$\2")
        buf.write("\u0189\u0188\3\2\2\2\u0189\u018a\3\2\2\2\u018a\u018b\3")
        buf.write("\2\2\2\u018b\u018c\7\17\2\2\u018cE\3\2\2\2\u018d\u0190")
        buf.write("\5H%\2\u018e\u018f\7\61\2\2\u018f\u0191\5L\'\2\u0190\u018e")
        buf.write("\3\2\2\2\u0190\u0191\3\2\2\2\u0191\u0194\3\2\2\2\u0192")
        buf.write("\u0194\5L\'\2\u0193\u018d\3\2\2\2\u0193\u0192\3\2\2\2")
        buf.write("\u0194G\3\2\2\2\u0195\u019a\5J&\2\u0196\u0197\7\61\2\2")
        buf.write("\u0197\u0199\5J&\2\u0198\u0196\3\2\2\2\u0199\u019c\3\2")
        buf.write("\2\2\u019a\u0198\3\2\2\2\u019a\u019b\3\2\2\2\u019bI\3")
        buf.write("\2\2\2\u019c\u019a\3\2\2\2\u019d\u019e\5j\66\2\u019e\u019f")
        buf.write("\7\62\2\2\u019f\u01a0\5,\27\2\u01a0K\3\2\2\2\u01a1\u01a2")
        buf.write("\7\7\2\2\u01a2\u01a3\5N(\2\u01a3\u01a4\7\33\2\2\u01a4")
        buf.write("\u01a9\5P)\2\u01a5\u01a6\7\61\2\2\u01a6\u01a8\5P)\2\u01a7")
        buf.write("\u01a5\3\2\2\2\u01a8\u01ab\3\2\2\2\u01a9\u01a7\3\2\2\2")
        buf.write("\u01a9\u01aa\3\2\2\2\u01aaM\3\2\2\2\u01ab\u01a9\3\2\2")
        buf.write("\2\u01ac\u01ad\5\6\4\2\u01ad\u01ae\7\62\2\2\u01ae\u01af")
        buf.write("\5\64\33\2\u01af\u01b2\3\2\2\2\u01b0\u01b2\5\64\33\2\u01b1")
        buf.write("\u01ac\3\2\2\2\u01b1\u01b0\3\2\2\2\u01b2O\3\2\2\2\u01b3")
        buf.write("\u01b4\5l\67\2\u01b4\u01b5\7\62\2\2\u01b5\u01b6\79\2\2")
        buf.write("\u01b6\u01b7\5F$\2\u01b7\u01b8\7:\2\2\u01b8Q\3\2\2\2\u01b9")
        buf.write("\u01ba\7#\2\2\u01ba\u01bb\7\33\2\2\u01bb\u01bc\5T+\2\u01bc")
        buf.write("S\3\2\2\2\u01bd\u01be\5.\30\2\u01beU\3\2\2\2\u01bf\u01c0")
        buf.write("\7\20\2\2\u01c0\u01c1\7\33\2\2\u01c1\u01c4\5,\27\2\u01c2")
        buf.write("\u01c4\7\20\2\2\u01c3\u01bf\3\2\2\2\u01c3\u01c2\3\2\2")
        buf.write("\2\u01c4W\3\2\2\2\u01c5\u01c6\7?\2\2\u01c6\u01c7\5\64")
        buf.write("\33\2\u01c7Y\3\2\2\2\u01c8\u01c9\7(\2\2\u01c9\u01ce\5")
        buf.write("\\/\2\u01ca\u01cb\7\61\2\2\u01cb\u01cd\5\\/\2\u01cc\u01ca")
        buf.write("\3\2\2\2\u01cd\u01d0\3\2\2\2\u01ce\u01cc\3\2\2\2\u01ce")
        buf.write("\u01cf\3\2\2\2\u01cf\u01d1\3\2\2\2\u01d0\u01ce\3\2\2\2")
        buf.write("\u01d1\u01d2\7\61\2\2\u01d2[\3\2\2\2\u01d3\u01d4\5j\66")
        buf.write("\2\u01d4\u01d5\7\62\2\2\u01d5\u01d6\5,\27\2\u01d6]\3\2")
        buf.write("\2\2\u01d7\u01d8\5`\61\2\u01d8\u01d9\7\61\2\2\u01d9_\3")
        buf.write("\2\2\2\u01da\u01dd\5b\62\2\u01db\u01dd\5n8\2\u01dc\u01da")
        buf.write("\3\2\2\2\u01dc\u01db\3\2\2\2\u01dda\3\2\2\2\u01de\u01df")
        buf.write("\7\36\2\2\u01df\u01e1\5\6\4\2\u01e0\u01e2\5d\63\2\u01e1")
        buf.write("\u01e0\3\2\2\2\u01e1\u01e2\3\2\2\2\u01e2\u01e3\3\2\2\2")
        buf.write("\u01e3\u01e4\7\61\2\2\u01e4\u01e5\5\b\5\2\u01e5c\3\2\2")
        buf.write("\2\u01e6\u01e7\79\2\2\u01e7\u01ec\5f\64\2\u01e8\u01e9")
        buf.write("\7\61\2\2\u01e9\u01eb\5f\64\2\u01ea\u01e8\3\2\2\2\u01eb")
        buf.write("\u01ee\3\2\2\2\u01ec\u01ea\3\2\2\2\u01ec\u01ed\3\2\2\2")
        buf.write("\u01ed\u01ef\3\2\2\2\u01ee\u01ec\3\2\2\2\u01ef\u01f0\7")
        buf.write(":\2\2\u01f0e\3\2\2\2\u01f1\u01f9\5h\65\2\u01f2\u01f3\7")
        buf.write("(\2\2\u01f3\u01f9\5h\65\2\u01f4\u01f5\7\22\2\2\u01f5\u01f9")
        buf.write("\5h\65\2\u01f6\u01f7\7\36\2\2\u01f7\u01f9\5h\65\2\u01f8")
        buf.write("\u01f1\3\2\2\2\u01f8\u01f2\3\2\2\2\u01f8\u01f4\3\2\2\2")
        buf.write("\u01f8\u01f6\3\2\2\2\u01f9g\3\2\2\2\u01fa\u01fb\5j\66")
        buf.write("\2\u01fb\u01fc\7\62\2\2\u01fc\u01fd\5\64\33\2\u01fdi\3")
        buf.write("\2\2\2\u01fe\u0203\5\6\4\2\u01ff\u0200\7\60\2\2\u0200")
        buf.write("\u0202\5\6\4\2\u0201\u01ff\3\2\2\2\u0202\u0205\3\2\2\2")
        buf.write("\u0203\u0201\3\2\2\2\u0203\u0204\3\2\2\2\u0204k\3\2\2")
        buf.write("\2\u0205\u0203\3\2\2\2\u0206\u020b\5\26\f\2\u0207\u0208")
        buf.write("\7\60\2\2\u0208\u020a\5\26\f\2\u0209\u0207\3\2\2\2\u020a")
        buf.write("\u020d\3\2\2\2\u020b\u0209\3\2\2\2\u020b\u020c\3\2\2\2")
        buf.write("\u020cm\3\2\2\2\u020d\u020b\3\2\2\2\u020e\u020f\7\22\2")
        buf.write("\2\u020f\u0211\5\6\4\2\u0210\u0212\5d\63\2\u0211\u0210")
        buf.write("\3\2\2\2\u0211\u0212\3\2\2\2\u0212\u0213\3\2\2\2\u0213")
        buf.write("\u0214\7\62\2\2\u0214\u0215\5p9\2\u0215\u0216\7\61\2\2")
        buf.write("\u0216\u0217\5\b\5\2\u0217o\3\2\2\2\u0218\u0219\5\64\33")
        buf.write("\2\u0219q\3\2\2\2\u021a\u021b\5\16\b\2\u021b\u021c\7\62")
        buf.write("\2\2\u021c\u021d\5t;\2\u021d\u0220\3\2\2\2\u021e\u0220")
        buf.write("\5t;\2\u021f\u021a\3\2\2\2\u021f\u021e\3\2\2\2\u0220s")
        buf.write("\3\2\2\2\u0221\u0224\5v<\2\u0222\u0224\5\u00a4S\2\u0223")
        buf.write("\u0221\3\2\2\2\u0223\u0222\3\2\2\2\u0224u\3\2\2\2\u0225")
        buf.write("\u022a\5x=\2\u0226\u022a\5\u0098M\2\u0227\u022a\5\u009e")
        buf.write("P\2\u0228\u022a\5\u00a0Q\2\u0229\u0225\3\2\2\2\u0229\u0226")
        buf.write("\3\2\2\2\u0229\u0227\3\2\2\2\u0229\u0228\3\2\2\2\u022a")
        buf.write("w\3\2\2\2\u022b\u022c\5z>\2\u022c\u022d\7/\2\2\u022d\u022e")
        buf.write("\5|?\2\u022ey\3\2\2\2\u022f\u0230\7@\2\2\u0230\u0233\5")
        buf.write("\6\4\2\u0231\u0233\5\6\4\2\u0232\u022f\3\2\2\2\u0232\u0231")
        buf.write("\3\2\2\2\u0233\u024f\3\2\2\2\u0234\u0235\7;\2\2\u0235")
        buf.write("\u023a\5|?\2\u0236\u0237\7\60\2\2\u0237\u0239\5|?\2\u0238")
        buf.write("\u0236\3\2\2\2\u0239\u023c\3\2\2\2\u023a\u0238\3\2\2\2")
        buf.write("\u023a\u023b\3\2\2\2\u023b\u023d\3\2\2\2\u023c\u023a\3")
        buf.write("\2\2\2\u023d\u023e\7=\2\2\u023e\u024e\3\2\2\2\u023f\u0240")
        buf.write("\7<\2\2\u0240\u0245\5|?\2\u0241\u0242\7\60\2\2\u0242\u0244")
        buf.write("\5|?\2\u0243\u0241\3\2\2\2\u0244\u0247\3\2\2\2\u0245\u0243")
        buf.write("\3\2\2\2\u0245\u0246\3\2\2\2\u0246\u0248\3\2\2\2\u0247")
        buf.write("\u0245\3\2\2\2\u0248\u0249\7>\2\2\u0249\u024e\3\2\2\2")
        buf.write("\u024a\u024b\7A\2\2\u024b\u024e\5\6\4\2\u024c\u024e\7")
        buf.write("?\2\2\u024d\u0234\3\2\2\2\u024d\u023f\3\2\2\2\u024d\u024a")
        buf.write("\3\2\2\2\u024d\u024c\3\2\2\2\u024e\u0251\3\2\2\2\u024f")
        buf.write("\u024d\3\2\2\2\u024f\u0250\3\2\2\2\u0250{\3\2\2\2\u0251")
        buf.write("\u024f\3\2\2\2\u0252\u0256\5\u0080A\2\u0253\u0254\5~@")
        buf.write("\2\u0254\u0255\5|?\2\u0255\u0257\3\2\2\2\u0256\u0253\3")
        buf.write("\2\2\2\u0256\u0257\3\2\2\2\u0257}\3\2\2\2\u0258\u0259")
        buf.write("\t\5\2\2\u0259\177\3\2\2\2\u025a\u025e\5\u0084C\2\u025b")
        buf.write("\u025c\5\u0082B\2\u025c\u025d\5\u0080A\2\u025d\u025f\3")
        buf.write("\2\2\2\u025e\u025b\3\2\2\2\u025e\u025f\3\2\2\2\u025f\u0081")
        buf.write("\3\2\2\2\u0260\u0261\t\6\2\2\u0261\u0083\3\2\2\2\u0262")
        buf.write("\u0266\5\u0088E\2\u0263\u0264\5\u0086D\2\u0264\u0265\5")
        buf.write("\u0084C\2\u0265\u0267\3\2\2\2\u0266\u0263\3\2\2\2\u0266")
        buf.write("\u0267\3\2\2\2\u0267\u0085\3\2\2\2\u0268\u0269\t\7\2\2")
        buf.write("\u0269\u0087\3\2\2\2\u026a\u026c\t\2\2\2\u026b\u026a\3")
        buf.write("\2\2\2\u026b\u026c\3\2\2\2\u026c\u026d\3\2\2\2\u026d\u026e")
        buf.write("\5\u008aF\2\u026e\u0089\3\2\2\2\u026f\u027b\5z>\2\u0270")
        buf.write("\u0271\79\2\2\u0271\u0272\5|?\2\u0272\u0273\7:\2\2\u0273")
        buf.write("\u027b\3\2\2\2\u0274\u027b\5\u008eH\2\u0275\u027b\5\u008c")
        buf.write("G\2\u0276\u027b\5\u0092J\2\u0277\u0278\7\32\2\2\u0278")
        buf.write("\u027b\5\u008aF\2\u0279\u027b\5 \21\2\u027a\u026f\3\2")
        buf.write("\2\2\u027a\u0270\3\2\2\2\u027a\u0274\3\2\2\2\u027a\u0275")
        buf.write("\3\2\2\2\u027a\u0276\3\2\2\2\u027a\u0277\3\2\2\2\u027a")
        buf.write("\u0279\3\2\2\2\u027b\u008b\3\2\2\2\u027c\u0281\5\30\r")
        buf.write("\2\u027d\u0281\5\24\13\2\u027e\u0281\5\"\22\2\u027f\u0281")
        buf.write("\7\31\2\2\u0280\u027c\3\2\2\2\u0280\u027d\3\2\2\2\u0280")
        buf.write("\u027e\3\2\2\2\u0280\u027f\3\2\2\2\u0281\u008d\3\2\2\2")
        buf.write("\u0282\u0283\5\6\4\2\u0283\u0284\79\2\2\u0284\u0285\5")
        buf.write("\u0090I\2\u0285\u0286\7:\2\2\u0286\u008f\3\2\2\2\u0287")
        buf.write("\u028c\5\u009aN\2\u0288\u0289\7\60\2\2\u0289\u028b\5\u009a")
        buf.write("N\2\u028a\u0288\3\2\2\2\u028b\u028e\3\2\2\2\u028c\u028a")
        buf.write("\3\2\2\2\u028c\u028d\3\2\2\2\u028d\u0091\3\2\2\2\u028e")
        buf.write("\u028c\3\2\2\2\u028f\u0290\7;\2\2\u0290\u0291\5\u0094")
        buf.write("K\2\u0291\u0292\7=\2\2\u0292\u0298\3\2\2\2\u0293\u0294")
        buf.write("\7<\2\2\u0294\u0295\5\u0094K\2\u0295\u0296\7>\2\2\u0296")
        buf.write("\u0298\3\2\2\2\u0297\u028f\3\2\2\2\u0297\u0293\3\2\2\2")
        buf.write("\u0298\u0093\3\2\2\2\u0299\u029e\5\u0096L\2\u029a\u029b")
        buf.write("\7\60\2\2\u029b\u029d\5\u0096L\2\u029c\u029a\3\2\2\2\u029d")
        buf.write("\u02a0\3\2\2\2\u029e\u029c\3\2\2\2\u029e\u029f\3\2\2\2")
        buf.write("\u029f\u02a3\3\2\2\2\u02a0\u029e\3\2\2\2\u02a1\u02a3\3")
        buf.write("\2\2\2\u02a2\u0299\3\2\2\2\u02a2\u02a1\3\2\2\2\u02a3\u0095")
        buf.write("\3\2\2\2\u02a4\u02a7\5|?\2\u02a5\u02a6\7B\2\2\u02a6\u02a8")
        buf.write("\5|?\2\u02a7\u02a5\3\2\2\2\u02a7\u02a8\3\2\2\2\u02a8\u0097")
        buf.write("\3\2\2\2\u02a9\u02ae\5\6\4\2\u02aa\u02ab\79\2\2\u02ab")
        buf.write("\u02ac\5\u0090I\2\u02ac\u02ad\7:\2\2\u02ad\u02af\3\2\2")
        buf.write("\2\u02ae\u02aa\3\2\2\2\u02ae\u02af\3\2\2\2\u02af\u0099")
        buf.write("\3\2\2\2\u02b0\u02b4\5|?\2\u02b1\u02b3\5\u009cO\2\u02b2")
        buf.write("\u02b1\3\2\2\2\u02b3\u02b6\3\2\2\2\u02b4\u02b2\3\2\2\2")
        buf.write("\u02b4\u02b5\3\2\2\2\u02b5\u009b\3\2\2\2\u02b6\u02b4\3")
        buf.write("\2\2\2\u02b7\u02b8\7\62\2\2\u02b8\u02b9\5|?\2\u02b9\u009d")
        buf.write("\3\2\2\2\u02ba\u02bb\7\23\2\2\u02bb\u02bc\5\16\b\2\u02bc")
        buf.write("\u009f\3\2\2\2\u02bd\u02be\3\2\2\2\u02be\u00a1\3\2\2\2")
        buf.write("\u02bf\u02c0\3\2\2\2\u02c0\u00a3\3\2\2\2\u02c1\u02c6\5")
        buf.write("\u00a6T\2\u02c2\u02c6\5\u00aaV\2\u02c3\u02c6\5\u00b2Z")
        buf.write("\2\u02c4\u02c6\5\u00c0a\2\u02c5\u02c1\3\2\2\2\u02c5\u02c2")
        buf.write("\3\2\2\2\u02c5\u02c3\3\2\2\2\u02c5\u02c4\3\2\2\2\u02c6")
        buf.write("\u00a5\3\2\2\2\u02c7\u02c8\7\5\2\2\u02c8\u02c9\5\u00a8")
        buf.write("U\2\u02c9\u02ca\7\17\2\2\u02ca\u00a7\3\2\2\2\u02cb\u02d0")
        buf.write("\5r:\2\u02cc\u02cd\7\61\2\2\u02cd\u02cf\5r:\2\u02ce\u02cc")
        buf.write("\3\2\2\2\u02cf\u02d2\3\2\2\2\u02d0\u02ce\3\2\2\2\u02d0")
        buf.write("\u02d1\3\2\2\2\u02d1\u00a9\3\2\2\2\u02d2\u02d0\3\2\2\2")
        buf.write("\u02d3\u02d6\5\u00acW\2\u02d4\u02d6\5\u00aeX\2\u02d5\u02d3")
        buf.write("\3\2\2\2\u02d5\u02d4\3\2\2\2\u02d6\u00ab\3\2\2\2\u02d7")
        buf.write("\u02d8\7\24\2\2\u02d8\u02d9\5|?\2\u02d9\u02da\7$\2\2\u02da")
        buf.write("\u02dd\5r:\2\u02db\u02dc\7\16\2\2\u02dc\u02de\5r:\2\u02dd")
        buf.write("\u02db\3\2\2\2\u02dd\u02de\3\2\2\2\u02de\u00ad\3\2\2\2")
        buf.write("\u02df\u02e0\7\7\2\2\u02e0\u02e1\5|?\2\u02e1\u02e2\7\33")
        buf.write("\2\2\u02e2\u02e7\5\u00b0Y\2\u02e3\u02e4\7\61\2\2\u02e4")
        buf.write("\u02e6\5\u00b0Y\2\u02e5\u02e3\3\2\2\2\u02e6\u02e9\3\2")
        buf.write("\2\2\u02e7\u02e5\3\2\2\2\u02e7\u02e8\3\2\2\2\u02e8\u02ed")
        buf.write("\3\2\2\2\u02e9\u02e7\3\2\2\2\u02ea\u02eb\7\61\2\2\u02eb")
        buf.write("\u02ec\7\16\2\2\u02ec\u02ee\5\u00a8U\2\u02ed\u02ea\3\2")
        buf.write("\2\2\u02ed\u02ee\3\2\2\2\u02ee\u02ef\3\2\2\2\u02ef\u02f0")
        buf.write("\7\17\2\2\u02f0\u00af\3\2\2\2\u02f1\u02f2\5l\67\2\u02f2")
        buf.write("\u02f3\7\62\2\2\u02f3\u02f4\5r:\2\u02f4\u00b1\3\2\2\2")
        buf.write("\u02f5\u02f9\5\u00b4[\2\u02f6\u02f9\5\u00b6\\\2\u02f7")
        buf.write("\u02f9\5\u00b8]\2\u02f8\u02f5\3\2\2\2\u02f8\u02f6\3\2")
        buf.write("\2\2\u02f8\u02f7\3\2\2\2\u02f9\u00b3\3\2\2\2\u02fa\u02fb")
        buf.write("\7)\2\2\u02fb\u02fc\5|?\2\u02fc\u02fd\7\f\2\2\u02fd\u02fe")
        buf.write("\5r:\2\u02fe\u00b5\3\2\2\2\u02ff\u0300\7\"\2\2\u0300\u0301")
        buf.write("\5\u00a8U\2\u0301\u0302\7\'\2\2\u0302\u0303\5|?\2\u0303")
        buf.write("\u00b7\3\2\2\2\u0304\u0305\7\21\2\2\u0305\u0306\5\6\4")
        buf.write("\2\u0306\u0307\7/\2\2\u0307\u0308\5\u00ba^\2\u0308\u0309")
        buf.write("\7\f\2\2\u0309\u030a\5r:\2\u030a\u00b9\3\2\2\2\u030b\u030c")
        buf.write("\5\u00bc_\2\u030c\u030d\t\b\2\2\u030d\u030e\5\u00be`\2")
        buf.write("\u030e\u00bb\3\2\2\2\u030f\u0310\5|?\2\u0310\u00bd\3\2")
        buf.write("\2\2\u0311\u0312\5|?\2\u0312\u00bf\3\2\2\2\u0313\u0314")
        buf.write("\7*\2\2\u0314\u0315\5\u00c2b\2\u0315\u0316\7\f\2\2\u0316")
        buf.write("\u0317\5r:\2\u0317\u00c1\3\2\2\2\u0318\u031d\5z>\2\u0319")
        buf.write("\u031a\7\60\2\2\u031a\u031c\5z>\2\u031b\u0319\3\2\2\2")
        buf.write("\u031c\u031f\3\2\2\2\u031d\u031b\3\2\2\2\u031d\u031e\3")
        buf.write("\2\2\2\u031e\u00c3\3\2\2\2\u031f\u031d\3\2\2\2C\u00c6")
        buf.write("\u00d1\u00d9\u00e4\u00e6\u00f5\u0102\u0117\u011b\u012d")
        buf.write("\u0134\u0138\u013f\u0144\u014a\u0156\u015b\u0161\u0167")
        buf.write("\u0179\u0180\u0189\u0190\u0193\u019a\u01a9\u01b1\u01c3")
        buf.write("\u01ce\u01dc\u01e1\u01ec\u01f8\u0203\u020b\u0211\u021f")
        buf.write("\u0223\u0229\u0232\u023a\u0245\u024d\u024f\u0256\u025e")
        buf.write("\u0266\u026b\u027a\u0280\u028c\u0297\u029e\u02a2\u02a7")
        buf.write("\u02ae\u02b4\u02c5\u02d0\u02d5\u02dd\u02e7\u02ed\u02f8")
        buf.write("\u031d")
        return buf.getvalue()


class pascalParser ( Parser ):

    grammarFileName = "pascal.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<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>", "'+'", "'-'", "'*'", "'/'", "':='", "','", 
                     "';'", "':'", "'='", "'<>'", "'<'", "'<='", "'>='", 
                     "'>'", "'('", "')'", "'['", "'(.'", "']'", "'.)'", 
                     "'^'", "'@'", "'.'", "'..'", "'{'", "'}'" ]

    symbolicNames = [ "<INVALID>", "AND", "ARRAY", "BEGIN", "BOOLEAN", "CASE", 
                      "CHAR", "CHR", "CONST", "DIV", "DO", "DOWNTO", "ELSE", 
                      "END", "FILE", "FOR", "FUNCTION", "GOTO", "IF", "IN", 
                      "INTEGER", "LABEL", "MOD", "NIL", "NOT", "OF", "OR", 
                      "PACKED", "PROCEDURE", "PROGRAM", "REAL", "RECORD", 
                      "REPEAT", "SET", "THEN", "TO", "TYPE", "UNTIL", "VAR", 
                      "WHILE", "WITH", "PLUS", "MINUS", "STAR", "SLASH", 
                      "ASSIGN", "COMMA", "SEMI", "COLON", "EQUAL", "NOT_EQUAL", 
                      "LT", "LE", "GE", "GT", "LPAREN", "RPAREN", "LBRACK", 
                      "LBRACK2", "RBRACK", "RBRACK2", "POINTER", "AT", "DOT", 
                      "DOTDOT", "LCURLY", "RCURLY", "UNIT", "INTERFACE", 
                      "USES", "STRING", "IMPLEMENTATION", "TRUE", "FALSE", 
                      "WS", "COMMENT_1", "COMMENT_2", "IDENT", "STRING_LITERAL", 
                      "NUM_INT", "NUM_REAL" ]

    RULE_program = 0
    RULE_programHeading = 1
    RULE_identifier = 2
    RULE_block = 3
    RULE_usesUnitsPart = 4
    RULE_labelDeclarationPart = 5
    RULE_label = 6
    RULE_constantDefinitionPart = 7
    RULE_constantDefinition = 8
    RULE_constantChr = 9
    RULE_constant = 10
    RULE_unsignedNumber = 11
    RULE_unsignedInteger = 12
    RULE_unsignedReal = 13
    RULE_sign = 14
    RULE_bool_ = 15
    RULE_string = 16
    RULE_typeDefinitionPart = 17
    RULE_typeDefinition = 18
    RULE_functionType = 19
    RULE_procedureType = 20
    RULE_re_type = 21
    RULE_simpleType = 22
    RULE_scalarType = 23
    RULE_subrangeType = 24
    RULE_typeIdentifier = 25
    RULE_structuredType = 26
    RULE_unpackedStructuredType = 27
    RULE_stringtype = 28
    RULE_arrayType = 29
    RULE_typeList = 30
    RULE_indexType = 31
    RULE_componentType = 32
    RULE_recordType = 33
    RULE_fieldList = 34
    RULE_fixedPart = 35
    RULE_recordSection = 36
    RULE_variantPart = 37
    RULE_tag = 38
    RULE_variant = 39
    RULE_setType = 40
    RULE_baseType = 41
    RULE_fileType = 42
    RULE_pointerType = 43
    RULE_variableDeclarationPart = 44
    RULE_variableDeclaration = 45
    RULE_procedureAndFunctionDeclarationPart = 46
    RULE_procedureOrFunctionDeclaration = 47
    RULE_procedureDeclaration = 48
    RULE_formalParameterList = 49
    RULE_formalParameterSection = 50
    RULE_parameterGroup = 51
    RULE_identifierList = 52
    RULE_constList = 53
    RULE_functionDeclaration = 54
    RULE_resultType = 55
    RULE_statement = 56
    RULE_unlabelledStatement = 57
    RULE_simpleStatement = 58
    RULE_assignmentStatement = 59
    RULE_variable = 60
    RULE_expression = 61
    RULE_relationaloperator = 62
    RULE_simpleExpression = 63
    RULE_additiveoperator = 64
    RULE_term = 65
    RULE_multiplicativeoperator = 66
    RULE_signedFactor = 67
    RULE_factor = 68
    RULE_unsignedConstant = 69
    RULE_functionDesignator = 70
    RULE_parameterList = 71
    RULE_re_set = 72
    RULE_elementList = 73
    RULE_element = 74
    RULE_procedureStatement = 75
    RULE_actualParameter = 76
    RULE_parameterwidth = 77
    RULE_gotoStatement = 78
    RULE_emptyStatement = 79
    RULE_empty = 80
    RULE_structuredStatement = 81
    RULE_compoundStatement = 82
    RULE_statements = 83
    RULE_conditionalStatement = 84
    RULE_ifStatement = 85
    RULE_caseStatement = 86
    RULE_caseListElement = 87
    RULE_repetetiveStatement = 88
    RULE_whileStatement = 89
    RULE_repeatStatement = 90
    RULE_forStatement = 91
    RULE_forList = 92
    RULE_initialValue = 93
    RULE_finalValue = 94
    RULE_withStatement = 95
    RULE_recordVariableList = 96

    ruleNames =  [ "program", "programHeading", "identifier", "block", "usesUnitsPart", 
                   "labelDeclarationPart", "label", "constantDefinitionPart", 
                   "constantDefinition", "constantChr", "constant", "unsignedNumber", 
                   "unsignedInteger", "unsignedReal", "sign", "bool_", "string", 
                   "typeDefinitionPart", "typeDefinition", "functionType", 
                   "procedureType", "re_type", "simpleType", "scalarType", 
                   "subrangeType", "typeIdentifier", "structuredType", "unpackedStructuredType", 
                   "stringtype", "arrayType", "typeList", "indexType", "componentType", 
                   "recordType", "fieldList", "fixedPart", "recordSection", 
                   "variantPart", "tag", "variant", "setType", "baseType", 
                   "fileType", "pointerType", "variableDeclarationPart", 
                   "variableDeclaration", "procedureAndFunctionDeclarationPart", 
                   "procedureOrFunctionDeclaration", "procedureDeclaration", 
                   "formalParameterList", "formalParameterSection", "parameterGroup", 
                   "identifierList", "constList", "functionDeclaration", 
                   "resultType", "statement", "unlabelledStatement", "simpleStatement", 
                   "assignmentStatement", "variable", "expression", "relationaloperator", 
                   "simpleExpression", "additiveoperator", "term", "multiplicativeoperator", 
                   "signedFactor", "factor", "unsignedConstant", "functionDesignator", 
                   "parameterList", "re_set", "elementList", "element", 
                   "procedureStatement", "actualParameter", "parameterwidth", 
                   "gotoStatement", "emptyStatement", "empty", "structuredStatement", 
                   "compoundStatement", "statements", "conditionalStatement", 
                   "ifStatement", "caseStatement", "caseListElement", "repetetiveStatement", 
                   "whileStatement", "repeatStatement", "forStatement", 
                   "forList", "initialValue", "finalValue", "withStatement", 
                   "recordVariableList" ]

    EOF = Token.EOF
    AND=1
    ARRAY=2
    BEGIN=3
    BOOLEAN=4
    CASE=5
    CHAR=6
    CHR=7
    CONST=8
    DIV=9
    DO=10
    DOWNTO=11
    ELSE=12
    END=13
    FILE=14
    FOR=15
    FUNCTION=16
    GOTO=17
    IF=18
    IN=19
    INTEGER=20
    LABEL=21
    MOD=22
    NIL=23
    NOT=24
    OF=25
    OR=26
    PACKED=27
    PROCEDURE=28
    PROGRAM=29
    REAL=30
    RECORD=31
    REPEAT=32
    SET=33
    THEN=34
    TO=35
    TYPE=36
    UNTIL=37
    VAR=38
    WHILE=39
    WITH=40
    PLUS=41
    MINUS=42
    STAR=43
    SLASH=44
    ASSIGN=45
    COMMA=46
    SEMI=47
    COLON=48
    EQUAL=49
    NOT_EQUAL=50
    LT=51
    LE=52
    GE=53
    GT=54
    LPAREN=55
    RPAREN=56
    LBRACK=57
    LBRACK2=58
    RBRACK=59
    RBRACK2=60
    POINTER=61
    AT=62
    DOT=63
    DOTDOT=64
    LCURLY=65
    RCURLY=66
    UNIT=67
    INTERFACE=68
    USES=69
    STRING=70
    IMPLEMENTATION=71
    TRUE=72
    FALSE=73
    WS=74
    COMMENT_1=75
    COMMENT_2=76
    IDENT=77
    STRING_LITERAL=78
    NUM_INT=79
    NUM_REAL=80

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




    class ProgramContext(ParserRuleContext):

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

        def programHeading(self):
            return self.getTypedRuleContext(pascalParser.ProgramHeadingContext,0)


        def block(self):
            return self.getTypedRuleContext(pascalParser.BlockContext,0)


        def DOT(self):
            return self.getToken(pascalParser.DOT, 0)

        def INTERFACE(self):
            return self.getToken(pascalParser.INTERFACE, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_program

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

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




    def program(self):

        localctx = pascalParser.ProgramContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_program)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 194
            self.programHeading()
            self.state = 196
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==pascalParser.INTERFACE:
                self.state = 195
                self.match(pascalParser.INTERFACE)


            self.state = 198
            self.block()
            self.state = 199
            self.match(pascalParser.DOT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ProgramHeadingContext(ParserRuleContext):

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

        def PROGRAM(self):
            return self.getToken(pascalParser.PROGRAM, 0)

        def identifier(self):
            return self.getTypedRuleContext(pascalParser.IdentifierContext,0)


        def SEMI(self):
            return self.getToken(pascalParser.SEMI, 0)

        def LPAREN(self):
            return self.getToken(pascalParser.LPAREN, 0)

        def identifierList(self):
            return self.getTypedRuleContext(pascalParser.IdentifierListContext,0)


        def RPAREN(self):
            return self.getToken(pascalParser.RPAREN, 0)

        def UNIT(self):
            return self.getToken(pascalParser.UNIT, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_programHeading

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

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




    def programHeading(self):

        localctx = pascalParser.ProgramHeadingContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_programHeading)
        self._la = 0 # Token type
        try:
            self.state = 215
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.PROGRAM]:
                self.enterOuterAlt(localctx, 1)
                self.state = 201
                self.match(pascalParser.PROGRAM)
                self.state = 202
                self.identifier()
                self.state = 207
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==pascalParser.LPAREN:
                    self.state = 203
                    self.match(pascalParser.LPAREN)
                    self.state = 204
                    self.identifierList()
                    self.state = 205
                    self.match(pascalParser.RPAREN)


                self.state = 209
                self.match(pascalParser.SEMI)
                pass
            elif token in [pascalParser.UNIT]:
                self.enterOuterAlt(localctx, 2)
                self.state = 211
                self.match(pascalParser.UNIT)
                self.state = 212
                self.identifier()
                self.state = 213
                self.match(pascalParser.SEMI)
                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 IdentifierContext(ParserRuleContext):

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

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

        def getRuleIndex(self):
            return pascalParser.RULE_identifier

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

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




    def identifier(self):

        localctx = pascalParser.IdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_identifier)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 217
            self.match(pascalParser.IDENT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class BlockContext(ParserRuleContext):

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

        def compoundStatement(self):
            return self.getTypedRuleContext(pascalParser.CompoundStatementContext,0)


        def labelDeclarationPart(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.LabelDeclarationPartContext)
            else:
                return self.getTypedRuleContext(pascalParser.LabelDeclarationPartContext,i)


        def constantDefinitionPart(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.ConstantDefinitionPartContext)
            else:
                return self.getTypedRuleContext(pascalParser.ConstantDefinitionPartContext,i)


        def typeDefinitionPart(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.TypeDefinitionPartContext)
            else:
                return self.getTypedRuleContext(pascalParser.TypeDefinitionPartContext,i)


        def variableDeclarationPart(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.VariableDeclarationPartContext)
            else:
                return self.getTypedRuleContext(pascalParser.VariableDeclarationPartContext,i)


        def procedureAndFunctionDeclarationPart(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.ProcedureAndFunctionDeclarationPartContext)
            else:
                return self.getTypedRuleContext(pascalParser.ProcedureAndFunctionDeclarationPartContext,i)


        def usesUnitsPart(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.UsesUnitsPartContext)
            else:
                return self.getTypedRuleContext(pascalParser.UsesUnitsPartContext,i)


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

        def getRuleIndex(self):
            return pascalParser.RULE_block

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

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




    def block(self):

        localctx = pascalParser.BlockContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_block)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 228
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 8)) & ~0x3f) == 0 and ((1 << (_la - 8)) & ((1 << (pascalParser.CONST - 8)) | (1 << (pascalParser.FUNCTION - 8)) | (1 << (pascalParser.LABEL - 8)) | (1 << (pascalParser.PROCEDURE - 8)) | (1 << (pascalParser.TYPE - 8)) | (1 << (pascalParser.VAR - 8)) | (1 << (pascalParser.USES - 8)) | (1 << (pascalParser.IMPLEMENTATION - 8)))) != 0):
                self.state = 226
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [pascalParser.LABEL]:
                    self.state = 219
                    self.labelDeclarationPart()
                    pass
                elif token in [pascalParser.CONST]:
                    self.state = 220
                    self.constantDefinitionPart()
                    pass
                elif token in [pascalParser.TYPE]:
                    self.state = 221
                    self.typeDefinitionPart()
                    pass
                elif token in [pascalParser.VAR]:
                    self.state = 222
                    self.variableDeclarationPart()
                    pass
                elif token in [pascalParser.FUNCTION, pascalParser.PROCEDURE]:
                    self.state = 223
                    self.procedureAndFunctionDeclarationPart()
                    pass
                elif token in [pascalParser.USES]:
                    self.state = 224
                    self.usesUnitsPart()
                    pass
                elif token in [pascalParser.IMPLEMENTATION]:
                    self.state = 225
                    self.match(pascalParser.IMPLEMENTATION)
                    pass
                else:
                    raise NoViableAltException(self)

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

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


    class UsesUnitsPartContext(ParserRuleContext):

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

        def USES(self):
            return self.getToken(pascalParser.USES, 0)

        def identifierList(self):
            return self.getTypedRuleContext(pascalParser.IdentifierListContext,0)


        def SEMI(self):
            return self.getToken(pascalParser.SEMI, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_usesUnitsPart

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

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




    def usesUnitsPart(self):

        localctx = pascalParser.UsesUnitsPartContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_usesUnitsPart)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 233
            self.match(pascalParser.USES)
            self.state = 234
            self.identifierList()
            self.state = 235
            self.match(pascalParser.SEMI)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class LabelDeclarationPartContext(ParserRuleContext):

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

        def LABEL(self):
            return self.getToken(pascalParser.LABEL, 0)

        def label(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.LabelContext)
            else:
                return self.getTypedRuleContext(pascalParser.LabelContext,i)


        def SEMI(self):
            return self.getToken(pascalParser.SEMI, 0)

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

        def getRuleIndex(self):
            return pascalParser.RULE_labelDeclarationPart

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

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




    def labelDeclarationPart(self):

        localctx = pascalParser.LabelDeclarationPartContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_labelDeclarationPart)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 237
            self.match(pascalParser.LABEL)
            self.state = 238
            self.label()
            self.state = 243
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==pascalParser.COMMA:
                self.state = 239
                self.match(pascalParser.COMMA)
                self.state = 240
                self.label()
                self.state = 245
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 246
            self.match(pascalParser.SEMI)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class LabelContext(ParserRuleContext):

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

        def unsignedInteger(self):
            return self.getTypedRuleContext(pascalParser.UnsignedIntegerContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_label

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

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




    def label(self):

        localctx = pascalParser.LabelContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_label)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 248
            self.unsignedInteger()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ConstantDefinitionPartContext(ParserRuleContext):

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

        def CONST(self):
            return self.getToken(pascalParser.CONST, 0)

        def constantDefinition(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.ConstantDefinitionContext)
            else:
                return self.getTypedRuleContext(pascalParser.ConstantDefinitionContext,i)


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

        def getRuleIndex(self):
            return pascalParser.RULE_constantDefinitionPart

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

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




    def constantDefinitionPart(self):

        localctx = pascalParser.ConstantDefinitionPartContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_constantDefinitionPart)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 250
            self.match(pascalParser.CONST)
            self.state = 254 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 251
                self.constantDefinition()
                self.state = 252
                self.match(pascalParser.SEMI)
                self.state = 256 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==pascalParser.IDENT):
                    break

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


    class ConstantDefinitionContext(ParserRuleContext):

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

        def identifier(self):
            return self.getTypedRuleContext(pascalParser.IdentifierContext,0)


        def EQUAL(self):
            return self.getToken(pascalParser.EQUAL, 0)

        def constant(self):
            return self.getTypedRuleContext(pascalParser.ConstantContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_constantDefinition

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

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




    def constantDefinition(self):

        localctx = pascalParser.ConstantDefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_constantDefinition)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 258
            self.identifier()
            self.state = 259
            self.match(pascalParser.EQUAL)
            self.state = 260
            self.constant()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ConstantChrContext(ParserRuleContext):

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

        def CHR(self):
            return self.getToken(pascalParser.CHR, 0)

        def LPAREN(self):
            return self.getToken(pascalParser.LPAREN, 0)

        def unsignedInteger(self):
            return self.getTypedRuleContext(pascalParser.UnsignedIntegerContext,0)


        def RPAREN(self):
            return self.getToken(pascalParser.RPAREN, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_constantChr

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

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




    def constantChr(self):

        localctx = pascalParser.ConstantChrContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_constantChr)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 262
            self.match(pascalParser.CHR)
            self.state = 263
            self.match(pascalParser.LPAREN)
            self.state = 264
            self.unsignedInteger()
            self.state = 265
            self.match(pascalParser.RPAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ConstantContext(ParserRuleContext):

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

        def unsignedNumber(self):
            return self.getTypedRuleContext(pascalParser.UnsignedNumberContext,0)


        def sign(self):
            return self.getTypedRuleContext(pascalParser.SignContext,0)


        def identifier(self):
            return self.getTypedRuleContext(pascalParser.IdentifierContext,0)


        def string(self):
            return self.getTypedRuleContext(pascalParser.StringContext,0)


        def constantChr(self):
            return self.getTypedRuleContext(pascalParser.ConstantChrContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_constant

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

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




    def constant(self):

        localctx = pascalParser.ConstantContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_constant)
        try:
            self.state = 277
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,7,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 267
                self.unsignedNumber()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 268
                self.sign()
                self.state = 269
                self.unsignedNumber()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 271
                self.identifier()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 272
                self.sign()
                self.state = 273
                self.identifier()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 275
                self.string()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 276
                self.constantChr()
                pass


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


    class UnsignedNumberContext(ParserRuleContext):

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

        def unsignedInteger(self):
            return self.getTypedRuleContext(pascalParser.UnsignedIntegerContext,0)


        def unsignedReal(self):
            return self.getTypedRuleContext(pascalParser.UnsignedRealContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_unsignedNumber

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

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




    def unsignedNumber(self):

        localctx = pascalParser.UnsignedNumberContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_unsignedNumber)
        try:
            self.state = 281
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.NUM_INT]:
                self.enterOuterAlt(localctx, 1)
                self.state = 279
                self.unsignedInteger()
                pass
            elif token in [pascalParser.NUM_REAL]:
                self.enterOuterAlt(localctx, 2)
                self.state = 280
                self.unsignedReal()
                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 UnsignedIntegerContext(ParserRuleContext):

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

        def NUM_INT(self):
            return self.getToken(pascalParser.NUM_INT, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_unsignedInteger

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

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




    def unsignedInteger(self):

        localctx = pascalParser.UnsignedIntegerContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_unsignedInteger)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 283
            self.match(pascalParser.NUM_INT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class UnsignedRealContext(ParserRuleContext):

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

        def NUM_REAL(self):
            return self.getToken(pascalParser.NUM_REAL, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_unsignedReal

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

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




    def unsignedReal(self):

        localctx = pascalParser.UnsignedRealContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_unsignedReal)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 285
            self.match(pascalParser.NUM_REAL)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SignContext(ParserRuleContext):

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

        def PLUS(self):
            return self.getToken(pascalParser.PLUS, 0)

        def MINUS(self):
            return self.getToken(pascalParser.MINUS, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_sign

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

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




    def sign(self):

        localctx = pascalParser.SignContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_sign)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 287
            _la = self._input.LA(1)
            if not(_la==pascalParser.PLUS or _la==pascalParser.MINUS):
                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 Bool_Context(ParserRuleContext):

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

        def TRUE(self):
            return self.getToken(pascalParser.TRUE, 0)

        def FALSE(self):
            return self.getToken(pascalParser.FALSE, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_bool_

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

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




    def bool_(self):

        localctx = pascalParser.Bool_Context(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_bool_)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 289
            _la = self._input.LA(1)
            if not(_la==pascalParser.TRUE or _la==pascalParser.FALSE):
                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 StringContext(ParserRuleContext):

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

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

        def getRuleIndex(self):
            return pascalParser.RULE_string

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

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




    def string(self):

        localctx = pascalParser.StringContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_string)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 291
            self.match(pascalParser.STRING_LITERAL)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TypeDefinitionPartContext(ParserRuleContext):

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

        def TYPE(self):
            return self.getToken(pascalParser.TYPE, 0)

        def typeDefinition(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.TypeDefinitionContext)
            else:
                return self.getTypedRuleContext(pascalParser.TypeDefinitionContext,i)


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

        def getRuleIndex(self):
            return pascalParser.RULE_typeDefinitionPart

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

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




    def typeDefinitionPart(self):

        localctx = pascalParser.TypeDefinitionPartContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_typeDefinitionPart)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 293
            self.match(pascalParser.TYPE)
            self.state = 297 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 294
                self.typeDefinition()
                self.state = 295
                self.match(pascalParser.SEMI)
                self.state = 299 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==pascalParser.IDENT):
                    break

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


    class TypeDefinitionContext(ParserRuleContext):

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

        def identifier(self):
            return self.getTypedRuleContext(pascalParser.IdentifierContext,0)


        def EQUAL(self):
            return self.getToken(pascalParser.EQUAL, 0)

        def re_type(self):
            return self.getTypedRuleContext(pascalParser.Re_typeContext,0)


        def functionType(self):
            return self.getTypedRuleContext(pascalParser.FunctionTypeContext,0)


        def procedureType(self):
            return self.getTypedRuleContext(pascalParser.ProcedureTypeContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_typeDefinition

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

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




    def typeDefinition(self):

        localctx = pascalParser.TypeDefinitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_typeDefinition)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 301
            self.identifier()
            self.state = 302
            self.match(pascalParser.EQUAL)
            self.state = 306
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.ARRAY, pascalParser.BOOLEAN, pascalParser.CHAR, pascalParser.CHR, pascalParser.FILE, pascalParser.INTEGER, pascalParser.PACKED, pascalParser.REAL, pascalParser.RECORD, pascalParser.SET, pascalParser.PLUS, pascalParser.MINUS, pascalParser.LPAREN, pascalParser.POINTER, pascalParser.STRING, pascalParser.IDENT, pascalParser.STRING_LITERAL, pascalParser.NUM_INT, pascalParser.NUM_REAL]:
                self.state = 303
                self.re_type()
                pass
            elif token in [pascalParser.FUNCTION]:
                self.state = 304
                self.functionType()
                pass
            elif token in [pascalParser.PROCEDURE]:
                self.state = 305
                self.procedureType()
                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 FunctionTypeContext(ParserRuleContext):

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

        def FUNCTION(self):
            return self.getToken(pascalParser.FUNCTION, 0)

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

        def resultType(self):
            return self.getTypedRuleContext(pascalParser.ResultTypeContext,0)


        def formalParameterList(self):
            return self.getTypedRuleContext(pascalParser.FormalParameterListContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_functionType

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

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




    def functionType(self):

        localctx = pascalParser.FunctionTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_functionType)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 308
            self.match(pascalParser.FUNCTION)
            self.state = 310
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==pascalParser.LPAREN:
                self.state = 309
                self.formalParameterList()


            self.state = 312
            self.match(pascalParser.COLON)
            self.state = 313
            self.resultType()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ProcedureTypeContext(ParserRuleContext):

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

        def PROCEDURE(self):
            return self.getToken(pascalParser.PROCEDURE, 0)

        def formalParameterList(self):
            return self.getTypedRuleContext(pascalParser.FormalParameterListContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_procedureType

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

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




    def procedureType(self):

        localctx = pascalParser.ProcedureTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_procedureType)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 315
            self.match(pascalParser.PROCEDURE)
            self.state = 317
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==pascalParser.LPAREN:
                self.state = 316
                self.formalParameterList()


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


    class Re_typeContext(ParserRuleContext):

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

        def simpleType(self):
            return self.getTypedRuleContext(pascalParser.SimpleTypeContext,0)


        def structuredType(self):
            return self.getTypedRuleContext(pascalParser.StructuredTypeContext,0)


        def pointerType(self):
            return self.getTypedRuleContext(pascalParser.PointerTypeContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_re_type

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

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




    def re_type(self):

        localctx = pascalParser.Re_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 42, self.RULE_re_type)
        try:
            self.state = 322
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.BOOLEAN, pascalParser.CHAR, pascalParser.CHR, pascalParser.INTEGER, pascalParser.REAL, pascalParser.PLUS, pascalParser.MINUS, pascalParser.LPAREN, pascalParser.STRING, pascalParser.IDENT, pascalParser.STRING_LITERAL, pascalParser.NUM_INT, pascalParser.NUM_REAL]:
                self.enterOuterAlt(localctx, 1)
                self.state = 319
                self.simpleType()
                pass
            elif token in [pascalParser.ARRAY, pascalParser.FILE, pascalParser.PACKED, pascalParser.RECORD, pascalParser.SET]:
                self.enterOuterAlt(localctx, 2)
                self.state = 320
                self.structuredType()
                pass
            elif token in [pascalParser.POINTER]:
                self.enterOuterAlt(localctx, 3)
                self.state = 321
                self.pointerType()
                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 SimpleTypeContext(ParserRuleContext):

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

        def scalarType(self):
            return self.getTypedRuleContext(pascalParser.ScalarTypeContext,0)


        def subrangeType(self):
            return self.getTypedRuleContext(pascalParser.SubrangeTypeContext,0)


        def typeIdentifier(self):
            return self.getTypedRuleContext(pascalParser.TypeIdentifierContext,0)


        def stringtype(self):
            return self.getTypedRuleContext(pascalParser.StringtypeContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_simpleType

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

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




    def simpleType(self):

        localctx = pascalParser.SimpleTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_simpleType)
        try:
            self.state = 328
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,14,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 324
                self.scalarType()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 325
                self.subrangeType()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 326
                self.typeIdentifier()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 327
                self.stringtype()
                pass


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


    class ScalarTypeContext(ParserRuleContext):

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

        def LPAREN(self):
            return self.getToken(pascalParser.LPAREN, 0)

        def identifierList(self):
            return self.getTypedRuleContext(pascalParser.IdentifierListContext,0)


        def RPAREN(self):
            return self.getToken(pascalParser.RPAREN, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_scalarType

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

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




    def scalarType(self):

        localctx = pascalParser.ScalarTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 46, self.RULE_scalarType)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 330
            self.match(pascalParser.LPAREN)
            self.state = 331
            self.identifierList()
            self.state = 332
            self.match(pascalParser.RPAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SubrangeTypeContext(ParserRuleContext):

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

        def constant(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.ConstantContext)
            else:
                return self.getTypedRuleContext(pascalParser.ConstantContext,i)


        def DOTDOT(self):
            return self.getToken(pascalParser.DOTDOT, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_subrangeType

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

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




    def subrangeType(self):

        localctx = pascalParser.SubrangeTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_subrangeType)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 334
            self.constant()
            self.state = 335
            self.match(pascalParser.DOTDOT)
            self.state = 336
            self.constant()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TypeIdentifierContext(ParserRuleContext):

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

        def identifier(self):
            return self.getTypedRuleContext(pascalParser.IdentifierContext,0)


        def CHAR(self):
            return self.getToken(pascalParser.CHAR, 0)

        def BOOLEAN(self):
            return self.getToken(pascalParser.BOOLEAN, 0)

        def INTEGER(self):
            return self.getToken(pascalParser.INTEGER, 0)

        def REAL(self):
            return self.getToken(pascalParser.REAL, 0)

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

        def getRuleIndex(self):
            return pascalParser.RULE_typeIdentifier

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

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




    def typeIdentifier(self):

        localctx = pascalParser.TypeIdentifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 50, self.RULE_typeIdentifier)
        self._la = 0 # Token type
        try:
            self.state = 340
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.IDENT]:
                self.enterOuterAlt(localctx, 1)
                self.state = 338
                self.identifier()
                pass
            elif token in [pascalParser.BOOLEAN, pascalParser.CHAR, pascalParser.INTEGER, pascalParser.REAL, pascalParser.STRING]:
                self.enterOuterAlt(localctx, 2)
                self.state = 339
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << pascalParser.BOOLEAN) | (1 << pascalParser.CHAR) | (1 << pascalParser.INTEGER) | (1 << pascalParser.REAL))) != 0) or _la==pascalParser.STRING):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                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 StructuredTypeContext(ParserRuleContext):

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

        def PACKED(self):
            return self.getToken(pascalParser.PACKED, 0)

        def unpackedStructuredType(self):
            return self.getTypedRuleContext(pascalParser.UnpackedStructuredTypeContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_structuredType

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

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




    def structuredType(self):

        localctx = pascalParser.StructuredTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 52, self.RULE_structuredType)
        try:
            self.state = 345
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.PACKED]:
                self.enterOuterAlt(localctx, 1)
                self.state = 342
                self.match(pascalParser.PACKED)
                self.state = 343
                self.unpackedStructuredType()
                pass
            elif token in [pascalParser.ARRAY, pascalParser.FILE, pascalParser.RECORD, pascalParser.SET]:
                self.enterOuterAlt(localctx, 2)
                self.state = 344
                self.unpackedStructuredType()
                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 UnpackedStructuredTypeContext(ParserRuleContext):

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

        def arrayType(self):
            return self.getTypedRuleContext(pascalParser.ArrayTypeContext,0)


        def recordType(self):
            return self.getTypedRuleContext(pascalParser.RecordTypeContext,0)


        def setType(self):
            return self.getTypedRuleContext(pascalParser.SetTypeContext,0)


        def fileType(self):
            return self.getTypedRuleContext(pascalParser.FileTypeContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_unpackedStructuredType

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

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




    def unpackedStructuredType(self):

        localctx = pascalParser.UnpackedStructuredTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 54, self.RULE_unpackedStructuredType)
        try:
            self.state = 351
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.ARRAY]:
                self.enterOuterAlt(localctx, 1)
                self.state = 347
                self.arrayType()
                pass
            elif token in [pascalParser.RECORD]:
                self.enterOuterAlt(localctx, 2)
                self.state = 348
                self.recordType()
                pass
            elif token in [pascalParser.SET]:
                self.enterOuterAlt(localctx, 3)
                self.state = 349
                self.setType()
                pass
            elif token in [pascalParser.FILE]:
                self.enterOuterAlt(localctx, 4)
                self.state = 350
                self.fileType()
                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 StringtypeContext(ParserRuleContext):

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

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

        def LBRACK(self):
            return self.getToken(pascalParser.LBRACK, 0)

        def RBRACK(self):
            return self.getToken(pascalParser.RBRACK, 0)

        def identifier(self):
            return self.getTypedRuleContext(pascalParser.IdentifierContext,0)


        def unsignedNumber(self):
            return self.getTypedRuleContext(pascalParser.UnsignedNumberContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_stringtype

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

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




    def stringtype(self):

        localctx = pascalParser.StringtypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 56, self.RULE_stringtype)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 353
            self.match(pascalParser.STRING)
            self.state = 354
            self.match(pascalParser.LBRACK)
            self.state = 357
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.IDENT]:
                self.state = 355
                self.identifier()
                pass
            elif token in [pascalParser.NUM_INT, pascalParser.NUM_REAL]:
                self.state = 356
                self.unsignedNumber()
                pass
            else:
                raise NoViableAltException(self)

            self.state = 359
            self.match(pascalParser.RBRACK)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ArrayTypeContext(ParserRuleContext):

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

        def ARRAY(self):
            return self.getToken(pascalParser.ARRAY, 0)

        def LBRACK(self):
            return self.getToken(pascalParser.LBRACK, 0)

        def typeList(self):
            return self.getTypedRuleContext(pascalParser.TypeListContext,0)


        def RBRACK(self):
            return self.getToken(pascalParser.RBRACK, 0)

        def OF(self):
            return self.getToken(pascalParser.OF, 0)

        def componentType(self):
            return self.getTypedRuleContext(pascalParser.ComponentTypeContext,0)


        def LBRACK2(self):
            return self.getToken(pascalParser.LBRACK2, 0)

        def RBRACK2(self):
            return self.getToken(pascalParser.RBRACK2, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_arrayType

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

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




    def arrayType(self):

        localctx = pascalParser.ArrayTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 58, self.RULE_arrayType)
        try:
            self.state = 375
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,19,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 361
                self.match(pascalParser.ARRAY)
                self.state = 362
                self.match(pascalParser.LBRACK)
                self.state = 363
                self.typeList()
                self.state = 364
                self.match(pascalParser.RBRACK)
                self.state = 365
                self.match(pascalParser.OF)
                self.state = 366
                self.componentType()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 368
                self.match(pascalParser.ARRAY)
                self.state = 369
                self.match(pascalParser.LBRACK2)
                self.state = 370
                self.typeList()
                self.state = 371
                self.match(pascalParser.RBRACK2)
                self.state = 372
                self.match(pascalParser.OF)
                self.state = 373
                self.componentType()
                pass


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


    class TypeListContext(ParserRuleContext):

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

        def indexType(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.IndexTypeContext)
            else:
                return self.getTypedRuleContext(pascalParser.IndexTypeContext,i)


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

        def getRuleIndex(self):
            return pascalParser.RULE_typeList

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

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




    def typeList(self):

        localctx = pascalParser.TypeListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 60, self.RULE_typeList)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 377
            self.indexType()
            self.state = 382
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==pascalParser.COMMA:
                self.state = 378
                self.match(pascalParser.COMMA)
                self.state = 379
                self.indexType()
                self.state = 384
                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 IndexTypeContext(ParserRuleContext):

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

        def simpleType(self):
            return self.getTypedRuleContext(pascalParser.SimpleTypeContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_indexType

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

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




    def indexType(self):

        localctx = pascalParser.IndexTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 62, self.RULE_indexType)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 385
            self.simpleType()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ComponentTypeContext(ParserRuleContext):

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

        def re_type(self):
            return self.getTypedRuleContext(pascalParser.Re_typeContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_componentType

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

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




    def componentType(self):

        localctx = pascalParser.ComponentTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 64, self.RULE_componentType)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 387
            self.re_type()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RecordTypeContext(ParserRuleContext):

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

        def RECORD(self):
            return self.getToken(pascalParser.RECORD, 0)

        def END(self):
            return self.getToken(pascalParser.END, 0)

        def fieldList(self):
            return self.getTypedRuleContext(pascalParser.FieldListContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_recordType

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

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




    def recordType(self):

        localctx = pascalParser.RecordTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 66, self.RULE_recordType)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 389
            self.match(pascalParser.RECORD)
            self.state = 391
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==pascalParser.CASE or _la==pascalParser.IDENT:
                self.state = 390
                self.fieldList()


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


    class FieldListContext(ParserRuleContext):

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

        def fixedPart(self):
            return self.getTypedRuleContext(pascalParser.FixedPartContext,0)


        def SEMI(self):
            return self.getToken(pascalParser.SEMI, 0)

        def variantPart(self):
            return self.getTypedRuleContext(pascalParser.VariantPartContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_fieldList

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

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




    def fieldList(self):

        localctx = pascalParser.FieldListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 68, self.RULE_fieldList)
        self._la = 0 # Token type
        try:
            self.state = 401
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.IDENT]:
                self.enterOuterAlt(localctx, 1)
                self.state = 395
                self.fixedPart()
                self.state = 398
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==pascalParser.SEMI:
                    self.state = 396
                    self.match(pascalParser.SEMI)
                    self.state = 397
                    self.variantPart()


                pass
            elif token in [pascalParser.CASE]:
                self.enterOuterAlt(localctx, 2)
                self.state = 400
                self.variantPart()
                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 FixedPartContext(ParserRuleContext):

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

        def recordSection(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.RecordSectionContext)
            else:
                return self.getTypedRuleContext(pascalParser.RecordSectionContext,i)


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

        def getRuleIndex(self):
            return pascalParser.RULE_fixedPart

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

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




    def fixedPart(self):

        localctx = pascalParser.FixedPartContext(self, self._ctx, self.state)
        self.enterRule(localctx, 70, self.RULE_fixedPart)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 403
            self.recordSection()
            self.state = 408
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,24,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 404
                    self.match(pascalParser.SEMI)
                    self.state = 405
                    self.recordSection() 
                self.state = 410
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,24,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 RecordSectionContext(ParserRuleContext):

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

        def identifierList(self):
            return self.getTypedRuleContext(pascalParser.IdentifierListContext,0)


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

        def re_type(self):
            return self.getTypedRuleContext(pascalParser.Re_typeContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_recordSection

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

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




    def recordSection(self):

        localctx = pascalParser.RecordSectionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 72, self.RULE_recordSection)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 411
            self.identifierList()
            self.state = 412
            self.match(pascalParser.COLON)
            self.state = 413
            self.re_type()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class VariantPartContext(ParserRuleContext):

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

        def CASE(self):
            return self.getToken(pascalParser.CASE, 0)

        def tag(self):
            return self.getTypedRuleContext(pascalParser.TagContext,0)


        def OF(self):
            return self.getToken(pascalParser.OF, 0)

        def variant(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.VariantContext)
            else:
                return self.getTypedRuleContext(pascalParser.VariantContext,i)


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

        def getRuleIndex(self):
            return pascalParser.RULE_variantPart

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

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




    def variantPart(self):

        localctx = pascalParser.VariantPartContext(self, self._ctx, self.state)
        self.enterRule(localctx, 74, self.RULE_variantPart)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 415
            self.match(pascalParser.CASE)
            self.state = 416
            self.tag()
            self.state = 417
            self.match(pascalParser.OF)
            self.state = 418
            self.variant()
            self.state = 423
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==pascalParser.SEMI:
                self.state = 419
                self.match(pascalParser.SEMI)
                self.state = 420
                self.variant()
                self.state = 425
                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 TagContext(ParserRuleContext):

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

        def identifier(self):
            return self.getTypedRuleContext(pascalParser.IdentifierContext,0)


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

        def typeIdentifier(self):
            return self.getTypedRuleContext(pascalParser.TypeIdentifierContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_tag

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

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




    def tag(self):

        localctx = pascalParser.TagContext(self, self._ctx, self.state)
        self.enterRule(localctx, 76, self.RULE_tag)
        try:
            self.state = 431
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,26,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 426
                self.identifier()
                self.state = 427
                self.match(pascalParser.COLON)
                self.state = 428
                self.typeIdentifier()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 430
                self.typeIdentifier()
                pass


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


    class VariantContext(ParserRuleContext):

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

        def constList(self):
            return self.getTypedRuleContext(pascalParser.ConstListContext,0)


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

        def LPAREN(self):
            return self.getToken(pascalParser.LPAREN, 0)

        def fieldList(self):
            return self.getTypedRuleContext(pascalParser.FieldListContext,0)


        def RPAREN(self):
            return self.getToken(pascalParser.RPAREN, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_variant

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

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




    def variant(self):

        localctx = pascalParser.VariantContext(self, self._ctx, self.state)
        self.enterRule(localctx, 78, self.RULE_variant)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 433
            self.constList()
            self.state = 434
            self.match(pascalParser.COLON)
            self.state = 435
            self.match(pascalParser.LPAREN)
            self.state = 436
            self.fieldList()
            self.state = 437
            self.match(pascalParser.RPAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SetTypeContext(ParserRuleContext):

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

        def SET(self):
            return self.getToken(pascalParser.SET, 0)

        def OF(self):
            return self.getToken(pascalParser.OF, 0)

        def baseType(self):
            return self.getTypedRuleContext(pascalParser.BaseTypeContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_setType

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

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




    def setType(self):

        localctx = pascalParser.SetTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 80, self.RULE_setType)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 439
            self.match(pascalParser.SET)
            self.state = 440
            self.match(pascalParser.OF)
            self.state = 441
            self.baseType()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class BaseTypeContext(ParserRuleContext):

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

        def simpleType(self):
            return self.getTypedRuleContext(pascalParser.SimpleTypeContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_baseType

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

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




    def baseType(self):

        localctx = pascalParser.BaseTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 82, self.RULE_baseType)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 443
            self.simpleType()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class FileTypeContext(ParserRuleContext):

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

        def FILE(self):
            return self.getToken(pascalParser.FILE, 0)

        def OF(self):
            return self.getToken(pascalParser.OF, 0)

        def re_type(self):
            return self.getTypedRuleContext(pascalParser.Re_typeContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_fileType

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

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




    def fileType(self):

        localctx = pascalParser.FileTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 84, self.RULE_fileType)
        try:
            self.state = 449
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,27,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 445
                self.match(pascalParser.FILE)
                self.state = 446
                self.match(pascalParser.OF)
                self.state = 447
                self.re_type()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 448
                self.match(pascalParser.FILE)
                pass


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


    class PointerTypeContext(ParserRuleContext):

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

        def POINTER(self):
            return self.getToken(pascalParser.POINTER, 0)

        def typeIdentifier(self):
            return self.getTypedRuleContext(pascalParser.TypeIdentifierContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_pointerType

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

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




    def pointerType(self):

        localctx = pascalParser.PointerTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 86, self.RULE_pointerType)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 451
            self.match(pascalParser.POINTER)
            self.state = 452
            self.typeIdentifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class VariableDeclarationPartContext(ParserRuleContext):

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

        def VAR(self):
            return self.getToken(pascalParser.VAR, 0)

        def variableDeclaration(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.VariableDeclarationContext)
            else:
                return self.getTypedRuleContext(pascalParser.VariableDeclarationContext,i)


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

        def getRuleIndex(self):
            return pascalParser.RULE_variableDeclarationPart

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

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




    def variableDeclarationPart(self):

        localctx = pascalParser.VariableDeclarationPartContext(self, self._ctx, self.state)
        self.enterRule(localctx, 88, self.RULE_variableDeclarationPart)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 454
            self.match(pascalParser.VAR)
            self.state = 455
            self.variableDeclaration()
            self.state = 460
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,28,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 456
                    self.match(pascalParser.SEMI)
                    self.state = 457
                    self.variableDeclaration() 
                self.state = 462
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,28,self._ctx)

            self.state = 463
            self.match(pascalParser.SEMI)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class VariableDeclarationContext(ParserRuleContext):

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

        def identifierList(self):
            return self.getTypedRuleContext(pascalParser.IdentifierListContext,0)


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

        def re_type(self):
            return self.getTypedRuleContext(pascalParser.Re_typeContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_variableDeclaration

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

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




    def variableDeclaration(self):

        localctx = pascalParser.VariableDeclarationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 90, self.RULE_variableDeclaration)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 465
            self.identifierList()
            self.state = 466
            self.match(pascalParser.COLON)
            self.state = 467
            self.re_type()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ProcedureAndFunctionDeclarationPartContext(ParserRuleContext):

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

        def procedureOrFunctionDeclaration(self):
            return self.getTypedRuleContext(pascalParser.ProcedureOrFunctionDeclarationContext,0)


        def SEMI(self):
            return self.getToken(pascalParser.SEMI, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_procedureAndFunctionDeclarationPart

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

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




    def procedureAndFunctionDeclarationPart(self):

        localctx = pascalParser.ProcedureAndFunctionDeclarationPartContext(self, self._ctx, self.state)
        self.enterRule(localctx, 92, self.RULE_procedureAndFunctionDeclarationPart)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 469
            self.procedureOrFunctionDeclaration()
            self.state = 470
            self.match(pascalParser.SEMI)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ProcedureOrFunctionDeclarationContext(ParserRuleContext):

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

        def procedureDeclaration(self):
            return self.getTypedRuleContext(pascalParser.ProcedureDeclarationContext,0)


        def functionDeclaration(self):
            return self.getTypedRuleContext(pascalParser.FunctionDeclarationContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_procedureOrFunctionDeclaration

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

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




    def procedureOrFunctionDeclaration(self):

        localctx = pascalParser.ProcedureOrFunctionDeclarationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 94, self.RULE_procedureOrFunctionDeclaration)
        try:
            self.state = 474
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.PROCEDURE]:
                self.enterOuterAlt(localctx, 1)
                self.state = 472
                self.procedureDeclaration()
                pass
            elif token in [pascalParser.FUNCTION]:
                self.enterOuterAlt(localctx, 2)
                self.state = 473
                self.functionDeclaration()
                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 ProcedureDeclarationContext(ParserRuleContext):

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

        def PROCEDURE(self):
            return self.getToken(pascalParser.PROCEDURE, 0)

        def identifier(self):
            return self.getTypedRuleContext(pascalParser.IdentifierContext,0)


        def SEMI(self):
            return self.getToken(pascalParser.SEMI, 0)

        def block(self):
            return self.getTypedRuleContext(pascalParser.BlockContext,0)


        def formalParameterList(self):
            return self.getTypedRuleContext(pascalParser.FormalParameterListContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_procedureDeclaration

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

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




    def procedureDeclaration(self):

        localctx = pascalParser.ProcedureDeclarationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 96, self.RULE_procedureDeclaration)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 476
            self.match(pascalParser.PROCEDURE)
            self.state = 477
            self.identifier()
            self.state = 479
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==pascalParser.LPAREN:
                self.state = 478
                self.formalParameterList()


            self.state = 481
            self.match(pascalParser.SEMI)
            self.state = 482
            self.block()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class FormalParameterListContext(ParserRuleContext):

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

        def LPAREN(self):
            return self.getToken(pascalParser.LPAREN, 0)

        def formalParameterSection(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.FormalParameterSectionContext)
            else:
                return self.getTypedRuleContext(pascalParser.FormalParameterSectionContext,i)


        def RPAREN(self):
            return self.getToken(pascalParser.RPAREN, 0)

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

        def getRuleIndex(self):
            return pascalParser.RULE_formalParameterList

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

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




    def formalParameterList(self):

        localctx = pascalParser.FormalParameterListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 98, self.RULE_formalParameterList)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 484
            self.match(pascalParser.LPAREN)
            self.state = 485
            self.formalParameterSection()
            self.state = 490
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==pascalParser.SEMI:
                self.state = 486
                self.match(pascalParser.SEMI)
                self.state = 487
                self.formalParameterSection()
                self.state = 492
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 493
            self.match(pascalParser.RPAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class FormalParameterSectionContext(ParserRuleContext):

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

        def parameterGroup(self):
            return self.getTypedRuleContext(pascalParser.ParameterGroupContext,0)


        def VAR(self):
            return self.getToken(pascalParser.VAR, 0)

        def FUNCTION(self):
            return self.getToken(pascalParser.FUNCTION, 0)

        def PROCEDURE(self):
            return self.getToken(pascalParser.PROCEDURE, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_formalParameterSection

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

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




    def formalParameterSection(self):

        localctx = pascalParser.FormalParameterSectionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 100, self.RULE_formalParameterSection)
        try:
            self.state = 502
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.IDENT]:
                self.enterOuterAlt(localctx, 1)
                self.state = 495
                self.parameterGroup()
                pass
            elif token in [pascalParser.VAR]:
                self.enterOuterAlt(localctx, 2)
                self.state = 496
                self.match(pascalParser.VAR)
                self.state = 497
                self.parameterGroup()
                pass
            elif token in [pascalParser.FUNCTION]:
                self.enterOuterAlt(localctx, 3)
                self.state = 498
                self.match(pascalParser.FUNCTION)
                self.state = 499
                self.parameterGroup()
                pass
            elif token in [pascalParser.PROCEDURE]:
                self.enterOuterAlt(localctx, 4)
                self.state = 500
                self.match(pascalParser.PROCEDURE)
                self.state = 501
                self.parameterGroup()
                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 ParameterGroupContext(ParserRuleContext):

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

        def identifierList(self):
            return self.getTypedRuleContext(pascalParser.IdentifierListContext,0)


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

        def typeIdentifier(self):
            return self.getTypedRuleContext(pascalParser.TypeIdentifierContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_parameterGroup

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

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




    def parameterGroup(self):

        localctx = pascalParser.ParameterGroupContext(self, self._ctx, self.state)
        self.enterRule(localctx, 102, self.RULE_parameterGroup)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 504
            self.identifierList()
            self.state = 505
            self.match(pascalParser.COLON)
            self.state = 506
            self.typeIdentifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class IdentifierListContext(ParserRuleContext):

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

        def identifier(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.IdentifierContext)
            else:
                return self.getTypedRuleContext(pascalParser.IdentifierContext,i)


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

        def getRuleIndex(self):
            return pascalParser.RULE_identifierList

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

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




    def identifierList(self):

        localctx = pascalParser.IdentifierListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 104, self.RULE_identifierList)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 508
            self.identifier()
            self.state = 513
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==pascalParser.COMMA:
                self.state = 509
                self.match(pascalParser.COMMA)
                self.state = 510
                self.identifier()
                self.state = 515
                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 ConstListContext(ParserRuleContext):

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

        def constant(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.ConstantContext)
            else:
                return self.getTypedRuleContext(pascalParser.ConstantContext,i)


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

        def getRuleIndex(self):
            return pascalParser.RULE_constList

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

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




    def constList(self):

        localctx = pascalParser.ConstListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 106, self.RULE_constList)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 516
            self.constant()
            self.state = 521
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==pascalParser.COMMA:
                self.state = 517
                self.match(pascalParser.COMMA)
                self.state = 518
                self.constant()
                self.state = 523
                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 FunctionDeclarationContext(ParserRuleContext):

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

        def FUNCTION(self):
            return self.getToken(pascalParser.FUNCTION, 0)

        def identifier(self):
            return self.getTypedRuleContext(pascalParser.IdentifierContext,0)


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

        def resultType(self):
            return self.getTypedRuleContext(pascalParser.ResultTypeContext,0)


        def SEMI(self):
            return self.getToken(pascalParser.SEMI, 0)

        def block(self):
            return self.getTypedRuleContext(pascalParser.BlockContext,0)


        def formalParameterList(self):
            return self.getTypedRuleContext(pascalParser.FormalParameterListContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_functionDeclaration

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

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




    def functionDeclaration(self):

        localctx = pascalParser.FunctionDeclarationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 108, self.RULE_functionDeclaration)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 524
            self.match(pascalParser.FUNCTION)
            self.state = 525
            self.identifier()
            self.state = 527
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==pascalParser.LPAREN:
                self.state = 526
                self.formalParameterList()


            self.state = 529
            self.match(pascalParser.COLON)
            self.state = 530
            self.resultType()
            self.state = 531
            self.match(pascalParser.SEMI)
            self.state = 532
            self.block()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ResultTypeContext(ParserRuleContext):

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

        def typeIdentifier(self):
            return self.getTypedRuleContext(pascalParser.TypeIdentifierContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_resultType

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

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




    def resultType(self):

        localctx = pascalParser.ResultTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 110, self.RULE_resultType)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 534
            self.typeIdentifier()
        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 label(self):
            return self.getTypedRuleContext(pascalParser.LabelContext,0)


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

        def unlabelledStatement(self):
            return self.getTypedRuleContext(pascalParser.UnlabelledStatementContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_statement

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

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




    def statement(self):

        localctx = pascalParser.StatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 112, self.RULE_statement)
        try:
            self.state = 541
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.NUM_INT]:
                self.enterOuterAlt(localctx, 1)
                self.state = 536
                self.label()
                self.state = 537
                self.match(pascalParser.COLON)
                self.state = 538
                self.unlabelledStatement()
                pass
            elif token in [pascalParser.BEGIN, pascalParser.CASE, pascalParser.ELSE, pascalParser.END, pascalParser.FOR, pascalParser.GOTO, pascalParser.IF, pascalParser.REPEAT, pascalParser.UNTIL, pascalParser.WHILE, pascalParser.WITH, pascalParser.SEMI, pascalParser.AT, pascalParser.IDENT]:
                self.enterOuterAlt(localctx, 2)
                self.state = 540
                self.unlabelledStatement()
                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 UnlabelledStatementContext(ParserRuleContext):

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

        def simpleStatement(self):
            return self.getTypedRuleContext(pascalParser.SimpleStatementContext,0)


        def structuredStatement(self):
            return self.getTypedRuleContext(pascalParser.StructuredStatementContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_unlabelledStatement

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

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




    def unlabelledStatement(self):

        localctx = pascalParser.UnlabelledStatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 114, self.RULE_unlabelledStatement)
        try:
            self.state = 545
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.ELSE, pascalParser.END, pascalParser.GOTO, pascalParser.UNTIL, pascalParser.SEMI, pascalParser.AT, pascalParser.IDENT]:
                self.enterOuterAlt(localctx, 1)
                self.state = 543
                self.simpleStatement()
                pass
            elif token in [pascalParser.BEGIN, pascalParser.CASE, pascalParser.FOR, pascalParser.IF, pascalParser.REPEAT, pascalParser.WHILE, pascalParser.WITH]:
                self.enterOuterAlt(localctx, 2)
                self.state = 544
                self.structuredStatement()
                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 SimpleStatementContext(ParserRuleContext):

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

        def assignmentStatement(self):
            return self.getTypedRuleContext(pascalParser.AssignmentStatementContext,0)


        def procedureStatement(self):
            return self.getTypedRuleContext(pascalParser.ProcedureStatementContext,0)


        def gotoStatement(self):
            return self.getTypedRuleContext(pascalParser.GotoStatementContext,0)


        def emptyStatement(self):
            return self.getTypedRuleContext(pascalParser.EmptyStatementContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_simpleStatement

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

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




    def simpleStatement(self):

        localctx = pascalParser.SimpleStatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 116, self.RULE_simpleStatement)
        try:
            self.state = 551
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,38,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 547
                self.assignmentStatement()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 548
                self.procedureStatement()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 549
                self.gotoStatement()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 550
                self.emptyStatement()
                pass


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


    class AssignmentStatementContext(ParserRuleContext):

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

        def variable(self):
            return self.getTypedRuleContext(pascalParser.VariableContext,0)


        def ASSIGN(self):
            return self.getToken(pascalParser.ASSIGN, 0)

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


        def getRuleIndex(self):
            return pascalParser.RULE_assignmentStatement

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

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




    def assignmentStatement(self):

        localctx = pascalParser.AssignmentStatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 118, self.RULE_assignmentStatement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 553
            self.variable()
            self.state = 554
            self.match(pascalParser.ASSIGN)
            self.state = 555
            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 VariableContext(ParserRuleContext):

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

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

        def identifier(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.IdentifierContext)
            else:
                return self.getTypedRuleContext(pascalParser.IdentifierContext,i)


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

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


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

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

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

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

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

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

        def getRuleIndex(self):
            return pascalParser.RULE_variable

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

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




    def variable(self):

        localctx = pascalParser.VariableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 120, self.RULE_variable)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 560
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.AT]:
                self.state = 557
                self.match(pascalParser.AT)
                self.state = 558
                self.identifier()
                pass
            elif token in [pascalParser.IDENT]:
                self.state = 559
                self.identifier()
                pass
            else:
                raise NoViableAltException(self)

            self.state = 589
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << pascalParser.LBRACK) | (1 << pascalParser.LBRACK2) | (1 << pascalParser.POINTER) | (1 << pascalParser.DOT))) != 0):
                self.state = 587
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [pascalParser.LBRACK]:
                    self.state = 562
                    self.match(pascalParser.LBRACK)
                    self.state = 563
                    self.expression()
                    self.state = 568
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    while _la==pascalParser.COMMA:
                        self.state = 564
                        self.match(pascalParser.COMMA)
                        self.state = 565
                        self.expression()
                        self.state = 570
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)

                    self.state = 571
                    self.match(pascalParser.RBRACK)
                    pass
                elif token in [pascalParser.LBRACK2]:
                    self.state = 573
                    self.match(pascalParser.LBRACK2)
                    self.state = 574
                    self.expression()
                    self.state = 579
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    while _la==pascalParser.COMMA:
                        self.state = 575
                        self.match(pascalParser.COMMA)
                        self.state = 576
                        self.expression()
                        self.state = 581
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)

                    self.state = 582
                    self.match(pascalParser.RBRACK2)
                    pass
                elif token in [pascalParser.DOT]:
                    self.state = 584
                    self.match(pascalParser.DOT)
                    self.state = 585
                    self.identifier()
                    pass
                elif token in [pascalParser.POINTER]:
                    self.state = 586
                    self.match(pascalParser.POINTER)
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 591
                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 ExpressionContext(ParserRuleContext):

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

        def simpleExpression(self):
            return self.getTypedRuleContext(pascalParser.SimpleExpressionContext,0)


        def relationaloperator(self):
            return self.getTypedRuleContext(pascalParser.RelationaloperatorContext,0)


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


        def getRuleIndex(self):
            return pascalParser.RULE_expression

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

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




    def expression(self):

        localctx = pascalParser.ExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 122, self.RULE_expression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 592
            self.simpleExpression()
            self.state = 596
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << pascalParser.IN) | (1 << pascalParser.EQUAL) | (1 << pascalParser.NOT_EQUAL) | (1 << pascalParser.LT) | (1 << pascalParser.LE) | (1 << pascalParser.GE) | (1 << pascalParser.GT))) != 0):
                self.state = 593
                self.relationaloperator()
                self.state = 594
                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 RelationaloperatorContext(ParserRuleContext):

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

        def EQUAL(self):
            return self.getToken(pascalParser.EQUAL, 0)

        def NOT_EQUAL(self):
            return self.getToken(pascalParser.NOT_EQUAL, 0)

        def LT(self):
            return self.getToken(pascalParser.LT, 0)

        def LE(self):
            return self.getToken(pascalParser.LE, 0)

        def GE(self):
            return self.getToken(pascalParser.GE, 0)

        def GT(self):
            return self.getToken(pascalParser.GT, 0)

        def IN(self):
            return self.getToken(pascalParser.IN, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_relationaloperator

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

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




    def relationaloperator(self):

        localctx = pascalParser.RelationaloperatorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 124, self.RULE_relationaloperator)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 598
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << pascalParser.IN) | (1 << pascalParser.EQUAL) | (1 << pascalParser.NOT_EQUAL) | (1 << pascalParser.LT) | (1 << pascalParser.LE) | (1 << pascalParser.GE) | (1 << pascalParser.GT))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SimpleExpressionContext(ParserRuleContext):

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

        def term(self):
            return self.getTypedRuleContext(pascalParser.TermContext,0)


        def additiveoperator(self):
            return self.getTypedRuleContext(pascalParser.AdditiveoperatorContext,0)


        def simpleExpression(self):
            return self.getTypedRuleContext(pascalParser.SimpleExpressionContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_simpleExpression

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

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




    def simpleExpression(self):

        localctx = pascalParser.SimpleExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 126, self.RULE_simpleExpression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 600
            self.term()
            self.state = 604
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << pascalParser.OR) | (1 << pascalParser.PLUS) | (1 << pascalParser.MINUS))) != 0):
                self.state = 601
                self.additiveoperator()
                self.state = 602
                self.simpleExpression()


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


    class AdditiveoperatorContext(ParserRuleContext):

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

        def PLUS(self):
            return self.getToken(pascalParser.PLUS, 0)

        def MINUS(self):
            return self.getToken(pascalParser.MINUS, 0)

        def OR(self):
            return self.getToken(pascalParser.OR, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_additiveoperator

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

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




    def additiveoperator(self):

        localctx = pascalParser.AdditiveoperatorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 128, self.RULE_additiveoperator)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 606
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << pascalParser.OR) | (1 << pascalParser.PLUS) | (1 << pascalParser.MINUS))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TermContext(ParserRuleContext):

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

        def signedFactor(self):
            return self.getTypedRuleContext(pascalParser.SignedFactorContext,0)


        def multiplicativeoperator(self):
            return self.getTypedRuleContext(pascalParser.MultiplicativeoperatorContext,0)


        def term(self):
            return self.getTypedRuleContext(pascalParser.TermContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_term

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

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




    def term(self):

        localctx = pascalParser.TermContext(self, self._ctx, self.state)
        self.enterRule(localctx, 130, self.RULE_term)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 608
            self.signedFactor()
            self.state = 612
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << pascalParser.AND) | (1 << pascalParser.DIV) | (1 << pascalParser.MOD) | (1 << pascalParser.STAR) | (1 << pascalParser.SLASH))) != 0):
                self.state = 609
                self.multiplicativeoperator()
                self.state = 610
                self.term()


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


    class MultiplicativeoperatorContext(ParserRuleContext):

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

        def STAR(self):
            return self.getToken(pascalParser.STAR, 0)

        def SLASH(self):
            return self.getToken(pascalParser.SLASH, 0)

        def DIV(self):
            return self.getToken(pascalParser.DIV, 0)

        def MOD(self):
            return self.getToken(pascalParser.MOD, 0)

        def AND(self):
            return self.getToken(pascalParser.AND, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_multiplicativeoperator

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

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




    def multiplicativeoperator(self):

        localctx = pascalParser.MultiplicativeoperatorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 132, self.RULE_multiplicativeoperator)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 614
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << pascalParser.AND) | (1 << pascalParser.DIV) | (1 << pascalParser.MOD) | (1 << pascalParser.STAR) | (1 << pascalParser.SLASH))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SignedFactorContext(ParserRuleContext):

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

        def factor(self):
            return self.getTypedRuleContext(pascalParser.FactorContext,0)


        def PLUS(self):
            return self.getToken(pascalParser.PLUS, 0)

        def MINUS(self):
            return self.getToken(pascalParser.MINUS, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_signedFactor

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

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




    def signedFactor(self):

        localctx = pascalParser.SignedFactorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 134, self.RULE_signedFactor)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 617
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==pascalParser.PLUS or _la==pascalParser.MINUS:
                self.state = 616
                _la = self._input.LA(1)
                if not(_la==pascalParser.PLUS or _la==pascalParser.MINUS):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


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


    class FactorContext(ParserRuleContext):

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

        def variable(self):
            return self.getTypedRuleContext(pascalParser.VariableContext,0)


        def LPAREN(self):
            return self.getToken(pascalParser.LPAREN, 0)

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


        def RPAREN(self):
            return self.getToken(pascalParser.RPAREN, 0)

        def functionDesignator(self):
            return self.getTypedRuleContext(pascalParser.FunctionDesignatorContext,0)


        def unsignedConstant(self):
            return self.getTypedRuleContext(pascalParser.UnsignedConstantContext,0)


        def re_set(self):
            return self.getTypedRuleContext(pascalParser.Re_setContext,0)


        def NOT(self):
            return self.getToken(pascalParser.NOT, 0)

        def factor(self):
            return self.getTypedRuleContext(pascalParser.FactorContext,0)


        def bool_(self):
            return self.getTypedRuleContext(pascalParser.Bool_Context,0)


        def getRuleIndex(self):
            return pascalParser.RULE_factor

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

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




    def factor(self):

        localctx = pascalParser.FactorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 136, self.RULE_factor)
        try:
            self.state = 632
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,48,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 621
                self.variable()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 622
                self.match(pascalParser.LPAREN)
                self.state = 623
                self.expression()
                self.state = 624
                self.match(pascalParser.RPAREN)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 626
                self.functionDesignator()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 627
                self.unsignedConstant()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 628
                self.re_set()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 629
                self.match(pascalParser.NOT)
                self.state = 630
                self.factor()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 631
                self.bool_()
                pass


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


    class UnsignedConstantContext(ParserRuleContext):

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

        def unsignedNumber(self):
            return self.getTypedRuleContext(pascalParser.UnsignedNumberContext,0)


        def constantChr(self):
            return self.getTypedRuleContext(pascalParser.ConstantChrContext,0)


        def string(self):
            return self.getTypedRuleContext(pascalParser.StringContext,0)


        def NIL(self):
            return self.getToken(pascalParser.NIL, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_unsignedConstant

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

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




    def unsignedConstant(self):

        localctx = pascalParser.UnsignedConstantContext(self, self._ctx, self.state)
        self.enterRule(localctx, 138, self.RULE_unsignedConstant)
        try:
            self.state = 638
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.NUM_INT, pascalParser.NUM_REAL]:
                self.enterOuterAlt(localctx, 1)
                self.state = 634
                self.unsignedNumber()
                pass
            elif token in [pascalParser.CHR]:
                self.enterOuterAlt(localctx, 2)
                self.state = 635
                self.constantChr()
                pass
            elif token in [pascalParser.STRING_LITERAL]:
                self.enterOuterAlt(localctx, 3)
                self.state = 636
                self.string()
                pass
            elif token in [pascalParser.NIL]:
                self.enterOuterAlt(localctx, 4)
                self.state = 637
                self.match(pascalParser.NIL)
                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 FunctionDesignatorContext(ParserRuleContext):

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

        def identifier(self):
            return self.getTypedRuleContext(pascalParser.IdentifierContext,0)


        def LPAREN(self):
            return self.getToken(pascalParser.LPAREN, 0)

        def parameterList(self):
            return self.getTypedRuleContext(pascalParser.ParameterListContext,0)


        def RPAREN(self):
            return self.getToken(pascalParser.RPAREN, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_functionDesignator

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

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




    def functionDesignator(self):

        localctx = pascalParser.FunctionDesignatorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 140, self.RULE_functionDesignator)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 640
            self.identifier()
            self.state = 641
            self.match(pascalParser.LPAREN)
            self.state = 642
            self.parameterList()
            self.state = 643
            self.match(pascalParser.RPAREN)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ParameterListContext(ParserRuleContext):

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

        def actualParameter(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.ActualParameterContext)
            else:
                return self.getTypedRuleContext(pascalParser.ActualParameterContext,i)


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

        def getRuleIndex(self):
            return pascalParser.RULE_parameterList

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

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




    def parameterList(self):

        localctx = pascalParser.ParameterListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 142, self.RULE_parameterList)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 645
            self.actualParameter()
            self.state = 650
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==pascalParser.COMMA:
                self.state = 646
                self.match(pascalParser.COMMA)
                self.state = 647
                self.actualParameter()
                self.state = 652
                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 Re_setContext(ParserRuleContext):

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

        def LBRACK(self):
            return self.getToken(pascalParser.LBRACK, 0)

        def elementList(self):
            return self.getTypedRuleContext(pascalParser.ElementListContext,0)


        def RBRACK(self):
            return self.getToken(pascalParser.RBRACK, 0)

        def LBRACK2(self):
            return self.getToken(pascalParser.LBRACK2, 0)

        def RBRACK2(self):
            return self.getToken(pascalParser.RBRACK2, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_re_set

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

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




    def re_set(self):

        localctx = pascalParser.Re_setContext(self, self._ctx, self.state)
        self.enterRule(localctx, 144, self.RULE_re_set)
        try:
            self.state = 661
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.LBRACK]:
                self.enterOuterAlt(localctx, 1)
                self.state = 653
                self.match(pascalParser.LBRACK)
                self.state = 654
                self.elementList()
                self.state = 655
                self.match(pascalParser.RBRACK)
                pass
            elif token in [pascalParser.LBRACK2]:
                self.enterOuterAlt(localctx, 2)
                self.state = 657
                self.match(pascalParser.LBRACK2)
                self.state = 658
                self.elementList()
                self.state = 659
                self.match(pascalParser.RBRACK2)
                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 ElementListContext(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(pascalParser.ElementContext)
            else:
                return self.getTypedRuleContext(pascalParser.ElementContext,i)


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

        def getRuleIndex(self):
            return pascalParser.RULE_elementList

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

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




    def elementList(self):

        localctx = pascalParser.ElementListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 146, self.RULE_elementList)
        self._la = 0 # Token type
        try:
            self.state = 672
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.CHR, pascalParser.NIL, pascalParser.NOT, pascalParser.PLUS, pascalParser.MINUS, pascalParser.LPAREN, pascalParser.LBRACK, pascalParser.LBRACK2, pascalParser.AT, pascalParser.TRUE, pascalParser.FALSE, pascalParser.IDENT, pascalParser.STRING_LITERAL, pascalParser.NUM_INT, pascalParser.NUM_REAL]:
                self.enterOuterAlt(localctx, 1)
                self.state = 663
                self.element()
                self.state = 668
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==pascalParser.COMMA:
                    self.state = 664
                    self.match(pascalParser.COMMA)
                    self.state = 665
                    self.element()
                    self.state = 670
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                pass
            elif token in [pascalParser.RBRACK, pascalParser.RBRACK2]:
                self.enterOuterAlt(localctx, 2)

                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 ElementContext(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(pascalParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(pascalParser.ExpressionContext,i)


        def DOTDOT(self):
            return self.getToken(pascalParser.DOTDOT, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_element

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

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




    def element(self):

        localctx = pascalParser.ElementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 148, self.RULE_element)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 674
            self.expression()
            self.state = 677
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==pascalParser.DOTDOT:
                self.state = 675
                self.match(pascalParser.DOTDOT)
                self.state = 676
                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 ProcedureStatementContext(ParserRuleContext):

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

        def identifier(self):
            return self.getTypedRuleContext(pascalParser.IdentifierContext,0)


        def LPAREN(self):
            return self.getToken(pascalParser.LPAREN, 0)

        def parameterList(self):
            return self.getTypedRuleContext(pascalParser.ParameterListContext,0)


        def RPAREN(self):
            return self.getToken(pascalParser.RPAREN, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_procedureStatement

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

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




    def procedureStatement(self):

        localctx = pascalParser.ProcedureStatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 150, self.RULE_procedureStatement)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 679
            self.identifier()
            self.state = 684
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==pascalParser.LPAREN:
                self.state = 680
                self.match(pascalParser.LPAREN)
                self.state = 681
                self.parameterList()
                self.state = 682
                self.match(pascalParser.RPAREN)


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


    class ActualParameterContext(ParserRuleContext):

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

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


        def parameterwidth(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.ParameterwidthContext)
            else:
                return self.getTypedRuleContext(pascalParser.ParameterwidthContext,i)


        def getRuleIndex(self):
            return pascalParser.RULE_actualParameter

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

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




    def actualParameter(self):

        localctx = pascalParser.ActualParameterContext(self, self._ctx, self.state)
        self.enterRule(localctx, 152, self.RULE_actualParameter)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 686
            self.expression()
            self.state = 690
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==pascalParser.COLON:
                self.state = 687
                self.parameterwidth()
                self.state = 692
                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 ParameterwidthContext(ParserRuleContext):

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

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

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


        def getRuleIndex(self):
            return pascalParser.RULE_parameterwidth

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

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




    def parameterwidth(self):

        localctx = pascalParser.ParameterwidthContext(self, self._ctx, self.state)
        self.enterRule(localctx, 154, self.RULE_parameterwidth)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 693
            self.match(pascalParser.COLON)
            self.state = 694
            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 GotoStatementContext(ParserRuleContext):

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

        def GOTO(self):
            return self.getToken(pascalParser.GOTO, 0)

        def label(self):
            return self.getTypedRuleContext(pascalParser.LabelContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_gotoStatement

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

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




    def gotoStatement(self):

        localctx = pascalParser.GotoStatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 156, self.RULE_gotoStatement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 696
            self.match(pascalParser.GOTO)
            self.state = 697
            self.label()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class EmptyStatementContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return pascalParser.RULE_emptyStatement

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

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




    def emptyStatement(self):

        localctx = pascalParser.EmptyStatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 158, self.RULE_emptyStatement)
        try:
            self.enterOuterAlt(localctx, 1)

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


    class EmptyContext(ParserRuleContext):

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


        def getRuleIndex(self):
            return pascalParser.RULE_empty

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

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




    def empty(self):

        localctx = pascalParser.EmptyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 160, self.RULE_empty)
        try:
            self.enterOuterAlt(localctx, 1)

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


    class StructuredStatementContext(ParserRuleContext):

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

        def compoundStatement(self):
            return self.getTypedRuleContext(pascalParser.CompoundStatementContext,0)


        def conditionalStatement(self):
            return self.getTypedRuleContext(pascalParser.ConditionalStatementContext,0)


        def repetetiveStatement(self):
            return self.getTypedRuleContext(pascalParser.RepetetiveStatementContext,0)


        def withStatement(self):
            return self.getTypedRuleContext(pascalParser.WithStatementContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_structuredStatement

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

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




    def structuredStatement(self):

        localctx = pascalParser.StructuredStatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 162, self.RULE_structuredStatement)
        try:
            self.state = 707
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.BEGIN]:
                self.enterOuterAlt(localctx, 1)
                self.state = 703
                self.compoundStatement()
                pass
            elif token in [pascalParser.CASE, pascalParser.IF]:
                self.enterOuterAlt(localctx, 2)
                self.state = 704
                self.conditionalStatement()
                pass
            elif token in [pascalParser.FOR, pascalParser.REPEAT, pascalParser.WHILE]:
                self.enterOuterAlt(localctx, 3)
                self.state = 705
                self.repetetiveStatement()
                pass
            elif token in [pascalParser.WITH]:
                self.enterOuterAlt(localctx, 4)
                self.state = 706
                self.withStatement()
                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 CompoundStatementContext(ParserRuleContext):

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

        def BEGIN(self):
            return self.getToken(pascalParser.BEGIN, 0)

        def statements(self):
            return self.getTypedRuleContext(pascalParser.StatementsContext,0)


        def END(self):
            return self.getToken(pascalParser.END, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_compoundStatement

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

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




    def compoundStatement(self):

        localctx = pascalParser.CompoundStatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 164, self.RULE_compoundStatement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 709
            self.match(pascalParser.BEGIN)
            self.state = 710
            self.statements()
            self.state = 711
            self.match(pascalParser.END)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class StatementsContext(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(pascalParser.StatementContext)
            else:
                return self.getTypedRuleContext(pascalParser.StatementContext,i)


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

        def getRuleIndex(self):
            return pascalParser.RULE_statements

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

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




    def statements(self):

        localctx = pascalParser.StatementsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 166, self.RULE_statements)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 713
            self.statement()
            self.state = 718
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==pascalParser.SEMI:
                self.state = 714
                self.match(pascalParser.SEMI)
                self.state = 715
                self.statement()
                self.state = 720
                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 ConditionalStatementContext(ParserRuleContext):

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

        def ifStatement(self):
            return self.getTypedRuleContext(pascalParser.IfStatementContext,0)


        def caseStatement(self):
            return self.getTypedRuleContext(pascalParser.CaseStatementContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_conditionalStatement

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

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




    def conditionalStatement(self):

        localctx = pascalParser.ConditionalStatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 168, self.RULE_conditionalStatement)
        try:
            self.state = 723
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.IF]:
                self.enterOuterAlt(localctx, 1)
                self.state = 721
                self.ifStatement()
                pass
            elif token in [pascalParser.CASE]:
                self.enterOuterAlt(localctx, 2)
                self.state = 722
                self.caseStatement()
                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 IfStatementContext(ParserRuleContext):

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

        def IF(self):
            return self.getToken(pascalParser.IF, 0)

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


        def THEN(self):
            return self.getToken(pascalParser.THEN, 0)

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


        def ELSE(self):
            return self.getToken(pascalParser.ELSE, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_ifStatement

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

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




    def ifStatement(self):

        localctx = pascalParser.IfStatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 170, self.RULE_ifStatement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 725
            self.match(pascalParser.IF)
            self.state = 726
            self.expression()
            self.state = 727
            self.match(pascalParser.THEN)
            self.state = 728
            self.statement()
            self.state = 731
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,60,self._ctx)
            if la_ == 1:
                self.state = 729
                self.match(pascalParser.ELSE)
                self.state = 730
                self.statement()


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


    class CaseStatementContext(ParserRuleContext):

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

        def CASE(self):
            return self.getToken(pascalParser.CASE, 0)

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


        def OF(self):
            return self.getToken(pascalParser.OF, 0)

        def caseListElement(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.CaseListElementContext)
            else:
                return self.getTypedRuleContext(pascalParser.CaseListElementContext,i)


        def END(self):
            return self.getToken(pascalParser.END, 0)

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

        def ELSE(self):
            return self.getToken(pascalParser.ELSE, 0)

        def statements(self):
            return self.getTypedRuleContext(pascalParser.StatementsContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_caseStatement

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

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




    def caseStatement(self):

        localctx = pascalParser.CaseStatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 172, self.RULE_caseStatement)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 733
            self.match(pascalParser.CASE)
            self.state = 734
            self.expression()
            self.state = 735
            self.match(pascalParser.OF)
            self.state = 736
            self.caseListElement()
            self.state = 741
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,61,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 737
                    self.match(pascalParser.SEMI)
                    self.state = 738
                    self.caseListElement() 
                self.state = 743
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,61,self._ctx)

            self.state = 747
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==pascalParser.SEMI:
                self.state = 744
                self.match(pascalParser.SEMI)
                self.state = 745
                self.match(pascalParser.ELSE)
                self.state = 746
                self.statements()


            self.state = 749
            self.match(pascalParser.END)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CaseListElementContext(ParserRuleContext):

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

        def constList(self):
            return self.getTypedRuleContext(pascalParser.ConstListContext,0)


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

        def statement(self):
            return self.getTypedRuleContext(pascalParser.StatementContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_caseListElement

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

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




    def caseListElement(self):

        localctx = pascalParser.CaseListElementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 174, self.RULE_caseListElement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 751
            self.constList()
            self.state = 752
            self.match(pascalParser.COLON)
            self.state = 753
            self.statement()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RepetetiveStatementContext(ParserRuleContext):

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

        def whileStatement(self):
            return self.getTypedRuleContext(pascalParser.WhileStatementContext,0)


        def repeatStatement(self):
            return self.getTypedRuleContext(pascalParser.RepeatStatementContext,0)


        def forStatement(self):
            return self.getTypedRuleContext(pascalParser.ForStatementContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_repetetiveStatement

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

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




    def repetetiveStatement(self):

        localctx = pascalParser.RepetetiveStatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 176, self.RULE_repetetiveStatement)
        try:
            self.state = 758
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [pascalParser.WHILE]:
                self.enterOuterAlt(localctx, 1)
                self.state = 755
                self.whileStatement()
                pass
            elif token in [pascalParser.REPEAT]:
                self.enterOuterAlt(localctx, 2)
                self.state = 756
                self.repeatStatement()
                pass
            elif token in [pascalParser.FOR]:
                self.enterOuterAlt(localctx, 3)
                self.state = 757
                self.forStatement()
                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 WhileStatementContext(ParserRuleContext):

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

        def WHILE(self):
            return self.getToken(pascalParser.WHILE, 0)

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


        def DO(self):
            return self.getToken(pascalParser.DO, 0)

        def statement(self):
            return self.getTypedRuleContext(pascalParser.StatementContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_whileStatement

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

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




    def whileStatement(self):

        localctx = pascalParser.WhileStatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 178, self.RULE_whileStatement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 760
            self.match(pascalParser.WHILE)
            self.state = 761
            self.expression()
            self.state = 762
            self.match(pascalParser.DO)
            self.state = 763
            self.statement()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RepeatStatementContext(ParserRuleContext):

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

        def REPEAT(self):
            return self.getToken(pascalParser.REPEAT, 0)

        def statements(self):
            return self.getTypedRuleContext(pascalParser.StatementsContext,0)


        def UNTIL(self):
            return self.getToken(pascalParser.UNTIL, 0)

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


        def getRuleIndex(self):
            return pascalParser.RULE_repeatStatement

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

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




    def repeatStatement(self):

        localctx = pascalParser.RepeatStatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 180, self.RULE_repeatStatement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 765
            self.match(pascalParser.REPEAT)
            self.state = 766
            self.statements()
            self.state = 767
            self.match(pascalParser.UNTIL)
            self.state = 768
            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 ForStatementContext(ParserRuleContext):

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

        def FOR(self):
            return self.getToken(pascalParser.FOR, 0)

        def identifier(self):
            return self.getTypedRuleContext(pascalParser.IdentifierContext,0)


        def ASSIGN(self):
            return self.getToken(pascalParser.ASSIGN, 0)

        def forList(self):
            return self.getTypedRuleContext(pascalParser.ForListContext,0)


        def DO(self):
            return self.getToken(pascalParser.DO, 0)

        def statement(self):
            return self.getTypedRuleContext(pascalParser.StatementContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_forStatement

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

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




    def forStatement(self):

        localctx = pascalParser.ForStatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 182, self.RULE_forStatement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 770
            self.match(pascalParser.FOR)
            self.state = 771
            self.identifier()
            self.state = 772
            self.match(pascalParser.ASSIGN)
            self.state = 773
            self.forList()
            self.state = 774
            self.match(pascalParser.DO)
            self.state = 775
            self.statement()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ForListContext(ParserRuleContext):

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

        def initialValue(self):
            return self.getTypedRuleContext(pascalParser.InitialValueContext,0)


        def finalValue(self):
            return self.getTypedRuleContext(pascalParser.FinalValueContext,0)


        def TO(self):
            return self.getToken(pascalParser.TO, 0)

        def DOWNTO(self):
            return self.getToken(pascalParser.DOWNTO, 0)

        def getRuleIndex(self):
            return pascalParser.RULE_forList

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

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




    def forList(self):

        localctx = pascalParser.ForListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 184, self.RULE_forList)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 777
            self.initialValue()
            self.state = 778
            _la = self._input.LA(1)
            if not(_la==pascalParser.DOWNTO or _la==pascalParser.TO):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 779
            self.finalValue()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class InitialValueContext(ParserRuleContext):

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

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


        def getRuleIndex(self):
            return pascalParser.RULE_initialValue

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

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




    def initialValue(self):

        localctx = pascalParser.InitialValueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 186, self.RULE_initialValue)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 781
            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 FinalValueContext(ParserRuleContext):

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

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


        def getRuleIndex(self):
            return pascalParser.RULE_finalValue

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

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




    def finalValue(self):

        localctx = pascalParser.FinalValueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 188, self.RULE_finalValue)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 783
            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 WithStatementContext(ParserRuleContext):

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

        def WITH(self):
            return self.getToken(pascalParser.WITH, 0)

        def recordVariableList(self):
            return self.getTypedRuleContext(pascalParser.RecordVariableListContext,0)


        def DO(self):
            return self.getToken(pascalParser.DO, 0)

        def statement(self):
            return self.getTypedRuleContext(pascalParser.StatementContext,0)


        def getRuleIndex(self):
            return pascalParser.RULE_withStatement

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

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




    def withStatement(self):

        localctx = pascalParser.WithStatementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 190, self.RULE_withStatement)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 785
            self.match(pascalParser.WITH)
            self.state = 786
            self.recordVariableList()
            self.state = 787
            self.match(pascalParser.DO)
            self.state = 788
            self.statement()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RecordVariableListContext(ParserRuleContext):

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

        def variable(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(pascalParser.VariableContext)
            else:
                return self.getTypedRuleContext(pascalParser.VariableContext,i)


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

        def getRuleIndex(self):
            return pascalParser.RULE_recordVariableList

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

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




    def recordVariableList(self):

        localctx = pascalParser.RecordVariableListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 192, self.RULE_recordVariableList)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 790
            self.variable()
            self.state = 795
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==pascalParser.COMMA:
                self.state = 791
                self.match(pascalParser.COMMA)
                self.state = 792
                self.variable()
                self.state = 797
                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





