# Generated from /home/grabl/.cache/bazel/_bazel_grabl/7ef8d994fdedbcf15566d4e42e182314/sandbox/linux-sandbox/33/execroot/vaticle_typeql/bazel-out/k8-fastbuild/bin/grammar/TypeQLPython.g4 by ANTLR 4.7.2
# encoding: utf-8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys

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


class TypeQLPythonParser ( Parser ):

    grammarFileName = "TypeQLPython.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "';'", "','", "'{'", "'}'", "'('", "')'", 
                     "':'", "'['", "']'", "'match'", "'get'", "'define'", 
                     "'undefine'", "'insert'", "'delete'", "'compute'", 
                     "'thing'", "'entity'", "'attribute'", "'relation'", 
                     "'role'", "'rule'", "'offset'", "'limit'", "'sort'", 
                     "<INVALID>", "'asc'", "'desc'", "'type'", "'abstract'", 
                     "<INVALID>", "'sub'", "'sub!'", "'owns'", "'@key'", 
                     "'regex'", "'as'", "'plays'", "'relates'", "'when'", 
                     "'then'", "'iid'", "<INVALID>", "'isa'", "'isa!'", 
                     "'has'", "'value'", "'is'", "'or'", "'not'", "'='", 
                     "'!='", "'>'", "'>='", "'<'", "'<='", "'like'", "'contains'", 
                     "'group'", "'count'", "'max'", "'min'", "'mean'", "'median'", 
                     "'std'", "'sum'", "'cluster'", "'centrality'", "'path'", 
                     "'degree'", "'k-core'", "'connected-component'", "'from'", 
                     "'to'", "'of'", "'in'", "'using'", "'where'", "'min-k'", 
                     "'k'", "'size'", "'long'", "'double'", "'string'", 
                     "'boolean'", "'datetime'", "<INVALID>", "'true'", "'false'", 
                     "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                     "<INVALID>", "<INVALID>", "'$_'" ]

    symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "MATCH", "GET", "DEFINE", 
                      "UNDEFINE", "INSERT", "DELETE", "COMPUTE", "THING", 
                      "ENTITY", "ATTRIBUTE", "RELATION", "ROLE", "RULE", 
                      "OFFSET", "LIMIT", "SORT", "ORDER_", "ASC", "DESC", 
                      "TYPE", "ABSTRACT", "SUB_", "SUB", "SUBX", "OWNS", 
                      "IS_KEY", "REGEX", "AS", "PLAYS", "RELATES", "WHEN", 
                      "THEN", "IID", "ISA_", "ISA", "ISAX", "HAS", "VALUE", 
                      "IS", "OR", "NOT", "EQ", "NEQ", "GT", "GTE", "LT", 
                      "LTE", "LIKE", "CONTAINS", "GROUP", "COUNT", "MAX", 
                      "MIN", "MEAN", "MEDIAN", "STD", "SUM", "CLUSTER", 
                      "CENTRALITY", "PATH", "DEGREE", "K_CORE", "CONNECTED_COMPONENT", 
                      "FROM", "TO", "OF", "IN", "USING", "WHERE", "MIN_K", 
                      "K", "SIZE", "LONG", "DOUBLE", "STRING", "BOOLEAN", 
                      "DATETIME", "BOOLEAN_", "TRUE", "FALSE", "STRING_", 
                      "LONG_", "DOUBLE_", "DATE_", "DATETIME_", "VAR_", 
                      "VAR_ANONYMOUS_", "VAR_NAMED_", "IID_", "LABEL_", 
                      "LABEL_SCOPED_", "COMMENT", "WS", "UNRECOGNISED" ]

    RULE_eof_query = 0
    RULE_eof_queries = 1
    RULE_eof_pattern = 2
    RULE_eof_patterns = 3
    RULE_eof_definables = 4
    RULE_eof_variable = 5
    RULE_eof_label = 6
    RULE_eof_schema_rule = 7
    RULE_query = 8
    RULE_query_define = 9
    RULE_query_undefine = 10
    RULE_query_insert = 11
    RULE_query_delete_or_update = 12
    RULE_query_match = 13
    RULE_query_compute = 14
    RULE_query_match_aggregate = 15
    RULE_query_match_group = 16
    RULE_query_match_group_agg = 17
    RULE_modifiers = 18
    RULE_filter_ = 19
    RULE_sort = 20
    RULE_offset = 21
    RULE_limit = 22
    RULE_match_aggregate = 23
    RULE_aggregate_method = 24
    RULE_match_group = 25
    RULE_definables = 26
    RULE_definable = 27
    RULE_patterns = 28
    RULE_pattern = 29
    RULE_pattern_conjunction = 30
    RULE_pattern_disjunction = 31
    RULE_pattern_negation = 32
    RULE_pattern_variable = 33
    RULE_variable_concept = 34
    RULE_variable_type = 35
    RULE_type_constraint = 36
    RULE_variable_things = 37
    RULE_variable_thing_any = 38
    RULE_variable_thing = 39
    RULE_variable_relation = 40
    RULE_variable_attribute = 41
    RULE_relation = 42
    RULE_role_player = 43
    RULE_player = 44
    RULE_attributes = 45
    RULE_attribute = 46
    RULE_predicate = 47
    RULE_predicate_equality = 48
    RULE_predicate_substring = 49
    RULE_predicate_value = 50
    RULE_schema_rule = 51
    RULE_compute_conditions = 52
    RULE_compute_method = 53
    RULE_conditions_count = 54
    RULE_conditions_value = 55
    RULE_conditions_central = 56
    RULE_conditions_cluster = 57
    RULE_conditions_path = 58
    RULE_input_count = 59
    RULE_input_value = 60
    RULE_input_central = 61
    RULE_input_cluster = 62
    RULE_input_path = 63
    RULE_compute_direction = 64
    RULE_compute_target = 65
    RULE_compute_scope = 66
    RULE_compute_config = 67
    RULE_compute_algorithm = 68
    RULE_compute_args = 69
    RULE_compute_args_array = 70
    RULE_compute_arg = 71
    RULE_type_any = 72
    RULE_type_scoped = 73
    RULE_type_ = 74
    RULE_label_any = 75
    RULE_label_scoped = 76
    RULE_label = 77
    RULE_labels = 78
    RULE_label_array = 79
    RULE_schema_native = 80
    RULE_type_native = 81
    RULE_value_type = 82
    RULE_value = 83
    RULE_regex = 84
    RULE_unreserved = 85

    ruleNames =  [ "eof_query", "eof_queries", "eof_pattern", "eof_patterns", 
                   "eof_definables", "eof_variable", "eof_label", "eof_schema_rule", 
                   "query", "query_define", "query_undefine", "query_insert", 
                   "query_delete_or_update", "query_match", "query_compute", 
                   "query_match_aggregate", "query_match_group", "query_match_group_agg", 
                   "modifiers", "filter_", "sort", "offset", "limit", "match_aggregate", 
                   "aggregate_method", "match_group", "definables", "definable", 
                   "patterns", "pattern", "pattern_conjunction", "pattern_disjunction", 
                   "pattern_negation", "pattern_variable", "variable_concept", 
                   "variable_type", "type_constraint", "variable_things", 
                   "variable_thing_any", "variable_thing", "variable_relation", 
                   "variable_attribute", "relation", "role_player", "player", 
                   "attributes", "attribute", "predicate", "predicate_equality", 
                   "predicate_substring", "predicate_value", "schema_rule", 
                   "compute_conditions", "compute_method", "conditions_count", 
                   "conditions_value", "conditions_central", "conditions_cluster", 
                   "conditions_path", "input_count", "input_value", "input_central", 
                   "input_cluster", "input_path", "compute_direction", "compute_target", 
                   "compute_scope", "compute_config", "compute_algorithm", 
                   "compute_args", "compute_args_array", "compute_arg", 
                   "type_any", "type_scoped", "type_", "label_any", "label_scoped", 
                   "label", "labels", "label_array", "schema_native", "type_native", 
                   "value_type", "value", "regex", "unreserved" ]

    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
    MATCH=10
    GET=11
    DEFINE=12
    UNDEFINE=13
    INSERT=14
    DELETE=15
    COMPUTE=16
    THING=17
    ENTITY=18
    ATTRIBUTE=19
    RELATION=20
    ROLE=21
    RULE=22
    OFFSET=23
    LIMIT=24
    SORT=25
    ORDER_=26
    ASC=27
    DESC=28
    TYPE=29
    ABSTRACT=30
    SUB_=31
    SUB=32
    SUBX=33
    OWNS=34
    IS_KEY=35
    REGEX=36
    AS=37
    PLAYS=38
    RELATES=39
    WHEN=40
    THEN=41
    IID=42
    ISA_=43
    ISA=44
    ISAX=45
    HAS=46
    VALUE=47
    IS=48
    OR=49
    NOT=50
    EQ=51
    NEQ=52
    GT=53
    GTE=54
    LT=55
    LTE=56
    LIKE=57
    CONTAINS=58
    GROUP=59
    COUNT=60
    MAX=61
    MIN=62
    MEAN=63
    MEDIAN=64
    STD=65
    SUM=66
    CLUSTER=67
    CENTRALITY=68
    PATH=69
    DEGREE=70
    K_CORE=71
    CONNECTED_COMPONENT=72
    FROM=73
    TO=74
    OF=75
    IN=76
    USING=77
    WHERE=78
    MIN_K=79
    K=80
    SIZE=81
    LONG=82
    DOUBLE=83
    STRING=84
    BOOLEAN=85
    DATETIME=86
    BOOLEAN_=87
    TRUE=88
    FALSE=89
    STRING_=90
    LONG_=91
    DOUBLE_=92
    DATE_=93
    DATETIME_=94
    VAR_=95
    VAR_ANONYMOUS_=96
    VAR_NAMED_=97
    IID_=98
    LABEL_=99
    LABEL_SCOPED_=100
    COMMENT=101
    WS=102
    UNRECOGNISED=103

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



    class Eof_queryContext(ParserRuleContext):

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

        def query(self):
            return self.getTypedRuleContext(TypeQLPythonParser.QueryContext,0)


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

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_eof_query

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

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

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




    def eof_query(self):

        localctx = TypeQLPythonParser.Eof_queryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_eof_query)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 172
            self.query()
            self.state = 173
            self.match(TypeQLPythonParser.EOF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Eof_queriesContext(ParserRuleContext):

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

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

        def query(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TypeQLPythonParser.QueryContext)
            else:
                return self.getTypedRuleContext(TypeQLPythonParser.QueryContext,i)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_eof_queries

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

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

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




    def eof_queries(self):

        localctx = TypeQLPythonParser.Eof_queriesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_eof_queries)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 176 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 175
                self.query()
                self.state = 178 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TypeQLPythonParser.MATCH) | (1 << TypeQLPythonParser.DEFINE) | (1 << TypeQLPythonParser.UNDEFINE) | (1 << TypeQLPythonParser.INSERT) | (1 << TypeQLPythonParser.COMPUTE))) != 0)):
                    break

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

    class Eof_patternContext(ParserRuleContext):

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

        def pattern(self):
            return self.getTypedRuleContext(TypeQLPythonParser.PatternContext,0)


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

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_eof_pattern

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

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

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




    def eof_pattern(self):

        localctx = TypeQLPythonParser.Eof_patternContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_eof_pattern)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 182
            self.pattern()
            self.state = 183
            self.match(TypeQLPythonParser.EOF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Eof_patternsContext(ParserRuleContext):

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

        def patterns(self):
            return self.getTypedRuleContext(TypeQLPythonParser.PatternsContext,0)


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

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_eof_patterns

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

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

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




    def eof_patterns(self):

        localctx = TypeQLPythonParser.Eof_patternsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_eof_patterns)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 185
            self.patterns()
            self.state = 186
            self.match(TypeQLPythonParser.EOF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Eof_definablesContext(ParserRuleContext):

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

        def definables(self):
            return self.getTypedRuleContext(TypeQLPythonParser.DefinablesContext,0)


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

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_eof_definables

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

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

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




    def eof_definables(self):

        localctx = TypeQLPythonParser.Eof_definablesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_eof_definables)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 188
            self.definables()
            self.state = 189
            self.match(TypeQLPythonParser.EOF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Eof_variableContext(ParserRuleContext):

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

        def pattern_variable(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Pattern_variableContext,0)


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

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_eof_variable

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

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

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




    def eof_variable(self):

        localctx = TypeQLPythonParser.Eof_variableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_eof_variable)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 191
            self.pattern_variable()
            self.state = 192
            self.match(TypeQLPythonParser.EOF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Eof_labelContext(ParserRuleContext):

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

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


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

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_eof_label

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

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

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




    def eof_label(self):

        localctx = TypeQLPythonParser.Eof_labelContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_eof_label)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 194
            self.label()
            self.state = 195
            self.match(TypeQLPythonParser.EOF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Eof_schema_ruleContext(ParserRuleContext):

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

        def schema_rule(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Schema_ruleContext,0)


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

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_eof_schema_rule

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

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

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




    def eof_schema_rule(self):

        localctx = TypeQLPythonParser.Eof_schema_ruleContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_eof_schema_rule)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 197
            self.schema_rule()
            self.state = 198
            self.match(TypeQLPythonParser.EOF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class QueryContext(ParserRuleContext):

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

        def query_define(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Query_defineContext,0)


        def query_undefine(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Query_undefineContext,0)


        def query_insert(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Query_insertContext,0)


        def query_delete_or_update(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Query_delete_or_updateContext,0)


        def query_match(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Query_matchContext,0)


        def query_match_aggregate(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Query_match_aggregateContext,0)


        def query_match_group(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Query_match_groupContext,0)


        def query_match_group_agg(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Query_match_group_aggContext,0)


        def query_compute(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Query_computeContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_query

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

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

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




    def query(self):

        localctx = TypeQLPythonParser.QueryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_query)
        try:
            self.state = 209
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,1,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 200
                self.query_define()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 201
                self.query_undefine()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 202
                self.query_insert()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 203
                self.query_delete_or_update()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 204
                self.query_match()
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 205
                self.query_match_aggregate()
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 206
                self.query_match_group()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 207
                self.query_match_group_agg()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 208
                self.query_compute()
                pass


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

    class Query_defineContext(ParserRuleContext):

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

        def DEFINE(self):
            return self.getToken(TypeQLPythonParser.DEFINE, 0)

        def definables(self):
            return self.getTypedRuleContext(TypeQLPythonParser.DefinablesContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_query_define

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

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

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




    def query_define(self):

        localctx = TypeQLPythonParser.Query_defineContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_query_define)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 211
            self.match(TypeQLPythonParser.DEFINE)
            self.state = 212
            self.definables()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Query_undefineContext(ParserRuleContext):

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

        def UNDEFINE(self):
            return self.getToken(TypeQLPythonParser.UNDEFINE, 0)

        def definables(self):
            return self.getTypedRuleContext(TypeQLPythonParser.DefinablesContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_query_undefine

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

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

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




    def query_undefine(self):

        localctx = TypeQLPythonParser.Query_undefineContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_query_undefine)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 214
            self.match(TypeQLPythonParser.UNDEFINE)
            self.state = 215
            self.definables()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Query_insertContext(ParserRuleContext):

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

        def MATCH(self):
            return self.getToken(TypeQLPythonParser.MATCH, 0)

        def patterns(self):
            return self.getTypedRuleContext(TypeQLPythonParser.PatternsContext,0)


        def INSERT(self):
            return self.getToken(TypeQLPythonParser.INSERT, 0)

        def variable_things(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Variable_thingsContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_query_insert

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

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

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




    def query_insert(self):

        localctx = TypeQLPythonParser.Query_insertContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_query_insert)
        try:
            self.state = 224
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [TypeQLPythonParser.MATCH]:
                self.enterOuterAlt(localctx, 1)
                self.state = 217
                self.match(TypeQLPythonParser.MATCH)
                self.state = 218
                self.patterns()
                self.state = 219
                self.match(TypeQLPythonParser.INSERT)
                self.state = 220
                self.variable_things()
                pass
            elif token in [TypeQLPythonParser.INSERT]:
                self.enterOuterAlt(localctx, 2)
                self.state = 222
                self.match(TypeQLPythonParser.INSERT)
                self.state = 223
                self.variable_things()
                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 Query_delete_or_updateContext(ParserRuleContext):

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

        def MATCH(self):
            return self.getToken(TypeQLPythonParser.MATCH, 0)

        def patterns(self):
            return self.getTypedRuleContext(TypeQLPythonParser.PatternsContext,0)


        def DELETE(self):
            return self.getToken(TypeQLPythonParser.DELETE, 0)

        def variable_things(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TypeQLPythonParser.Variable_thingsContext)
            else:
                return self.getTypedRuleContext(TypeQLPythonParser.Variable_thingsContext,i)


        def INSERT(self):
            return self.getToken(TypeQLPythonParser.INSERT, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_query_delete_or_update

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

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

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




    def query_delete_or_update(self):

        localctx = TypeQLPythonParser.Query_delete_or_updateContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_query_delete_or_update)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 226
            self.match(TypeQLPythonParser.MATCH)
            self.state = 227
            self.patterns()
            self.state = 228
            self.match(TypeQLPythonParser.DELETE)
            self.state = 229
            self.variable_things()
            self.state = 232
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,3,self._ctx)
            if la_ == 1:
                self.state = 230
                self.match(TypeQLPythonParser.INSERT)
                self.state = 231
                self.variable_things()


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

    class Query_matchContext(ParserRuleContext):

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

        def MATCH(self):
            return self.getToken(TypeQLPythonParser.MATCH, 0)

        def patterns(self):
            return self.getTypedRuleContext(TypeQLPythonParser.PatternsContext,0)


        def modifiers(self):
            return self.getTypedRuleContext(TypeQLPythonParser.ModifiersContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_query_match

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

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

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




    def query_match(self):

        localctx = TypeQLPythonParser.Query_matchContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_query_match)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 234
            self.match(TypeQLPythonParser.MATCH)
            self.state = 235
            self.patterns()

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

    class Query_computeContext(ParserRuleContext):

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

        def COMPUTE(self):
            return self.getToken(TypeQLPythonParser.COMPUTE, 0)

        def compute_conditions(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Compute_conditionsContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_query_compute

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

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

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




    def query_compute(self):

        localctx = TypeQLPythonParser.Query_computeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_query_compute)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 238
            self.match(TypeQLPythonParser.COMPUTE)
            self.state = 239
            self.compute_conditions()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Query_match_aggregateContext(ParserRuleContext):

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

        def query_match(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Query_matchContext,0)


        def match_aggregate(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Match_aggregateContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_query_match_aggregate

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

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

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




    def query_match_aggregate(self):

        localctx = TypeQLPythonParser.Query_match_aggregateContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_query_match_aggregate)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 241
            self.query_match()
            self.state = 242
            self.match_aggregate()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Query_match_groupContext(ParserRuleContext):

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

        def query_match(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Query_matchContext,0)


        def match_group(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Match_groupContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_query_match_group

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

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

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




    def query_match_group(self):

        localctx = TypeQLPythonParser.Query_match_groupContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_query_match_group)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 244
            self.query_match()
            self.state = 245
            self.match_group()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Query_match_group_aggContext(ParserRuleContext):

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

        def query_match(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Query_matchContext,0)


        def match_group(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Match_groupContext,0)


        def match_aggregate(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Match_aggregateContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_query_match_group_agg

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

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

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




    def query_match_group_agg(self):

        localctx = TypeQLPythonParser.Query_match_group_aggContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_query_match_group_agg)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 247
            self.query_match()
            self.state = 248
            self.match_group()
            self.state = 249
            self.match_aggregate()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class ModifiersContext(ParserRuleContext):

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

        def filter_(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Filter_Context,0)


        def sort(self):
            return self.getTypedRuleContext(TypeQLPythonParser.SortContext,0)


        def offset(self):
            return self.getTypedRuleContext(TypeQLPythonParser.OffsetContext,0)


        def limit(self):
            return self.getTypedRuleContext(TypeQLPythonParser.LimitContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_modifiers

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

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

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




    def modifiers(self):

        localctx = TypeQLPythonParser.ModifiersContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_modifiers)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 254
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==TypeQLPythonParser.GET:
                self.state = 251
                self.filter_()
                self.state = 252
                self.match(TypeQLPythonParser.T__0)


            self.state = 259
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==TypeQLPythonParser.SORT:
                self.state = 256
                self.sort()
                self.state = 257
                self.match(TypeQLPythonParser.T__0)


            self.state = 264
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==TypeQLPythonParser.OFFSET:
                self.state = 261
                self.offset()
                self.state = 262
                self.match(TypeQLPythonParser.T__0)


            self.state = 269
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==TypeQLPythonParser.LIMIT:
                self.state = 266
                self.limit()
                self.state = 267
                self.match(TypeQLPythonParser.T__0)


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

    class Filter_Context(ParserRuleContext):

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

        def GET(self):
            return self.getToken(TypeQLPythonParser.GET, 0)

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

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_filter_

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

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

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




    def filter_(self):

        localctx = TypeQLPythonParser.Filter_Context(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_filter_)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 271
            self.match(TypeQLPythonParser.GET)
            self.state = 272
            self.match(TypeQLPythonParser.VAR_)
            self.state = 277
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==TypeQLPythonParser.T__1:
                self.state = 273
                self.match(TypeQLPythonParser.T__1)
                self.state = 274
                self.match(TypeQLPythonParser.VAR_)
                self.state = 279
                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 SortContext(ParserRuleContext):

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

        def SORT(self):
            return self.getToken(TypeQLPythonParser.SORT, 0)

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

        def ORDER_(self):
            return self.getToken(TypeQLPythonParser.ORDER_, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_sort

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

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

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




    def sort(self):

        localctx = TypeQLPythonParser.SortContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_sort)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 280
            self.match(TypeQLPythonParser.SORT)
            self.state = 281
            self.match(TypeQLPythonParser.VAR_)
            self.state = 286
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==TypeQLPythonParser.T__1:
                self.state = 282
                self.match(TypeQLPythonParser.T__1)
                self.state = 283
                self.match(TypeQLPythonParser.VAR_)
                self.state = 288
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 290
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==TypeQLPythonParser.ORDER_:
                self.state = 289
                self.match(TypeQLPythonParser.ORDER_)


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

    class OffsetContext(ParserRuleContext):

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

        def OFFSET(self):
            return self.getToken(TypeQLPythonParser.OFFSET, 0)

        def LONG_(self):
            return self.getToken(TypeQLPythonParser.LONG_, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_offset

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

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

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




    def offset(self):

        localctx = TypeQLPythonParser.OffsetContext(self, self._ctx, self.state)
        self.enterRule(localctx, 42, self.RULE_offset)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 292
            self.match(TypeQLPythonParser.OFFSET)
            self.state = 293
            self.match(TypeQLPythonParser.LONG_)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class LimitContext(ParserRuleContext):

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

        def LIMIT(self):
            return self.getToken(TypeQLPythonParser.LIMIT, 0)

        def LONG_(self):
            return self.getToken(TypeQLPythonParser.LONG_, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_limit

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

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

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




    def limit(self):

        localctx = TypeQLPythonParser.LimitContext(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_limit)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 295
            self.match(TypeQLPythonParser.LIMIT)
            self.state = 296
            self.match(TypeQLPythonParser.LONG_)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Match_aggregateContext(ParserRuleContext):

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

        def aggregate_method(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Aggregate_methodContext,0)


        def VAR_(self):
            return self.getToken(TypeQLPythonParser.VAR_, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_match_aggregate

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

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

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




    def match_aggregate(self):

        localctx = TypeQLPythonParser.Match_aggregateContext(self, self._ctx, self.state)
        self.enterRule(localctx, 46, self.RULE_match_aggregate)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 298
            self.aggregate_method()
            self.state = 300
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==TypeQLPythonParser.VAR_:
                self.state = 299
                self.match(TypeQLPythonParser.VAR_)


            self.state = 302
            self.match(TypeQLPythonParser.T__0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Aggregate_methodContext(ParserRuleContext):

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

        def COUNT(self):
            return self.getToken(TypeQLPythonParser.COUNT, 0)

        def MAX(self):
            return self.getToken(TypeQLPythonParser.MAX, 0)

        def MEAN(self):
            return self.getToken(TypeQLPythonParser.MEAN, 0)

        def MEDIAN(self):
            return self.getToken(TypeQLPythonParser.MEDIAN, 0)

        def MIN(self):
            return self.getToken(TypeQLPythonParser.MIN, 0)

        def STD(self):
            return self.getToken(TypeQLPythonParser.STD, 0)

        def SUM(self):
            return self.getToken(TypeQLPythonParser.SUM, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_aggregate_method

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

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

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




    def aggregate_method(self):

        localctx = TypeQLPythonParser.Aggregate_methodContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_aggregate_method)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 304
            _la = self._input.LA(1)
            if not(((((_la - 60)) & ~0x3f) == 0 and ((1 << (_la - 60)) & ((1 << (TypeQLPythonParser.COUNT - 60)) | (1 << (TypeQLPythonParser.MAX - 60)) | (1 << (TypeQLPythonParser.MIN - 60)) | (1 << (TypeQLPythonParser.MEAN - 60)) | (1 << (TypeQLPythonParser.MEDIAN - 60)) | (1 << (TypeQLPythonParser.STD - 60)) | (1 << (TypeQLPythonParser.SUM - 60)))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Match_groupContext(ParserRuleContext):

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

        def GROUP(self):
            return self.getToken(TypeQLPythonParser.GROUP, 0)

        def VAR_(self):
            return self.getToken(TypeQLPythonParser.VAR_, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_match_group

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

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

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




    def match_group(self):

        localctx = TypeQLPythonParser.Match_groupContext(self, self._ctx, self.state)
        self.enterRule(localctx, 50, self.RULE_match_group)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 306
            self.match(TypeQLPythonParser.GROUP)
            self.state = 307
            self.match(TypeQLPythonParser.VAR_)
            self.state = 308
            self.match(TypeQLPythonParser.T__0)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class DefinablesContext(ParserRuleContext):

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

        def definable(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TypeQLPythonParser.DefinableContext)
            else:
                return self.getTypedRuleContext(TypeQLPythonParser.DefinableContext,i)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_definables

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

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

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




    def definables(self):

        localctx = TypeQLPythonParser.DefinablesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 52, self.RULE_definables)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 313 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 310
                self.definable()
                self.state = 311
                self.match(TypeQLPythonParser.T__0)
                self.state = 315 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TypeQLPythonParser.GET) | (1 << TypeQLPythonParser.THING) | (1 << TypeQLPythonParser.ENTITY) | (1 << TypeQLPythonParser.ATTRIBUTE) | (1 << TypeQLPythonParser.RELATION) | (1 << TypeQLPythonParser.ROLE) | (1 << TypeQLPythonParser.RULE) | (1 << TypeQLPythonParser.OFFSET) | (1 << TypeQLPythonParser.LIMIT) | (1 << TypeQLPythonParser.SORT) | (1 << TypeQLPythonParser.VALUE) | (1 << TypeQLPythonParser.CONTAINS) | (1 << TypeQLPythonParser.GROUP) | (1 << TypeQLPythonParser.COUNT) | (1 << TypeQLPythonParser.MAX) | (1 << TypeQLPythonParser.MIN) | (1 << TypeQLPythonParser.MEAN))) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & ((1 << (TypeQLPythonParser.MEDIAN - 64)) | (1 << (TypeQLPythonParser.STD - 64)) | (1 << (TypeQLPythonParser.SUM - 64)) | (1 << (TypeQLPythonParser.CLUSTER - 64)) | (1 << (TypeQLPythonParser.PATH - 64)) | (1 << (TypeQLPythonParser.DEGREE - 64)) | (1 << (TypeQLPythonParser.K_CORE - 64)) | (1 << (TypeQLPythonParser.CONNECTED_COMPONENT - 64)) | (1 << (TypeQLPythonParser.FROM - 64)) | (1 << (TypeQLPythonParser.TO - 64)) | (1 << (TypeQLPythonParser.OF - 64)) | (1 << (TypeQLPythonParser.IN - 64)) | (1 << (TypeQLPythonParser.WHERE - 64)) | (1 << (TypeQLPythonParser.MIN_K - 64)) | (1 << (TypeQLPythonParser.K - 64)) | (1 << (TypeQLPythonParser.SIZE - 64)) | (1 << (TypeQLPythonParser.VAR_ - 64)) | (1 << (TypeQLPythonParser.LABEL_ - 64)) | (1 << (TypeQLPythonParser.LABEL_SCOPED_ - 64)))) != 0)):
                    break

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

    class DefinableContext(ParserRuleContext):

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

        def variable_type(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Variable_typeContext,0)


        def schema_rule(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Schema_ruleContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_definable

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

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

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




    def definable(self):

        localctx = TypeQLPythonParser.DefinableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 54, self.RULE_definable)
        try:
            self.state = 319
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,13,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 317
                self.variable_type()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 318
                self.schema_rule()
                pass


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

    class PatternsContext(ParserRuleContext):

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

        def pattern(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TypeQLPythonParser.PatternContext)
            else:
                return self.getTypedRuleContext(TypeQLPythonParser.PatternContext,i)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_patterns

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

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

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




    def patterns(self):

        localctx = TypeQLPythonParser.PatternsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 56, self.RULE_patterns)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 324 
            self._errHandler.sync(self)
            _alt = 1
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt == 1:
                    self.state = 321
                    self.pattern()
                    self.state = 322
                    self.match(TypeQLPythonParser.T__0)

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

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

    class PatternContext(ParserRuleContext):

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

        def pattern_variable(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Pattern_variableContext,0)


        def pattern_conjunction(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Pattern_conjunctionContext,0)


        def pattern_disjunction(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Pattern_disjunctionContext,0)


        def pattern_negation(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Pattern_negationContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_pattern

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

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

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




    def pattern(self):

        localctx = TypeQLPythonParser.PatternContext(self, self._ctx, self.state)
        self.enterRule(localctx, 58, self.RULE_pattern)
        try:
            self.state = 332
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,15,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 328
                self.pattern_variable()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 329
                self.pattern_conjunction()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 330
                self.pattern_disjunction()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 331
                self.pattern_negation()
                pass


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

    class Pattern_conjunctionContext(ParserRuleContext):

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

        def patterns(self):
            return self.getTypedRuleContext(TypeQLPythonParser.PatternsContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_pattern_conjunction

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

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

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




    def pattern_conjunction(self):

        localctx = TypeQLPythonParser.Pattern_conjunctionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 60, self.RULE_pattern_conjunction)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 334
            self.match(TypeQLPythonParser.T__2)
            self.state = 335
            self.patterns()
            self.state = 336
            self.match(TypeQLPythonParser.T__3)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Pattern_disjunctionContext(ParserRuleContext):

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

        def patterns(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TypeQLPythonParser.PatternsContext)
            else:
                return self.getTypedRuleContext(TypeQLPythonParser.PatternsContext,i)


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

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_pattern_disjunction

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

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

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




    def pattern_disjunction(self):

        localctx = TypeQLPythonParser.Pattern_disjunctionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 62, self.RULE_pattern_disjunction)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 338
            self.match(TypeQLPythonParser.T__2)
            self.state = 339
            self.patterns()
            self.state = 340
            self.match(TypeQLPythonParser.T__3)
            self.state = 346 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 341
                self.match(TypeQLPythonParser.OR)
                self.state = 342
                self.match(TypeQLPythonParser.T__2)
                self.state = 343
                self.patterns()
                self.state = 344
                self.match(TypeQLPythonParser.T__3)
                self.state = 348 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==TypeQLPythonParser.OR):
                    break

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

    class Pattern_negationContext(ParserRuleContext):

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

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

        def patterns(self):
            return self.getTypedRuleContext(TypeQLPythonParser.PatternsContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_pattern_negation

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

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

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




    def pattern_negation(self):

        localctx = TypeQLPythonParser.Pattern_negationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 64, self.RULE_pattern_negation)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 350
            self.match(TypeQLPythonParser.NOT)
            self.state = 351
            self.match(TypeQLPythonParser.T__2)
            self.state = 352
            self.patterns()
            self.state = 353
            self.match(TypeQLPythonParser.T__3)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Pattern_variableContext(ParserRuleContext):

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

        def variable_concept(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Variable_conceptContext,0)


        def variable_type(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Variable_typeContext,0)


        def variable_thing_any(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Variable_thing_anyContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_pattern_variable

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

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

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




    def pattern_variable(self):

        localctx = TypeQLPythonParser.Pattern_variableContext(self, self._ctx, self.state)
        self.enterRule(localctx, 66, self.RULE_pattern_variable)
        try:
            self.state = 358
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,17,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 355
                self.variable_concept()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 356
                self.variable_type()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 357
                self.variable_thing_any()
                pass


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

    class Variable_conceptContext(ParserRuleContext):

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

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

        def IS(self):
            return self.getToken(TypeQLPythonParser.IS, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_variable_concept

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

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

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




    def variable_concept(self):

        localctx = TypeQLPythonParser.Variable_conceptContext(self, self._ctx, self.state)
        self.enterRule(localctx, 68, self.RULE_variable_concept)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 360
            self.match(TypeQLPythonParser.VAR_)
            self.state = 361
            self.match(TypeQLPythonParser.IS)
            self.state = 362
            self.match(TypeQLPythonParser.VAR_)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Variable_typeContext(ParserRuleContext):

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

        def type_any(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Type_anyContext,0)


        def type_constraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TypeQLPythonParser.Type_constraintContext)
            else:
                return self.getTypedRuleContext(TypeQLPythonParser.Type_constraintContext,i)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_variable_type

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

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

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




    def variable_type(self):

        localctx = TypeQLPythonParser.Variable_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 70, self.RULE_variable_type)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 364
            self.type_any()
            self.state = 365
            self.type_constraint()
            self.state = 370
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==TypeQLPythonParser.T__1:
                self.state = 366
                self.match(TypeQLPythonParser.T__1)
                self.state = 367
                self.type_constraint()
                self.state = 372
                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 Type_constraintContext(ParserRuleContext):

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

        def ABSTRACT(self):
            return self.getToken(TypeQLPythonParser.ABSTRACT, 0)

        def SUB_(self):
            return self.getToken(TypeQLPythonParser.SUB_, 0)

        def type_any(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Type_anyContext,0)


        def OWNS(self):
            return self.getToken(TypeQLPythonParser.OWNS, 0)

        def type_(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TypeQLPythonParser.Type_Context)
            else:
                return self.getTypedRuleContext(TypeQLPythonParser.Type_Context,i)


        def AS(self):
            return self.getToken(TypeQLPythonParser.AS, 0)

        def IS_KEY(self):
            return self.getToken(TypeQLPythonParser.IS_KEY, 0)

        def RELATES(self):
            return self.getToken(TypeQLPythonParser.RELATES, 0)

        def PLAYS(self):
            return self.getToken(TypeQLPythonParser.PLAYS, 0)

        def type_scoped(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Type_scopedContext,0)


        def VALUE(self):
            return self.getToken(TypeQLPythonParser.VALUE, 0)

        def value_type(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Value_typeContext,0)


        def REGEX(self):
            return self.getToken(TypeQLPythonParser.REGEX, 0)

        def STRING_(self):
            return self.getToken(TypeQLPythonParser.STRING_, 0)

        def WHEN(self):
            return self.getToken(TypeQLPythonParser.WHEN, 0)

        def patterns(self):
            return self.getTypedRuleContext(TypeQLPythonParser.PatternsContext,0)


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

        def variable_things(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Variable_thingsContext,0)


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

        def label_any(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Label_anyContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_type_constraint

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

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

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




    def type_constraint(self):

        localctx = TypeQLPythonParser.Type_constraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 72, self.RULE_type_constraint)
        self._la = 0 # Token type
        try:
            self.state = 413
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [TypeQLPythonParser.ABSTRACT]:
                self.enterOuterAlt(localctx, 1)
                self.state = 373
                self.match(TypeQLPythonParser.ABSTRACT)
                pass
            elif token in [TypeQLPythonParser.SUB_]:
                self.enterOuterAlt(localctx, 2)
                self.state = 374
                self.match(TypeQLPythonParser.SUB_)
                self.state = 375
                self.type_any()
                pass
            elif token in [TypeQLPythonParser.OWNS]:
                self.enterOuterAlt(localctx, 3)
                self.state = 376
                self.match(TypeQLPythonParser.OWNS)
                self.state = 377
                self.type_()
                self.state = 380
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==TypeQLPythonParser.AS:
                    self.state = 378
                    self.match(TypeQLPythonParser.AS)
                    self.state = 379
                    self.type_()


                self.state = 383
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==TypeQLPythonParser.IS_KEY:
                    self.state = 382
                    self.match(TypeQLPythonParser.IS_KEY)


                pass
            elif token in [TypeQLPythonParser.RELATES]:
                self.enterOuterAlt(localctx, 4)
                self.state = 385
                self.match(TypeQLPythonParser.RELATES)
                self.state = 386
                self.type_()
                self.state = 389
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==TypeQLPythonParser.AS:
                    self.state = 387
                    self.match(TypeQLPythonParser.AS)
                    self.state = 388
                    self.type_()


                pass
            elif token in [TypeQLPythonParser.PLAYS]:
                self.enterOuterAlt(localctx, 5)
                self.state = 391
                self.match(TypeQLPythonParser.PLAYS)
                self.state = 392
                self.type_scoped()
                self.state = 395
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==TypeQLPythonParser.AS:
                    self.state = 393
                    self.match(TypeQLPythonParser.AS)
                    self.state = 394
                    self.type_()


                pass
            elif token in [TypeQLPythonParser.VALUE]:
                self.enterOuterAlt(localctx, 6)
                self.state = 397
                self.match(TypeQLPythonParser.VALUE)
                self.state = 398
                self.value_type()
                pass
            elif token in [TypeQLPythonParser.REGEX]:
                self.enterOuterAlt(localctx, 7)
                self.state = 399
                self.match(TypeQLPythonParser.REGEX)
                self.state = 400
                self.match(TypeQLPythonParser.STRING_)
                pass
            elif token in [TypeQLPythonParser.WHEN]:
                self.enterOuterAlt(localctx, 8)
                self.state = 401
                self.match(TypeQLPythonParser.WHEN)
                self.state = 402
                self.match(TypeQLPythonParser.T__2)
                self.state = 403
                self.patterns()
                self.state = 404
                self.match(TypeQLPythonParser.T__3)
                pass
            elif token in [TypeQLPythonParser.THEN]:
                self.enterOuterAlt(localctx, 9)
                self.state = 406
                self.match(TypeQLPythonParser.THEN)
                self.state = 407
                self.match(TypeQLPythonParser.T__2)
                self.state = 408
                self.variable_things()
                self.state = 409
                self.match(TypeQLPythonParser.T__3)
                pass
            elif token in [TypeQLPythonParser.TYPE]:
                self.enterOuterAlt(localctx, 10)
                self.state = 411
                self.match(TypeQLPythonParser.TYPE)
                self.state = 412
                self.label_any()
                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 Variable_thingsContext(ParserRuleContext):

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

        def variable_thing_any(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TypeQLPythonParser.Variable_thing_anyContext)
            else:
                return self.getTypedRuleContext(TypeQLPythonParser.Variable_thing_anyContext,i)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_variable_things

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

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

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




    def variable_things(self):

        localctx = TypeQLPythonParser.Variable_thingsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 74, self.RULE_variable_things)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 418 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 415
                self.variable_thing_any()
                self.state = 416
                self.match(TypeQLPythonParser.T__0)
                self.state = 420 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TypeQLPythonParser.T__4) | (1 << TypeQLPythonParser.EQ) | (1 << TypeQLPythonParser.NEQ) | (1 << TypeQLPythonParser.GT) | (1 << TypeQLPythonParser.GTE) | (1 << TypeQLPythonParser.LT) | (1 << TypeQLPythonParser.LTE) | (1 << TypeQLPythonParser.LIKE) | (1 << TypeQLPythonParser.CONTAINS))) != 0) or ((((_la - 87)) & ~0x3f) == 0 and ((1 << (_la - 87)) & ((1 << (TypeQLPythonParser.BOOLEAN_ - 87)) | (1 << (TypeQLPythonParser.STRING_ - 87)) | (1 << (TypeQLPythonParser.LONG_ - 87)) | (1 << (TypeQLPythonParser.DOUBLE_ - 87)) | (1 << (TypeQLPythonParser.DATE_ - 87)) | (1 << (TypeQLPythonParser.DATETIME_ - 87)) | (1 << (TypeQLPythonParser.VAR_ - 87)))) != 0)):
                    break

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

    class Variable_thing_anyContext(ParserRuleContext):

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

        def variable_thing(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Variable_thingContext,0)


        def variable_relation(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Variable_relationContext,0)


        def variable_attribute(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Variable_attributeContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_variable_thing_any

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

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

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




    def variable_thing_any(self):

        localctx = TypeQLPythonParser.Variable_thing_anyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 76, self.RULE_variable_thing_any)
        try:
            self.state = 425
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,25,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 422
                self.variable_thing()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 423
                self.variable_relation()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 424
                self.variable_attribute()
                pass


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

    class Variable_thingContext(ParserRuleContext):

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

        def VAR_(self):
            return self.getToken(TypeQLPythonParser.VAR_, 0)

        def ISA_(self):
            return self.getToken(TypeQLPythonParser.ISA_, 0)

        def type_(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Type_Context,0)


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


        def IID(self):
            return self.getToken(TypeQLPythonParser.IID, 0)

        def IID_(self):
            return self.getToken(TypeQLPythonParser.IID_, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_variable_thing

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

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

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




    def variable_thing(self):

        localctx = TypeQLPythonParser.Variable_thingContext(self, self._ctx, self.state)
        self.enterRule(localctx, 78, self.RULE_variable_thing)
        self._la = 0 # Token type
        try:
            self.state = 443
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,28,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 427
                self.match(TypeQLPythonParser.VAR_)
                self.state = 428
                self.match(TypeQLPythonParser.ISA_)
                self.state = 429
                self.type_()
                self.state = 432
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==TypeQLPythonParser.T__1:
                    self.state = 430
                    self.match(TypeQLPythonParser.T__1)
                    self.state = 431
                    self.attributes()


                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 434
                self.match(TypeQLPythonParser.VAR_)
                self.state = 435
                self.match(TypeQLPythonParser.IID)
                self.state = 436
                self.match(TypeQLPythonParser.IID_)
                self.state = 439
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==TypeQLPythonParser.T__1:
                    self.state = 437
                    self.match(TypeQLPythonParser.T__1)
                    self.state = 438
                    self.attributes()


                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 441
                self.match(TypeQLPythonParser.VAR_)
                self.state = 442
                self.attributes()
                pass


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

    class Variable_relationContext(ParserRuleContext):

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

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


        def ISA_(self):
            return self.getToken(TypeQLPythonParser.ISA_, 0)

        def type_(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Type_Context,0)


        def VAR_(self):
            return self.getToken(TypeQLPythonParser.VAR_, 0)

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


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_variable_relation

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

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

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




    def variable_relation(self):

        localctx = TypeQLPythonParser.Variable_relationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 80, self.RULE_variable_relation)
        self._la = 0 # Token type
        try:
            self.state = 462
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,33,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 446
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==TypeQLPythonParser.VAR_:
                    self.state = 445
                    self.match(TypeQLPythonParser.VAR_)


                self.state = 448
                self.relation()
                self.state = 449
                self.match(TypeQLPythonParser.ISA_)
                self.state = 450
                self.type_()
                self.state = 453
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==TypeQLPythonParser.T__1:
                    self.state = 451
                    self.match(TypeQLPythonParser.T__1)
                    self.state = 452
                    self.attributes()


                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 456
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==TypeQLPythonParser.VAR_:
                    self.state = 455
                    self.match(TypeQLPythonParser.VAR_)


                self.state = 458
                self.relation()
                self.state = 460
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==TypeQLPythonParser.HAS:
                    self.state = 459
                    self.attributes()


                pass


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

    class Variable_attributeContext(ParserRuleContext):

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

        def predicate(self):
            return self.getTypedRuleContext(TypeQLPythonParser.PredicateContext,0)


        def ISA_(self):
            return self.getToken(TypeQLPythonParser.ISA_, 0)

        def type_(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Type_Context,0)


        def VAR_(self):
            return self.getToken(TypeQLPythonParser.VAR_, 0)

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


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_variable_attribute

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

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

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




    def variable_attribute(self):

        localctx = TypeQLPythonParser.Variable_attributeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 82, self.RULE_variable_attribute)
        self._la = 0 # Token type
        try:
            self.state = 481
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,38,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 465
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==TypeQLPythonParser.VAR_:
                    self.state = 464
                    self.match(TypeQLPythonParser.VAR_)


                self.state = 467
                self.predicate()
                self.state = 468
                self.match(TypeQLPythonParser.ISA_)
                self.state = 469
                self.type_()
                self.state = 472
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==TypeQLPythonParser.T__1:
                    self.state = 470
                    self.match(TypeQLPythonParser.T__1)
                    self.state = 471
                    self.attributes()


                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 475
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==TypeQLPythonParser.VAR_:
                    self.state = 474
                    self.match(TypeQLPythonParser.VAR_)


                self.state = 477
                self.predicate()
                self.state = 479
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==TypeQLPythonParser.HAS:
                    self.state = 478
                    self.attributes()


                pass


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

    class RelationContext(ParserRuleContext):

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

        def role_player(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TypeQLPythonParser.Role_playerContext)
            else:
                return self.getTypedRuleContext(TypeQLPythonParser.Role_playerContext,i)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_relation

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

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

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




    def relation(self):

        localctx = TypeQLPythonParser.RelationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 84, self.RULE_relation)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 483
            self.match(TypeQLPythonParser.T__4)
            self.state = 484
            self.role_player()
            self.state = 489
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==TypeQLPythonParser.T__1:
                self.state = 485
                self.match(TypeQLPythonParser.T__1)
                self.state = 486
                self.role_player()
                self.state = 491
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 492
            self.match(TypeQLPythonParser.T__5)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Role_playerContext(ParserRuleContext):

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

        def type_(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Type_Context,0)


        def player(self):
            return self.getTypedRuleContext(TypeQLPythonParser.PlayerContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_role_player

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

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

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




    def role_player(self):

        localctx = TypeQLPythonParser.Role_playerContext(self, self._ctx, self.state)
        self.enterRule(localctx, 86, self.RULE_role_player)
        try:
            self.state = 499
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,40,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 494
                self.type_()
                self.state = 495
                self.match(TypeQLPythonParser.T__6)
                self.state = 496
                self.player()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 498
                self.player()
                pass


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

    class PlayerContext(ParserRuleContext):

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

        def VAR_(self):
            return self.getToken(TypeQLPythonParser.VAR_, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_player

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

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

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




    def player(self):

        localctx = TypeQLPythonParser.PlayerContext(self, self._ctx, self.state)
        self.enterRule(localctx, 88, self.RULE_player)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 501
            self.match(TypeQLPythonParser.VAR_)
        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):

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

        def attribute(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TypeQLPythonParser.AttributeContext)
            else:
                return self.getTypedRuleContext(TypeQLPythonParser.AttributeContext,i)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_attributes

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

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

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




    def attributes(self):

        localctx = TypeQLPythonParser.AttributesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 90, self.RULE_attributes)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 503
            self.attribute()
            self.state = 508
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==TypeQLPythonParser.T__1:
                self.state = 504
                self.match(TypeQLPythonParser.T__1)
                self.state = 505
                self.attribute()
                self.state = 510
                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 AttributeContext(ParserRuleContext):

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

        def HAS(self):
            return self.getToken(TypeQLPythonParser.HAS, 0)

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


        def VAR_(self):
            return self.getToken(TypeQLPythonParser.VAR_, 0)

        def predicate(self):
            return self.getTypedRuleContext(TypeQLPythonParser.PredicateContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_attribute

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

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

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




    def attribute(self):

        localctx = TypeQLPythonParser.AttributeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 92, self.RULE_attribute)
        try:
            self.state = 519
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,43,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 511
                self.match(TypeQLPythonParser.HAS)
                self.state = 512
                self.label()
                self.state = 515
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [TypeQLPythonParser.VAR_]:
                    self.state = 513
                    self.match(TypeQLPythonParser.VAR_)
                    pass
                elif token in [TypeQLPythonParser.EQ, TypeQLPythonParser.NEQ, TypeQLPythonParser.GT, TypeQLPythonParser.GTE, TypeQLPythonParser.LT, TypeQLPythonParser.LTE, TypeQLPythonParser.LIKE, TypeQLPythonParser.CONTAINS, TypeQLPythonParser.BOOLEAN_, TypeQLPythonParser.STRING_, TypeQLPythonParser.LONG_, TypeQLPythonParser.DOUBLE_, TypeQLPythonParser.DATE_, TypeQLPythonParser.DATETIME_]:
                    self.state = 514
                    self.predicate()
                    pass
                else:
                    raise NoViableAltException(self)

                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 517
                self.match(TypeQLPythonParser.HAS)
                self.state = 518
                self.match(TypeQLPythonParser.VAR_)
                pass


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

    class PredicateContext(ParserRuleContext):

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

        def value(self):
            return self.getTypedRuleContext(TypeQLPythonParser.ValueContext,0)


        def predicate_equality(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Predicate_equalityContext,0)


        def predicate_value(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Predicate_valueContext,0)


        def predicate_substring(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Predicate_substringContext,0)


        def STRING_(self):
            return self.getToken(TypeQLPythonParser.STRING_, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_predicate

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

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

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




    def predicate(self):

        localctx = TypeQLPythonParser.PredicateContext(self, self._ctx, self.state)
        self.enterRule(localctx, 94, self.RULE_predicate)
        try:
            self.state = 528
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [TypeQLPythonParser.BOOLEAN_, TypeQLPythonParser.STRING_, TypeQLPythonParser.LONG_, TypeQLPythonParser.DOUBLE_, TypeQLPythonParser.DATE_, TypeQLPythonParser.DATETIME_]:
                self.enterOuterAlt(localctx, 1)
                self.state = 521
                self.value()
                pass
            elif token in [TypeQLPythonParser.EQ, TypeQLPythonParser.NEQ, TypeQLPythonParser.GT, TypeQLPythonParser.GTE, TypeQLPythonParser.LT, TypeQLPythonParser.LTE]:
                self.enterOuterAlt(localctx, 2)
                self.state = 522
                self.predicate_equality()
                self.state = 523
                self.predicate_value()
                pass
            elif token in [TypeQLPythonParser.LIKE, TypeQLPythonParser.CONTAINS]:
                self.enterOuterAlt(localctx, 3)
                self.state = 525
                self.predicate_substring()
                self.state = 526
                self.match(TypeQLPythonParser.STRING_)
                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 Predicate_equalityContext(ParserRuleContext):

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

        def EQ(self):
            return self.getToken(TypeQLPythonParser.EQ, 0)

        def NEQ(self):
            return self.getToken(TypeQLPythonParser.NEQ, 0)

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

        def GTE(self):
            return self.getToken(TypeQLPythonParser.GTE, 0)

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

        def LTE(self):
            return self.getToken(TypeQLPythonParser.LTE, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_predicate_equality

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

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

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




    def predicate_equality(self):

        localctx = TypeQLPythonParser.Predicate_equalityContext(self, self._ctx, self.state)
        self.enterRule(localctx, 96, self.RULE_predicate_equality)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 530
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TypeQLPythonParser.EQ) | (1 << TypeQLPythonParser.NEQ) | (1 << TypeQLPythonParser.GT) | (1 << TypeQLPythonParser.GTE) | (1 << TypeQLPythonParser.LT) | (1 << TypeQLPythonParser.LTE))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Predicate_substringContext(ParserRuleContext):

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

        def CONTAINS(self):
            return self.getToken(TypeQLPythonParser.CONTAINS, 0)

        def LIKE(self):
            return self.getToken(TypeQLPythonParser.LIKE, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_predicate_substring

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

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

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




    def predicate_substring(self):

        localctx = TypeQLPythonParser.Predicate_substringContext(self, self._ctx, self.state)
        self.enterRule(localctx, 98, self.RULE_predicate_substring)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 532
            _la = self._input.LA(1)
            if not(_la==TypeQLPythonParser.LIKE or _la==TypeQLPythonParser.CONTAINS):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Predicate_valueContext(ParserRuleContext):

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

        def value(self):
            return self.getTypedRuleContext(TypeQLPythonParser.ValueContext,0)


        def VAR_(self):
            return self.getToken(TypeQLPythonParser.VAR_, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_predicate_value

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

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

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




    def predicate_value(self):

        localctx = TypeQLPythonParser.Predicate_valueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 100, self.RULE_predicate_value)
        try:
            self.state = 536
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [TypeQLPythonParser.BOOLEAN_, TypeQLPythonParser.STRING_, TypeQLPythonParser.LONG_, TypeQLPythonParser.DOUBLE_, TypeQLPythonParser.DATE_, TypeQLPythonParser.DATETIME_]:
                self.enterOuterAlt(localctx, 1)
                self.state = 534
                self.value()
                pass
            elif token in [TypeQLPythonParser.VAR_]:
                self.enterOuterAlt(localctx, 2)
                self.state = 535
                self.match(TypeQLPythonParser.VAR_)
                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 Schema_ruleContext(ParserRuleContext):

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

        def RULE(self):
            return self.getToken(TypeQLPythonParser.RULE, 0)

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


        def WHEN(self):
            return self.getToken(TypeQLPythonParser.WHEN, 0)

        def patterns(self):
            return self.getTypedRuleContext(TypeQLPythonParser.PatternsContext,0)


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

        def variable_thing_any(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Variable_thing_anyContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_schema_rule

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

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

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




    def schema_rule(self):

        localctx = TypeQLPythonParser.Schema_ruleContext(self, self._ctx, self.state)
        self.enterRule(localctx, 102, self.RULE_schema_rule)
        try:
            self.state = 553
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,46,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 538
                self.match(TypeQLPythonParser.RULE)
                self.state = 539
                self.label()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 540
                self.match(TypeQLPythonParser.RULE)
                self.state = 541
                self.label()
                self.state = 542
                self.match(TypeQLPythonParser.T__6)
                self.state = 543
                self.match(TypeQLPythonParser.WHEN)
                self.state = 544
                self.match(TypeQLPythonParser.T__2)
                self.state = 545
                self.patterns()
                self.state = 546
                self.match(TypeQLPythonParser.T__3)
                self.state = 547
                self.match(TypeQLPythonParser.THEN)
                self.state = 548
                self.match(TypeQLPythonParser.T__2)
                self.state = 549
                self.variable_thing_any()
                self.state = 550
                self.match(TypeQLPythonParser.T__0)
                self.state = 551
                self.match(TypeQLPythonParser.T__3)
                pass


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

    class Compute_conditionsContext(ParserRuleContext):

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

        def conditions_count(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Conditions_countContext,0)


        def conditions_value(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Conditions_valueContext,0)


        def conditions_central(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Conditions_centralContext,0)


        def conditions_cluster(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Conditions_clusterContext,0)


        def conditions_path(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Conditions_pathContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_compute_conditions

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

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

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




    def compute_conditions(self):

        localctx = TypeQLPythonParser.Compute_conditionsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 104, self.RULE_compute_conditions)
        try:
            self.state = 570
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [TypeQLPythonParser.COUNT]:
                self.enterOuterAlt(localctx, 1)
                self.state = 555
                self.conditions_count()
                self.state = 556
                self.match(TypeQLPythonParser.T__0)
                pass
            elif token in [TypeQLPythonParser.MAX, TypeQLPythonParser.MIN, TypeQLPythonParser.MEAN, TypeQLPythonParser.MEDIAN, TypeQLPythonParser.STD, TypeQLPythonParser.SUM]:
                self.enterOuterAlt(localctx, 2)
                self.state = 558
                self.conditions_value()
                self.state = 559
                self.match(TypeQLPythonParser.T__0)
                pass
            elif token in [TypeQLPythonParser.CENTRALITY]:
                self.enterOuterAlt(localctx, 3)
                self.state = 561
                self.conditions_central()
                self.state = 562
                self.match(TypeQLPythonParser.T__0)
                pass
            elif token in [TypeQLPythonParser.CLUSTER]:
                self.enterOuterAlt(localctx, 4)
                self.state = 564
                self.conditions_cluster()
                self.state = 565
                self.match(TypeQLPythonParser.T__0)
                pass
            elif token in [TypeQLPythonParser.PATH]:
                self.enterOuterAlt(localctx, 5)
                self.state = 567
                self.conditions_path()
                self.state = 568
                self.match(TypeQLPythonParser.T__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 Compute_methodContext(ParserRuleContext):

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

        def MIN(self):
            return self.getToken(TypeQLPythonParser.MIN, 0)

        def MAX(self):
            return self.getToken(TypeQLPythonParser.MAX, 0)

        def MEDIAN(self):
            return self.getToken(TypeQLPythonParser.MEDIAN, 0)

        def MEAN(self):
            return self.getToken(TypeQLPythonParser.MEAN, 0)

        def STD(self):
            return self.getToken(TypeQLPythonParser.STD, 0)

        def SUM(self):
            return self.getToken(TypeQLPythonParser.SUM, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_compute_method

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

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

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




    def compute_method(self):

        localctx = TypeQLPythonParser.Compute_methodContext(self, self._ctx, self.state)
        self.enterRule(localctx, 106, self.RULE_compute_method)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 572
            _la = self._input.LA(1)
            if not(((((_la - 61)) & ~0x3f) == 0 and ((1 << (_la - 61)) & ((1 << (TypeQLPythonParser.MAX - 61)) | (1 << (TypeQLPythonParser.MIN - 61)) | (1 << (TypeQLPythonParser.MEAN - 61)) | (1 << (TypeQLPythonParser.MEDIAN - 61)) | (1 << (TypeQLPythonParser.STD - 61)) | (1 << (TypeQLPythonParser.SUM - 61)))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Conditions_countContext(ParserRuleContext):

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

        def COUNT(self):
            return self.getToken(TypeQLPythonParser.COUNT, 0)

        def input_count(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Input_countContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_conditions_count

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

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

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




    def conditions_count(self):

        localctx = TypeQLPythonParser.Conditions_countContext(self, self._ctx, self.state)
        self.enterRule(localctx, 108, self.RULE_conditions_count)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 574
            self.match(TypeQLPythonParser.COUNT)
            self.state = 576
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==TypeQLPythonParser.IN:
                self.state = 575
                self.input_count()


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

    class Conditions_valueContext(ParserRuleContext):

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

        def compute_method(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Compute_methodContext,0)


        def input_value(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TypeQLPythonParser.Input_valueContext)
            else:
                return self.getTypedRuleContext(TypeQLPythonParser.Input_valueContext,i)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_conditions_value

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

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

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




    def conditions_value(self):

        localctx = TypeQLPythonParser.Conditions_valueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 110, self.RULE_conditions_value)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 578
            self.compute_method()
            self.state = 579
            self.input_value()
            self.state = 584
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==TypeQLPythonParser.T__1:
                self.state = 580
                self.match(TypeQLPythonParser.T__1)
                self.state = 581
                self.input_value()
                self.state = 586
                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 Conditions_centralContext(ParserRuleContext):

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

        def CENTRALITY(self):
            return self.getToken(TypeQLPythonParser.CENTRALITY, 0)

        def input_central(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TypeQLPythonParser.Input_centralContext)
            else:
                return self.getTypedRuleContext(TypeQLPythonParser.Input_centralContext,i)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_conditions_central

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

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

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




    def conditions_central(self):

        localctx = TypeQLPythonParser.Conditions_centralContext(self, self._ctx, self.state)
        self.enterRule(localctx, 112, self.RULE_conditions_central)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 587
            self.match(TypeQLPythonParser.CENTRALITY)
            self.state = 588
            self.input_central()
            self.state = 593
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==TypeQLPythonParser.T__1:
                self.state = 589
                self.match(TypeQLPythonParser.T__1)
                self.state = 590
                self.input_central()
                self.state = 595
                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 Conditions_clusterContext(ParserRuleContext):

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

        def CLUSTER(self):
            return self.getToken(TypeQLPythonParser.CLUSTER, 0)

        def input_cluster(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TypeQLPythonParser.Input_clusterContext)
            else:
                return self.getTypedRuleContext(TypeQLPythonParser.Input_clusterContext,i)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_conditions_cluster

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

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

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




    def conditions_cluster(self):

        localctx = TypeQLPythonParser.Conditions_clusterContext(self, self._ctx, self.state)
        self.enterRule(localctx, 114, self.RULE_conditions_cluster)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 596
            self.match(TypeQLPythonParser.CLUSTER)
            self.state = 597
            self.input_cluster()
            self.state = 602
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==TypeQLPythonParser.T__1:
                self.state = 598
                self.match(TypeQLPythonParser.T__1)
                self.state = 599
                self.input_cluster()
                self.state = 604
                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 Conditions_pathContext(ParserRuleContext):

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

        def PATH(self):
            return self.getToken(TypeQLPythonParser.PATH, 0)

        def input_path(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TypeQLPythonParser.Input_pathContext)
            else:
                return self.getTypedRuleContext(TypeQLPythonParser.Input_pathContext,i)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_conditions_path

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

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

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




    def conditions_path(self):

        localctx = TypeQLPythonParser.Conditions_pathContext(self, self._ctx, self.state)
        self.enterRule(localctx, 116, self.RULE_conditions_path)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 605
            self.match(TypeQLPythonParser.PATH)
            self.state = 606
            self.input_path()
            self.state = 611
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==TypeQLPythonParser.T__1:
                self.state = 607
                self.match(TypeQLPythonParser.T__1)
                self.state = 608
                self.input_path()
                self.state = 613
                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 Input_countContext(ParserRuleContext):

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

        def compute_scope(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Compute_scopeContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_input_count

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

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

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




    def input_count(self):

        localctx = TypeQLPythonParser.Input_countContext(self, self._ctx, self.state)
        self.enterRule(localctx, 118, self.RULE_input_count)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 614
            self.compute_scope()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Input_valueContext(ParserRuleContext):

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

        def compute_scope(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Compute_scopeContext,0)


        def compute_target(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Compute_targetContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_input_value

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

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

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




    def input_value(self):

        localctx = TypeQLPythonParser.Input_valueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 120, self.RULE_input_value)
        try:
            self.state = 618
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [TypeQLPythonParser.IN]:
                self.enterOuterAlt(localctx, 1)
                self.state = 616
                self.compute_scope()
                pass
            elif token in [TypeQLPythonParser.OF]:
                self.enterOuterAlt(localctx, 2)
                self.state = 617
                self.compute_target()
                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 Input_centralContext(ParserRuleContext):

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

        def compute_scope(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Compute_scopeContext,0)


        def compute_target(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Compute_targetContext,0)


        def compute_config(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Compute_configContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_input_central

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

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

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




    def input_central(self):

        localctx = TypeQLPythonParser.Input_centralContext(self, self._ctx, self.state)
        self.enterRule(localctx, 122, self.RULE_input_central)
        try:
            self.state = 623
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [TypeQLPythonParser.IN]:
                self.enterOuterAlt(localctx, 1)
                self.state = 620
                self.compute_scope()
                pass
            elif token in [TypeQLPythonParser.OF]:
                self.enterOuterAlt(localctx, 2)
                self.state = 621
                self.compute_target()
                pass
            elif token in [TypeQLPythonParser.USING, TypeQLPythonParser.WHERE]:
                self.enterOuterAlt(localctx, 3)
                self.state = 622
                self.compute_config()
                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 Input_clusterContext(ParserRuleContext):

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

        def compute_scope(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Compute_scopeContext,0)


        def compute_config(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Compute_configContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_input_cluster

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

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

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




    def input_cluster(self):

        localctx = TypeQLPythonParser.Input_clusterContext(self, self._ctx, self.state)
        self.enterRule(localctx, 124, self.RULE_input_cluster)
        try:
            self.state = 627
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [TypeQLPythonParser.IN]:
                self.enterOuterAlt(localctx, 1)
                self.state = 625
                self.compute_scope()
                pass
            elif token in [TypeQLPythonParser.USING, TypeQLPythonParser.WHERE]:
                self.enterOuterAlt(localctx, 2)
                self.state = 626
                self.compute_config()
                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 Input_pathContext(ParserRuleContext):

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

        def compute_scope(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Compute_scopeContext,0)


        def compute_direction(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Compute_directionContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_input_path

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

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

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




    def input_path(self):

        localctx = TypeQLPythonParser.Input_pathContext(self, self._ctx, self.state)
        self.enterRule(localctx, 126, self.RULE_input_path)
        try:
            self.state = 631
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [TypeQLPythonParser.IN]:
                self.enterOuterAlt(localctx, 1)
                self.state = 629
                self.compute_scope()
                pass
            elif token in [TypeQLPythonParser.FROM, TypeQLPythonParser.TO]:
                self.enterOuterAlt(localctx, 2)
                self.state = 630
                self.compute_direction()
                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 Compute_directionContext(ParserRuleContext):

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

        def FROM(self):
            return self.getToken(TypeQLPythonParser.FROM, 0)

        def IID_(self):
            return self.getToken(TypeQLPythonParser.IID_, 0)

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

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_compute_direction

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

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

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




    def compute_direction(self):

        localctx = TypeQLPythonParser.Compute_directionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 128, self.RULE_compute_direction)
        try:
            self.state = 637
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [TypeQLPythonParser.FROM]:
                self.enterOuterAlt(localctx, 1)
                self.state = 633
                self.match(TypeQLPythonParser.FROM)
                self.state = 634
                self.match(TypeQLPythonParser.IID_)
                pass
            elif token in [TypeQLPythonParser.TO]:
                self.enterOuterAlt(localctx, 2)
                self.state = 635
                self.match(TypeQLPythonParser.TO)
                self.state = 636
                self.match(TypeQLPythonParser.IID_)
                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 Compute_targetContext(ParserRuleContext):

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

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

        def labels(self):
            return self.getTypedRuleContext(TypeQLPythonParser.LabelsContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_compute_target

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

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

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




    def compute_target(self):

        localctx = TypeQLPythonParser.Compute_targetContext(self, self._ctx, self.state)
        self.enterRule(localctx, 130, self.RULE_compute_target)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 639
            self.match(TypeQLPythonParser.OF)
            self.state = 640
            self.labels()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Compute_scopeContext(ParserRuleContext):

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

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

        def labels(self):
            return self.getTypedRuleContext(TypeQLPythonParser.LabelsContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_compute_scope

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

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

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




    def compute_scope(self):

        localctx = TypeQLPythonParser.Compute_scopeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 132, self.RULE_compute_scope)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 642
            self.match(TypeQLPythonParser.IN)
            self.state = 643
            self.labels()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Compute_configContext(ParserRuleContext):

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

        def USING(self):
            return self.getToken(TypeQLPythonParser.USING, 0)

        def compute_algorithm(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Compute_algorithmContext,0)


        def WHERE(self):
            return self.getToken(TypeQLPythonParser.WHERE, 0)

        def compute_args(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Compute_argsContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_compute_config

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

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

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




    def compute_config(self):

        localctx = TypeQLPythonParser.Compute_configContext(self, self._ctx, self.state)
        self.enterRule(localctx, 134, self.RULE_compute_config)
        try:
            self.state = 649
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [TypeQLPythonParser.USING]:
                self.enterOuterAlt(localctx, 1)
                self.state = 645
                self.match(TypeQLPythonParser.USING)
                self.state = 646
                self.compute_algorithm()
                pass
            elif token in [TypeQLPythonParser.WHERE]:
                self.enterOuterAlt(localctx, 2)
                self.state = 647
                self.match(TypeQLPythonParser.WHERE)
                self.state = 648
                self.compute_args()
                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 Compute_algorithmContext(ParserRuleContext):

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

        def DEGREE(self):
            return self.getToken(TypeQLPythonParser.DEGREE, 0)

        def K_CORE(self):
            return self.getToken(TypeQLPythonParser.K_CORE, 0)

        def CONNECTED_COMPONENT(self):
            return self.getToken(TypeQLPythonParser.CONNECTED_COMPONENT, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_compute_algorithm

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

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

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




    def compute_algorithm(self):

        localctx = TypeQLPythonParser.Compute_algorithmContext(self, self._ctx, self.state)
        self.enterRule(localctx, 136, self.RULE_compute_algorithm)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 651
            _la = self._input.LA(1)
            if not(((((_la - 70)) & ~0x3f) == 0 and ((1 << (_la - 70)) & ((1 << (TypeQLPythonParser.DEGREE - 70)) | (1 << (TypeQLPythonParser.K_CORE - 70)) | (1 << (TypeQLPythonParser.CONNECTED_COMPONENT - 70)))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Compute_argsContext(ParserRuleContext):

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

        def compute_arg(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Compute_argContext,0)


        def compute_args_array(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Compute_args_arrayContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_compute_args

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

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

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




    def compute_args(self):

        localctx = TypeQLPythonParser.Compute_argsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 138, self.RULE_compute_args)
        try:
            self.state = 655
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [TypeQLPythonParser.CONTAINS, TypeQLPythonParser.MIN_K, TypeQLPythonParser.K, TypeQLPythonParser.SIZE]:
                self.enterOuterAlt(localctx, 1)
                self.state = 653
                self.compute_arg()
                pass
            elif token in [TypeQLPythonParser.T__7]:
                self.enterOuterAlt(localctx, 2)
                self.state = 654
                self.compute_args_array()
                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 Compute_args_arrayContext(ParserRuleContext):

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

        def compute_arg(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(TypeQLPythonParser.Compute_argContext)
            else:
                return self.getTypedRuleContext(TypeQLPythonParser.Compute_argContext,i)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_compute_args_array

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

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

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




    def compute_args_array(self):

        localctx = TypeQLPythonParser.Compute_args_arrayContext(self, self._ctx, self.state)
        self.enterRule(localctx, 140, self.RULE_compute_args_array)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 657
            self.match(TypeQLPythonParser.T__7)
            self.state = 658
            self.compute_arg()
            self.state = 663
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==TypeQLPythonParser.T__1:
                self.state = 659
                self.match(TypeQLPythonParser.T__1)
                self.state = 660
                self.compute_arg()
                self.state = 665
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 666
            self.match(TypeQLPythonParser.T__8)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Compute_argContext(ParserRuleContext):

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

        def MIN_K(self):
            return self.getToken(TypeQLPythonParser.MIN_K, 0)

        def EQ(self):
            return self.getToken(TypeQLPythonParser.EQ, 0)

        def LONG_(self):
            return self.getToken(TypeQLPythonParser.LONG_, 0)

        def K(self):
            return self.getToken(TypeQLPythonParser.K, 0)

        def SIZE(self):
            return self.getToken(TypeQLPythonParser.SIZE, 0)

        def CONTAINS(self):
            return self.getToken(TypeQLPythonParser.CONTAINS, 0)

        def IID_(self):
            return self.getToken(TypeQLPythonParser.IID_, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_compute_arg

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

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

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




    def compute_arg(self):

        localctx = TypeQLPythonParser.Compute_argContext(self, self._ctx, self.state)
        self.enterRule(localctx, 142, self.RULE_compute_arg)
        try:
            self.state = 680
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [TypeQLPythonParser.MIN_K]:
                self.enterOuterAlt(localctx, 1)
                self.state = 668
                self.match(TypeQLPythonParser.MIN_K)
                self.state = 669
                self.match(TypeQLPythonParser.EQ)
                self.state = 670
                self.match(TypeQLPythonParser.LONG_)
                pass
            elif token in [TypeQLPythonParser.K]:
                self.enterOuterAlt(localctx, 2)
                self.state = 671
                self.match(TypeQLPythonParser.K)
                self.state = 672
                self.match(TypeQLPythonParser.EQ)
                self.state = 673
                self.match(TypeQLPythonParser.LONG_)
                pass
            elif token in [TypeQLPythonParser.SIZE]:
                self.enterOuterAlt(localctx, 3)
                self.state = 674
                self.match(TypeQLPythonParser.SIZE)
                self.state = 675
                self.match(TypeQLPythonParser.EQ)
                self.state = 676
                self.match(TypeQLPythonParser.LONG_)
                pass
            elif token in [TypeQLPythonParser.CONTAINS]:
                self.enterOuterAlt(localctx, 4)
                self.state = 677
                self.match(TypeQLPythonParser.CONTAINS)
                self.state = 678
                self.match(TypeQLPythonParser.EQ)
                self.state = 679
                self.match(TypeQLPythonParser.IID_)
                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 Type_anyContext(ParserRuleContext):

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

        def type_scoped(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Type_scopedContext,0)


        def type_(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Type_Context,0)


        def VAR_(self):
            return self.getToken(TypeQLPythonParser.VAR_, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_type_any

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

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

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




    def type_any(self):

        localctx = TypeQLPythonParser.Type_anyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 144, self.RULE_type_any)
        try:
            self.state = 685
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,62,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 682
                self.type_scoped()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 683
                self.type_()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 684
                self.match(TypeQLPythonParser.VAR_)
                pass


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

    class Type_scopedContext(ParserRuleContext):

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

        def label_scoped(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Label_scopedContext,0)


        def VAR_(self):
            return self.getToken(TypeQLPythonParser.VAR_, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_type_scoped

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

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

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




    def type_scoped(self):

        localctx = TypeQLPythonParser.Type_scopedContext(self, self._ctx, self.state)
        self.enterRule(localctx, 146, self.RULE_type_scoped)
        try:
            self.state = 689
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [TypeQLPythonParser.LABEL_SCOPED_]:
                self.enterOuterAlt(localctx, 1)
                self.state = 687
                self.label_scoped()
                pass
            elif token in [TypeQLPythonParser.VAR_]:
                self.enterOuterAlt(localctx, 2)
                self.state = 688
                self.match(TypeQLPythonParser.VAR_)
                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 Type_Context(ParserRuleContext):

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

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


        def VAR_(self):
            return self.getToken(TypeQLPythonParser.VAR_, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_type_

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

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

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




    def type_(self):

        localctx = TypeQLPythonParser.Type_Context(self, self._ctx, self.state)
        self.enterRule(localctx, 148, self.RULE_type_)
        try:
            self.state = 693
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [TypeQLPythonParser.GET, TypeQLPythonParser.THING, TypeQLPythonParser.ENTITY, TypeQLPythonParser.ATTRIBUTE, TypeQLPythonParser.RELATION, TypeQLPythonParser.ROLE, TypeQLPythonParser.RULE, TypeQLPythonParser.OFFSET, TypeQLPythonParser.LIMIT, TypeQLPythonParser.SORT, TypeQLPythonParser.VALUE, TypeQLPythonParser.CONTAINS, TypeQLPythonParser.GROUP, TypeQLPythonParser.COUNT, TypeQLPythonParser.MAX, TypeQLPythonParser.MIN, TypeQLPythonParser.MEAN, TypeQLPythonParser.MEDIAN, TypeQLPythonParser.STD, TypeQLPythonParser.SUM, TypeQLPythonParser.CLUSTER, TypeQLPythonParser.PATH, TypeQLPythonParser.DEGREE, TypeQLPythonParser.K_CORE, TypeQLPythonParser.CONNECTED_COMPONENT, TypeQLPythonParser.FROM, TypeQLPythonParser.TO, TypeQLPythonParser.OF, TypeQLPythonParser.IN, TypeQLPythonParser.WHERE, TypeQLPythonParser.MIN_K, TypeQLPythonParser.K, TypeQLPythonParser.SIZE, TypeQLPythonParser.LABEL_]:
                self.enterOuterAlt(localctx, 1)
                self.state = 691
                self.label()
                pass
            elif token in [TypeQLPythonParser.VAR_]:
                self.enterOuterAlt(localctx, 2)
                self.state = 692
                self.match(TypeQLPythonParser.VAR_)
                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 Label_anyContext(ParserRuleContext):

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

        def label_scoped(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Label_scopedContext,0)


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


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_label_any

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

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

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




    def label_any(self):

        localctx = TypeQLPythonParser.Label_anyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 150, self.RULE_label_any)
        try:
            self.state = 697
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [TypeQLPythonParser.LABEL_SCOPED_]:
                self.enterOuterAlt(localctx, 1)
                self.state = 695
                self.label_scoped()
                pass
            elif token in [TypeQLPythonParser.GET, TypeQLPythonParser.THING, TypeQLPythonParser.ENTITY, TypeQLPythonParser.ATTRIBUTE, TypeQLPythonParser.RELATION, TypeQLPythonParser.ROLE, TypeQLPythonParser.RULE, TypeQLPythonParser.OFFSET, TypeQLPythonParser.LIMIT, TypeQLPythonParser.SORT, TypeQLPythonParser.VALUE, TypeQLPythonParser.CONTAINS, TypeQLPythonParser.GROUP, TypeQLPythonParser.COUNT, TypeQLPythonParser.MAX, TypeQLPythonParser.MIN, TypeQLPythonParser.MEAN, TypeQLPythonParser.MEDIAN, TypeQLPythonParser.STD, TypeQLPythonParser.SUM, TypeQLPythonParser.CLUSTER, TypeQLPythonParser.PATH, TypeQLPythonParser.DEGREE, TypeQLPythonParser.K_CORE, TypeQLPythonParser.CONNECTED_COMPONENT, TypeQLPythonParser.FROM, TypeQLPythonParser.TO, TypeQLPythonParser.OF, TypeQLPythonParser.IN, TypeQLPythonParser.WHERE, TypeQLPythonParser.MIN_K, TypeQLPythonParser.K, TypeQLPythonParser.SIZE, TypeQLPythonParser.LABEL_]:
                self.enterOuterAlt(localctx, 2)
                self.state = 696
                self.label()
                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 Label_scopedContext(ParserRuleContext):

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

        def LABEL_SCOPED_(self):
            return self.getToken(TypeQLPythonParser.LABEL_SCOPED_, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_label_scoped

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

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

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




    def label_scoped(self):

        localctx = TypeQLPythonParser.Label_scopedContext(self, self._ctx, self.state)
        self.enterRule(localctx, 152, self.RULE_label_scoped)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 699
            self.match(TypeQLPythonParser.LABEL_SCOPED_)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class LabelContext(ParserRuleContext):

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

        def LABEL_(self):
            return self.getToken(TypeQLPythonParser.LABEL_, 0)

        def schema_native(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Schema_nativeContext,0)


        def type_native(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Type_nativeContext,0)


        def unreserved(self):
            return self.getTypedRuleContext(TypeQLPythonParser.UnreservedContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_label

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

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

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




    def label(self):

        localctx = TypeQLPythonParser.LabelContext(self, self._ctx, self.state)
        self.enterRule(localctx, 154, self.RULE_label)
        try:
            self.state = 705
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [TypeQLPythonParser.LABEL_]:
                self.enterOuterAlt(localctx, 1)
                self.state = 701
                self.match(TypeQLPythonParser.LABEL_)
                pass
            elif token in [TypeQLPythonParser.RULE]:
                self.enterOuterAlt(localctx, 2)
                self.state = 702
                self.schema_native()
                pass
            elif token in [TypeQLPythonParser.THING, TypeQLPythonParser.ENTITY, TypeQLPythonParser.ATTRIBUTE, TypeQLPythonParser.RELATION, TypeQLPythonParser.ROLE]:
                self.enterOuterAlt(localctx, 3)
                self.state = 703
                self.type_native()
                pass
            elif token in [TypeQLPythonParser.GET, TypeQLPythonParser.OFFSET, TypeQLPythonParser.LIMIT, TypeQLPythonParser.SORT, TypeQLPythonParser.VALUE, TypeQLPythonParser.CONTAINS, TypeQLPythonParser.GROUP, TypeQLPythonParser.COUNT, TypeQLPythonParser.MAX, TypeQLPythonParser.MIN, TypeQLPythonParser.MEAN, TypeQLPythonParser.MEDIAN, TypeQLPythonParser.STD, TypeQLPythonParser.SUM, TypeQLPythonParser.CLUSTER, TypeQLPythonParser.PATH, TypeQLPythonParser.DEGREE, TypeQLPythonParser.K_CORE, TypeQLPythonParser.CONNECTED_COMPONENT, TypeQLPythonParser.FROM, TypeQLPythonParser.TO, TypeQLPythonParser.OF, TypeQLPythonParser.IN, TypeQLPythonParser.WHERE, TypeQLPythonParser.MIN_K, TypeQLPythonParser.K, TypeQLPythonParser.SIZE]:
                self.enterOuterAlt(localctx, 4)
                self.state = 704
                self.unreserved()
                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 LabelsContext(ParserRuleContext):

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

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


        def label_array(self):
            return self.getTypedRuleContext(TypeQLPythonParser.Label_arrayContext,0)


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_labels

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

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

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




    def labels(self):

        localctx = TypeQLPythonParser.LabelsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 156, self.RULE_labels)
        try:
            self.state = 709
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [TypeQLPythonParser.GET, TypeQLPythonParser.THING, TypeQLPythonParser.ENTITY, TypeQLPythonParser.ATTRIBUTE, TypeQLPythonParser.RELATION, TypeQLPythonParser.ROLE, TypeQLPythonParser.RULE, TypeQLPythonParser.OFFSET, TypeQLPythonParser.LIMIT, TypeQLPythonParser.SORT, TypeQLPythonParser.VALUE, TypeQLPythonParser.CONTAINS, TypeQLPythonParser.GROUP, TypeQLPythonParser.COUNT, TypeQLPythonParser.MAX, TypeQLPythonParser.MIN, TypeQLPythonParser.MEAN, TypeQLPythonParser.MEDIAN, TypeQLPythonParser.STD, TypeQLPythonParser.SUM, TypeQLPythonParser.CLUSTER, TypeQLPythonParser.PATH, TypeQLPythonParser.DEGREE, TypeQLPythonParser.K_CORE, TypeQLPythonParser.CONNECTED_COMPONENT, TypeQLPythonParser.FROM, TypeQLPythonParser.TO, TypeQLPythonParser.OF, TypeQLPythonParser.IN, TypeQLPythonParser.WHERE, TypeQLPythonParser.MIN_K, TypeQLPythonParser.K, TypeQLPythonParser.SIZE, TypeQLPythonParser.LABEL_]:
                self.enterOuterAlt(localctx, 1)
                self.state = 707
                self.label()
                pass
            elif token in [TypeQLPythonParser.T__7]:
                self.enterOuterAlt(localctx, 2)
                self.state = 708
                self.label_array()
                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 Label_arrayContext(ParserRuleContext):

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

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


        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_label_array

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

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

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




    def label_array(self):

        localctx = TypeQLPythonParser.Label_arrayContext(self, self._ctx, self.state)
        self.enterRule(localctx, 158, self.RULE_label_array)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 711
            self.match(TypeQLPythonParser.T__7)
            self.state = 712
            self.label()
            self.state = 717
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==TypeQLPythonParser.T__1:
                self.state = 713
                self.match(TypeQLPythonParser.T__1)
                self.state = 714
                self.label()
                self.state = 719
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 720
            self.match(TypeQLPythonParser.T__8)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Schema_nativeContext(ParserRuleContext):

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

        def RULE(self):
            return self.getToken(TypeQLPythonParser.RULE, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_schema_native

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

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

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




    def schema_native(self):

        localctx = TypeQLPythonParser.Schema_nativeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 160, self.RULE_schema_native)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 722
            self.match(TypeQLPythonParser.RULE)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Type_nativeContext(ParserRuleContext):

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

        def THING(self):
            return self.getToken(TypeQLPythonParser.THING, 0)

        def ENTITY(self):
            return self.getToken(TypeQLPythonParser.ENTITY, 0)

        def ATTRIBUTE(self):
            return self.getToken(TypeQLPythonParser.ATTRIBUTE, 0)

        def RELATION(self):
            return self.getToken(TypeQLPythonParser.RELATION, 0)

        def ROLE(self):
            return self.getToken(TypeQLPythonParser.ROLE, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_type_native

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

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

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




    def type_native(self):

        localctx = TypeQLPythonParser.Type_nativeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 162, self.RULE_type_native)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 724
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TypeQLPythonParser.THING) | (1 << TypeQLPythonParser.ENTITY) | (1 << TypeQLPythonParser.ATTRIBUTE) | (1 << TypeQLPythonParser.RELATION) | (1 << TypeQLPythonParser.ROLE))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class Value_typeContext(ParserRuleContext):

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

        def LONG(self):
            return self.getToken(TypeQLPythonParser.LONG, 0)

        def DOUBLE(self):
            return self.getToken(TypeQLPythonParser.DOUBLE, 0)

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

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

        def DATETIME(self):
            return self.getToken(TypeQLPythonParser.DATETIME, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_value_type

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

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

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




    def value_type(self):

        localctx = TypeQLPythonParser.Value_typeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 164, self.RULE_value_type)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 726
            _la = self._input.LA(1)
            if not(((((_la - 82)) & ~0x3f) == 0 and ((1 << (_la - 82)) & ((1 << (TypeQLPythonParser.LONG - 82)) | (1 << (TypeQLPythonParser.DOUBLE - 82)) | (1 << (TypeQLPythonParser.STRING - 82)) | (1 << (TypeQLPythonParser.BOOLEAN - 82)) | (1 << (TypeQLPythonParser.DATETIME - 82)))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class ValueContext(ParserRuleContext):

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

        def STRING_(self):
            return self.getToken(TypeQLPythonParser.STRING_, 0)

        def LONG_(self):
            return self.getToken(TypeQLPythonParser.LONG_, 0)

        def DOUBLE_(self):
            return self.getToken(TypeQLPythonParser.DOUBLE_, 0)

        def BOOLEAN_(self):
            return self.getToken(TypeQLPythonParser.BOOLEAN_, 0)

        def DATE_(self):
            return self.getToken(TypeQLPythonParser.DATE_, 0)

        def DATETIME_(self):
            return self.getToken(TypeQLPythonParser.DATETIME_, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_value

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

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

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




    def value(self):

        localctx = TypeQLPythonParser.ValueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 166, self.RULE_value)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 728
            _la = self._input.LA(1)
            if not(((((_la - 87)) & ~0x3f) == 0 and ((1 << (_la - 87)) & ((1 << (TypeQLPythonParser.BOOLEAN_ - 87)) | (1 << (TypeQLPythonParser.STRING_ - 87)) | (1 << (TypeQLPythonParser.LONG_ - 87)) | (1 << (TypeQLPythonParser.DOUBLE_ - 87)) | (1 << (TypeQLPythonParser.DATE_ - 87)) | (1 << (TypeQLPythonParser.DATETIME_ - 87)))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class RegexContext(ParserRuleContext):

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

        def STRING_(self):
            return self.getToken(TypeQLPythonParser.STRING_, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_regex

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

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

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




    def regex(self):

        localctx = TypeQLPythonParser.RegexContext(self, self._ctx, self.state)
        self.enterRule(localctx, 168, self.RULE_regex)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 730
            self.match(TypeQLPythonParser.STRING_)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx

    class UnreservedContext(ParserRuleContext):

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

        def VALUE(self):
            return self.getToken(TypeQLPythonParser.VALUE, 0)

        def MIN(self):
            return self.getToken(TypeQLPythonParser.MIN, 0)

        def MAX(self):
            return self.getToken(TypeQLPythonParser.MAX, 0)

        def MEDIAN(self):
            return self.getToken(TypeQLPythonParser.MEDIAN, 0)

        def MEAN(self):
            return self.getToken(TypeQLPythonParser.MEAN, 0)

        def STD(self):
            return self.getToken(TypeQLPythonParser.STD, 0)

        def SUM(self):
            return self.getToken(TypeQLPythonParser.SUM, 0)

        def COUNT(self):
            return self.getToken(TypeQLPythonParser.COUNT, 0)

        def GET(self):
            return self.getToken(TypeQLPythonParser.GET, 0)

        def SORT(self):
            return self.getToken(TypeQLPythonParser.SORT, 0)

        def LIMIT(self):
            return self.getToken(TypeQLPythonParser.LIMIT, 0)

        def OFFSET(self):
            return self.getToken(TypeQLPythonParser.OFFSET, 0)

        def GROUP(self):
            return self.getToken(TypeQLPythonParser.GROUP, 0)

        def PATH(self):
            return self.getToken(TypeQLPythonParser.PATH, 0)

        def CLUSTER(self):
            return self.getToken(TypeQLPythonParser.CLUSTER, 0)

        def FROM(self):
            return self.getToken(TypeQLPythonParser.FROM, 0)

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

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

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

        def DEGREE(self):
            return self.getToken(TypeQLPythonParser.DEGREE, 0)

        def K_CORE(self):
            return self.getToken(TypeQLPythonParser.K_CORE, 0)

        def CONNECTED_COMPONENT(self):
            return self.getToken(TypeQLPythonParser.CONNECTED_COMPONENT, 0)

        def MIN_K(self):
            return self.getToken(TypeQLPythonParser.MIN_K, 0)

        def K(self):
            return self.getToken(TypeQLPythonParser.K, 0)

        def CONTAINS(self):
            return self.getToken(TypeQLPythonParser.CONTAINS, 0)

        def SIZE(self):
            return self.getToken(TypeQLPythonParser.SIZE, 0)

        def WHERE(self):
            return self.getToken(TypeQLPythonParser.WHERE, 0)

        def getRuleIndex(self):
            return TypeQLPythonParser.RULE_unreserved

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

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

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




    def unreserved(self):

        localctx = TypeQLPythonParser.UnreservedContext(self, self._ctx, self.state)
        self.enterRule(localctx, 170, self.RULE_unreserved)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 732
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << TypeQLPythonParser.GET) | (1 << TypeQLPythonParser.OFFSET) | (1 << TypeQLPythonParser.LIMIT) | (1 << TypeQLPythonParser.SORT) | (1 << TypeQLPythonParser.VALUE) | (1 << TypeQLPythonParser.CONTAINS) | (1 << TypeQLPythonParser.GROUP) | (1 << TypeQLPythonParser.COUNT) | (1 << TypeQLPythonParser.MAX) | (1 << TypeQLPythonParser.MIN) | (1 << TypeQLPythonParser.MEAN))) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & ((1 << (TypeQLPythonParser.MEDIAN - 64)) | (1 << (TypeQLPythonParser.STD - 64)) | (1 << (TypeQLPythonParser.SUM - 64)) | (1 << (TypeQLPythonParser.CLUSTER - 64)) | (1 << (TypeQLPythonParser.PATH - 64)) | (1 << (TypeQLPythonParser.DEGREE - 64)) | (1 << (TypeQLPythonParser.K_CORE - 64)) | (1 << (TypeQLPythonParser.CONNECTED_COMPONENT - 64)) | (1 << (TypeQLPythonParser.FROM - 64)) | (1 << (TypeQLPythonParser.TO - 64)) | (1 << (TypeQLPythonParser.OF - 64)) | (1 << (TypeQLPythonParser.IN - 64)) | (1 << (TypeQLPythonParser.WHERE - 64)) | (1 << (TypeQLPythonParser.MIN_K - 64)) | (1 << (TypeQLPythonParser.K - 64)) | (1 << (TypeQLPythonParser.SIZE - 64)))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx





