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


def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3;")
        buf.write("\u0239\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/\3\2\3\2\5\2a\n\2\3\2\3\2\3\3\3\3\3\3\3\3\3\3\3\3")
        buf.write("\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3")
        buf.write("\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3")
        buf.write("\3\3\3\3\3\3\3\3\3\3\3\3\3\3\5\3\u008d\n\3\3\4\3\4\5\4")
        buf.write("\u0091\n\4\3\5\3\5\3\5\3\5\3\5\3\6\3\6\5\6\u009a\n\6\3")
        buf.write("\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b")
        buf.write("\3\b\3\t\3\t\3\t\3\t\3\t\5\t\u00b0\n\t\3\n\3\n\3\n\3\n")
        buf.write("\3\n\3\13\3\13\5\13\u00b9\n\13\3\f\3\f\3\f\3\f\3\r\3\r")
        buf.write("\3\r\3\r\3\r\3\r\5\r\u00c5\n\r\3\r\3\r\3\16\3\16\5\16")
        buf.write("\u00cb\n\16\3\17\3\17\3\17\3\17\3\17\3\20\3\20\3\20\3")
        buf.write("\20\5\20\u00d6\n\20\3\21\3\21\3\21\3\21\3\21\3\21\5\21")
        buf.write("\u00de\n\21\3\21\3\21\3\22\3\22\5\22\u00e4\n\22\3\23\3")
        buf.write("\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\5\23\u00f0")
        buf.write("\n\23\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\5\24")
        buf.write("\u00fb\n\24\3\25\3\25\3\25\3\25\7\25\u0101\n\25\f\25\16")
        buf.write("\25\u0104\13\25\3\25\3\25\3\26\3\26\3\26\3\26\7\26\u010c")
        buf.write("\n\26\f\26\16\26\u010f\13\26\3\26\3\26\3\27\3\27\5\27")
        buf.write("\u0115\n\27\3\30\3\30\3\30\5\30\u011a\n\30\3\30\3\30\3")
        buf.write("\30\3\31\3\31\3\31\3\31\3\31\3\32\3\32\5\32\u0126\n\32")
        buf.write("\3\33\3\33\6\33\u012a\n\33\r\33\16\33\u012b\3\33\3\33")
        buf.write("\3\33\5\33\u0131\n\33\3\33\3\33\5\33\u0135\n\33\3\34\3")
        buf.write("\34\3\34\5\34\u013a\n\34\3\34\3\34\3\34\3\34\3\34\3\34")
        buf.write("\3\34\5\34\u0143\n\34\3\34\3\34\3\34\3\34\3\34\3\34\3")
        buf.write("\34\3\34\3\34\5\34\u014e\n\34\3\35\3\35\3\35\3\35\3\35")
        buf.write("\3\35\3\35\3\35\3\35\3\36\3\36\3\36\3\36\3\36\3\37\3\37")
        buf.write("\3\37\5\37\u0161\n\37\3 \3 \5 \u0165\n \3!\3!\3!\3!\3")
        buf.write("!\3\"\3\"\5\"\u016e\n\"\3#\3#\3#\3#\3#\3#\3#\3#\3#\3#")
        buf.write("\5#\u017a\n#\3$\3$\3$\7$\u017f\n$\f$\16$\u0182\13$\3%")
        buf.write("\5%\u0185\n%\3%\3%\3%\3%\3&\3&\3&\3&\3&\3&\3&\5&\u0192")
        buf.write("\n&\3\'\3\'\3\'\6\'\u0197\n\'\r\'\16\'\u0198\3\'\5\'\u019c")
        buf.write("\n\'\3(\3(\3(\6(\u01a1\n(\r(\16(\u01a2\3(\5(\u01a6\n(")
        buf.write("\3)\3)\3)\3)\3)\3)\3)\3)\3)\3)\3)\3)\3)\3)\5)\u01b6\n")
        buf.write(")\3*\3*\3*\3*\3*\3*\3*\3*\3*\7*\u01c1\n*\f*\16*\u01c4")
        buf.write("\13*\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\3+\7+\u01d2\n+\f")
        buf.write("+\16+\u01d5\13+\3,\3,\3,\3,\3,\3,\3,\3,\3,\3,\3,\3,\3")
        buf.write(",\5,\u01e4\n,\3-\3-\3-\3-\5-\u01ea\n-\3-\3-\3-\5-\u01ef")
        buf.write("\n-\3-\3-\3-\3-\3-\3-\3-\3-\3-\3-\3-\3-\3-\3-\3-\3-\5")
        buf.write("-\u0201\n-\3-\3-\3-\3-\3-\3-\3-\3-\5-\u020b\n-\3-\3-\3")
        buf.write("-\3-\3-\3-\7-\u0213\n-\f-\16-\u0216\13-\3.\3.\3.\3.\3")
        buf.write(".\3.\3.\5.\u021f\n.\3.\3.\3.\3.\3.\5.\u0226\n.\3.\3.\3")
        buf.write(".\3.\7.\u022c\n.\f.\16.\u022f\13.\3/\3/\3/\7/\u0234\n")
        buf.write("/\f/\16/\u0237\13/\3/\2\6RTXZ\60\2\4\6\b\n\f\16\20\22")
        buf.write("\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<>@BDFHJLNPR")
        buf.write("TVXZ\\\2\3\3\2%*\2\u0256\2^\3\2\2\2\4\u008c\3\2\2\2\6")
        buf.write("\u008e\3\2\2\2\b\u0092\3\2\2\2\n\u0097\3\2\2\2\f\u009b")
        buf.write("\3\2\2\2\16\u009f\3\2\2\2\20\u00af\3\2\2\2\22\u00b1\3")
        buf.write("\2\2\2\24\u00b6\3\2\2\2\26\u00ba\3\2\2\2\30\u00be\3\2")
        buf.write("\2\2\32\u00c8\3\2\2\2\34\u00cc\3\2\2\2\36\u00d5\3\2\2")
        buf.write("\2 \u00d7\3\2\2\2\"\u00e1\3\2\2\2$\u00ef\3\2\2\2&\u00fa")
        buf.write("\3\2\2\2(\u00fc\3\2\2\2*\u0107\3\2\2\2,\u0112\3\2\2\2")
        buf.write(".\u0116\3\2\2\2\60\u011e\3\2\2\2\62\u0123\3\2\2\2\64\u0134")
        buf.write("\3\2\2\2\66\u014d\3\2\2\28\u014f\3\2\2\2:\u0158\3\2\2")
        buf.write("\2<\u0160\3\2\2\2>\u0162\3\2\2\2@\u0166\3\2\2\2B\u016b")
        buf.write("\3\2\2\2D\u0179\3\2\2\2F\u017b\3\2\2\2H\u0184\3\2\2\2")
        buf.write("J\u0191\3\2\2\2L\u019b\3\2\2\2N\u01a5\3\2\2\2P\u01b5\3")
        buf.write("\2\2\2R\u01b7\3\2\2\2T\u01c5\3\2\2\2V\u01e3\3\2\2\2X\u0200")
        buf.write("\3\2\2\2Z\u021e\3\2\2\2\\\u0230\3\2\2\2^`\5\4\3\2_a\5")
        buf.write("\2\2\2`_\3\2\2\2`a\3\2\2\2ab\3\2\2\2bc\7\2\2\3c\3\3\2")
        buf.write("\2\2de\7\r\2\2ef\7\64\2\2fg\7.\2\2g\u008d\7,\2\2hi\7\16")
        buf.write("\2\2ij\7\64\2\2jk\7,\2\2kl\7:\2\2lm\5\6\4\2mn\7;\2\2n")
        buf.write("\u008d\3\2\2\2op\7\17\2\2pq\7\64\2\2qr\7,\2\2rs\7:\2\2")
        buf.write("st\5\n\6\2tu\7;\2\2u\u008d\3\2\2\2vw\7\21\2\2wx\7\64\2")
        buf.write("\2xy\7,\2\2yz\7:\2\2z{\5B\"\2{|\7;\2\2|\u008d\3\2\2\2")
        buf.write("}~\7\20\2\2~\177\7\64\2\2\177\u0080\7,\2\2\u0080\u0081")
        buf.write("\7:\2\2\u0081\u0082\5,\27\2\u0082\u0083\7;\2\2\u0083\u008d")
        buf.write("\3\2\2\2\u0084\u0085\7\22\2\2\u0085\u0086\7\64\2\2\u0086")
        buf.write("\u0087\7,\2\2\u0087\u0088\7:\2\2\u0088\u0089\5> \2\u0089")
        buf.write("\u008a\7;\2\2\u008a\u008d\3\2\2\2\u008b\u008d\7,\2\2\u008c")
        buf.write("d\3\2\2\2\u008ch\3\2\2\2\u008co\3\2\2\2\u008cv\3\2\2\2")
        buf.write("\u008c}\3\2\2\2\u008c\u0084\3\2\2\2\u008c\u008b\3\2\2")
        buf.write("\2\u008d\5\3\2\2\2\u008e\u0090\5\b\5\2\u008f\u0091\5\6")
        buf.write("\4\2\u0090\u008f\3\2\2\2\u0090\u0091\3\2\2\2\u0091\7\3")
        buf.write("\2\2\2\u0092\u0093\7-\2\2\u0093\u0094\7\64\2\2\u0094\u0095")
        buf.write("\5J&\2\u0095\u0096\7,\2\2\u0096\t\3\2\2\2\u0097\u0099")
        buf.write("\5\f\7\2\u0098\u009a\5\n\6\2\u0099\u0098\3\2\2\2\u0099")
        buf.write("\u009a\3\2\2\2\u009a\13\3\2\2\2\u009b\u009c\7-\2\2\u009c")
        buf.write("\u009d\7\64\2\2\u009d\u009e\5\16\b\2\u009e\r\3\2\2\2\u009f")
        buf.write("\u00a0\7,\2\2\u00a0\u00a1\7:\2\2\u00a1\u00a2\7\24\2\2")
        buf.write("\u00a2\u00a3\7\64\2\2\u00a3\u00a4\5(\25\2\u00a4\u00a5")
        buf.write("\7,\2\2\u00a5\u00a6\7\25\2\2\u00a6\u00a7\7\64\2\2\u00a7")
        buf.write("\u00a8\5\20\t\2\u00a8\u00a9\7;\2\2\u00a9\17\3\2\2\2\u00aa")
        buf.write("\u00ab\5*\26\2\u00ab\u00ac\7,\2\2\u00ac\u00b0\3\2\2\2")
        buf.write("\u00ad\u00b0\5\22\n\2\u00ae\u00b0\5\30\r\2\u00af\u00aa")
        buf.write("\3\2\2\2\u00af\u00ad\3\2\2\2\u00af\u00ae\3\2\2\2\u00b0")
        buf.write("\21\3\2\2\2\u00b1\u00b2\7,\2\2\u00b2\u00b3\7:\2\2\u00b3")
        buf.write("\u00b4\5\24\13\2\u00b4\u00b5\7;\2\2\u00b5\23\3\2\2\2\u00b6")
        buf.write("\u00b8\5\26\f\2\u00b7\u00b9\5\24\13\2\u00b8\u00b7\3\2")
        buf.write("\2\2\u00b8\u00b9\3\2\2\2\u00b9\25\3\2\2\2\u00ba\u00bb")
        buf.write("\7-\2\2\u00bb\u00bc\7\64\2\2\u00bc\u00bd\5\36\20\2\u00bd")
        buf.write("\27\3\2\2\2\u00be\u00bf\7,\2\2\u00bf\u00c0\7:\2\2\u00c0")
        buf.write("\u00c4\5\32\16\2\u00c1\u00c2\7\31\2\2\u00c2\u00c3\7\64")
        buf.write("\2\2\u00c3\u00c5\5\20\t\2\u00c4\u00c1\3\2\2\2\u00c4\u00c5")
        buf.write("\3\2\2\2\u00c5\u00c6\3\2\2\2\u00c6\u00c7\7;\2\2\u00c7")
        buf.write("\31\3\2\2\2\u00c8\u00ca\5\34\17\2\u00c9\u00cb\5\32\16")
        buf.write("\2\u00ca\u00c9\3\2\2\2\u00ca\u00cb\3\2\2\2\u00cb\33\3")
        buf.write("\2\2\2\u00cc\u00cd\7\27\2\2\u00cd\u00ce\5&\24\2\u00ce")
        buf.write("\u00cf\7\64\2\2\u00cf\u00d0\5\20\t\2\u00d0\35\3\2\2\2")
        buf.write("\u00d1\u00d2\5J&\2\u00d2\u00d3\7,\2\2\u00d3\u00d6\3\2")
        buf.write("\2\2\u00d4\u00d6\5 \21\2\u00d5\u00d1\3\2\2\2\u00d5\u00d4")
        buf.write("\3\2\2\2\u00d6\37\3\2\2\2\u00d7\u00d8\7,\2\2\u00d8\u00d9")
        buf.write("\7:\2\2\u00d9\u00dd\5\"\22\2\u00da\u00db\7\31\2\2\u00db")
        buf.write("\u00dc\7\64\2\2\u00dc\u00de\5\36\20\2\u00dd\u00da\3\2")
        buf.write("\2\2\u00dd\u00de\3\2\2\2\u00de\u00df\3\2\2\2\u00df\u00e0")
        buf.write("\7;\2\2\u00e0!\3\2\2\2\u00e1\u00e3\5$\23\2\u00e2\u00e4")
        buf.write("\5\"\22\2\u00e3\u00e2\3\2\2\2\u00e3\u00e4\3\2\2\2\u00e4")
        buf.write("#\3\2\2\2\u00e5\u00e6\7\27\2\2\u00e6\u00e7\5&\24\2\u00e7")
        buf.write("\u00e8\7\64\2\2\u00e8\u00e9\5\36\20\2\u00e9\u00f0\3\2")
        buf.write("\2\2\u00ea\u00eb\7 \2\2\u00eb\u00ec\5L\'\2\u00ec\u00ed")
        buf.write("\7\64\2\2\u00ed\u00ee\5\36\20\2\u00ee\u00f0\3\2\2\2\u00ef")
        buf.write("\u00e5\3\2\2\2\u00ef\u00ea\3\2\2\2\u00f0%\3\2\2\2\u00f1")
        buf.write("\u00f2\7-\2\2\u00f2\u00f3\7\3\2\2\u00f3\u00fb\7-\2\2\u00f4")
        buf.write("\u00f5\7-\2\2\u00f5\u00f6\7\3\2\2\u00f6\u00fb\5J&\2\u00f7")
        buf.write("\u00f8\7-\2\2\u00f8\u00f9\7\30\2\2\u00f9\u00fb\5(\25\2")
        buf.write("\u00fa\u00f1\3\2\2\2\u00fa\u00f4\3\2\2\2\u00fa\u00f7\3")
        buf.write("\2\2\2\u00fb\'\3\2\2\2\u00fc\u00fd\7\67\2\2\u00fd\u0102")
        buf.write("\7-\2\2\u00fe\u00ff\7\4\2\2\u00ff\u0101\7-\2\2\u0100\u00fe")
        buf.write("\3\2\2\2\u0101\u0104\3\2\2\2\u0102\u0100\3\2\2\2\u0102")
        buf.write("\u0103\3\2\2\2\u0103\u0105\3\2\2\2\u0104\u0102\3\2\2\2")
        buf.write("\u0105\u0106\78\2\2\u0106)\3\2\2\2\u0107\u0108\7\67\2")
        buf.write("\2\u0108\u010d\5J&\2\u0109\u010a\7\4\2\2\u010a\u010c\5")
        buf.write("J&\2\u010b\u0109\3\2\2\2\u010c\u010f\3\2\2\2\u010d\u010b")
        buf.write("\3\2\2\2\u010d\u010e\3\2\2\2\u010e\u0110\3\2\2\2\u010f")
        buf.write("\u010d\3\2\2\2\u0110\u0111\78\2\2\u0111+\3\2\2\2\u0112")
        buf.write("\u0114\5.\30\2\u0113\u0115\5,\27\2\u0114\u0113\3\2\2\2")
        buf.write("\u0114\u0115\3\2\2\2\u0115-\3\2\2\2\u0116\u0119\7-\2\2")
        buf.write("\u0117\u0118\7\26\2\2\u0118\u011a\7-\2\2\u0119\u0117\3")
        buf.write("\2\2\2\u0119\u011a\3\2\2\2\u011a\u011b\3\2\2\2\u011b\u011c")
        buf.write("\7\64\2\2\u011c\u011d\5\60\31\2\u011d/\3\2\2\2\u011e\u011f")
        buf.write("\7,\2\2\u011f\u0120\7:\2\2\u0120\u0121\5\62\32\2\u0121")
        buf.write("\u0122\7;\2\2\u0122\61\3\2\2\2\u0123\u0125\5\64\33\2\u0124")
        buf.write("\u0126\5\62\32\2\u0125\u0124\3\2\2\2\u0125\u0126\3\2\2")
        buf.write("\2\u0126\63\3\2\2\2\u0127\u0135\5H%\2\u0128\u012a\5\66")
        buf.write("\34\2\u0129\u0128\3\2\2\2\u012a\u012b\3\2\2\2\u012b\u0129")
        buf.write("\3\2\2\2\u012b\u012c\3\2\2\2\u012c\u0130\3\2\2\2\u012d")
        buf.write("\u012e\7\31\2\2\u012e\u012f\7\64\2\2\u012f\u0131\5\60")
        buf.write("\31\2\u0130\u012d\3\2\2\2\u0130\u0131\3\2\2\2\u0131\u0135")
        buf.write("\3\2\2\2\u0132\u0135\58\35\2\u0133\u0135\5:\36\2\u0134")
        buf.write("\u0127\3\2\2\2\u0134\u0129\3\2\2\2\u0134\u0132\3\2\2\2")
        buf.write("\u0134\u0133\3\2\2\2\u0135\65\3\2\2\2\u0136\u0139\7\27")
        buf.write("\2\2\u0137\u0138\7-\2\2\u0138\u013a\7\34\2\2\u0139\u0137")
        buf.write("\3\2\2\2\u0139\u013a\3\2\2\2\u013a\u013b\3\2\2\2\u013b")
        buf.write("\u013c\5&\24\2\u013c\u013d\7\64\2\2\u013d\u013e\5\60\31")
        buf.write("\2\u013e\u014e\3\2\2\2\u013f\u0142\7\27\2\2\u0140\u0141")
        buf.write("\7-\2\2\u0141\u0143\7\34\2\2\u0142\u0140\3\2\2\2\u0142")
        buf.write("\u0143\3\2\2\2\u0143\u0144\3\2\2\2\u0144\u0145\5J&\2\u0145")
        buf.write("\u0146\7\64\2\2\u0146\u0147\5\60\31\2\u0147\u014e\3\2")
        buf.write("\2\2\u0148\u0149\7 \2\2\u0149\u014a\5L\'\2\u014a\u014b")
        buf.write("\7\64\2\2\u014b\u014c\5\60\31\2\u014c\u014e\3\2\2\2\u014d")
        buf.write("\u0136\3\2\2\2\u014d\u013f\3\2\2\2\u014d\u0148\3\2\2\2")
        buf.write("\u014e\67\3\2\2\2\u014f\u0150\7\36\2\2\u0150\u0151\7\62")
        buf.write("\2\2\u0151\u0152\7-\2\2\u0152\u0153\7\65\2\2\u0153\u0154")
        buf.write("\5\\/\2\u0154\u0155\7\66\2\2\u0155\u0156\7\64\2\2\u0156")
        buf.write("\u0157\5\60\31\2\u01579\3\2\2\2\u0158\u0159\7\33\2\2\u0159")
        buf.write("\u015a\7-\2\2\u015a\u015b\7\3\2\2\u015b\u015c\5<\37\2")
        buf.write("\u015c;\3\2\2\2\u015d\u015e\7-\2\2\u015e\u0161\7,\2\2")
        buf.write("\u015f\u0161\5\22\n\2\u0160\u015d\3\2\2\2\u0160\u015f")
        buf.write("\3\2\2\2\u0161=\3\2\2\2\u0162\u0164\5@!\2\u0163\u0165")
        buf.write("\5> \2\u0164\u0163\3\2\2\2\u0164\u0165\3\2\2\2\u0165?")
        buf.write("\3\2\2\2\u0166\u0167\7-\2\2\u0167\u0168\7\64\2\2\u0168")
        buf.write("\u0169\5J&\2\u0169\u016a\7,\2\2\u016aA\3\2\2\2\u016b\u016d")
        buf.write("\5D#\2\u016c\u016e\5B\"\2\u016d\u016c\3\2\2\2\u016d\u016e")
        buf.write("\3\2\2\2\u016eC\3\2\2\2\u016f\u0170\7-\2\2\u0170\u0171")
        buf.write("\7\64\2\2\u0171\u017a\5\36\20\2\u0172\u0173\7-\2\2\u0173")
        buf.write("\u0174\7\65\2\2\u0174\u0175\5F$\2\u0175\u0176\7\66\2\2")
        buf.write("\u0176\u0177\7\64\2\2\u0177\u0178\5\36\20\2\u0178\u017a")
        buf.write("\3\2\2\2\u0179\u016f\3\2\2\2\u0179\u0172\3\2\2\2\u017a")
        buf.write("E\3\2\2\2\u017b\u0180\7-\2\2\u017c\u017d\7\4\2\2\u017d")
        buf.write("\u017f\7-\2\2\u017e\u017c\3\2\2\2\u017f\u0182\3\2\2\2")
        buf.write("\u0180\u017e\3\2\2\2\u0180\u0181\3\2\2\2\u0181G\3\2\2")
        buf.write("\2\u0182\u0180\3\2\2\2\u0183\u0185\7\32\2\2\u0184\u0183")
        buf.write("\3\2\2\2\u0184\u0185\3\2\2\2\u0185\u0186\3\2\2\2\u0186")
        buf.write("\u0187\7-\2\2\u0187\u0188\7\3\2\2\u0188\u0189\5\36\20")
        buf.write("\2\u0189I\3\2\2\2\u018a\u018b\7 \2\2\u018b\u018c\5L\'")
        buf.write("\2\u018c\u018d\5R*\2\u018d\u018e\7!\2\2\u018e\u018f\5")
        buf.write("J&\2\u018f\u0192\3\2\2\2\u0190\u0192\5R*\2\u0191\u018a")
        buf.write("\3\2\2\2\u0191\u0190\3\2\2\2\u0192K\3\2\2\2\u0193\u0196")
        buf.write("\5N(\2\u0194\u0195\7#\2\2\u0195\u0197\5N(\2\u0196\u0194")
        buf.write("\3\2\2\2\u0197\u0198\3\2\2\2\u0198\u0196\3\2\2\2\u0198")
        buf.write("\u0199\3\2\2\2\u0199\u019c\3\2\2\2\u019a\u019c\5N(\2\u019b")
        buf.write("\u0193\3\2\2\2\u019b\u019a\3\2\2\2\u019cM\3\2\2\2\u019d")
        buf.write("\u01a0\5P)\2\u019e\u019f\7\"\2\2\u019f\u01a1\5P)\2\u01a0")
        buf.write("\u019e\3\2\2\2\u01a1\u01a2\3\2\2\2\u01a2\u01a0\3\2\2\2")
        buf.write("\u01a2\u01a3\3\2\2\2\u01a3\u01a6\3\2\2\2\u01a4\u01a6\5")
        buf.write("P)\2\u01a5\u019d\3\2\2\2\u01a5\u01a4\3\2\2\2\u01a6O\3")
        buf.write("\2\2\2\u01a7\u01a8\5R*\2\u01a8\u01a9\t\2\2\2\u01a9\u01aa")
        buf.write("\5R*\2\u01aa\u01b6\3\2\2\2\u01ab\u01ac\7$\2\2\u01ac\u01b6")
        buf.write("\5P)\2\u01ad\u01ae\5R*\2\u01ae\u01af\7\30\2\2\u01af\u01b0")
        buf.write("\7\67\2\2\u01b0\u01b1\5J&\2\u01b1\u01b2\7+\2\2\u01b2\u01b3")
        buf.write("\5J&\2\u01b3\u01b4\78\2\2\u01b4\u01b6\3\2\2\2\u01b5\u01a7")
        buf.write("\3\2\2\2\u01b5\u01ab\3\2\2\2\u01b5\u01ad\3\2\2\2\u01b6")
        buf.write("Q\3\2\2\2\u01b7\u01b8\b*\1\2\u01b8\u01b9\5T+\2\u01b9\u01c2")
        buf.write("\3\2\2\2\u01ba\u01bb\f\5\2\2\u01bb\u01bc\7\5\2\2\u01bc")
        buf.write("\u01c1\5T+\2\u01bd\u01be\f\4\2\2\u01be\u01bf\7\6\2\2\u01bf")
        buf.write("\u01c1\5T+\2\u01c0\u01ba\3\2\2\2\u01c0\u01bd\3\2\2\2\u01c1")
        buf.write("\u01c4\3\2\2\2\u01c2\u01c0\3\2\2\2\u01c2\u01c3\3\2\2\2")
        buf.write("\u01c3S\3\2\2\2\u01c4\u01c2\3\2\2\2\u01c5\u01c6\b+\1\2")
        buf.write("\u01c6\u01c7\5V,\2\u01c7\u01d3\3\2\2\2\u01c8\u01c9\f\6")
        buf.write("\2\2\u01c9\u01ca\7\7\2\2\u01ca\u01d2\5V,\2\u01cb\u01cc")
        buf.write("\f\5\2\2\u01cc\u01cd\7\63\2\2\u01cd\u01d2\5V,\2\u01ce")
        buf.write("\u01cf\f\4\2\2\u01cf\u01d0\7\b\2\2\u01d0\u01d2\5V,\2\u01d1")
        buf.write("\u01c8\3\2\2\2\u01d1\u01cb\3\2\2\2\u01d1\u01ce\3\2\2\2")
        buf.write("\u01d2\u01d5\3\2\2\2\u01d3\u01d1\3\2\2\2\u01d3\u01d4\3")
        buf.write("\2\2\2\u01d4U\3\2\2\2\u01d5\u01d3\3\2\2\2\u01d6\u01d7")
        buf.write("\7\5\2\2\u01d7\u01e4\5V,\2\u01d8\u01d9\7\6\2\2\u01d9\u01e4")
        buf.write("\5V,\2\u01da\u01e4\5X-\2\u01db\u01dc\7\65\2\2\u01dc\u01dd")
        buf.write("\5J&\2\u01dd\u01de\7\66\2\2\u01de\u01e4\3\2\2\2\u01df")
        buf.write("\u01e4\7/\2\2\u01e0\u01e1\7/\2\2\u01e1\u01e4\7\t\2\2\u01e2")
        buf.write("\u01e4\7\n\2\2\u01e3\u01d6\3\2\2\2\u01e3\u01d8\3\2\2\2")
        buf.write("\u01e3\u01da\3\2\2\2\u01e3\u01db\3\2\2\2\u01e3\u01df\3")
        buf.write("\2\2\2\u01e3\u01e0\3\2\2\2\u01e3\u01e2\3\2\2\2\u01e4W")
        buf.write("\3\2\2\2\u01e5\u01e6\b-\1\2\u01e6\u01e7\7-\2\2\u01e7\u01e9")
        buf.write("\7\65\2\2\u01e8\u01ea\5\\/\2\u01e9\u01e8\3\2\2\2\u01e9")
        buf.write("\u01ea\3\2\2\2\u01ea\u01eb\3\2\2\2\u01eb\u0201\7\66\2")
        buf.write("\2\u01ec\u01ee\7\67\2\2\u01ed\u01ef\5\\/\2\u01ee\u01ed")
        buf.write("\3\2\2\2\u01ee\u01ef\3\2\2\2\u01ef\u01f0\3\2\2\2\u01f0")
        buf.write("\u0201\78\2\2\u01f1\u0201\7-\2\2\u01f2\u0201\7.\2\2\u01f3")
        buf.write("\u0201\5Z.\2\u01f4\u01f5\7\13\2\2\u01f5\u01f6\7\65\2\2")
        buf.write("\u01f6\u01f7\5Z.\2\u01f7\u01f8\7\66\2\2\u01f8\u0201\3")
        buf.write("\2\2\2\u01f9\u01fa\7\13\2\2\u01fa\u01fb\7\65\2\2\u01fb")
        buf.write("\u01fc\5Z.\2\u01fc\u01fd\7\f\2\2\u01fd\u01fe\5Z.\2\u01fe")
        buf.write("\u01ff\7\66\2\2\u01ff\u0201\3\2\2\2\u0200\u01e5\3\2\2")
        buf.write("\2\u0200\u01ec\3\2\2\2\u0200\u01f1\3\2\2\2\u0200\u01f2")
        buf.write("\3\2\2\2\u0200\u01f3\3\2\2\2\u0200\u01f4\3\2\2\2\u0200")
        buf.write("\u01f9\3\2\2\2\u0201\u0214\3\2\2\2\u0202\u0203\f\f\2\2")
        buf.write("\u0203\u0204\7\62\2\2\u0204\u0213\7-\2\2\u0205\u0206\f")
        buf.write("\n\2\2\u0206\u0207\7\62\2\2\u0207\u0208\7-\2\2\u0208\u020a")
        buf.write("\7\65\2\2\u0209\u020b\5\\/\2\u020a\u0209\3\2\2\2\u020a")
        buf.write("\u020b\3\2\2\2\u020b\u020c\3\2\2\2\u020c\u0213\7\66\2")
        buf.write("\2\u020d\u020e\f\b\2\2\u020e\u020f\7\67\2\2\u020f\u0210")
        buf.write("\5J&\2\u0210\u0211\78\2\2\u0211\u0213\3\2\2\2\u0212\u0202")
        buf.write("\3\2\2\2\u0212\u0205\3\2\2\2\u0212\u020d\3\2\2\2\u0213")
        buf.write("\u0216\3\2\2\2\u0214\u0212\3\2\2\2\u0214\u0215\3\2\2\2")
        buf.write("\u0215Y\3\2\2\2\u0216\u0214\3\2\2\2\u0217\u0218\b.\1\2")
        buf.write("\u0218\u021f\7-\2\2\u0219\u021a\7\65\2\2\u021a\u021b\5")
        buf.write("Z.\2\u021b\u021c\7\66\2\2\u021c\u021f\3\2\2\2\u021d\u021f")
        buf.write("\5&\24\2\u021e\u0217\3\2\2\2\u021e\u0219\3\2\2\2\u021e")
        buf.write("\u021d\3\2\2\2\u021f\u022d\3\2\2\2\u0220\u0221\f\6\2\2")
        buf.write("\u0221\u0222\7\62\2\2\u0222\u0223\7-\2\2\u0223\u0225\7")
        buf.write("\65\2\2\u0224\u0226\5\\/\2\u0225\u0224\3\2\2\2\u0225\u0226")
        buf.write("\3\2\2\2\u0226\u0227\3\2\2\2\u0227\u022c\7\66\2\2\u0228")
        buf.write("\u0229\f\3\2\2\u0229\u022a\7\37\2\2\u022a\u022c\5&\24")
        buf.write("\2\u022b\u0220\3\2\2\2\u022b\u0228\3\2\2\2\u022c\u022f")
        buf.write("\3\2\2\2\u022d\u022b\3\2\2\2\u022d\u022e\3\2\2\2\u022e")
        buf.write("[\3\2\2\2\u022f\u022d\3\2\2\2\u0230\u0235\5J&\2\u0231")
        buf.write("\u0232\7\4\2\2\u0232\u0234\5J&\2\u0233\u0231\3\2\2\2\u0234")
        buf.write("\u0237\3\2\2\2\u0235\u0233\3\2\2\2\u0235\u0236\3\2\2\2")
        buf.write("\u0236]\3\2\2\2\u0237\u0235\3\2\2\2\66`\u008c\u0090\u0099")
        buf.write("\u00af\u00b8\u00c4\u00ca\u00d5\u00dd\u00e3\u00ef\u00fa")
        buf.write("\u0102\u010d\u0114\u0119\u0125\u012b\u0130\u0134\u0139")
        buf.write("\u0142\u014d\u0160\u0164\u016d\u0179\u0180\u0184\u0191")
        buf.write("\u0198\u019b\u01a2\u01a5\u01b5\u01c0\u01c2\u01d1\u01d3")
        buf.write("\u01e3\u01e9\u01ee\u0200\u020a\u0212\u0214\u021e\u0225")
        buf.write("\u022b\u022d\u0235")
        return buf.getvalue()


class DynamodParser ( Parser ):

    grammarFileName = "Dynamod.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "'='", "','", "'+'", "'-'", "'**'", "'/'", 
                     "'%'", "'%%'", "'$'", "'|'", "'extends'", "'parameters'", 
                     "'attributes'", "'progressions'", "'formulas'", "'results'", 
                     "'changes'", "'values'", "'shares'", "'at'", "'for'", 
                     "'in'", "'otherwise'", "'var'", "'set'", "'as'", "'by'", 
                     "'after'", "'with'", "'if'", "'else'", "'and'", "'or'", 
                     "'not'", "'<'", "'<='", "'>'", "'>='", "'!='", "'EQ'", 
                     "'..'", "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "'.'", "'*'", "':'", "'('", 
                     "')'", "'['", "']'" ]

    symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "EXTENDS", 
                      "PARAMETERS", "ATTRIBUTES", "PROGRESSION", "FORMULAS", 
                      "RESULTS", "CHANGES", "VALUES", "SHARES", "AT", "FOR", 
                      "IN", "OTHERWISE", "VAR", "SET", "AS", "BY", "AFTER", 
                      "WITH", "IF", "ELSE", "AND", "OR", "NOT", "LT", "LE", 
                      "GT", "GE", "NE", "EQ", "DOTDOT", "NEWLINE", "NAME", 
                      "STRING", "NUMBER", "INTEGER", "FLOAT_NUMBER", "DOT", 
                      "STAR", "COLON", "OPEN_PAREN", "CLOSE_PAREN", "OPEN_BRACK", 
                      "CLOSE_BRACK", "SKIP_", "INDENT", "DEDENT" ]

    RULE_model = 0
    RULE_model_part = 1
    RULE_parameters = 2
    RULE_parameter = 3
    RULE_attributes = 4
    RULE_attribute = 5
    RULE_attribute_block = 6
    RULE_shares = 7
    RULE_share_map_block = 8
    RULE_share_map = 9
    RULE_share_def = 10
    RULE_cond_shares_block = 11
    RULE_cond_shares = 12
    RULE_cond_share = 13
    RULE_pexpression = 14
    RULE_pexpression_block = 15
    RULE_pexp_list = 16
    RULE_pexp_item = 17
    RULE_segment = 18
    RULE_values = 19
    RULE_expression_list = 20
    RULE_progressions = 21
    RULE_progression = 22
    RULE_progression_block = 23
    RULE_progression_statements = 24
    RULE_progression_statement = 25
    RULE_restriction = 26
    RULE_progression_after = 27
    RULE_progression_action = 28
    RULE_pstate = 29
    RULE_results = 30
    RULE_result = 31
    RULE_formulas = 32
    RULE_formula = 33
    RULE_formal_args = 34
    RULE_variable_definition = 35
    RULE_expression = 36
    RULE_condition = 37
    RULE_conjunction = 38
    RULE_comparison = 39
    RULE_expval = 40
    RULE_term = 41
    RULE_factor = 42
    RULE_primary = 43
    RULE_partition = 44
    RULE_arguments = 45

    ruleNames =  [ "model", "model_part", "parameters", "parameter", "attributes", 
                   "attribute", "attribute_block", "shares", "share_map_block", 
                   "share_map", "share_def", "cond_shares_block", "cond_shares", 
                   "cond_share", "pexpression", "pexpression_block", "pexp_list", 
                   "pexp_item", "segment", "values", "expression_list", 
                   "progressions", "progression", "progression_block", "progression_statements", 
                   "progression_statement", "restriction", "progression_after", 
                   "progression_action", "pstate", "results", "result", 
                   "formulas", "formula", "formal_args", "variable_definition", 
                   "expression", "condition", "conjunction", "comparison", 
                   "expval", "term", "factor", "primary", "partition", "arguments" ]

    EOF = Token.EOF
    T__0=1
    T__1=2
    T__2=3
    T__3=4
    T__4=5
    T__5=6
    T__6=7
    T__7=8
    T__8=9
    T__9=10
    EXTENDS=11
    PARAMETERS=12
    ATTRIBUTES=13
    PROGRESSION=14
    FORMULAS=15
    RESULTS=16
    CHANGES=17
    VALUES=18
    SHARES=19
    AT=20
    FOR=21
    IN=22
    OTHERWISE=23
    VAR=24
    SET=25
    AS=26
    BY=27
    AFTER=28
    WITH=29
    IF=30
    ELSE=31
    AND=32
    OR=33
    NOT=34
    LT=35
    LE=36
    GT=37
    GE=38
    NE=39
    EQ=40
    DOTDOT=41
    NEWLINE=42
    NAME=43
    STRING=44
    NUMBER=45
    INTEGER=46
    FLOAT_NUMBER=47
    DOT=48
    STAR=49
    COLON=50
    OPEN_PAREN=51
    CLOSE_PAREN=52
    OPEN_BRACK=53
    CLOSE_BRACK=54
    SKIP_=55
    INDENT=56
    DEDENT=57

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




    class ModelContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def model_part(self):
            return self.getTypedRuleContext(DynamodParser.Model_partContext,0)


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

        def model(self):
            return self.getTypedRuleContext(DynamodParser.ModelContext,0)


        def getRuleIndex(self):
            return DynamodParser.RULE_model

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




    def model(self):

        localctx = DynamodParser.ModelContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_model)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 92
            self.model_part()
            self.state = 94
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << DynamodParser.EXTENDS) | (1 << DynamodParser.PARAMETERS) | (1 << DynamodParser.ATTRIBUTES) | (1 << DynamodParser.PROGRESSION) | (1 << DynamodParser.FORMULAS) | (1 << DynamodParser.RESULTS) | (1 << DynamodParser.NEWLINE))) != 0):
                self.state = 93
                self.model()


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


    class Model_partContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return DynamodParser.RULE_model_part

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



    class Model_progressionsContext(Model_partContext):

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

        def PROGRESSION(self):
            return self.getToken(DynamodParser.PROGRESSION, 0)
        def COLON(self):
            return self.getToken(DynamodParser.COLON, 0)
        def NEWLINE(self):
            return self.getToken(DynamodParser.NEWLINE, 0)
        def INDENT(self):
            return self.getToken(DynamodParser.INDENT, 0)
        def progressions(self):
            return self.getTypedRuleContext(DynamodParser.ProgressionsContext,0)

        def DEDENT(self):
            return self.getToken(DynamodParser.DEDENT, 0)

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


    class Model_incContext(Model_partContext):

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

        def EXTENDS(self):
            return self.getToken(DynamodParser.EXTENDS, 0)
        def COLON(self):
            return self.getToken(DynamodParser.COLON, 0)
        def STRING(self):
            return self.getToken(DynamodParser.STRING, 0)
        def NEWLINE(self):
            return self.getToken(DynamodParser.NEWLINE, 0)

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


    class Model_attribsContext(Model_partContext):

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

        def ATTRIBUTES(self):
            return self.getToken(DynamodParser.ATTRIBUTES, 0)
        def COLON(self):
            return self.getToken(DynamodParser.COLON, 0)
        def NEWLINE(self):
            return self.getToken(DynamodParser.NEWLINE, 0)
        def INDENT(self):
            return self.getToken(DynamodParser.INDENT, 0)
        def attributes(self):
            return self.getTypedRuleContext(DynamodParser.AttributesContext,0)

        def DEDENT(self):
            return self.getToken(DynamodParser.DEDENT, 0)

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


    class Model_resultsContext(Model_partContext):

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

        def RESULTS(self):
            return self.getToken(DynamodParser.RESULTS, 0)
        def COLON(self):
            return self.getToken(DynamodParser.COLON, 0)
        def NEWLINE(self):
            return self.getToken(DynamodParser.NEWLINE, 0)
        def INDENT(self):
            return self.getToken(DynamodParser.INDENT, 0)
        def results(self):
            return self.getTypedRuleContext(DynamodParser.ResultsContext,0)

        def DEDENT(self):
            return self.getToken(DynamodParser.DEDENT, 0)

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


    class Model_formulasContext(Model_partContext):

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

        def FORMULAS(self):
            return self.getToken(DynamodParser.FORMULAS, 0)
        def COLON(self):
            return self.getToken(DynamodParser.COLON, 0)
        def NEWLINE(self):
            return self.getToken(DynamodParser.NEWLINE, 0)
        def INDENT(self):
            return self.getToken(DynamodParser.INDENT, 0)
        def formulas(self):
            return self.getTypedRuleContext(DynamodParser.FormulasContext,0)

        def DEDENT(self):
            return self.getToken(DynamodParser.DEDENT, 0)

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


    class Model_parsContext(Model_partContext):

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

        def PARAMETERS(self):
            return self.getToken(DynamodParser.PARAMETERS, 0)
        def COLON(self):
            return self.getToken(DynamodParser.COLON, 0)
        def NEWLINE(self):
            return self.getToken(DynamodParser.NEWLINE, 0)
        def INDENT(self):
            return self.getToken(DynamodParser.INDENT, 0)
        def parameters(self):
            return self.getTypedRuleContext(DynamodParser.ParametersContext,0)

        def DEDENT(self):
            return self.getToken(DynamodParser.DEDENT, 0)

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


    class Model_ignoreContext(Model_partContext):

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

        def NEWLINE(self):
            return self.getToken(DynamodParser.NEWLINE, 0)

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



    def model_part(self):

        localctx = DynamodParser.Model_partContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_model_part)
        try:
            self.state = 138
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [DynamodParser.EXTENDS]:
                localctx = DynamodParser.Model_incContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 98
                self.match(DynamodParser.EXTENDS)
                self.state = 99
                self.match(DynamodParser.COLON)
                self.state = 100
                self.match(DynamodParser.STRING)
                self.state = 101
                self.match(DynamodParser.NEWLINE)
                pass
            elif token in [DynamodParser.PARAMETERS]:
                localctx = DynamodParser.Model_parsContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 102
                self.match(DynamodParser.PARAMETERS)
                self.state = 103
                self.match(DynamodParser.COLON)
                self.state = 104
                self.match(DynamodParser.NEWLINE)
                self.state = 105
                self.match(DynamodParser.INDENT)
                self.state = 106
                self.parameters()
                self.state = 107
                self.match(DynamodParser.DEDENT)
                pass
            elif token in [DynamodParser.ATTRIBUTES]:
                localctx = DynamodParser.Model_attribsContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 109
                self.match(DynamodParser.ATTRIBUTES)
                self.state = 110
                self.match(DynamodParser.COLON)
                self.state = 111
                self.match(DynamodParser.NEWLINE)
                self.state = 112
                self.match(DynamodParser.INDENT)
                self.state = 113
                self.attributes()
                self.state = 114
                self.match(DynamodParser.DEDENT)
                pass
            elif token in [DynamodParser.FORMULAS]:
                localctx = DynamodParser.Model_formulasContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 116
                self.match(DynamodParser.FORMULAS)
                self.state = 117
                self.match(DynamodParser.COLON)
                self.state = 118
                self.match(DynamodParser.NEWLINE)
                self.state = 119
                self.match(DynamodParser.INDENT)
                self.state = 120
                self.formulas()
                self.state = 121
                self.match(DynamodParser.DEDENT)
                pass
            elif token in [DynamodParser.PROGRESSION]:
                localctx = DynamodParser.Model_progressionsContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 123
                self.match(DynamodParser.PROGRESSION)
                self.state = 124
                self.match(DynamodParser.COLON)
                self.state = 125
                self.match(DynamodParser.NEWLINE)
                self.state = 126
                self.match(DynamodParser.INDENT)
                self.state = 127
                self.progressions()
                self.state = 128
                self.match(DynamodParser.DEDENT)
                pass
            elif token in [DynamodParser.RESULTS]:
                localctx = DynamodParser.Model_resultsContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 130
                self.match(DynamodParser.RESULTS)
                self.state = 131
                self.match(DynamodParser.COLON)
                self.state = 132
                self.match(DynamodParser.NEWLINE)
                self.state = 133
                self.match(DynamodParser.INDENT)
                self.state = 134
                self.results()
                self.state = 135
                self.match(DynamodParser.DEDENT)
                pass
            elif token in [DynamodParser.NEWLINE]:
                localctx = DynamodParser.Model_ignoreContext(self, localctx)
                self.enterOuterAlt(localctx, 7)
                self.state = 137
                self.match(DynamodParser.NEWLINE)
                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 ParametersContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def parameter(self):
            return self.getTypedRuleContext(DynamodParser.ParameterContext,0)


        def parameters(self):
            return self.getTypedRuleContext(DynamodParser.ParametersContext,0)


        def getRuleIndex(self):
            return DynamodParser.RULE_parameters

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




    def parameters(self):

        localctx = DynamodParser.ParametersContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_parameters)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 140
            self.parameter()
            self.state = 142
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==DynamodParser.NAME:
                self.state = 141
                self.parameters()


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


    class ParameterContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)

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

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


        def NEWLINE(self):
            return self.getToken(DynamodParser.NEWLINE, 0)

        def getRuleIndex(self):
            return DynamodParser.RULE_parameter

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




    def parameter(self):

        localctx = DynamodParser.ParameterContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_parameter)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 144
            self.match(DynamodParser.NAME)
            self.state = 145
            self.match(DynamodParser.COLON)
            self.state = 146
            self.expression()
            self.state = 147
            self.match(DynamodParser.NEWLINE)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AttributesContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def attribute(self):
            return self.getTypedRuleContext(DynamodParser.AttributeContext,0)


        def attributes(self):
            return self.getTypedRuleContext(DynamodParser.AttributesContext,0)


        def getRuleIndex(self):
            return DynamodParser.RULE_attributes

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




    def attributes(self):

        localctx = DynamodParser.AttributesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_attributes)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 149
            self.attribute()
            self.state = 151
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==DynamodParser.NAME:
                self.state = 150
                self.attributes()


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


    class AttributeContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)

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

        def attribute_block(self):
            return self.getTypedRuleContext(DynamodParser.Attribute_blockContext,0)


        def getRuleIndex(self):
            return DynamodParser.RULE_attribute

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




    def attribute(self):

        localctx = DynamodParser.AttributeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_attribute)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 153
            self.match(DynamodParser.NAME)
            self.state = 154
            self.match(DynamodParser.COLON)
            self.state = 155
            self.attribute_block()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Attribute_blockContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def INDENT(self):
            return self.getToken(DynamodParser.INDENT, 0)

        def VALUES(self):
            return self.getToken(DynamodParser.VALUES, 0)

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

        def values(self):
            return self.getTypedRuleContext(DynamodParser.ValuesContext,0)


        def SHARES(self):
            return self.getToken(DynamodParser.SHARES, 0)

        def shares(self):
            return self.getTypedRuleContext(DynamodParser.SharesContext,0)


        def DEDENT(self):
            return self.getToken(DynamodParser.DEDENT, 0)

        def getRuleIndex(self):
            return DynamodParser.RULE_attribute_block

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




    def attribute_block(self):

        localctx = DynamodParser.Attribute_blockContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_attribute_block)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 157
            self.match(DynamodParser.NEWLINE)
            self.state = 158
            self.match(DynamodParser.INDENT)
            self.state = 159
            self.match(DynamodParser.VALUES)
            self.state = 160
            self.match(DynamodParser.COLON)
            self.state = 161
            self.values()
            self.state = 162
            self.match(DynamodParser.NEWLINE)
            self.state = 163
            self.match(DynamodParser.SHARES)
            self.state = 164
            self.match(DynamodParser.COLON)
            self.state = 165
            self.shares()
            self.state = 166
            self.match(DynamodParser.DEDENT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SharesContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return DynamodParser.RULE_shares

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



    class Shares_as_listContext(SharesContext):

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

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

        def NEWLINE(self):
            return self.getToken(DynamodParser.NEWLINE, 0)

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


    class Shares_as_condContext(SharesContext):

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

        def cond_shares_block(self):
            return self.getTypedRuleContext(DynamodParser.Cond_shares_blockContext,0)


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


    class Shares_as_mapContext(SharesContext):

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

        def share_map_block(self):
            return self.getTypedRuleContext(DynamodParser.Share_map_blockContext,0)


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



    def shares(self):

        localctx = DynamodParser.SharesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_shares)
        try:
            self.state = 173
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,4,self._ctx)
            if la_ == 1:
                localctx = DynamodParser.Shares_as_listContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 168
                self.expression_list()
                self.state = 169
                self.match(DynamodParser.NEWLINE)
                pass

            elif la_ == 2:
                localctx = DynamodParser.Shares_as_mapContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 171
                self.share_map_block()
                pass

            elif la_ == 3:
                localctx = DynamodParser.Shares_as_condContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 172
                self.cond_shares_block()
                pass


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


    class Share_map_blockContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def NEWLINE(self):
            return self.getToken(DynamodParser.NEWLINE, 0)

        def INDENT(self):
            return self.getToken(DynamodParser.INDENT, 0)

        def share_map(self):
            return self.getTypedRuleContext(DynamodParser.Share_mapContext,0)


        def DEDENT(self):
            return self.getToken(DynamodParser.DEDENT, 0)

        def getRuleIndex(self):
            return DynamodParser.RULE_share_map_block

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




    def share_map_block(self):

        localctx = DynamodParser.Share_map_blockContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_share_map_block)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 175
            self.match(DynamodParser.NEWLINE)
            self.state = 176
            self.match(DynamodParser.INDENT)
            self.state = 177
            self.share_map()
            self.state = 178
            self.match(DynamodParser.DEDENT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Share_mapContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def share_def(self):
            return self.getTypedRuleContext(DynamodParser.Share_defContext,0)


        def share_map(self):
            return self.getTypedRuleContext(DynamodParser.Share_mapContext,0)


        def getRuleIndex(self):
            return DynamodParser.RULE_share_map

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




    def share_map(self):

        localctx = DynamodParser.Share_mapContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_share_map)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 180
            self.share_def()
            self.state = 182
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==DynamodParser.NAME:
                self.state = 181
                self.share_map()


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


    class Share_defContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)

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

        def pexpression(self):
            return self.getTypedRuleContext(DynamodParser.PexpressionContext,0)


        def getRuleIndex(self):
            return DynamodParser.RULE_share_def

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




    def share_def(self):

        localctx = DynamodParser.Share_defContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_share_def)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 184
            self.match(DynamodParser.NAME)
            self.state = 185
            self.match(DynamodParser.COLON)
            self.state = 186
            self.pexpression()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Cond_shares_blockContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def NEWLINE(self):
            return self.getToken(DynamodParser.NEWLINE, 0)

        def INDENT(self):
            return self.getToken(DynamodParser.INDENT, 0)

        def cond_shares(self):
            return self.getTypedRuleContext(DynamodParser.Cond_sharesContext,0)


        def DEDENT(self):
            return self.getToken(DynamodParser.DEDENT, 0)

        def OTHERWISE(self):
            return self.getToken(DynamodParser.OTHERWISE, 0)

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

        def shares(self):
            return self.getTypedRuleContext(DynamodParser.SharesContext,0)


        def getRuleIndex(self):
            return DynamodParser.RULE_cond_shares_block

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




    def cond_shares_block(self):

        localctx = DynamodParser.Cond_shares_blockContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_cond_shares_block)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 188
            self.match(DynamodParser.NEWLINE)
            self.state = 189
            self.match(DynamodParser.INDENT)
            self.state = 190
            self.cond_shares()
            self.state = 194
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==DynamodParser.OTHERWISE:
                self.state = 191
                self.match(DynamodParser.OTHERWISE)
                self.state = 192
                self.match(DynamodParser.COLON)
                self.state = 193
                self.shares()


            self.state = 196
            self.match(DynamodParser.DEDENT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Cond_sharesContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def cond_share(self):
            return self.getTypedRuleContext(DynamodParser.Cond_shareContext,0)


        def cond_shares(self):
            return self.getTypedRuleContext(DynamodParser.Cond_sharesContext,0)


        def getRuleIndex(self):
            return DynamodParser.RULE_cond_shares

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




    def cond_shares(self):

        localctx = DynamodParser.Cond_sharesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_cond_shares)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 198
            self.cond_share()
            self.state = 200
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==DynamodParser.FOR:
                self.state = 199
                self.cond_shares()


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


    class Cond_shareContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def segment(self):
            return self.getTypedRuleContext(DynamodParser.SegmentContext,0)


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

        def shares(self):
            return self.getTypedRuleContext(DynamodParser.SharesContext,0)


        def getRuleIndex(self):
            return DynamodParser.RULE_cond_share

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




    def cond_share(self):

        localctx = DynamodParser.Cond_shareContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_cond_share)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 202
            self.match(DynamodParser.FOR)
            self.state = 203
            self.segment()
            self.state = 204
            self.match(DynamodParser.COLON)
            self.state = 205
            self.shares()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PexpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return DynamodParser.RULE_pexpression

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



    class Pexpr_as_blockContext(PexpressionContext):

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

        def pexpression_block(self):
            return self.getTypedRuleContext(DynamodParser.Pexpression_blockContext,0)


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


    class Pexpr_as_simpleContext(PexpressionContext):

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

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

        def NEWLINE(self):
            return self.getToken(DynamodParser.NEWLINE, 0)

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



    def pexpression(self):

        localctx = DynamodParser.PexpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_pexpression)
        try:
            self.state = 211
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [DynamodParser.T__2, DynamodParser.T__3, DynamodParser.T__7, DynamodParser.T__8, DynamodParser.IF, DynamodParser.NAME, DynamodParser.STRING, DynamodParser.NUMBER, DynamodParser.OPEN_PAREN, DynamodParser.OPEN_BRACK]:
                localctx = DynamodParser.Pexpr_as_simpleContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 207
                self.expression()
                self.state = 208
                self.match(DynamodParser.NEWLINE)
                pass
            elif token in [DynamodParser.NEWLINE]:
                localctx = DynamodParser.Pexpr_as_blockContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 210
                self.pexpression_block()
                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 Pexpression_blockContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def NEWLINE(self):
            return self.getToken(DynamodParser.NEWLINE, 0)

        def INDENT(self):
            return self.getToken(DynamodParser.INDENT, 0)

        def pexp_list(self):
            return self.getTypedRuleContext(DynamodParser.Pexp_listContext,0)


        def DEDENT(self):
            return self.getToken(DynamodParser.DEDENT, 0)

        def OTHERWISE(self):
            return self.getToken(DynamodParser.OTHERWISE, 0)

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

        def pexpression(self):
            return self.getTypedRuleContext(DynamodParser.PexpressionContext,0)


        def getRuleIndex(self):
            return DynamodParser.RULE_pexpression_block

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




    def pexpression_block(self):

        localctx = DynamodParser.Pexpression_blockContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_pexpression_block)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 213
            self.match(DynamodParser.NEWLINE)
            self.state = 214
            self.match(DynamodParser.INDENT)
            self.state = 215
            self.pexp_list()
            self.state = 219
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==DynamodParser.OTHERWISE:
                self.state = 216
                self.match(DynamodParser.OTHERWISE)
                self.state = 217
                self.match(DynamodParser.COLON)
                self.state = 218
                self.pexpression()


            self.state = 221
            self.match(DynamodParser.DEDENT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Pexp_listContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def pexp_item(self):
            return self.getTypedRuleContext(DynamodParser.Pexp_itemContext,0)


        def pexp_list(self):
            return self.getTypedRuleContext(DynamodParser.Pexp_listContext,0)


        def getRuleIndex(self):
            return DynamodParser.RULE_pexp_list

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




    def pexp_list(self):

        localctx = DynamodParser.Pexp_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_pexp_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 223
            self.pexp_item()
            self.state = 225
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==DynamodParser.FOR or _la==DynamodParser.IF:
                self.state = 224
                self.pexp_list()


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


    class Pexp_itemContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return DynamodParser.RULE_pexp_item

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



    class Pexp_forContext(Pexp_itemContext):

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

        def FOR(self):
            return self.getToken(DynamodParser.FOR, 0)
        def segment(self):
            return self.getTypedRuleContext(DynamodParser.SegmentContext,0)

        def COLON(self):
            return self.getToken(DynamodParser.COLON, 0)
        def pexpression(self):
            return self.getTypedRuleContext(DynamodParser.PexpressionContext,0)


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


    class Pexp_ifContext(Pexp_itemContext):

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

        def IF(self):
            return self.getToken(DynamodParser.IF, 0)
        def condition(self):
            return self.getTypedRuleContext(DynamodParser.ConditionContext,0)

        def COLON(self):
            return self.getToken(DynamodParser.COLON, 0)
        def pexpression(self):
            return self.getTypedRuleContext(DynamodParser.PexpressionContext,0)


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



    def pexp_item(self):

        localctx = DynamodParser.Pexp_itemContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_pexp_item)
        try:
            self.state = 237
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [DynamodParser.FOR]:
                localctx = DynamodParser.Pexp_forContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 227
                self.match(DynamodParser.FOR)
                self.state = 228
                self.segment()
                self.state = 229
                self.match(DynamodParser.COLON)
                self.state = 230
                self.pexpression()
                pass
            elif token in [DynamodParser.IF]:
                localctx = DynamodParser.Pexp_ifContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 232
                self.match(DynamodParser.IF)
                self.state = 233
                self.condition()
                self.state = 234
                self.match(DynamodParser.COLON)
                self.state = 235
                self.pexpression()
                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 SegmentContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return DynamodParser.RULE_segment

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



    class Seg_as_eqContext(SegmentContext):

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

        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)
        def expression(self):
            return self.getTypedRuleContext(DynamodParser.ExpressionContext,0)


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


    class Seg_as_axvalContext(SegmentContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a DynamodParser.SegmentContext
            super().__init__(parser)
            self.axis = None # Token
            self.value = None # Token
            self.copyFrom(ctx)

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

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


    class Seg_as_inContext(SegmentContext):

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

        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)
        def IN(self):
            return self.getToken(DynamodParser.IN, 0)
        def values(self):
            return self.getTypedRuleContext(DynamodParser.ValuesContext,0)


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



    def segment(self):

        localctx = DynamodParser.SegmentContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_segment)
        try:
            self.state = 248
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,12,self._ctx)
            if la_ == 1:
                localctx = DynamodParser.Seg_as_axvalContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 239
                localctx.axis = self.match(DynamodParser.NAME)
                self.state = 240
                self.match(DynamodParser.T__0)
                self.state = 241
                localctx.value = self.match(DynamodParser.NAME)
                pass

            elif la_ == 2:
                localctx = DynamodParser.Seg_as_eqContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 242
                self.match(DynamodParser.NAME)
                self.state = 243
                self.match(DynamodParser.T__0)
                self.state = 244
                self.expression()
                pass

            elif la_ == 3:
                localctx = DynamodParser.Seg_as_inContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 245
                self.match(DynamodParser.NAME)
                self.state = 246
                self.match(DynamodParser.IN)
                self.state = 247
                self.values()
                pass


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


    class ValuesContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def OPEN_BRACK(self):
            return self.getToken(DynamodParser.OPEN_BRACK, 0)

        def CLOSE_BRACK(self):
            return self.getToken(DynamodParser.CLOSE_BRACK, 0)

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

        def getRuleIndex(self):
            return DynamodParser.RULE_values

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




    def values(self):

        localctx = DynamodParser.ValuesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_values)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 250
            self.match(DynamodParser.OPEN_BRACK)
            self.state = 251
            localctx._NAME = self.match(DynamodParser.NAME)
            localctx.vals.append(localctx._NAME)
            self.state = 256
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==DynamodParser.T__1:
                self.state = 252
                self.match(DynamodParser.T__1)
                self.state = 253
                localctx._NAME = self.match(DynamodParser.NAME)
                localctx.vals.append(localctx._NAME)
                self.state = 258
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 259
            self.match(DynamodParser.CLOSE_BRACK)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Expression_listContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def OPEN_BRACK(self):
            return self.getToken(DynamodParser.OPEN_BRACK, 0)

        def CLOSE_BRACK(self):
            return self.getToken(DynamodParser.CLOSE_BRACK, 0)

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


        def getRuleIndex(self):
            return DynamodParser.RULE_expression_list

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




    def expression_list(self):

        localctx = DynamodParser.Expression_listContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_expression_list)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 261
            self.match(DynamodParser.OPEN_BRACK)
            self.state = 262
            localctx._expression = self.expression()
            localctx.exprs.append(localctx._expression)
            self.state = 267
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==DynamodParser.T__1:
                self.state = 263
                self.match(DynamodParser.T__1)
                self.state = 264
                localctx._expression = self.expression()
                localctx.exprs.append(localctx._expression)
                self.state = 269
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 270
            self.match(DynamodParser.CLOSE_BRACK)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ProgressionsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def progression(self):
            return self.getTypedRuleContext(DynamodParser.ProgressionContext,0)


        def progressions(self):
            return self.getTypedRuleContext(DynamodParser.ProgressionsContext,0)


        def getRuleIndex(self):
            return DynamodParser.RULE_progressions

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




    def progressions(self):

        localctx = DynamodParser.ProgressionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 42, self.RULE_progressions)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 272
            self.progression()
            self.state = 274
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==DynamodParser.NAME:
                self.state = 273
                self.progressions()


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


    class ProgressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def progression_block(self):
            return self.getTypedRuleContext(DynamodParser.Progression_blockContext,0)


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

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

        def getRuleIndex(self):
            return DynamodParser.RULE_progression

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




    def progression(self):

        localctx = DynamodParser.ProgressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_progression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 276
            localctx.name = self.match(DynamodParser.NAME)
            self.state = 279
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==DynamodParser.AT:
                self.state = 277
                self.match(DynamodParser.AT)
                self.state = 278
                localctx.before = self.match(DynamodParser.NAME)


            self.state = 281
            self.match(DynamodParser.COLON)
            self.state = 282
            self.progression_block()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Progression_blockContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def NEWLINE(self):
            return self.getToken(DynamodParser.NEWLINE, 0)

        def INDENT(self):
            return self.getToken(DynamodParser.INDENT, 0)

        def progression_statements(self):
            return self.getTypedRuleContext(DynamodParser.Progression_statementsContext,0)


        def DEDENT(self):
            return self.getToken(DynamodParser.DEDENT, 0)

        def getRuleIndex(self):
            return DynamodParser.RULE_progression_block

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




    def progression_block(self):

        localctx = DynamodParser.Progression_blockContext(self, self._ctx, self.state)
        self.enterRule(localctx, 46, self.RULE_progression_block)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 284
            self.match(DynamodParser.NEWLINE)
            self.state = 285
            self.match(DynamodParser.INDENT)
            self.state = 286
            self.progression_statements()
            self.state = 287
            self.match(DynamodParser.DEDENT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Progression_statementsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def progression_statement(self):
            return self.getTypedRuleContext(DynamodParser.Progression_statementContext,0)


        def progression_statements(self):
            return self.getTypedRuleContext(DynamodParser.Progression_statementsContext,0)


        def getRuleIndex(self):
            return DynamodParser.RULE_progression_statements

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




    def progression_statements(self):

        localctx = DynamodParser.Progression_statementsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_progression_statements)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 289
            self.progression_statement()
            self.state = 291
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << DynamodParser.FOR) | (1 << DynamodParser.VAR) | (1 << DynamodParser.SET) | (1 << DynamodParser.AFTER) | (1 << DynamodParser.IF) | (1 << DynamodParser.NAME))) != 0):
                self.state = 290
                self.progression_statements()


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


    class Progression_statementContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return DynamodParser.RULE_progression_statement

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



    class Prog_afterContext(Progression_statementContext):

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

        def progression_after(self):
            return self.getTypedRuleContext(DynamodParser.Progression_afterContext,0)


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


    class Prog_vardefContext(Progression_statementContext):

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

        def variable_definition(self):
            return self.getTypedRuleContext(DynamodParser.Variable_definitionContext,0)


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


    class Prog_actionContext(Progression_statementContext):

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

        def progression_action(self):
            return self.getTypedRuleContext(DynamodParser.Progression_actionContext,0)


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


    class Prog_restrictionsContext(Progression_statementContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a DynamodParser.Progression_statementContext
            super().__init__(parser)
            self._restriction = None # RestrictionContext
            self.restr = list() # of RestrictionContexts
            self.copyFrom(ctx)

        def OTHERWISE(self):
            return self.getToken(DynamodParser.OTHERWISE, 0)
        def COLON(self):
            return self.getToken(DynamodParser.COLON, 0)
        def progression_block(self):
            return self.getTypedRuleContext(DynamodParser.Progression_blockContext,0)

        def restriction(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DynamodParser.RestrictionContext)
            else:
                return self.getTypedRuleContext(DynamodParser.RestrictionContext,i)


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



    def progression_statement(self):

        localctx = DynamodParser.Progression_statementContext(self, self._ctx, self.state)
        self.enterRule(localctx, 50, self.RULE_progression_statement)
        self._la = 0 # Token type
        try:
            self.state = 306
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [DynamodParser.VAR, DynamodParser.NAME]:
                localctx = DynamodParser.Prog_vardefContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 293
                self.variable_definition()
                pass
            elif token in [DynamodParser.FOR, DynamodParser.IF]:
                localctx = DynamodParser.Prog_restrictionsContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 295 
                self._errHandler.sync(self)
                _alt = 1
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt == 1:
                        self.state = 294
                        localctx._restriction = self.restriction()
                        localctx.restr.append(localctx._restriction)

                    else:
                        raise NoViableAltException(self)
                    self.state = 297 
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,18,self._ctx)

                self.state = 302
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==DynamodParser.OTHERWISE:
                    self.state = 299
                    self.match(DynamodParser.OTHERWISE)
                    self.state = 300
                    self.match(DynamodParser.COLON)
                    self.state = 301
                    self.progression_block()


                pass
            elif token in [DynamodParser.AFTER]:
                localctx = DynamodParser.Prog_afterContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 304
                self.progression_after()
                pass
            elif token in [DynamodParser.SET]:
                localctx = DynamodParser.Prog_actionContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 305
                self.progression_action()
                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 RestrictionContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return DynamodParser.RULE_restriction

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



    class Restr_probContext(RestrictionContext):

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

        def FOR(self):
            return self.getToken(DynamodParser.FOR, 0)
        def expression(self):
            return self.getTypedRuleContext(DynamodParser.ExpressionContext,0)

        def COLON(self):
            return self.getToken(DynamodParser.COLON, 0)
        def progression_block(self):
            return self.getTypedRuleContext(DynamodParser.Progression_blockContext,0)

        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)
        def AS(self):
            return self.getToken(DynamodParser.AS, 0)

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


    class Restr_forContext(RestrictionContext):

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

        def FOR(self):
            return self.getToken(DynamodParser.FOR, 0)
        def segment(self):
            return self.getTypedRuleContext(DynamodParser.SegmentContext,0)

        def COLON(self):
            return self.getToken(DynamodParser.COLON, 0)
        def progression_block(self):
            return self.getTypedRuleContext(DynamodParser.Progression_blockContext,0)

        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)
        def AS(self):
            return self.getToken(DynamodParser.AS, 0)

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


    class Restr_ifContext(RestrictionContext):

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

        def IF(self):
            return self.getToken(DynamodParser.IF, 0)
        def condition(self):
            return self.getTypedRuleContext(DynamodParser.ConditionContext,0)

        def COLON(self):
            return self.getToken(DynamodParser.COLON, 0)
        def progression_block(self):
            return self.getTypedRuleContext(DynamodParser.Progression_blockContext,0)


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



    def restriction(self):

        localctx = DynamodParser.RestrictionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 52, self.RULE_restriction)
        try:
            self.state = 331
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,23,self._ctx)
            if la_ == 1:
                localctx = DynamodParser.Restr_forContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 308
                self.match(DynamodParser.FOR)
                self.state = 311
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,21,self._ctx)
                if la_ == 1:
                    self.state = 309
                    self.match(DynamodParser.NAME)
                    self.state = 310
                    self.match(DynamodParser.AS)


                self.state = 313
                self.segment()
                self.state = 314
                self.match(DynamodParser.COLON)
                self.state = 315
                self.progression_block()
                pass

            elif la_ == 2:
                localctx = DynamodParser.Restr_probContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 317
                self.match(DynamodParser.FOR)
                self.state = 320
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,22,self._ctx)
                if la_ == 1:
                    self.state = 318
                    self.match(DynamodParser.NAME)
                    self.state = 319
                    self.match(DynamodParser.AS)


                self.state = 322
                self.expression()
                self.state = 323
                self.match(DynamodParser.COLON)
                self.state = 324
                self.progression_block()
                pass

            elif la_ == 3:
                localctx = DynamodParser.Restr_ifContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 326
                self.match(DynamodParser.IF)
                self.state = 327
                self.condition()
                self.state = 328
                self.match(DynamodParser.COLON)
                self.state = 329
                self.progression_block()
                pass


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


    class Progression_afterContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def AFTER(self):
            return self.getToken(DynamodParser.AFTER, 0)

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

        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)

        def OPEN_PAREN(self):
            return self.getToken(DynamodParser.OPEN_PAREN, 0)

        def arguments(self):
            return self.getTypedRuleContext(DynamodParser.ArgumentsContext,0)


        def CLOSE_PAREN(self):
            return self.getToken(DynamodParser.CLOSE_PAREN, 0)

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

        def progression_block(self):
            return self.getTypedRuleContext(DynamodParser.Progression_blockContext,0)


        def getRuleIndex(self):
            return DynamodParser.RULE_progression_after

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




    def progression_after(self):

        localctx = DynamodParser.Progression_afterContext(self, self._ctx, self.state)
        self.enterRule(localctx, 54, self.RULE_progression_after)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 333
            self.match(DynamodParser.AFTER)
            self.state = 334
            self.match(DynamodParser.DOT)
            self.state = 335
            self.match(DynamodParser.NAME)
            self.state = 336
            self.match(DynamodParser.OPEN_PAREN)
            self.state = 337
            self.arguments()
            self.state = 338
            self.match(DynamodParser.CLOSE_PAREN)
            self.state = 339
            self.match(DynamodParser.COLON)
            self.state = 340
            self.progression_block()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Progression_actionContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)

        def pstate(self):
            return self.getTypedRuleContext(DynamodParser.PstateContext,0)


        def getRuleIndex(self):
            return DynamodParser.RULE_progression_action

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




    def progression_action(self):

        localctx = DynamodParser.Progression_actionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 56, self.RULE_progression_action)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 342
            self.match(DynamodParser.SET)
            self.state = 343
            self.match(DynamodParser.NAME)
            self.state = 344
            self.match(DynamodParser.T__0)
            self.state = 345
            self.pstate()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PstateContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return DynamodParser.RULE_pstate

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



    class Pstate_nameContext(PstateContext):

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

        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)
        def NEWLINE(self):
            return self.getToken(DynamodParser.NEWLINE, 0)

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


    class Pstate_blockContext(PstateContext):

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

        def share_map_block(self):
            return self.getTypedRuleContext(DynamodParser.Share_map_blockContext,0)


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



    def pstate(self):

        localctx = DynamodParser.PstateContext(self, self._ctx, self.state)
        self.enterRule(localctx, 58, self.RULE_pstate)
        try:
            self.state = 350
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [DynamodParser.NAME]:
                localctx = DynamodParser.Pstate_nameContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 347
                self.match(DynamodParser.NAME)
                self.state = 348
                self.match(DynamodParser.NEWLINE)
                pass
            elif token in [DynamodParser.NEWLINE]:
                localctx = DynamodParser.Pstate_blockContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 349
                self.share_map_block()
                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 ResultsContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def result(self):
            return self.getTypedRuleContext(DynamodParser.ResultContext,0)


        def results(self):
            return self.getTypedRuleContext(DynamodParser.ResultsContext,0)


        def getRuleIndex(self):
            return DynamodParser.RULE_results

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




    def results(self):

        localctx = DynamodParser.ResultsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 60, self.RULE_results)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 352
            self.result()
            self.state = 354
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==DynamodParser.NAME:
                self.state = 353
                self.results()


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


    class ResultContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)

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

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


        def NEWLINE(self):
            return self.getToken(DynamodParser.NEWLINE, 0)

        def getRuleIndex(self):
            return DynamodParser.RULE_result

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




    def result(self):

        localctx = DynamodParser.ResultContext(self, self._ctx, self.state)
        self.enterRule(localctx, 62, self.RULE_result)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 356
            self.match(DynamodParser.NAME)
            self.state = 357
            self.match(DynamodParser.COLON)
            self.state = 358
            self.expression()
            self.state = 359
            self.match(DynamodParser.NEWLINE)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class FormulasContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def formula(self):
            return self.getTypedRuleContext(DynamodParser.FormulaContext,0)


        def formulas(self):
            return self.getTypedRuleContext(DynamodParser.FormulasContext,0)


        def getRuleIndex(self):
            return DynamodParser.RULE_formulas

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




    def formulas(self):

        localctx = DynamodParser.FormulasContext(self, self._ctx, self.state)
        self.enterRule(localctx, 64, self.RULE_formulas)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 361
            self.formula()
            self.state = 363
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==DynamodParser.NAME:
                self.state = 362
                self.formulas()


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


    class FormulaContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return DynamodParser.RULE_formula

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



    class Formula_funcContext(FormulaContext):

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

        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)
        def OPEN_PAREN(self):
            return self.getToken(DynamodParser.OPEN_PAREN, 0)
        def formal_args(self):
            return self.getTypedRuleContext(DynamodParser.Formal_argsContext,0)

        def CLOSE_PAREN(self):
            return self.getToken(DynamodParser.CLOSE_PAREN, 0)
        def COLON(self):
            return self.getToken(DynamodParser.COLON, 0)
        def pexpression(self):
            return self.getTypedRuleContext(DynamodParser.PexpressionContext,0)


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


    class Formula_exprContext(FormulaContext):

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

        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)
        def COLON(self):
            return self.getToken(DynamodParser.COLON, 0)
        def pexpression(self):
            return self.getTypedRuleContext(DynamodParser.PexpressionContext,0)


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



    def formula(self):

        localctx = DynamodParser.FormulaContext(self, self._ctx, self.state)
        self.enterRule(localctx, 66, self.RULE_formula)
        try:
            self.state = 375
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,27,self._ctx)
            if la_ == 1:
                localctx = DynamodParser.Formula_exprContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 365
                self.match(DynamodParser.NAME)
                self.state = 366
                self.match(DynamodParser.COLON)
                self.state = 367
                self.pexpression()
                pass

            elif la_ == 2:
                localctx = DynamodParser.Formula_funcContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 368
                self.match(DynamodParser.NAME)
                self.state = 369
                self.match(DynamodParser.OPEN_PAREN)
                self.state = 370
                self.formal_args()
                self.state = 371
                self.match(DynamodParser.CLOSE_PAREN)
                self.state = 372
                self.match(DynamodParser.COLON)
                self.state = 373
                self.pexpression()
                pass


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


    class Formal_argsContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def getRuleIndex(self):
            return DynamodParser.RULE_formal_args

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




    def formal_args(self):

        localctx = DynamodParser.Formal_argsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 68, self.RULE_formal_args)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 377
            localctx._NAME = self.match(DynamodParser.NAME)
            localctx.args.append(localctx._NAME)
            self.state = 382
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==DynamodParser.T__1:
                self.state = 378
                self.match(DynamodParser.T__1)
                self.state = 379
                localctx._NAME = self.match(DynamodParser.NAME)
                localctx.args.append(localctx._NAME)
                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 Variable_definitionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)

        def pexpression(self):
            return self.getTypedRuleContext(DynamodParser.PexpressionContext,0)


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

        def getRuleIndex(self):
            return DynamodParser.RULE_variable_definition

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




    def variable_definition(self):

        localctx = DynamodParser.Variable_definitionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 70, self.RULE_variable_definition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 386
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==DynamodParser.VAR:
                self.state = 385
                self.match(DynamodParser.VAR)


            self.state = 388
            self.match(DynamodParser.NAME)
            self.state = 389
            self.match(DynamodParser.T__0)
            self.state = 390
            self.pexpression()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return DynamodParser.RULE_expression

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



    class Expr_ifelseContext(ExpressionContext):

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

        def IF(self):
            return self.getToken(DynamodParser.IF, 0)
        def condition(self):
            return self.getTypedRuleContext(DynamodParser.ConditionContext,0)

        def expval(self):
            return self.getTypedRuleContext(DynamodParser.ExpvalContext,0)

        def ELSE(self):
            return self.getToken(DynamodParser.ELSE, 0)
        def expression(self):
            return self.getTypedRuleContext(DynamodParser.ExpressionContext,0)


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


    class Expr_valueContext(ExpressionContext):

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

        def expval(self):
            return self.getTypedRuleContext(DynamodParser.ExpvalContext,0)


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



    def expression(self):

        localctx = DynamodParser.ExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 72, self.RULE_expression)
        try:
            self.state = 399
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [DynamodParser.IF]:
                localctx = DynamodParser.Expr_ifelseContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 392
                self.match(DynamodParser.IF)
                self.state = 393
                self.condition()
                self.state = 394
                self.expval(0)
                self.state = 395
                self.match(DynamodParser.ELSE)
                self.state = 396
                self.expression()
                pass
            elif token in [DynamodParser.T__2, DynamodParser.T__3, DynamodParser.T__7, DynamodParser.T__8, DynamodParser.NAME, DynamodParser.STRING, DynamodParser.NUMBER, DynamodParser.OPEN_PAREN, DynamodParser.OPEN_BRACK]:
                localctx = DynamodParser.Expr_valueContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 398
                self.expval(0)
                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 ConditionContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return DynamodParser.RULE_condition

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



    class Disj_oneContext(ConditionContext):

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

        def conjunction(self):
            return self.getTypedRuleContext(DynamodParser.ConjunctionContext,0)


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


    class Disj_orsContext(ConditionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a DynamodParser.ConditionContext
            super().__init__(parser)
            self._conjunction = None # ConjunctionContext
            self.conds = list() # of ConjunctionContexts
            self.copyFrom(ctx)

        def conjunction(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DynamodParser.ConjunctionContext)
            else:
                return self.getTypedRuleContext(DynamodParser.ConjunctionContext,i)

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

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



    def condition(self):

        localctx = DynamodParser.ConditionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 74, self.RULE_condition)
        self._la = 0 # Token type
        try:
            self.state = 409
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,32,self._ctx)
            if la_ == 1:
                localctx = DynamodParser.Disj_orsContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 401
                localctx._conjunction = self.conjunction()
                localctx.conds.append(localctx._conjunction)
                self.state = 404 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while True:
                    self.state = 402
                    self.match(DynamodParser.OR)
                    self.state = 403
                    localctx._conjunction = self.conjunction()
                    localctx.conds.append(localctx._conjunction)
                    self.state = 406 
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if not (_la==DynamodParser.OR):
                        break

                pass

            elif la_ == 2:
                localctx = DynamodParser.Disj_oneContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 408
                self.conjunction()
                pass


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


    class ConjunctionContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return DynamodParser.RULE_conjunction

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



    class Conj_andsContext(ConjunctionContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a DynamodParser.ConjunctionContext
            super().__init__(parser)
            self._comparison = None # ComparisonContext
            self.conds = list() # of ComparisonContexts
            self.copyFrom(ctx)

        def comparison(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DynamodParser.ComparisonContext)
            else:
                return self.getTypedRuleContext(DynamodParser.ComparisonContext,i)

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

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


    class Conj_compContext(ConjunctionContext):

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

        def comparison(self):
            return self.getTypedRuleContext(DynamodParser.ComparisonContext,0)


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



    def conjunction(self):

        localctx = DynamodParser.ConjunctionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 76, self.RULE_conjunction)
        self._la = 0 # Token type
        try:
            self.state = 419
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,34,self._ctx)
            if la_ == 1:
                localctx = DynamodParser.Conj_andsContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 411
                localctx._comparison = self.comparison()
                localctx.conds.append(localctx._comparison)
                self.state = 414 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while True:
                    self.state = 412
                    self.match(DynamodParser.AND)
                    self.state = 413
                    localctx._comparison = self.comparison()
                    localctx.conds.append(localctx._comparison)
                    self.state = 416 
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if not (_la==DynamodParser.AND):
                        break

                pass

            elif la_ == 2:
                localctx = DynamodParser.Conj_compContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 418
                self.comparison()
                pass


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


    class ComparisonContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return DynamodParser.RULE_comparison

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



    class Comp_two_opsContext(ComparisonContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a DynamodParser.ComparisonContext
            super().__init__(parser)
            self.op1 = None # ExpvalContext
            self.op = None # Token
            self.op2 = None # ExpvalContext
            self.copyFrom(ctx)

        def expval(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DynamodParser.ExpvalContext)
            else:
                return self.getTypedRuleContext(DynamodParser.ExpvalContext,i)

        def LT(self):
            return self.getToken(DynamodParser.LT, 0)
        def LE(self):
            return self.getToken(DynamodParser.LE, 0)
        def GT(self):
            return self.getToken(DynamodParser.GT, 0)
        def GE(self):
            return self.getToken(DynamodParser.GE, 0)
        def EQ(self):
            return self.getToken(DynamodParser.EQ, 0)
        def NE(self):
            return self.getToken(DynamodParser.NE, 0)

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


    class Comp_notContext(ComparisonContext):

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

        def NOT(self):
            return self.getToken(DynamodParser.NOT, 0)
        def comparison(self):
            return self.getTypedRuleContext(DynamodParser.ComparisonContext,0)


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


    class Comp_intervalContext(ComparisonContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a DynamodParser.ComparisonContext
            super().__init__(parser)
            self.op1 = None # ExpressionContext
            self.op2 = None # ExpressionContext
            self.copyFrom(ctx)

        def expval(self):
            return self.getTypedRuleContext(DynamodParser.ExpvalContext,0)

        def IN(self):
            return self.getToken(DynamodParser.IN, 0)
        def OPEN_BRACK(self):
            return self.getToken(DynamodParser.OPEN_BRACK, 0)
        def DOTDOT(self):
            return self.getToken(DynamodParser.DOTDOT, 0)
        def CLOSE_BRACK(self):
            return self.getToken(DynamodParser.CLOSE_BRACK, 0)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DynamodParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(DynamodParser.ExpressionContext,i)


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



    def comparison(self):

        localctx = DynamodParser.ComparisonContext(self, self._ctx, self.state)
        self.enterRule(localctx, 78, self.RULE_comparison)
        self._la = 0 # Token type
        try:
            self.state = 435
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,35,self._ctx)
            if la_ == 1:
                localctx = DynamodParser.Comp_two_opsContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 421
                localctx.op1 = self.expval(0)
                self.state = 422
                localctx.op = self._input.LT(1)
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << DynamodParser.LT) | (1 << DynamodParser.LE) | (1 << DynamodParser.GT) | (1 << DynamodParser.GE) | (1 << DynamodParser.NE) | (1 << DynamodParser.EQ))) != 0)):
                    localctx.op = self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 423
                localctx.op2 = self.expval(0)
                pass

            elif la_ == 2:
                localctx = DynamodParser.Comp_notContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 425
                self.match(DynamodParser.NOT)
                self.state = 426
                self.comparison()
                pass

            elif la_ == 3:
                localctx = DynamodParser.Comp_intervalContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 427
                self.expval(0)
                self.state = 428
                self.match(DynamodParser.IN)
                self.state = 429
                self.match(DynamodParser.OPEN_BRACK)
                self.state = 430
                localctx.op1 = self.expression()
                self.state = 431
                self.match(DynamodParser.DOTDOT)
                self.state = 432
                localctx.op2 = self.expression()
                self.state = 433
                self.match(DynamodParser.CLOSE_BRACK)
                pass


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


    class ExpvalContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return DynamodParser.RULE_expval

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


    class Expval_subContext(ExpvalContext):

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

        def expval(self):
            return self.getTypedRuleContext(DynamodParser.ExpvalContext,0)

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


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


    class Expval_addContext(ExpvalContext):

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

        def expval(self):
            return self.getTypedRuleContext(DynamodParser.ExpvalContext,0)

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


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


    class Expval_termContext(ExpvalContext):

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

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


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



    def expval(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = DynamodParser.ExpvalContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 80
        self.enterRecursionRule(localctx, 80, self.RULE_expval, _p)
        try:
            self.enterOuterAlt(localctx, 1)
            localctx = DynamodParser.Expval_termContext(self, localctx)
            self._ctx = localctx
            _prevctx = localctx

            self.state = 438
            self.term(0)
            self._ctx.stop = self._input.LT(-1)
            self.state = 448
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,37,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    self.state = 446
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,36,self._ctx)
                    if la_ == 1:
                        localctx = DynamodParser.Expval_addContext(self, DynamodParser.ExpvalContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expval)
                        self.state = 440
                        if not self.precpred(self._ctx, 3):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 3)")
                        self.state = 441
                        self.match(DynamodParser.T__2)
                        self.state = 442
                        self.term(0)
                        pass

                    elif la_ == 2:
                        localctx = DynamodParser.Expval_subContext(self, DynamodParser.ExpvalContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_expval)
                        self.state = 443
                        if not self.precpred(self._ctx, 2):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                        self.state = 444
                        self.match(DynamodParser.T__3)
                        self.state = 445
                        self.term(0)
                        pass

             
                self.state = 450
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,37,self._ctx)

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


    class TermContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return DynamodParser.RULE_term

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


    class Term_mulContext(TermContext):

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

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

        def STAR(self):
            return self.getToken(DynamodParser.STAR, 0)
        def factor(self):
            return self.getTypedRuleContext(DynamodParser.FactorContext,0)


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


    class Term_expContext(TermContext):

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

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

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


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


    class Term_factorContext(TermContext):

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

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


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


    class Term_divContext(TermContext):

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

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

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


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



    def term(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = DynamodParser.TermContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 82
        self.enterRecursionRule(localctx, 82, self.RULE_term, _p)
        try:
            self.enterOuterAlt(localctx, 1)
            localctx = DynamodParser.Term_factorContext(self, localctx)
            self._ctx = localctx
            _prevctx = localctx

            self.state = 452
            self.factor()
            self._ctx.stop = self._input.LT(-1)
            self.state = 465
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,39,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    self.state = 463
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,38,self._ctx)
                    if la_ == 1:
                        localctx = DynamodParser.Term_expContext(self, DynamodParser.TermContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_term)
                        self.state = 454
                        if not self.precpred(self._ctx, 4):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 4)")
                        self.state = 455
                        self.match(DynamodParser.T__4)
                        self.state = 456
                        self.factor()
                        pass

                    elif la_ == 2:
                        localctx = DynamodParser.Term_mulContext(self, DynamodParser.TermContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_term)
                        self.state = 457
                        if not self.precpred(self._ctx, 3):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 3)")
                        self.state = 458
                        self.match(DynamodParser.STAR)
                        self.state = 459
                        self.factor()
                        pass

                    elif la_ == 3:
                        localctx = DynamodParser.Term_divContext(self, DynamodParser.TermContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_term)
                        self.state = 460
                        if not self.precpred(self._ctx, 2):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
                        self.state = 461
                        self.match(DynamodParser.T__5)
                        self.state = 462
                        self.factor()
                        pass

             
                self.state = 467
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,39,self._ctx)

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


    class FactorContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return DynamodParser.RULE_factor

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



    class Factor_posContext(FactorContext):

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

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


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


    class Factor_percentContext(FactorContext):

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

        def NUMBER(self):
            return self.getToken(DynamodParser.NUMBER, 0)

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


    class Factor_negContext(FactorContext):

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

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


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


    class Factor_primaryContext(FactorContext):

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

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


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


    class Factor_restContext(FactorContext):

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


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


    class Factor_exprContext(FactorContext):

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

        def OPEN_PAREN(self):
            return self.getToken(DynamodParser.OPEN_PAREN, 0)
        def expression(self):
            return self.getTypedRuleContext(DynamodParser.ExpressionContext,0)

        def CLOSE_PAREN(self):
            return self.getToken(DynamodParser.CLOSE_PAREN, 0)

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


    class Factor_numberContext(FactorContext):

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

        def NUMBER(self):
            return self.getToken(DynamodParser.NUMBER, 0)

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



    def factor(self):

        localctx = DynamodParser.FactorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 84, self.RULE_factor)
        try:
            self.state = 481
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,40,self._ctx)
            if la_ == 1:
                localctx = DynamodParser.Factor_posContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 468
                self.match(DynamodParser.T__2)
                self.state = 469
                self.factor()
                pass

            elif la_ == 2:
                localctx = DynamodParser.Factor_negContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 470
                self.match(DynamodParser.T__3)
                self.state = 471
                self.factor()
                pass

            elif la_ == 3:
                localctx = DynamodParser.Factor_primaryContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 472
                self.primary(0)
                pass

            elif la_ == 4:
                localctx = DynamodParser.Factor_exprContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 473
                self.match(DynamodParser.OPEN_PAREN)
                self.state = 474
                self.expression()
                self.state = 475
                self.match(DynamodParser.CLOSE_PAREN)
                pass

            elif la_ == 5:
                localctx = DynamodParser.Factor_numberContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 477
                self.match(DynamodParser.NUMBER)
                pass

            elif la_ == 6:
                localctx = DynamodParser.Factor_percentContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 478
                self.match(DynamodParser.NUMBER)
                self.state = 479
                self.match(DynamodParser.T__6)
                pass

            elif la_ == 7:
                localctx = DynamodParser.Factor_restContext(self, localctx)
                self.enterOuterAlt(localctx, 7)
                self.state = 480
                self.match(DynamodParser.T__7)
                pass


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


    class PrimaryContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return DynamodParser.RULE_primary

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


    class Primary_stringContext(PrimaryContext):

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

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

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


    class Primary_funcContext(PrimaryContext):

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

        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)
        def OPEN_PAREN(self):
            return self.getToken(DynamodParser.OPEN_PAREN, 0)
        def CLOSE_PAREN(self):
            return self.getToken(DynamodParser.CLOSE_PAREN, 0)
        def arguments(self):
            return self.getTypedRuleContext(DynamodParser.ArgumentsContext,0)


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


    class Primary_methodContext(PrimaryContext):

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

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

        def DOT(self):
            return self.getToken(DynamodParser.DOT, 0)
        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)
        def OPEN_PAREN(self):
            return self.getToken(DynamodParser.OPEN_PAREN, 0)
        def CLOSE_PAREN(self):
            return self.getToken(DynamodParser.CLOSE_PAREN, 0)
        def arguments(self):
            return self.getTypedRuleContext(DynamodParser.ArgumentsContext,0)


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


    class Primary_dotContext(PrimaryContext):

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

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

        def DOT(self):
            return self.getToken(DynamodParser.DOT, 0)
        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)

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


    class Primary_listContext(PrimaryContext):

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

        def OPEN_BRACK(self):
            return self.getToken(DynamodParser.OPEN_BRACK, 0)
        def CLOSE_BRACK(self):
            return self.getToken(DynamodParser.CLOSE_BRACK, 0)
        def arguments(self):
            return self.getTypedRuleContext(DynamodParser.ArgumentsContext,0)


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


    class Primary_partitionContext(PrimaryContext):

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

        def partition(self):
            return self.getTypedRuleContext(DynamodParser.PartitionContext,0)


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


    class Primary_shareContext(PrimaryContext):

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

        def OPEN_PAREN(self):
            return self.getToken(DynamodParser.OPEN_PAREN, 0)
        def partition(self):
            return self.getTypedRuleContext(DynamodParser.PartitionContext,0)

        def CLOSE_PAREN(self):
            return self.getToken(DynamodParser.CLOSE_PAREN, 0)

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


    class Primary_nameContext(PrimaryContext):

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

        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)

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


    class Primary_rel_shareContext(PrimaryContext):

        def __init__(self, parser, ctx:ParserRuleContext): # actually a DynamodParser.PrimaryContext
            super().__init__(parser)
            self.part = None # PartitionContext
            self.base = None # PartitionContext
            self.copyFrom(ctx)

        def OPEN_PAREN(self):
            return self.getToken(DynamodParser.OPEN_PAREN, 0)
        def CLOSE_PAREN(self):
            return self.getToken(DynamodParser.CLOSE_PAREN, 0)
        def partition(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(DynamodParser.PartitionContext)
            else:
                return self.getTypedRuleContext(DynamodParser.PartitionContext,i)


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


    class Primary_indexedContext(PrimaryContext):

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

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

        def OPEN_BRACK(self):
            return self.getToken(DynamodParser.OPEN_BRACK, 0)
        def expression(self):
            return self.getTypedRuleContext(DynamodParser.ExpressionContext,0)

        def CLOSE_BRACK(self):
            return self.getToken(DynamodParser.CLOSE_BRACK, 0)

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



    def primary(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = DynamodParser.PrimaryContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 86
        self.enterRecursionRule(localctx, 86, self.RULE_primary, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 510
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,43,self._ctx)
            if la_ == 1:
                localctx = DynamodParser.Primary_funcContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 484
                self.match(DynamodParser.NAME)
                self.state = 485
                self.match(DynamodParser.OPEN_PAREN)
                self.state = 487
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << DynamodParser.T__2) | (1 << DynamodParser.T__3) | (1 << DynamodParser.T__7) | (1 << DynamodParser.T__8) | (1 << DynamodParser.IF) | (1 << DynamodParser.NAME) | (1 << DynamodParser.STRING) | (1 << DynamodParser.NUMBER) | (1 << DynamodParser.OPEN_PAREN) | (1 << DynamodParser.OPEN_BRACK))) != 0):
                    self.state = 486
                    self.arguments()


                self.state = 489
                self.match(DynamodParser.CLOSE_PAREN)
                pass

            elif la_ == 2:
                localctx = DynamodParser.Primary_listContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 490
                self.match(DynamodParser.OPEN_BRACK)
                self.state = 492
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << DynamodParser.T__2) | (1 << DynamodParser.T__3) | (1 << DynamodParser.T__7) | (1 << DynamodParser.T__8) | (1 << DynamodParser.IF) | (1 << DynamodParser.NAME) | (1 << DynamodParser.STRING) | (1 << DynamodParser.NUMBER) | (1 << DynamodParser.OPEN_PAREN) | (1 << DynamodParser.OPEN_BRACK))) != 0):
                    self.state = 491
                    self.arguments()


                self.state = 494
                self.match(DynamodParser.CLOSE_BRACK)
                pass

            elif la_ == 3:
                localctx = DynamodParser.Primary_nameContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 495
                self.match(DynamodParser.NAME)
                pass

            elif la_ == 4:
                localctx = DynamodParser.Primary_stringContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 496
                self.match(DynamodParser.STRING)
                pass

            elif la_ == 5:
                localctx = DynamodParser.Primary_partitionContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 497
                self.partition(0)
                pass

            elif la_ == 6:
                localctx = DynamodParser.Primary_shareContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 498
                self.match(DynamodParser.T__8)
                self.state = 499
                self.match(DynamodParser.OPEN_PAREN)
                self.state = 500
                self.partition(0)
                self.state = 501
                self.match(DynamodParser.CLOSE_PAREN)
                pass

            elif la_ == 7:
                localctx = DynamodParser.Primary_rel_shareContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 503
                self.match(DynamodParser.T__8)
                self.state = 504
                self.match(DynamodParser.OPEN_PAREN)
                self.state = 505
                localctx.part = self.partition(0)
                self.state = 506
                self.match(DynamodParser.T__9)
                self.state = 507
                localctx.base = self.partition(0)
                self.state = 508
                self.match(DynamodParser.CLOSE_PAREN)
                pass


            self._ctx.stop = self._input.LT(-1)
            self.state = 530
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,46,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    self.state = 528
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,45,self._ctx)
                    if la_ == 1:
                        localctx = DynamodParser.Primary_dotContext(self, DynamodParser.PrimaryContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_primary)
                        self.state = 512
                        if not self.precpred(self._ctx, 10):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 10)")
                        self.state = 513
                        self.match(DynamodParser.DOT)
                        self.state = 514
                        self.match(DynamodParser.NAME)
                        pass

                    elif la_ == 2:
                        localctx = DynamodParser.Primary_methodContext(self, DynamodParser.PrimaryContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_primary)
                        self.state = 515
                        if not self.precpred(self._ctx, 8):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 8)")
                        self.state = 516
                        self.match(DynamodParser.DOT)
                        self.state = 517
                        self.match(DynamodParser.NAME)
                        self.state = 518
                        self.match(DynamodParser.OPEN_PAREN)
                        self.state = 520
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << DynamodParser.T__2) | (1 << DynamodParser.T__3) | (1 << DynamodParser.T__7) | (1 << DynamodParser.T__8) | (1 << DynamodParser.IF) | (1 << DynamodParser.NAME) | (1 << DynamodParser.STRING) | (1 << DynamodParser.NUMBER) | (1 << DynamodParser.OPEN_PAREN) | (1 << DynamodParser.OPEN_BRACK))) != 0):
                            self.state = 519
                            self.arguments()


                        self.state = 522
                        self.match(DynamodParser.CLOSE_PAREN)
                        pass

                    elif la_ == 3:
                        localctx = DynamodParser.Primary_indexedContext(self, DynamodParser.PrimaryContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_primary)
                        self.state = 523
                        if not self.precpred(self._ctx, 6):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
                        self.state = 524
                        self.match(DynamodParser.OPEN_BRACK)
                        self.state = 525
                        self.expression()
                        self.state = 526
                        self.match(DynamodParser.CLOSE_BRACK)
                        pass

             
                self.state = 532
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,46,self._ctx)

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


    class PartitionContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return DynamodParser.RULE_partition

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


    class Part_exprContext(PartitionContext):

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

        def OPEN_PAREN(self):
            return self.getToken(DynamodParser.OPEN_PAREN, 0)
        def partition(self):
            return self.getTypedRuleContext(DynamodParser.PartitionContext,0)

        def CLOSE_PAREN(self):
            return self.getToken(DynamodParser.CLOSE_PAREN, 0)

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


    class Part_methodContext(PartitionContext):

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

        def partition(self):
            return self.getTypedRuleContext(DynamodParser.PartitionContext,0)

        def DOT(self):
            return self.getToken(DynamodParser.DOT, 0)
        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)
        def OPEN_PAREN(self):
            return self.getToken(DynamodParser.OPEN_PAREN, 0)
        def CLOSE_PAREN(self):
            return self.getToken(DynamodParser.CLOSE_PAREN, 0)
        def arguments(self):
            return self.getTypedRuleContext(DynamodParser.ArgumentsContext,0)


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


    class Part_segmentContext(PartitionContext):

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

        def segment(self):
            return self.getTypedRuleContext(DynamodParser.SegmentContext,0)


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


    class Part_nameContext(PartitionContext):

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

        def NAME(self):
            return self.getToken(DynamodParser.NAME, 0)

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


    class Part_withContext(PartitionContext):

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

        def partition(self):
            return self.getTypedRuleContext(DynamodParser.PartitionContext,0)

        def WITH(self):
            return self.getToken(DynamodParser.WITH, 0)
        def segment(self):
            return self.getTypedRuleContext(DynamodParser.SegmentContext,0)


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



    def partition(self, _p:int=0):
        _parentctx = self._ctx
        _parentState = self.state
        localctx = DynamodParser.PartitionContext(self, self._ctx, _parentState)
        _prevctx = localctx
        _startState = 88
        self.enterRecursionRule(localctx, 88, self.RULE_partition, _p)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 540
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,47,self._ctx)
            if la_ == 1:
                localctx = DynamodParser.Part_nameContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx

                self.state = 534
                self.match(DynamodParser.NAME)
                pass

            elif la_ == 2:
                localctx = DynamodParser.Part_exprContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 535
                self.match(DynamodParser.OPEN_PAREN)
                self.state = 536
                self.partition(0)
                self.state = 537
                self.match(DynamodParser.CLOSE_PAREN)
                pass

            elif la_ == 3:
                localctx = DynamodParser.Part_segmentContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 539
                self.segment()
                pass


            self._ctx.stop = self._input.LT(-1)
            self.state = 555
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,50,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    if self._parseListeners is not None:
                        self.triggerExitRuleEvent()
                    _prevctx = localctx
                    self.state = 553
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,49,self._ctx)
                    if la_ == 1:
                        localctx = DynamodParser.Part_methodContext(self, DynamodParser.PartitionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_partition)
                        self.state = 542
                        if not self.precpred(self._ctx, 4):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 4)")
                        self.state = 543
                        self.match(DynamodParser.DOT)
                        self.state = 544
                        self.match(DynamodParser.NAME)
                        self.state = 545
                        self.match(DynamodParser.OPEN_PAREN)
                        self.state = 547
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << DynamodParser.T__2) | (1 << DynamodParser.T__3) | (1 << DynamodParser.T__7) | (1 << DynamodParser.T__8) | (1 << DynamodParser.IF) | (1 << DynamodParser.NAME) | (1 << DynamodParser.STRING) | (1 << DynamodParser.NUMBER) | (1 << DynamodParser.OPEN_PAREN) | (1 << DynamodParser.OPEN_BRACK))) != 0):
                            self.state = 546
                            self.arguments()


                        self.state = 549
                        self.match(DynamodParser.CLOSE_PAREN)
                        pass

                    elif la_ == 2:
                        localctx = DynamodParser.Part_withContext(self, DynamodParser.PartitionContext(self, _parentctx, _parentState))
                        self.pushNewRecursionContext(localctx, _startState, self.RULE_partition)
                        self.state = 550
                        if not self.precpred(self._ctx, 1):
                            from antlr4.error.Errors import FailedPredicateException
                            raise FailedPredicateException(self, "self.precpred(self._ctx, 1)")
                        self.state = 551
                        self.match(DynamodParser.WITH)
                        self.state = 552
                        self.segment()
                        pass

             
                self.state = 557
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,50,self._ctx)

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


    class ArgumentsContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


        def getRuleIndex(self):
            return DynamodParser.RULE_arguments

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




    def arguments(self):

        localctx = DynamodParser.ArgumentsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 90, self.RULE_arguments)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 558
            localctx._expression = self.expression()
            localctx.args.append(localctx._expression)
            self.state = 563
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==DynamodParser.T__1:
                self.state = 559
                self.match(DynamodParser.T__1)
                self.state = 560
                localctx._expression = self.expression()
                localctx.args.append(localctx._expression)
                self.state = 565
                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



    def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int):
        if self._predicates == None:
            self._predicates = dict()
        self._predicates[40] = self.expval_sempred
        self._predicates[41] = self.term_sempred
        self._predicates[43] = self.primary_sempred
        self._predicates[44] = self.partition_sempred
        pred = self._predicates.get(ruleIndex, None)
        if pred is None:
            raise Exception("No predicate with index:" + str(ruleIndex))
        else:
            return pred(localctx, predIndex)

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

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

    def term_sempred(self, localctx:TermContext, predIndex:int):
            if predIndex == 2:
                return self.precpred(self._ctx, 4)
         

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

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

    def primary_sempred(self, localctx:PrimaryContext, predIndex:int):
            if predIndex == 5:
                return self.precpred(self._ctx, 10)
         

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

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

    def partition_sempred(self, localctx:PartitionContext, predIndex:int):
            if predIndex == 8:
                return self.precpred(self._ctx, 4)
         

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




