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


def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3[")
        buf.write("\u0286\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\3\2\3\2\3\2\3\2\3\2\5\2\u0096")
        buf.write("\n\2\3\2\3\2\3\3\5\3\u009b\n\3\3\3\7\3\u009e\n\3\f\3\16")
        buf.write("\3\u00a1\13\3\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\6\3\6\3\6")
        buf.write("\5\6\u00ad\n\6\3\6\7\6\u00b0\n\6\f\6\16\6\u00b3\13\6\3")
        buf.write("\6\3\6\3\6\3\7\5\7\u00b9\n\7\3\7\6\7\u00bc\n\7\r\7\16")
        buf.write("\7\u00bd\3\7\5\7\u00c1\n\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b")
        buf.write("\6\b\u00ca\n\b\r\b\16\b\u00cb\3\b\3\b\3\t\3\t\3\t\7\t")
        buf.write("\u00d3\n\t\f\t\16\t\u00d6\13\t\3\t\3\t\3\t\3\n\3\n\6\n")
        buf.write("\u00dd\n\n\r\n\16\n\u00de\3\n\5\n\u00e2\n\n\3\n\7\n\u00e5")
        buf.write("\n\n\f\n\16\n\u00e8\13\n\3\n\5\n\u00eb\n\n\3\n\3\n\3\13")
        buf.write("\3\13\7\13\u00f1\n\13\f\13\16\13\u00f4\13\13\3\13\3\13")
        buf.write("\3\f\3\f\3\f\5\f\u00fb\n\f\3\r\3\r\3\16\3\16\3\16\3\17")
        buf.write("\3\17\3\20\5\20\u0105\n\20\3\20\3\20\3\21\5\21\u010a\n")
        buf.write("\21\3\21\5\21\u010d\n\21\3\22\3\22\5\22\u0111\n\22\3\22")
        buf.write("\3\22\5\22\u0115\n\22\5\22\u0117\n\22\3\23\3\23\3\23\6")
        buf.write("\23\u011c\n\23\r\23\16\23\u011d\3\24\3\24\3\24\3\24\5")
        buf.write("\24\u0124\n\24\5\24\u0126\n\24\3\25\3\25\3\25\3\26\3\26")
        buf.write("\3\26\3\27\3\27\5\27\u0130\n\27\3\27\3\27\5\27\u0134\n")
        buf.write("\27\3\27\5\27\u0137\n\27\3\27\5\27\u013a\n\27\7\27\u013c")
        buf.write("\n\27\f\27\16\27\u013f\13\27\3\27\3\27\3\30\3\30\3\30")
        buf.write("\5\30\u0146\n\30\5\30\u0148\n\30\3\31\3\31\3\31\5\31\u014d")
        buf.write("\n\31\3\32\3\32\3\32\3\33\3\33\3\33\3\33\3\34\3\34\3\34")
        buf.write("\7\34\u0159\n\34\f\34\16\34\u015c\13\34\3\35\3\35\3\35")
        buf.write("\3\36\3\36\3\36\5\36\u0164\n\36\3\37\3\37\3\37\3 \3 \3")
        buf.write(" \3 \3 \7 \u016e\n \f \16 \u0171\13 \3 \3 \5 \u0175\n")
        buf.write(" \3!\3!\5!\u0179\n!\3!\3!\3\"\3\"\3\"\5\"\u0180\n\"\5")
        buf.write("\"\u0182\n\"\3#\3#\3#\3#\3#\3#\5#\u018a\n#\3$\3$\3$\3")
        buf.write("$\3$\3$\5$\u0192\n$\7$\u0194\n$\f$\16$\u0197\13$\3%\5")
        buf.write("%\u019a\n%\3&\3&\3&\7&\u019f\n&\f&\16&\u01a2\13&\3\'\3")
        buf.write("\'\3(\3(\5(\u01a8\n(\3)\3)\5)\u01ac\n)\3*\3*\3*\3*\3+")
        buf.write("\3+\6+\u01b4\n+\r+\16+\u01b5\3+\3+\3,\3,\5,\u01bc\n,\3")
        buf.write("-\3-\5-\u01c0\n-\3.\3.\5.\u01c4\n.\3/\3/\3\60\3\60\3\60")
        buf.write("\3\60\3\60\3\60\5\60\u01ce\n\60\3\61\3\61\3\62\3\62\3")
        buf.write("\62\7\62\u01d5\n\62\f\62\16\62\u01d8\13\62\3\63\3\63\3")
        buf.write("\63\7\63\u01dd\n\63\f\63\16\63\u01e0\13\63\3\64\3\64\3")
        buf.write("\65\3\65\3\65\3\65\3\65\3\65\3\65\3\65\3\65\3\65\3\65")
        buf.write("\3\65\3\65\5\65\u01f1\n\65\3\66\3\66\3\67\3\67\3\67\3")
        buf.write("\67\3\67\3\67\3\67\7\67\u01fc\n\67\f\67\16\67\u01ff\13")
        buf.write("\67\38\38\38\38\38\78\u0206\n8\f8\168\u0209\138\39\39")
        buf.write("\39\39\39\39\39\59\u0212\n9\3:\3:\3:\3:\3:\3:\3:\5:\u021b")
        buf.write("\n:\3;\3;\3;\3;\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3")
        buf.write("<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3")
        buf.write("<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3<\3")
        buf.write("<\3<\3<\3<\3<\3<\3<\5<\u0258\n<\3=\3=\3=\3=\3=\3=\3=\5")
        buf.write("=\u0261\n=\3=\3=\3>\3>\5>\u0267\n>\3?\3?\3?\3?\5?\u026d")
        buf.write("\n?\3@\3@\3@\5@\u0272\n@\3A\3A\3B\3B\3C\3C\3D\3D\3E\3")
        buf.write("E\3F\3F\5F\u0280\nF\3G\3G\3H\3H\3H\2\2I\2\4\6\b\n\f\16")
        buf.write("\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<>@BDF")
        buf.write("HJLNPRTVXZ\\^`bdfhjlnprtvxz|~\u0080\u0082\u0084\u0086")
        buf.write("\u0088\u008a\u008c\u008e\2\f\3\2\6\7\3\2\25\26\3\2CD\3")
        buf.write("\2FH\3\2IK\3\2LN\3\2=>\3\2PQ\3\2@A\4\2BBVV\2\u02a2\2\u0090")
        buf.write("\3\2\2\2\4\u009a\3\2\2\2\6\u00a2\3\2\2\2\b\u00a5\3\2\2")
        buf.write("\2\n\u00a9\3\2\2\2\f\u00b8\3\2\2\2\16\u00c2\3\2\2\2\20")
        buf.write("\u00cf\3\2\2\2\22\u00da\3\2\2\2\24\u00ee\3\2\2\2\26\u00f7")
        buf.write("\3\2\2\2\30\u00fc\3\2\2\2\32\u00fe\3\2\2\2\34\u0101\3")
        buf.write("\2\2\2\36\u0104\3\2\2\2 \u0109\3\2\2\2\"\u0116\3\2\2\2")
        buf.write("$\u0118\3\2\2\2&\u0125\3\2\2\2(\u0127\3\2\2\2*\u012a\3")
        buf.write("\2\2\2,\u012d\3\2\2\2.\u0142\3\2\2\2\60\u014c\3\2\2\2")
        buf.write("\62\u014e\3\2\2\2\64\u0151\3\2\2\2\66\u0155\3\2\2\28\u015d")
        buf.write("\3\2\2\2:\u0163\3\2\2\2<\u0165\3\2\2\2>\u0174\3\2\2\2")
        buf.write("@\u0176\3\2\2\2B\u017c\3\2\2\2D\u0189\3\2\2\2F\u018b\3")
        buf.write("\2\2\2H\u0199\3\2\2\2J\u019b\3\2\2\2L\u01a3\3\2\2\2N\u01a7")
        buf.write("\3\2\2\2P\u01ab\3\2\2\2R\u01ad\3\2\2\2T\u01b1\3\2\2\2")
        buf.write("V\u01bb\3\2\2\2X\u01bf\3\2\2\2Z\u01c3\3\2\2\2\\\u01c5")
        buf.write("\3\2\2\2^\u01cd\3\2\2\2`\u01cf\3\2\2\2b\u01d1\3\2\2\2")
        buf.write("d\u01d9\3\2\2\2f\u01e1\3\2\2\2h\u01e3\3\2\2\2j\u01f2\3")
        buf.write("\2\2\2l\u01f4\3\2\2\2n\u0200\3\2\2\2p\u0211\3\2\2\2r\u021a")
        buf.write("\3\2\2\2t\u021c\3\2\2\2v\u0257\3\2\2\2x\u0259\3\2\2\2")
        buf.write("z\u0264\3\2\2\2|\u0268\3\2\2\2~\u0271\3\2\2\2\u0080\u0273")
        buf.write("\3\2\2\2\u0082\u0275\3\2\2\2\u0084\u0277\3\2\2\2\u0086")
        buf.write("\u0279\3\2\2\2\u0088\u027b\3\2\2\2\u008a\u027f\3\2\2\2")
        buf.write("\u008c\u0281\3\2\2\2\u008e\u0283\3\2\2\2\u0090\u0095\5")
        buf.write("\4\3\2\u0091\u0096\5\n\6\2\u0092\u0096\5\20\t\2\u0093")
        buf.write("\u0096\5\22\n\2\u0094\u0096\5\24\13\2\u0095\u0091\3\2")
        buf.write("\2\2\u0095\u0092\3\2\2\2\u0095\u0093\3\2\2\2\u0095\u0094")
        buf.write("\3\2\2\2\u0096\u0097\3\2\2\2\u0097\u0098\7\2\2\3\u0098")
        buf.write("\3\3\2\2\2\u0099\u009b\5\6\4\2\u009a\u0099\3\2\2\2\u009a")
        buf.write("\u009b\3\2\2\2\u009b\u009f\3\2\2\2\u009c\u009e\5\b\5\2")
        buf.write("\u009d\u009c\3\2\2\2\u009e\u00a1\3\2\2\2\u009f\u009d\3")
        buf.write("\2\2\2\u009f\u00a0\3\2\2\2\u00a0\5\3\2\2\2\u00a1\u009f")
        buf.write("\3\2\2\2\u00a2\u00a3\7\3\2\2\u00a3\u00a4\7?\2\2\u00a4")
        buf.write("\7\3\2\2\2\u00a5\u00a6\7\4\2\2\u00a6\u00a7\7@\2\2\u00a7")
        buf.write("\u00a8\7?\2\2\u00a8\t\3\2\2\2\u00a9\u00ac\7\5\2\2\u00aa")
        buf.write("\u00ad\5\f\7\2\u00ab\u00ad\5\16\b\2\u00ac\u00aa\3\2\2")
        buf.write("\2\u00ac\u00ab\3\2\2\2\u00ad\u00b1\3\2\2\2\u00ae\u00b0")
        buf.write("\5\26\f\2\u00af\u00ae\3\2\2\2\u00b0\u00b3\3\2\2\2\u00b1")
        buf.write("\u00af\3\2\2\2\u00b1\u00b2\3\2\2\2\u00b2\u00b4\3\2\2\2")
        buf.write("\u00b3\u00b1\3\2\2\2\u00b4\u00b5\5\36\20\2\u00b5\u00b6")
        buf.write("\5 \21\2\u00b6\13\3\2\2\2\u00b7\u00b9\t\2\2\2\u00b8\u00b7")
        buf.write("\3\2\2\2\u00b8\u00b9\3\2\2\2\u00b9\u00c0\3\2\2\2\u00ba")
        buf.write("\u00bc\5\\/\2\u00bb\u00ba\3\2\2\2\u00bc\u00bd\3\2\2\2")
        buf.write("\u00bd\u00bb\3\2\2\2\u00bd\u00be\3\2\2\2\u00be\u00c1\3")
        buf.write("\2\2\2\u00bf\u00c1\7\b\2\2\u00c0\u00bb\3\2\2\2\u00c0\u00bf")
        buf.write("\3\2\2\2\u00c1\r\3\2\2\2\u00c2\u00c3\7\t\2\2\u00c3\u00c4")
        buf.write("\7\n\2\2\u00c4\u00c5\7\t\2\2\u00c5\u00c6\5\f\7\2\u00c6")
        buf.write("\u00c7\7\13\2\2\u00c7\u00c9\7\f\2\2\u00c8\u00ca\5\\/\2")
        buf.write("\u00c9\u00c8\3\2\2\2\u00ca\u00cb\3\2\2\2\u00cb\u00c9\3")
        buf.write("\2\2\2\u00cb\u00cc\3\2\2\2\u00cc\u00cd\3\2\2\2\u00cd\u00ce")
        buf.write("\7\13\2\2\u00ce\17\3\2\2\2\u00cf\u00d0\7\r\2\2\u00d0\u00d4")
        buf.write("\5@!\2\u00d1\u00d3\5\26\f\2\u00d2\u00d1\3\2\2\2\u00d3")
        buf.write("\u00d6\3\2\2\2\u00d4\u00d2\3\2\2\2\u00d4\u00d5\3\2\2\2")
        buf.write("\u00d5\u00d7\3\2\2\2\u00d6\u00d4\3\2\2\2\u00d7\u00d8\5")
        buf.write("\36\20\2\u00d8\u00d9\5 \21\2\u00d9\21\3\2\2\2\u00da\u00e1")
        buf.write("\7\16\2\2\u00db\u00dd\5Z.\2\u00dc\u00db\3\2\2\2\u00dd")
        buf.write("\u00de\3\2\2\2\u00de\u00dc\3\2\2\2\u00de\u00df\3\2\2\2")
        buf.write("\u00df\u00e2\3\2\2\2\u00e0\u00e2\7\b\2\2\u00e1\u00dc\3")
        buf.write("\2\2\2\u00e1\u00e0\3\2\2\2\u00e2\u00e6\3\2\2\2\u00e3\u00e5")
        buf.write("\5\26\f\2\u00e4\u00e3\3\2\2\2\u00e5\u00e8\3\2\2\2\u00e6")
        buf.write("\u00e4\3\2\2\2\u00e6\u00e7\3\2\2\2\u00e7\u00ea\3\2\2\2")
        buf.write("\u00e8\u00e6\3\2\2\2\u00e9\u00eb\5\36\20\2\u00ea\u00e9")
        buf.write("\3\2\2\2\u00ea\u00eb\3\2\2\2\u00eb\u00ec\3\2\2\2\u00ec")
        buf.write("\u00ed\5 \21\2\u00ed\23\3\2\2\2\u00ee\u00f2\7\17\2\2\u00ef")
        buf.write("\u00f1\5\26\f\2\u00f0\u00ef\3\2\2\2\u00f1\u00f4\3\2\2")
        buf.write("\2\u00f2\u00f0\3\2\2\2\u00f2\u00f3\3\2\2\2\u00f3\u00f5")
        buf.write("\3\2\2\2\u00f4\u00f2\3\2\2\2\u00f5\u00f6\5\36\20\2\u00f6")
        buf.write("\25\3\2\2\2\u00f7\u00fa\7\20\2\2\u00f8\u00fb\5\30\r\2")
        buf.write("\u00f9\u00fb\5\32\16\2\u00fa\u00f8\3\2\2\2\u00fa\u00f9")
        buf.write("\3\2\2\2\u00fb\27\3\2\2\2\u00fc\u00fd\5\34\17\2\u00fd")
        buf.write("\31\3\2\2\2\u00fe\u00ff\7\21\2\2\u00ff\u0100\5\34\17\2")
        buf.write("\u0100\33\3\2\2\2\u0101\u0102\5\u008aF\2\u0102\35\3\2")
        buf.write("\2\2\u0103\u0105\7\22\2\2\u0104\u0103\3\2\2\2\u0104\u0105")
        buf.write("\3\2\2\2\u0105\u0106\3\2\2\2\u0106\u0107\5,\27\2\u0107")
        buf.write("\37\3\2\2\2\u0108\u010a\5$\23\2\u0109\u0108\3\2\2\2\u0109")
        buf.write("\u010a\3\2\2\2\u010a\u010c\3\2\2\2\u010b\u010d\5\"\22")
        buf.write("\2\u010c\u010b\3\2\2\2\u010c\u010d\3\2\2\2\u010d!\3\2")
        buf.write("\2\2\u010e\u0110\5(\25\2\u010f\u0111\5*\26\2\u0110\u010f")
        buf.write("\3\2\2\2\u0110\u0111\3\2\2\2\u0111\u0117\3\2\2\2\u0112")
        buf.write("\u0114\5*\26\2\u0113\u0115\5(\25\2\u0114\u0113\3\2\2\2")
        buf.write("\u0114\u0115\3\2\2\2\u0115\u0117\3\2\2\2\u0116\u010e\3")
        buf.write("\2\2\2\u0116\u0112\3\2\2\2\u0117#\3\2\2\2\u0118\u0119")
        buf.write("\7\23\2\2\u0119\u011b\7\24\2\2\u011a\u011c\5&\24\2\u011b")
        buf.write("\u011a\3\2\2\2\u011c\u011d\3\2\2\2\u011d\u011b\3\2\2\2")
        buf.write("\u011d\u011e\3\2\2\2\u011e%\3\2\2\2\u011f\u0120\t\3\2")
        buf.write("\2\u0120\u0126\5t;\2\u0121\u0124\5:\36\2\u0122\u0124\5")
        buf.write("\\/\2\u0123\u0121\3\2\2\2\u0123\u0122\3\2\2\2\u0124\u0126")
        buf.write("\3\2\2\2\u0125\u011f\3\2\2\2\u0125\u0123\3\2\2\2\u0126")
        buf.write("\'\3\2\2\2\u0127\u0128\7\27\2\2\u0128\u0129\7F\2\2\u0129")
        buf.write(")\3\2\2\2\u012a\u012b\7\30\2\2\u012b\u012c\7F\2\2\u012c")
        buf.write("+\3\2\2\2\u012d\u012f\7\31\2\2\u012e\u0130\5.\30\2\u012f")
        buf.write("\u012e\3\2\2\2\u012f\u0130\3\2\2\2\u0130\u013d\3\2\2\2")
        buf.write("\u0131\u0134\5\60\31\2\u0132\u0134\58\35\2\u0133\u0131")
        buf.write("\3\2\2\2\u0133\u0132\3\2\2\2\u0134\u0136\3\2\2\2\u0135")
        buf.write("\u0137\7\32\2\2\u0136\u0135\3\2\2\2\u0136\u0137\3\2\2")
        buf.write("\2\u0137\u0139\3\2\2\2\u0138\u013a\5.\30\2\u0139\u0138")
        buf.write("\3\2\2\2\u0139\u013a\3\2\2\2\u013a\u013c\3\2\2\2\u013b")
        buf.write("\u0133\3\2\2\2\u013c\u013f\3\2\2\2\u013d\u013b\3\2\2\2")
        buf.write("\u013d\u013e\3\2\2\2\u013e\u0140\3\2\2\2\u013f\u013d\3")
        buf.write("\2\2\2\u0140\u0141\7\33\2\2\u0141-\3\2\2\2\u0142\u0147")
        buf.write("\5D#\2\u0143\u0145\7\32\2\2\u0144\u0146\5.\30\2\u0145")
        buf.write("\u0144\3\2\2\2\u0145\u0146\3\2\2\2\u0146\u0148\3\2\2\2")
        buf.write("\u0147\u0143\3\2\2\2\u0147\u0148\3\2\2\2\u0148/\3\2\2")
        buf.write("\2\u0149\u014d\5\62\32\2\u014a\u014d\5\66\34\2\u014b\u014d")
        buf.write("\5\64\33\2\u014c\u0149\3\2\2\2\u014c\u014a\3\2\2\2\u014c")
        buf.write("\u014b\3\2\2\2\u014d\61\3\2\2\2\u014e\u014f\7\34\2\2\u014f")
        buf.write("\u0150\5,\27\2\u0150\63\3\2\2\2\u0151\u0152\7\35\2\2\u0152")
        buf.write("\u0153\5Z.\2\u0153\u0154\5,\27\2\u0154\65\3\2\2\2\u0155")
        buf.write("\u015a\5,\27\2\u0156\u0157\7\36\2\2\u0157\u0159\5,\27")
        buf.write("\2\u0158\u0156\3\2\2\2\u0159\u015c\3\2\2\2\u015a\u0158")
        buf.write("\3\2\2\2\u015a\u015b\3\2\2\2\u015b\67\3\2\2\2\u015c\u015a")
        buf.write("\3\2\2\2\u015d\u015e\7\37\2\2\u015e\u015f\5:\36\2\u015f")
        buf.write("9\3\2\2\2\u0160\u0164\5t;\2\u0161\u0164\5v<\2\u0162\u0164")
        buf.write("\5<\37\2\u0163\u0160\3\2\2\2\u0163\u0161\3\2\2\2\u0163")
        buf.write("\u0162\3\2\2\2\u0164;\3\2\2\2\u0165\u0166\5\u008aF\2\u0166")
        buf.write("\u0167\5> \2\u0167=\3\2\2\2\u0168\u0175\7U\2\2\u0169\u016a")
        buf.write("\7\t\2\2\u016a\u016f\5`\61\2\u016b\u016c\7 \2\2\u016c")
        buf.write("\u016e\5`\61\2\u016d\u016b\3\2\2\2\u016e\u0171\3\2\2\2")
        buf.write("\u016f\u016d\3\2\2\2\u016f\u0170\3\2\2\2\u0170\u0172\3")
        buf.write("\2\2\2\u0171\u016f\3\2\2\2\u0172\u0173\7\13\2\2\u0173")
        buf.write("\u0175\3\2\2\2\u0174\u0168\3\2\2\2\u0174\u0169\3\2\2\2")
        buf.write("\u0175?\3\2\2\2\u0176\u0178\7\31\2\2\u0177\u0179\5B\"")
        buf.write("\2\u0178\u0177\3\2\2\2\u0178\u0179\3\2\2\2\u0179\u017a")
        buf.write("\3\2\2\2\u017a\u017b\7\33\2\2\u017bA\3\2\2\2\u017c\u0181")
        buf.write("\5D#\2\u017d\u017f\7\32\2\2\u017e\u0180\5B\"\2\u017f\u017e")
        buf.write("\3\2\2\2\u017f\u0180\3\2\2\2\u0180\u0182\3\2\2\2\u0181")
        buf.write("\u017d\3\2\2\2\u0181\u0182\3\2\2\2\u0182C\3\2\2\2\u0183")
        buf.write("\u0184\5X-\2\u0184\u0185\5F$\2\u0185\u018a\3\2\2\2\u0186")
        buf.write("\u0187\5P)\2\u0187\u0188\5H%\2\u0188\u018a\3\2\2\2\u0189")
        buf.write("\u0183\3\2\2\2\u0189\u0186\3\2\2\2\u018aE\3\2\2\2\u018b")
        buf.write("\u018c\5N(\2\u018c\u0195\5J&\2\u018d\u0191\7!\2\2\u018e")
        buf.write("\u018f\5N(\2\u018f\u0190\5J&\2\u0190\u0192\3\2\2\2\u0191")
        buf.write("\u018e\3\2\2\2\u0191\u0192\3\2\2\2\u0192\u0194\3\2\2\2")
        buf.write("\u0193\u018d\3\2\2\2\u0194\u0197\3\2\2\2\u0195\u0193\3")
        buf.write("\2\2\2\u0195\u0196\3\2\2\2\u0196G\3\2\2\2\u0197\u0195")
        buf.write("\3\2\2\2\u0198\u019a\5F$\2\u0199\u0198\3\2\2\2\u0199\u019a")
        buf.write("\3\2\2\2\u019aI\3\2\2\2\u019b\u01a0\5L\'\2\u019c\u019d")
        buf.write("\7 \2\2\u019d\u019f\5L\'\2\u019e\u019c\3\2\2\2\u019f\u01a2")
        buf.write("\3\2\2\2\u01a0\u019e\3\2\2\2\u01a0\u01a1\3\2\2\2\u01a1")
        buf.write("K\3\2\2\2\u01a2\u01a0\3\2\2\2\u01a3\u01a4\5V,\2\u01a4")
        buf.write("M\3\2\2\2\u01a5\u01a8\5Z.\2\u01a6\u01a8\7\"\2\2\u01a7")
        buf.write("\u01a5\3\2\2\2\u01a7\u01a6\3\2\2\2\u01a8O\3\2\2\2\u01a9")
        buf.write("\u01ac\5T+\2\u01aa\u01ac\5R*\2\u01ab\u01a9\3\2\2\2\u01ab")
        buf.write("\u01aa\3\2\2\2\u01acQ\3\2\2\2\u01ad\u01ae\7#\2\2\u01ae")
        buf.write("\u01af\5F$\2\u01af\u01b0\7$\2\2\u01b0S\3\2\2\2\u01b1\u01b3")
        buf.write("\7\t\2\2\u01b2\u01b4\5V,\2\u01b3\u01b2\3\2\2\2\u01b4\u01b5")
        buf.write("\3\2\2\2\u01b5\u01b3\3\2\2\2\u01b5\u01b6\3\2\2\2\u01b6")
        buf.write("\u01b7\3\2\2\2\u01b7\u01b8\7\13\2\2\u01b8U\3\2\2\2\u01b9")
        buf.write("\u01bc\5X-\2\u01ba\u01bc\5P)\2\u01bb\u01b9\3\2\2\2\u01bb")
        buf.write("\u01ba\3\2\2\2\u01bcW\3\2\2\2\u01bd\u01c0\5\\/\2\u01be")
        buf.write("\u01c0\5^\60\2\u01bf\u01bd\3\2\2\2\u01bf\u01be\3\2\2\2")
        buf.write("\u01c0Y\3\2\2\2\u01c1\u01c4\5\\/\2\u01c2\u01c4\5\u008a")
        buf.write("F\2\u01c3\u01c1\3\2\2\2\u01c3\u01c2\3\2\2\2\u01c4[\3\2")
        buf.write("\2\2\u01c5\u01c6\t\4\2\2\u01c6]\3\2\2\2\u01c7\u01ce\5")
        buf.write("\u008aF\2\u01c8\u01ce\5|?\2\u01c9\u01ce\5~@\2\u01ca\u01ce")
        buf.write("\5\u0086D\2\u01cb\u01ce\5\u008eH\2\u01cc\u01ce\7U\2\2")
        buf.write("\u01cd\u01c7\3\2\2\2\u01cd\u01c8\3\2\2\2\u01cd\u01c9\3")
        buf.write("\2\2\2\u01cd\u01ca\3\2\2\2\u01cd\u01cb\3\2\2\2\u01cd\u01cc")
        buf.write("\3\2\2\2\u01ce_\3\2\2\2\u01cf\u01d0\5b\62\2\u01d0a\3\2")
        buf.write("\2\2\u01d1\u01d6\5d\63\2\u01d2\u01d3\7%\2\2\u01d3\u01d5")
        buf.write("\5d\63\2\u01d4\u01d2\3\2\2\2\u01d5\u01d8\3\2\2\2\u01d6")
        buf.write("\u01d4\3\2\2\2\u01d6\u01d7\3\2\2\2\u01d7c\3\2\2\2\u01d8")
        buf.write("\u01d6\3\2\2\2\u01d9\u01de\5f\64\2\u01da\u01db\7&\2\2")
        buf.write("\u01db\u01dd\5f\64\2\u01dc\u01da\3\2\2\2\u01dd\u01e0\3")
        buf.write("\2\2\2\u01de\u01dc\3\2\2\2\u01de\u01df\3\2\2\2\u01dfe")
        buf.write("\3\2\2\2\u01e0\u01de\3\2\2\2\u01e1\u01e2\5h\65\2\u01e2")
        buf.write("g\3\2\2\2\u01e3\u01f0\5j\66\2\u01e4\u01e5\7\'\2\2\u01e5")
        buf.write("\u01f1\5j\66\2\u01e6\u01e7\7(\2\2\u01e7\u01f1\5j\66\2")
        buf.write("\u01e8\u01e9\7)\2\2\u01e9\u01f1\5j\66\2\u01ea\u01eb\7")
        buf.write("*\2\2\u01eb\u01f1\5j\66\2\u01ec\u01ed\7+\2\2\u01ed\u01f1")
        buf.write("\5j\66\2\u01ee\u01ef\7,\2\2\u01ef\u01f1\5j\66\2\u01f0")
        buf.write("\u01e4\3\2\2\2\u01f0\u01e6\3\2\2\2\u01f0\u01e8\3\2\2\2")
        buf.write("\u01f0\u01ea\3\2\2\2\u01f0\u01ec\3\2\2\2\u01f0\u01ee\3")
        buf.write("\2\2\2\u01f0\u01f1\3\2\2\2\u01f1i\3\2\2\2\u01f2\u01f3")
        buf.write("\5l\67\2\u01f3k\3\2\2\2\u01f4\u01fd\5n8\2\u01f5\u01f6")
        buf.write("\7-\2\2\u01f6\u01fc\5n8\2\u01f7\u01f8\7.\2\2\u01f8\u01fc")
        buf.write("\5n8\2\u01f9\u01fc\5\u0082B\2\u01fa\u01fc\5\u0084C\2\u01fb")
        buf.write("\u01f5\3\2\2\2\u01fb\u01f7\3\2\2\2\u01fb\u01f9\3\2\2\2")
        buf.write("\u01fb\u01fa\3\2\2\2\u01fc\u01ff\3\2\2\2\u01fd\u01fb\3")
        buf.write("\2\2\2\u01fd\u01fe\3\2\2\2\u01fem\3\2\2\2\u01ff\u01fd")
        buf.write("\3\2\2\2\u0200\u0207\5p9\2\u0201\u0202\7\b\2\2\u0202\u0206")
        buf.write("\5p9\2\u0203\u0204\7/\2\2\u0204\u0206\5p9\2\u0205\u0201")
        buf.write("\3\2\2\2\u0205\u0203\3\2\2\2\u0206\u0209\3\2\2\2\u0207")
        buf.write("\u0205\3\2\2\2\u0207\u0208\3\2\2\2\u0208o\3\2\2\2\u0209")
        buf.write("\u0207\3\2\2\2\u020a\u020b\7\60\2\2\u020b\u0212\5r:\2")
        buf.write("\u020c\u020d\7-\2\2\u020d\u0212\5r:\2\u020e\u020f\7.\2")
        buf.write("\2\u020f\u0212\5r:\2\u0210\u0212\5r:\2\u0211\u020a\3\2")
        buf.write("\2\2\u0211\u020c\3\2\2\2\u0211\u020e\3\2\2\2\u0211\u0210")
        buf.write("\3\2\2\2\u0212q\3\2\2\2\u0213\u021b\5t;\2\u0214\u021b")
        buf.write("\5v<\2\u0215\u021b\5z>\2\u0216\u021b\5|?\2\u0217\u021b")
        buf.write("\5~@\2\u0218\u021b\5\u0086D\2\u0219\u021b\5\\/\2\u021a")
        buf.write("\u0213\3\2\2\2\u021a\u0214\3\2\2\2\u021a\u0215\3\2\2\2")
        buf.write("\u021a\u0216\3\2\2\2\u021a\u0217\3\2\2\2\u021a\u0218\3")
        buf.write("\2\2\2\u021a\u0219\3\2\2\2\u021bs\3\2\2\2\u021c\u021d")
        buf.write("\7\t\2\2\u021d\u021e\5`\61\2\u021e\u021f\7\13\2\2\u021f")
        buf.write("u\3\2\2\2\u0220\u0221\7\61\2\2\u0221\u0222\7\t\2\2\u0222")
        buf.write("\u0223\5`\61\2\u0223\u0224\7\13\2\2\u0224\u0258\3\2\2")
        buf.write("\2\u0225\u0226\7\62\2\2\u0226\u0227\7\t\2\2\u0227\u0228")
        buf.write("\5`\61\2\u0228\u0229\7\13\2\2\u0229\u0258\3\2\2\2\u022a")
        buf.write("\u022b\7\63\2\2\u022b\u022c\7\t\2\2\u022c\u022d\5`\61")
        buf.write("\2\u022d\u022e\7 \2\2\u022e\u022f\5`\61\2\u022f\u0230")
        buf.write("\7\13\2\2\u0230\u0258\3\2\2\2\u0231\u0232\7\64\2\2\u0232")
        buf.write("\u0233\7\t\2\2\u0233\u0234\5`\61\2\u0234\u0235\7\13\2")
        buf.write("\2\u0235\u0258\3\2\2\2\u0236\u0237\7\65\2\2\u0237\u0238")
        buf.write("\7\t\2\2\u0238\u0239\5\\/\2\u0239\u023a\7\13\2\2\u023a")
        buf.write("\u0258\3\2\2\2\u023b\u023c\7\66\2\2\u023c\u023d\7\t\2")
        buf.write("\2\u023d\u023e\5`\61\2\u023e\u023f\7 \2\2\u023f\u0240")
        buf.write("\5`\61\2\u0240\u0241\7\13\2\2\u0241\u0258\3\2\2\2\u0242")
        buf.write("\u0243\7\67\2\2\u0243\u0244\7\t\2\2\u0244\u0245\5`\61")
        buf.write("\2\u0245\u0246\7\13\2\2\u0246\u0258\3\2\2\2\u0247\u0248")
        buf.write("\78\2\2\u0248\u0249\7\t\2\2\u0249\u024a\5`\61\2\u024a")
        buf.write("\u024b\7\13\2\2\u024b\u0258\3\2\2\2\u024c\u024d\79\2\2")
        buf.write("\u024d\u024e\7\t\2\2\u024e\u024f\5`\61\2\u024f\u0250\7")
        buf.write("\13\2\2\u0250\u0258\3\2\2\2\u0251\u0252\7:\2\2\u0252\u0253")
        buf.write("\7\t\2\2\u0253\u0254\5`\61\2\u0254\u0255\7\13\2\2\u0255")
        buf.write("\u0258\3\2\2\2\u0256\u0258\5x=\2\u0257\u0220\3\2\2\2\u0257")
        buf.write("\u0225\3\2\2\2\u0257\u022a\3\2\2\2\u0257\u0231\3\2\2\2")
        buf.write("\u0257\u0236\3\2\2\2\u0257\u023b\3\2\2\2\u0257\u0242\3")
        buf.write("\2\2\2\u0257\u0247\3\2\2\2\u0257\u024c\3\2\2\2\u0257\u0251")
        buf.write("\3\2\2\2\u0257\u0256\3\2\2\2\u0258w\3\2\2\2\u0259\u025a")
        buf.write("\7;\2\2\u025a\u025b\7\t\2\2\u025b\u025c\5`\61\2\u025c")
        buf.write("\u025d\7 \2\2\u025d\u0260\5`\61\2\u025e\u025f\7 \2\2\u025f")
        buf.write("\u0261\5`\61\2\u0260\u025e\3\2\2\2\u0260\u0261\3\2\2\2")
        buf.write("\u0261\u0262\3\2\2\2\u0262\u0263\7\13\2\2\u0263y\3\2\2")
        buf.write("\2\u0264\u0266\5\u008aF\2\u0265\u0267\5> \2\u0266\u0265")
        buf.write("\3\2\2\2\u0266\u0267\3\2\2\2\u0267{\3\2\2\2\u0268\u026c")
        buf.write("\5\u0088E\2\u0269\u026d\7E\2\2\u026a\u026b\7<\2\2\u026b")
        buf.write("\u026d\5\u008aF\2\u026c\u0269\3\2\2\2\u026c\u026a\3\2")
        buf.write("\2\2\u026c\u026d\3\2\2\2\u026d}\3\2\2\2\u026e\u0272\5")
        buf.write("\u0080A\2\u026f\u0272\5\u0082B\2\u0270\u0272\5\u0084C")
        buf.write("\2\u0271\u026e\3\2\2\2\u0271\u026f\3\2\2\2\u0271\u0270")
        buf.write("\3\2\2\2\u0272\177\3\2\2\2\u0273\u0274\t\5\2\2\u0274\u0081")
        buf.write("\3\2\2\2\u0275\u0276\t\6\2\2\u0276\u0083\3\2\2\2\u0277")
        buf.write("\u0278\t\7\2\2\u0278\u0085\3\2\2\2\u0279\u027a\t\b\2\2")
        buf.write("\u027a\u0087\3\2\2\2\u027b\u027c\t\t\2\2\u027c\u0089\3")
        buf.write("\2\2\2\u027d\u0280\7?\2\2\u027e\u0280\5\u008cG\2\u027f")
        buf.write("\u027d\3\2\2\2\u027f\u027e\3\2\2\2\u0280\u008b\3\2\2\2")
        buf.write("\u0281\u0282\t\n\2\2\u0282\u008d\3\2\2\2\u0283\u0284\t")
        buf.write("\13\2\2\u0284\u008f\3\2\2\2E\u0095\u009a\u009f\u00ac\u00b1")
        buf.write("\u00b8\u00bd\u00c0\u00cb\u00d4\u00de\u00e1\u00e6\u00ea")
        buf.write("\u00f2\u00fa\u0104\u0109\u010c\u0110\u0114\u0116\u011d")
        buf.write("\u0123\u0125\u012f\u0133\u0136\u0139\u013d\u0145\u0147")
        buf.write("\u014c\u015a\u0163\u016f\u0174\u0178\u017f\u0181\u0189")
        buf.write("\u0191\u0195\u0199\u01a0\u01a7\u01ab\u01b5\u01bb\u01bf")
        buf.write("\u01c3\u01cd\u01d6\u01de\u01f0\u01fb\u01fd\u0205\u0207")
        buf.write("\u0211\u021a\u0257\u0260\u0266\u026c\u0271\u027f")
        return buf.getvalue()


class SparqlParser ( Parser ):

    grammarFileName = "Sparql.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "'BASE'", "'PREFIX'", "'SELECT'", "'DISTINCT'", 
                     "'REDUCED'", "'*'", "'('", "'COUNT'", "')'", "'AS'", 
                     "'CONSTRUCT'", "'DESCRIBE'", "'ASK'", "'FROM'", "'NAMED'", 
                     "'WHERE'", "'ORDER'", "'BY'", "'ASC'", "'DESC'", "'LIMIT'", 
                     "'OFFSET'", "'{'", "'.'", "'}'", "'OPTIONAL'", "'GRAPH'", 
                     "'UNION'", "'FILTER'", "','", "';'", "'a'", "'['", 
                     "']'", "'||'", "'&&'", "'='", "'!='", "'<'", "'>'", 
                     "'<='", "'>='", "'+'", "'-'", "'/'", "'!'", "'STR'", 
                     "'LANG'", "'LANGMATCHES'", "'DATATYPE'", "'BOUND'", 
                     "'sameTerm'", "'isIRI'", "'isURI'", "'isBLANK'", "'isLITERAL'", 
                     "'REGEX'", "'^^'", "'true'", "'false'" ]

    symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "IRI_REF", "PNAME_NS", "PNAME_LN", "BLANK_NODE_LABEL", 
                      "VAR1", "VAR2", "LANGTAG", "INTEGER", "DECIMAL", "DOUBLE", 
                      "INTEGER_POSITIVE", "DECIMAL_POSITIVE", "DOUBLE_POSITIVE", 
                      "INTEGER_NEGATIVE", "DECIMAL_NEGATIVE", "DOUBLE_NEGATIVE", 
                      "EXPONENT", "STRING_LITERAL1", "STRING_LITERAL2", 
                      "STRING_LITERAL_LONG1", "STRING_LITERAL_LONG2", "ECHAR", 
                      "NIL", "ANON", "PN_CHARS_U", "VARNAME", "PN_PREFIX", 
                      "PN_LOCAL", "WS" ]

    RULE_query = 0
    RULE_prologue = 1
    RULE_baseDecl = 2
    RULE_prefixDecl = 3
    RULE_selectQuery = 4
    RULE_entityQueryCondition = 5
    RULE_countQueryCondition = 6
    RULE_constructQuery = 7
    RULE_describeQuery = 8
    RULE_askQuery = 9
    RULE_datasetClause = 10
    RULE_defaultGraphClause = 11
    RULE_namedGraphClause = 12
    RULE_sourceSelector = 13
    RULE_whereClause = 14
    RULE_solutionModifier = 15
    RULE_limitOffsetClauses = 16
    RULE_orderClause = 17
    RULE_orderCondition = 18
    RULE_limitClause = 19
    RULE_offsetClause = 20
    RULE_groupGraphPattern = 21
    RULE_triplesBlock = 22
    RULE_graphPatternNotTriples = 23
    RULE_optionalGraphPattern = 24
    RULE_graphGraphPattern = 25
    RULE_groupOrUnionGraphPattern = 26
    RULE_filter_ = 27
    RULE_constraint = 28
    RULE_functionCall = 29
    RULE_argList = 30
    RULE_constructTemplate = 31
    RULE_constructTriples = 32
    RULE_triplesSameSubject = 33
    RULE_propertyListNotEmpty = 34
    RULE_propertyList = 35
    RULE_objectList = 36
    RULE_object_ = 37
    RULE_verb = 38
    RULE_triplesNode = 39
    RULE_blankNodePropertyList = 40
    RULE_collection = 41
    RULE_graphNode = 42
    RULE_varOrTerm = 43
    RULE_varOrIRIref = 44
    RULE_var_ = 45
    RULE_graphTerm = 46
    RULE_expression = 47
    RULE_conditionalOrExpression = 48
    RULE_conditionalAndExpression = 49
    RULE_valueLogical = 50
    RULE_relationalExpression = 51
    RULE_numericExpression = 52
    RULE_additiveExpression = 53
    RULE_multiplicativeExpression = 54
    RULE_unaryExpression = 55
    RULE_primaryExpression = 56
    RULE_brackettedExpression = 57
    RULE_builtInCall = 58
    RULE_regexExpression = 59
    RULE_iriRefOrFunction = 60
    RULE_rdfLiteral = 61
    RULE_numericLiteral = 62
    RULE_numericLiteralUnsigned = 63
    RULE_numericLiteralPositive = 64
    RULE_numericLiteralNegative = 65
    RULE_booleanLiteral = 66
    RULE_string = 67
    RULE_iriRef = 68
    RULE_prefixedName = 69
    RULE_blankNode = 70

    ruleNames =  [ "query", "prologue", "baseDecl", "prefixDecl", "selectQuery", 
                   "entityQueryCondition", "countQueryCondition", "constructQuery", 
                   "describeQuery", "askQuery", "datasetClause", "defaultGraphClause", 
                   "namedGraphClause", "sourceSelector", "whereClause", 
                   "solutionModifier", "limitOffsetClauses", "orderClause", 
                   "orderCondition", "limitClause", "offsetClause", "groupGraphPattern", 
                   "triplesBlock", "graphPatternNotTriples", "optionalGraphPattern", 
                   "graphGraphPattern", "groupOrUnionGraphPattern", "filter_", 
                   "constraint", "functionCall", "argList", "constructTemplate", 
                   "constructTriples", "triplesSameSubject", "propertyListNotEmpty", 
                   "propertyList", "objectList", "object_", "verb", "triplesNode", 
                   "blankNodePropertyList", "collection", "graphNode", "varOrTerm", 
                   "varOrIRIref", "var_", "graphTerm", "expression", "conditionalOrExpression", 
                   "conditionalAndExpression", "valueLogical", "relationalExpression", 
                   "numericExpression", "additiveExpression", "multiplicativeExpression", 
                   "unaryExpression", "primaryExpression", "brackettedExpression", 
                   "builtInCall", "regexExpression", "iriRefOrFunction", 
                   "rdfLiteral", "numericLiteral", "numericLiteralUnsigned", 
                   "numericLiteralPositive", "numericLiteralNegative", "booleanLiteral", 
                   "string", "iriRef", "prefixedName", "blankNode" ]

    EOF = Token.EOF
    T__0=1
    T__1=2
    T__2=3
    T__3=4
    T__4=5
    T__5=6
    T__6=7
    T__7=8
    T__8=9
    T__9=10
    T__10=11
    T__11=12
    T__12=13
    T__13=14
    T__14=15
    T__15=16
    T__16=17
    T__17=18
    T__18=19
    T__19=20
    T__20=21
    T__21=22
    T__22=23
    T__23=24
    T__24=25
    T__25=26
    T__26=27
    T__27=28
    T__28=29
    T__29=30
    T__30=31
    T__31=32
    T__32=33
    T__33=34
    T__34=35
    T__35=36
    T__36=37
    T__37=38
    T__38=39
    T__39=40
    T__40=41
    T__41=42
    T__42=43
    T__43=44
    T__44=45
    T__45=46
    T__46=47
    T__47=48
    T__48=49
    T__49=50
    T__50=51
    T__51=52
    T__52=53
    T__53=54
    T__54=55
    T__55=56
    T__56=57
    T__57=58
    T__58=59
    T__59=60
    IRI_REF=61
    PNAME_NS=62
    PNAME_LN=63
    BLANK_NODE_LABEL=64
    VAR1=65
    VAR2=66
    LANGTAG=67
    INTEGER=68
    DECIMAL=69
    DOUBLE=70
    INTEGER_POSITIVE=71
    DECIMAL_POSITIVE=72
    DOUBLE_POSITIVE=73
    INTEGER_NEGATIVE=74
    DECIMAL_NEGATIVE=75
    DOUBLE_NEGATIVE=76
    EXPONENT=77
    STRING_LITERAL1=78
    STRING_LITERAL2=79
    STRING_LITERAL_LONG1=80
    STRING_LITERAL_LONG2=81
    ECHAR=82
    NIL=83
    ANON=84
    PN_CHARS_U=85
    VARNAME=86
    PN_PREFIX=87
    PN_LOCAL=88
    WS=89

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




    class QueryContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def prologue(self):
            return self.getTypedRuleContext(SparqlParser.PrologueContext,0)


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

        def selectQuery(self):
            return self.getTypedRuleContext(SparqlParser.SelectQueryContext,0)


        def constructQuery(self):
            return self.getTypedRuleContext(SparqlParser.ConstructQueryContext,0)


        def describeQuery(self):
            return self.getTypedRuleContext(SparqlParser.DescribeQueryContext,0)


        def askQuery(self):
            return self.getTypedRuleContext(SparqlParser.AskQueryContext,0)


        def getRuleIndex(self):
            return SparqlParser.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 query(self):

        localctx = SparqlParser.QueryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_query)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 142
            self.prologue()
            self.state = 147
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.T__2]:
                self.state = 143
                self.selectQuery()
                pass
            elif token in [SparqlParser.T__10]:
                self.state = 144
                self.constructQuery()
                pass
            elif token in [SparqlParser.T__11]:
                self.state = 145
                self.describeQuery()
                pass
            elif token in [SparqlParser.T__12]:
                self.state = 146
                self.askQuery()
                pass
            else:
                raise NoViableAltException(self)

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


    class PrologueContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def baseDecl(self):
            return self.getTypedRuleContext(SparqlParser.BaseDeclContext,0)


        def prefixDecl(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.PrefixDeclContext)
            else:
                return self.getTypedRuleContext(SparqlParser.PrefixDeclContext,i)


        def getRuleIndex(self):
            return SparqlParser.RULE_prologue

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

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




    def prologue(self):

        localctx = SparqlParser.PrologueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_prologue)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 152
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SparqlParser.T__0:
                self.state = 151
                self.baseDecl()


            self.state = 157
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==SparqlParser.T__1:
                self.state = 154
                self.prefixDecl()
                self.state = 159
                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 BaseDeclContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def IRI_REF(self):
            return self.getToken(SparqlParser.IRI_REF, 0)

        def getRuleIndex(self):
            return SparqlParser.RULE_baseDecl

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

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




    def baseDecl(self):

        localctx = SparqlParser.BaseDeclContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_baseDecl)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 160
            self.match(SparqlParser.T__0)
            self.state = 161
            self.match(SparqlParser.IRI_REF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PrefixDeclContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def PNAME_NS(self):
            return self.getToken(SparqlParser.PNAME_NS, 0)

        def IRI_REF(self):
            return self.getToken(SparqlParser.IRI_REF, 0)

        def getRuleIndex(self):
            return SparqlParser.RULE_prefixDecl

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

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




    def prefixDecl(self):

        localctx = SparqlParser.PrefixDeclContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_prefixDecl)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 163
            self.match(SparqlParser.T__1)
            self.state = 164
            self.match(SparqlParser.PNAME_NS)
            self.state = 165
            self.match(SparqlParser.IRI_REF)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SelectQueryContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def whereClause(self):
            return self.getTypedRuleContext(SparqlParser.WhereClauseContext,0)


        def solutionModifier(self):
            return self.getTypedRuleContext(SparqlParser.SolutionModifierContext,0)


        def entityQueryCondition(self):
            return self.getTypedRuleContext(SparqlParser.EntityQueryConditionContext,0)


        def countQueryCondition(self):
            return self.getTypedRuleContext(SparqlParser.CountQueryConditionContext,0)


        def datasetClause(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.DatasetClauseContext)
            else:
                return self.getTypedRuleContext(SparqlParser.DatasetClauseContext,i)


        def getRuleIndex(self):
            return SparqlParser.RULE_selectQuery

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

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




    def selectQuery(self):

        localctx = SparqlParser.SelectQueryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_selectQuery)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 167
            self.match(SparqlParser.T__2)
            self.state = 170
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.T__3, SparqlParser.T__4, SparqlParser.T__5, SparqlParser.VAR1, SparqlParser.VAR2]:
                self.state = 168
                self.entityQueryCondition()
                pass
            elif token in [SparqlParser.T__6]:
                self.state = 169
                self.countQueryCondition()
                pass
            else:
                raise NoViableAltException(self)

            self.state = 175
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==SparqlParser.T__13:
                self.state = 172
                self.datasetClause()
                self.state = 177
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 178
            self.whereClause()
            self.state = 179
            self.solutionModifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class EntityQueryConditionContext(ParserRuleContext):
        __slots__ = 'parser'

        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.getTypedRuleContexts(SparqlParser.Var_Context)
            else:
                return self.getTypedRuleContext(SparqlParser.Var_Context,i)


        def getRuleIndex(self):
            return SparqlParser.RULE_entityQueryCondition

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

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




    def entityQueryCondition(self):

        localctx = SparqlParser.EntityQueryConditionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_entityQueryCondition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 182
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SparqlParser.T__3 or _la==SparqlParser.T__4:
                self.state = 181
                _la = self._input.LA(1)
                if not(_la==SparqlParser.T__3 or _la==SparqlParser.T__4):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


            self.state = 190
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.VAR1, SparqlParser.VAR2]:
                self.state = 185 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while True:
                    self.state = 184
                    self.var_()
                    self.state = 187 
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if not (_la==SparqlParser.VAR1 or _la==SparqlParser.VAR2):
                        break

                pass
            elif token in [SparqlParser.T__5]:
                self.state = 189
                self.match(SparqlParser.T__5)
                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 CountQueryConditionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def entityQueryCondition(self):
            return self.getTypedRuleContext(SparqlParser.EntityQueryConditionContext,0)


        def var_(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.Var_Context)
            else:
                return self.getTypedRuleContext(SparqlParser.Var_Context,i)


        def getRuleIndex(self):
            return SparqlParser.RULE_countQueryCondition

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

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




    def countQueryCondition(self):

        localctx = SparqlParser.CountQueryConditionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_countQueryCondition)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 192
            self.match(SparqlParser.T__6)
            self.state = 193
            self.match(SparqlParser.T__7)
            self.state = 194
            self.match(SparqlParser.T__6)
            self.state = 195
            self.entityQueryCondition()
            self.state = 196
            self.match(SparqlParser.T__8)
            self.state = 197
            self.match(SparqlParser.T__9)
            self.state = 199 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 198
                self.var_()
                self.state = 201 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (_la==SparqlParser.VAR1 or _la==SparqlParser.VAR2):
                    break

            self.state = 203
            self.match(SparqlParser.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 ConstructQueryContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def constructTemplate(self):
            return self.getTypedRuleContext(SparqlParser.ConstructTemplateContext,0)


        def whereClause(self):
            return self.getTypedRuleContext(SparqlParser.WhereClauseContext,0)


        def solutionModifier(self):
            return self.getTypedRuleContext(SparqlParser.SolutionModifierContext,0)


        def datasetClause(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.DatasetClauseContext)
            else:
                return self.getTypedRuleContext(SparqlParser.DatasetClauseContext,i)


        def getRuleIndex(self):
            return SparqlParser.RULE_constructQuery

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

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




    def constructQuery(self):

        localctx = SparqlParser.ConstructQueryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_constructQuery)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 205
            self.match(SparqlParser.T__10)
            self.state = 206
            self.constructTemplate()
            self.state = 210
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==SparqlParser.T__13:
                self.state = 207
                self.datasetClause()
                self.state = 212
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 213
            self.whereClause()
            self.state = 214
            self.solutionModifier()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DescribeQueryContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def solutionModifier(self):
            return self.getTypedRuleContext(SparqlParser.SolutionModifierContext,0)


        def datasetClause(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.DatasetClauseContext)
            else:
                return self.getTypedRuleContext(SparqlParser.DatasetClauseContext,i)


        def whereClause(self):
            return self.getTypedRuleContext(SparqlParser.WhereClauseContext,0)


        def varOrIRIref(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.VarOrIRIrefContext)
            else:
                return self.getTypedRuleContext(SparqlParser.VarOrIRIrefContext,i)


        def getRuleIndex(self):
            return SparqlParser.RULE_describeQuery

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

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




    def describeQuery(self):

        localctx = SparqlParser.DescribeQueryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_describeQuery)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 216
            self.match(SparqlParser.T__11)
            self.state = 223
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.IRI_REF, SparqlParser.PNAME_NS, SparqlParser.PNAME_LN, SparqlParser.VAR1, SparqlParser.VAR2]:
                self.state = 218 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while True:
                    self.state = 217
                    self.varOrIRIref()
                    self.state = 220 
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if not (((((_la - 61)) & ~0x3f) == 0 and ((1 << (_la - 61)) & ((1 << (SparqlParser.IRI_REF - 61)) | (1 << (SparqlParser.PNAME_NS - 61)) | (1 << (SparqlParser.PNAME_LN - 61)) | (1 << (SparqlParser.VAR1 - 61)) | (1 << (SparqlParser.VAR2 - 61)))) != 0)):
                        break

                pass
            elif token in [SparqlParser.T__5]:
                self.state = 222
                self.match(SparqlParser.T__5)
                pass
            else:
                raise NoViableAltException(self)

            self.state = 228
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==SparqlParser.T__13:
                self.state = 225
                self.datasetClause()
                self.state = 230
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 232
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SparqlParser.T__15 or _la==SparqlParser.T__22:
                self.state = 231
                self.whereClause()


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


    class AskQueryContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def whereClause(self):
            return self.getTypedRuleContext(SparqlParser.WhereClauseContext,0)


        def datasetClause(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.DatasetClauseContext)
            else:
                return self.getTypedRuleContext(SparqlParser.DatasetClauseContext,i)


        def getRuleIndex(self):
            return SparqlParser.RULE_askQuery

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

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




    def askQuery(self):

        localctx = SparqlParser.AskQueryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_askQuery)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 236
            self.match(SparqlParser.T__12)
            self.state = 240
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==SparqlParser.T__13:
                self.state = 237
                self.datasetClause()
                self.state = 242
                self._errHandler.sync(self)
                _la = self._input.LA(1)

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


    class DatasetClauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def defaultGraphClause(self):
            return self.getTypedRuleContext(SparqlParser.DefaultGraphClauseContext,0)


        def namedGraphClause(self):
            return self.getTypedRuleContext(SparqlParser.NamedGraphClauseContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_datasetClause

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

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




    def datasetClause(self):

        localctx = SparqlParser.DatasetClauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_datasetClause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 245
            self.match(SparqlParser.T__13)
            self.state = 248
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.IRI_REF, SparqlParser.PNAME_NS, SparqlParser.PNAME_LN]:
                self.state = 246
                self.defaultGraphClause()
                pass
            elif token in [SparqlParser.T__14]:
                self.state = 247
                self.namedGraphClause()
                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 DefaultGraphClauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def sourceSelector(self):
            return self.getTypedRuleContext(SparqlParser.SourceSelectorContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_defaultGraphClause

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

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




    def defaultGraphClause(self):

        localctx = SparqlParser.DefaultGraphClauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_defaultGraphClause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 250
            self.sourceSelector()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class NamedGraphClauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def sourceSelector(self):
            return self.getTypedRuleContext(SparqlParser.SourceSelectorContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_namedGraphClause

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

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




    def namedGraphClause(self):

        localctx = SparqlParser.NamedGraphClauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_namedGraphClause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 252
            self.match(SparqlParser.T__14)
            self.state = 253
            self.sourceSelector()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class SourceSelectorContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def iriRef(self):
            return self.getTypedRuleContext(SparqlParser.IriRefContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_sourceSelector

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

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




    def sourceSelector(self):

        localctx = SparqlParser.SourceSelectorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_sourceSelector)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 255
            self.iriRef()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class WhereClauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def groupGraphPattern(self):
            return self.getTypedRuleContext(SparqlParser.GroupGraphPatternContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_whereClause

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

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




    def whereClause(self):

        localctx = SparqlParser.WhereClauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_whereClause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 258
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SparqlParser.T__15:
                self.state = 257
                self.match(SparqlParser.T__15)


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


    class SolutionModifierContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def orderClause(self):
            return self.getTypedRuleContext(SparqlParser.OrderClauseContext,0)


        def limitOffsetClauses(self):
            return self.getTypedRuleContext(SparqlParser.LimitOffsetClausesContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_solutionModifier

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

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




    def solutionModifier(self):

        localctx = SparqlParser.SolutionModifierContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_solutionModifier)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 263
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SparqlParser.T__16:
                self.state = 262
                self.orderClause()


            self.state = 266
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SparqlParser.T__20 or _la==SparqlParser.T__21:
                self.state = 265
                self.limitOffsetClauses()


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


    class LimitOffsetClausesContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def limitClause(self):
            return self.getTypedRuleContext(SparqlParser.LimitClauseContext,0)


        def offsetClause(self):
            return self.getTypedRuleContext(SparqlParser.OffsetClauseContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_limitOffsetClauses

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

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




    def limitOffsetClauses(self):

        localctx = SparqlParser.LimitOffsetClausesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_limitOffsetClauses)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 276
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.T__20]:
                self.state = 268
                self.limitClause()
                self.state = 270
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==SparqlParser.T__21:
                    self.state = 269
                    self.offsetClause()


                pass
            elif token in [SparqlParser.T__21]:
                self.state = 272
                self.offsetClause()
                self.state = 274
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==SparqlParser.T__20:
                    self.state = 273
                    self.limitClause()


                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 OrderClauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def orderCondition(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.OrderConditionContext)
            else:
                return self.getTypedRuleContext(SparqlParser.OrderConditionContext,i)


        def getRuleIndex(self):
            return SparqlParser.RULE_orderClause

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

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




    def orderClause(self):

        localctx = SparqlParser.OrderClauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_orderClause)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 278
            self.match(SparqlParser.T__16)
            self.state = 279
            self.match(SparqlParser.T__17)
            self.state = 281 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 280
                self.orderCondition()
                self.state = 283 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not (((((_la - 7)) & ~0x3f) == 0 and ((1 << (_la - 7)) & ((1 << (SparqlParser.T__6 - 7)) | (1 << (SparqlParser.T__18 - 7)) | (1 << (SparqlParser.T__19 - 7)) | (1 << (SparqlParser.T__46 - 7)) | (1 << (SparqlParser.T__47 - 7)) | (1 << (SparqlParser.T__48 - 7)) | (1 << (SparqlParser.T__49 - 7)) | (1 << (SparqlParser.T__50 - 7)) | (1 << (SparqlParser.T__51 - 7)) | (1 << (SparqlParser.T__52 - 7)) | (1 << (SparqlParser.T__53 - 7)) | (1 << (SparqlParser.T__54 - 7)) | (1 << (SparqlParser.T__55 - 7)) | (1 << (SparqlParser.T__56 - 7)) | (1 << (SparqlParser.IRI_REF - 7)) | (1 << (SparqlParser.PNAME_NS - 7)) | (1 << (SparqlParser.PNAME_LN - 7)) | (1 << (SparqlParser.VAR1 - 7)) | (1 << (SparqlParser.VAR2 - 7)))) != 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 OrderConditionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def brackettedExpression(self):
            return self.getTypedRuleContext(SparqlParser.BrackettedExpressionContext,0)


        def constraint(self):
            return self.getTypedRuleContext(SparqlParser.ConstraintContext,0)


        def var_(self):
            return self.getTypedRuleContext(SparqlParser.Var_Context,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_orderCondition

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

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




    def orderCondition(self):

        localctx = SparqlParser.OrderConditionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_orderCondition)
        self._la = 0 # Token type
        try:
            self.state = 291
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.T__18, SparqlParser.T__19]:
                self.enterOuterAlt(localctx, 1)
                self.state = 285
                _la = self._input.LA(1)
                if not(_la==SparqlParser.T__18 or _la==SparqlParser.T__19):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 286
                self.brackettedExpression()
                pass
            elif token in [SparqlParser.T__6, SparqlParser.T__46, SparqlParser.T__47, SparqlParser.T__48, SparqlParser.T__49, SparqlParser.T__50, SparqlParser.T__51, SparqlParser.T__52, SparqlParser.T__53, SparqlParser.T__54, SparqlParser.T__55, SparqlParser.T__56, SparqlParser.IRI_REF, SparqlParser.PNAME_NS, SparqlParser.PNAME_LN, SparqlParser.VAR1, SparqlParser.VAR2]:
                self.enterOuterAlt(localctx, 2)
                self.state = 289
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [SparqlParser.T__6, SparqlParser.T__46, SparqlParser.T__47, SparqlParser.T__48, SparqlParser.T__49, SparqlParser.T__50, SparqlParser.T__51, SparqlParser.T__52, SparqlParser.T__53, SparqlParser.T__54, SparqlParser.T__55, SparqlParser.T__56, SparqlParser.IRI_REF, SparqlParser.PNAME_NS, SparqlParser.PNAME_LN]:
                    self.state = 287
                    self.constraint()
                    pass
                elif token in [SparqlParser.VAR1, SparqlParser.VAR2]:
                    self.state = 288
                    self.var_()
                    pass
                else:
                    raise NoViableAltException(self)

                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 LimitClauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def getRuleIndex(self):
            return SparqlParser.RULE_limitClause

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

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




    def limitClause(self):

        localctx = SparqlParser.LimitClauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_limitClause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 293
            self.match(SparqlParser.T__20)
            self.state = 294
            self.match(SparqlParser.INTEGER)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class OffsetClauseContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def getRuleIndex(self):
            return SparqlParser.RULE_offsetClause

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

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




    def offsetClause(self):

        localctx = SparqlParser.OffsetClauseContext(self, self._ctx, self.state)
        self.enterRule(localctx, 40, self.RULE_offsetClause)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 296
            self.match(SparqlParser.T__21)
            self.state = 297
            self.match(SparqlParser.INTEGER)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class GroupGraphPatternContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def triplesBlock(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.TriplesBlockContext)
            else:
                return self.getTypedRuleContext(SparqlParser.TriplesBlockContext,i)


        def graphPatternNotTriples(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.GraphPatternNotTriplesContext)
            else:
                return self.getTypedRuleContext(SparqlParser.GraphPatternNotTriplesContext,i)


        def filter_(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.Filter_Context)
            else:
                return self.getTypedRuleContext(SparqlParser.Filter_Context,i)


        def getRuleIndex(self):
            return SparqlParser.RULE_groupGraphPattern

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

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




    def groupGraphPattern(self):

        localctx = SparqlParser.GroupGraphPatternContext(self, self._ctx, self.state)
        self.enterRule(localctx, 42, self.RULE_groupGraphPattern)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 299
            self.match(SparqlParser.T__22)
            self.state = 301
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << SparqlParser.T__6) | (1 << SparqlParser.T__32) | (1 << SparqlParser.T__58) | (1 << SparqlParser.T__59) | (1 << SparqlParser.IRI_REF) | (1 << SparqlParser.PNAME_NS) | (1 << SparqlParser.PNAME_LN))) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & ((1 << (SparqlParser.BLANK_NODE_LABEL - 64)) | (1 << (SparqlParser.VAR1 - 64)) | (1 << (SparqlParser.VAR2 - 64)) | (1 << (SparqlParser.INTEGER - 64)) | (1 << (SparqlParser.DECIMAL - 64)) | (1 << (SparqlParser.DOUBLE - 64)) | (1 << (SparqlParser.INTEGER_POSITIVE - 64)) | (1 << (SparqlParser.DECIMAL_POSITIVE - 64)) | (1 << (SparqlParser.DOUBLE_POSITIVE - 64)) | (1 << (SparqlParser.INTEGER_NEGATIVE - 64)) | (1 << (SparqlParser.DECIMAL_NEGATIVE - 64)) | (1 << (SparqlParser.DOUBLE_NEGATIVE - 64)) | (1 << (SparqlParser.STRING_LITERAL1 - 64)) | (1 << (SparqlParser.STRING_LITERAL2 - 64)) | (1 << (SparqlParser.NIL - 64)) | (1 << (SparqlParser.ANON - 64)))) != 0):
                self.state = 300
                self.triplesBlock()


            self.state = 315
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << SparqlParser.T__22) | (1 << SparqlParser.T__25) | (1 << SparqlParser.T__26) | (1 << SparqlParser.T__28))) != 0):
                self.state = 305
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [SparqlParser.T__22, SparqlParser.T__25, SparqlParser.T__26]:
                    self.state = 303
                    self.graphPatternNotTriples()
                    pass
                elif token in [SparqlParser.T__28]:
                    self.state = 304
                    self.filter_()
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 308
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==SparqlParser.T__23:
                    self.state = 307
                    self.match(SparqlParser.T__23)


                self.state = 311
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << SparqlParser.T__6) | (1 << SparqlParser.T__32) | (1 << SparqlParser.T__58) | (1 << SparqlParser.T__59) | (1 << SparqlParser.IRI_REF) | (1 << SparqlParser.PNAME_NS) | (1 << SparqlParser.PNAME_LN))) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & ((1 << (SparqlParser.BLANK_NODE_LABEL - 64)) | (1 << (SparqlParser.VAR1 - 64)) | (1 << (SparqlParser.VAR2 - 64)) | (1 << (SparqlParser.INTEGER - 64)) | (1 << (SparqlParser.DECIMAL - 64)) | (1 << (SparqlParser.DOUBLE - 64)) | (1 << (SparqlParser.INTEGER_POSITIVE - 64)) | (1 << (SparqlParser.DECIMAL_POSITIVE - 64)) | (1 << (SparqlParser.DOUBLE_POSITIVE - 64)) | (1 << (SparqlParser.INTEGER_NEGATIVE - 64)) | (1 << (SparqlParser.DECIMAL_NEGATIVE - 64)) | (1 << (SparqlParser.DOUBLE_NEGATIVE - 64)) | (1 << (SparqlParser.STRING_LITERAL1 - 64)) | (1 << (SparqlParser.STRING_LITERAL2 - 64)) | (1 << (SparqlParser.NIL - 64)) | (1 << (SparqlParser.ANON - 64)))) != 0):
                    self.state = 310
                    self.triplesBlock()


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

            self.state = 318
            self.match(SparqlParser.T__24)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class TriplesBlockContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def triplesSameSubject(self):
            return self.getTypedRuleContext(SparqlParser.TriplesSameSubjectContext,0)


        def triplesBlock(self):
            return self.getTypedRuleContext(SparqlParser.TriplesBlockContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_triplesBlock

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

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




    def triplesBlock(self):

        localctx = SparqlParser.TriplesBlockContext(self, self._ctx, self.state)
        self.enterRule(localctx, 44, self.RULE_triplesBlock)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 320
            self.triplesSameSubject()
            self.state = 325
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SparqlParser.T__23:
                self.state = 321
                self.match(SparqlParser.T__23)
                self.state = 323
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << SparqlParser.T__6) | (1 << SparqlParser.T__32) | (1 << SparqlParser.T__58) | (1 << SparqlParser.T__59) | (1 << SparqlParser.IRI_REF) | (1 << SparqlParser.PNAME_NS) | (1 << SparqlParser.PNAME_LN))) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & ((1 << (SparqlParser.BLANK_NODE_LABEL - 64)) | (1 << (SparqlParser.VAR1 - 64)) | (1 << (SparqlParser.VAR2 - 64)) | (1 << (SparqlParser.INTEGER - 64)) | (1 << (SparqlParser.DECIMAL - 64)) | (1 << (SparqlParser.DOUBLE - 64)) | (1 << (SparqlParser.INTEGER_POSITIVE - 64)) | (1 << (SparqlParser.DECIMAL_POSITIVE - 64)) | (1 << (SparqlParser.DOUBLE_POSITIVE - 64)) | (1 << (SparqlParser.INTEGER_NEGATIVE - 64)) | (1 << (SparqlParser.DECIMAL_NEGATIVE - 64)) | (1 << (SparqlParser.DOUBLE_NEGATIVE - 64)) | (1 << (SparqlParser.STRING_LITERAL1 - 64)) | (1 << (SparqlParser.STRING_LITERAL2 - 64)) | (1 << (SparqlParser.NIL - 64)) | (1 << (SparqlParser.ANON - 64)))) != 0):
                    self.state = 322
                    self.triplesBlock()




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


    class GraphPatternNotTriplesContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def optionalGraphPattern(self):
            return self.getTypedRuleContext(SparqlParser.OptionalGraphPatternContext,0)


        def groupOrUnionGraphPattern(self):
            return self.getTypedRuleContext(SparqlParser.GroupOrUnionGraphPatternContext,0)


        def graphGraphPattern(self):
            return self.getTypedRuleContext(SparqlParser.GraphGraphPatternContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_graphPatternNotTriples

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

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




    def graphPatternNotTriples(self):

        localctx = SparqlParser.GraphPatternNotTriplesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 46, self.RULE_graphPatternNotTriples)
        try:
            self.state = 330
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.T__25]:
                self.enterOuterAlt(localctx, 1)
                self.state = 327
                self.optionalGraphPattern()
                pass
            elif token in [SparqlParser.T__22]:
                self.enterOuterAlt(localctx, 2)
                self.state = 328
                self.groupOrUnionGraphPattern()
                pass
            elif token in [SparqlParser.T__26]:
                self.enterOuterAlt(localctx, 3)
                self.state = 329
                self.graphGraphPattern()
                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 OptionalGraphPatternContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def groupGraphPattern(self):
            return self.getTypedRuleContext(SparqlParser.GroupGraphPatternContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_optionalGraphPattern

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

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




    def optionalGraphPattern(self):

        localctx = SparqlParser.OptionalGraphPatternContext(self, self._ctx, self.state)
        self.enterRule(localctx, 48, self.RULE_optionalGraphPattern)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 332
            self.match(SparqlParser.T__25)
            self.state = 333
            self.groupGraphPattern()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class GraphGraphPatternContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def varOrIRIref(self):
            return self.getTypedRuleContext(SparqlParser.VarOrIRIrefContext,0)


        def groupGraphPattern(self):
            return self.getTypedRuleContext(SparqlParser.GroupGraphPatternContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_graphGraphPattern

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

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




    def graphGraphPattern(self):

        localctx = SparqlParser.GraphGraphPatternContext(self, self._ctx, self.state)
        self.enterRule(localctx, 50, self.RULE_graphGraphPattern)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 335
            self.match(SparqlParser.T__26)
            self.state = 336
            self.varOrIRIref()
            self.state = 337
            self.groupGraphPattern()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class GroupOrUnionGraphPatternContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def groupGraphPattern(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.GroupGraphPatternContext)
            else:
                return self.getTypedRuleContext(SparqlParser.GroupGraphPatternContext,i)


        def getRuleIndex(self):
            return SparqlParser.RULE_groupOrUnionGraphPattern

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

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




    def groupOrUnionGraphPattern(self):

        localctx = SparqlParser.GroupOrUnionGraphPatternContext(self, self._ctx, self.state)
        self.enterRule(localctx, 52, self.RULE_groupOrUnionGraphPattern)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 339
            self.groupGraphPattern()
            self.state = 344
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==SparqlParser.T__27:
                self.state = 340
                self.match(SparqlParser.T__27)
                self.state = 341
                self.groupGraphPattern()
                self.state = 346
                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 Filter_Context(ParserRuleContext):
        __slots__ = 'parser'

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

        def constraint(self):
            return self.getTypedRuleContext(SparqlParser.ConstraintContext,0)


        def getRuleIndex(self):
            return SparqlParser.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 filter_(self):

        localctx = SparqlParser.Filter_Context(self, self._ctx, self.state)
        self.enterRule(localctx, 54, self.RULE_filter_)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 347
            self.match(SparqlParser.T__28)
            self.state = 348
            self.constraint()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ConstraintContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def brackettedExpression(self):
            return self.getTypedRuleContext(SparqlParser.BrackettedExpressionContext,0)


        def builtInCall(self):
            return self.getTypedRuleContext(SparqlParser.BuiltInCallContext,0)


        def functionCall(self):
            return self.getTypedRuleContext(SparqlParser.FunctionCallContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_constraint

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

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




    def constraint(self):

        localctx = SparqlParser.ConstraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 56, self.RULE_constraint)
        try:
            self.state = 353
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.T__6]:
                self.enterOuterAlt(localctx, 1)
                self.state = 350
                self.brackettedExpression()
                pass
            elif token in [SparqlParser.T__46, SparqlParser.T__47, SparqlParser.T__48, SparqlParser.T__49, SparqlParser.T__50, SparqlParser.T__51, SparqlParser.T__52, SparqlParser.T__53, SparqlParser.T__54, SparqlParser.T__55, SparqlParser.T__56]:
                self.enterOuterAlt(localctx, 2)
                self.state = 351
                self.builtInCall()
                pass
            elif token in [SparqlParser.IRI_REF, SparqlParser.PNAME_NS, SparqlParser.PNAME_LN]:
                self.enterOuterAlt(localctx, 3)
                self.state = 352
                self.functionCall()
                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 FunctionCallContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def iriRef(self):
            return self.getTypedRuleContext(SparqlParser.IriRefContext,0)


        def argList(self):
            return self.getTypedRuleContext(SparqlParser.ArgListContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_functionCall

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

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




    def functionCall(self):

        localctx = SparqlParser.FunctionCallContext(self, self._ctx, self.state)
        self.enterRule(localctx, 58, self.RULE_functionCall)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 355
            self.iriRef()
            self.state = 356
            self.argList()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ArgListContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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


        def getRuleIndex(self):
            return SparqlParser.RULE_argList

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

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




    def argList(self):

        localctx = SparqlParser.ArgListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 60, self.RULE_argList)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 370
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.NIL]:
                self.state = 358
                self.match(SparqlParser.NIL)
                pass
            elif token in [SparqlParser.T__6]:
                self.state = 359
                self.match(SparqlParser.T__6)
                self.state = 360
                self.expression()
                self.state = 365
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==SparqlParser.T__29:
                    self.state = 361
                    self.match(SparqlParser.T__29)
                    self.state = 362
                    self.expression()
                    self.state = 367
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 368
                self.match(SparqlParser.T__8)
                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 ConstructTemplateContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def constructTriples(self):
            return self.getTypedRuleContext(SparqlParser.ConstructTriplesContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_constructTemplate

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

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




    def constructTemplate(self):

        localctx = SparqlParser.ConstructTemplateContext(self, self._ctx, self.state)
        self.enterRule(localctx, 62, self.RULE_constructTemplate)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 372
            self.match(SparqlParser.T__22)
            self.state = 374
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << SparqlParser.T__6) | (1 << SparqlParser.T__32) | (1 << SparqlParser.T__58) | (1 << SparqlParser.T__59) | (1 << SparqlParser.IRI_REF) | (1 << SparqlParser.PNAME_NS) | (1 << SparqlParser.PNAME_LN))) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & ((1 << (SparqlParser.BLANK_NODE_LABEL - 64)) | (1 << (SparqlParser.VAR1 - 64)) | (1 << (SparqlParser.VAR2 - 64)) | (1 << (SparqlParser.INTEGER - 64)) | (1 << (SparqlParser.DECIMAL - 64)) | (1 << (SparqlParser.DOUBLE - 64)) | (1 << (SparqlParser.INTEGER_POSITIVE - 64)) | (1 << (SparqlParser.DECIMAL_POSITIVE - 64)) | (1 << (SparqlParser.DOUBLE_POSITIVE - 64)) | (1 << (SparqlParser.INTEGER_NEGATIVE - 64)) | (1 << (SparqlParser.DECIMAL_NEGATIVE - 64)) | (1 << (SparqlParser.DOUBLE_NEGATIVE - 64)) | (1 << (SparqlParser.STRING_LITERAL1 - 64)) | (1 << (SparqlParser.STRING_LITERAL2 - 64)) | (1 << (SparqlParser.NIL - 64)) | (1 << (SparqlParser.ANON - 64)))) != 0):
                self.state = 373
                self.constructTriples()


            self.state = 376
            self.match(SparqlParser.T__24)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ConstructTriplesContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def triplesSameSubject(self):
            return self.getTypedRuleContext(SparqlParser.TriplesSameSubjectContext,0)


        def constructTriples(self):
            return self.getTypedRuleContext(SparqlParser.ConstructTriplesContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_constructTriples

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

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




    def constructTriples(self):

        localctx = SparqlParser.ConstructTriplesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 64, self.RULE_constructTriples)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 378
            self.triplesSameSubject()
            self.state = 383
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SparqlParser.T__23:
                self.state = 379
                self.match(SparqlParser.T__23)
                self.state = 381
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << SparqlParser.T__6) | (1 << SparqlParser.T__32) | (1 << SparqlParser.T__58) | (1 << SparqlParser.T__59) | (1 << SparqlParser.IRI_REF) | (1 << SparqlParser.PNAME_NS) | (1 << SparqlParser.PNAME_LN))) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & ((1 << (SparqlParser.BLANK_NODE_LABEL - 64)) | (1 << (SparqlParser.VAR1 - 64)) | (1 << (SparqlParser.VAR2 - 64)) | (1 << (SparqlParser.INTEGER - 64)) | (1 << (SparqlParser.DECIMAL - 64)) | (1 << (SparqlParser.DOUBLE - 64)) | (1 << (SparqlParser.INTEGER_POSITIVE - 64)) | (1 << (SparqlParser.DECIMAL_POSITIVE - 64)) | (1 << (SparqlParser.DOUBLE_POSITIVE - 64)) | (1 << (SparqlParser.INTEGER_NEGATIVE - 64)) | (1 << (SparqlParser.DECIMAL_NEGATIVE - 64)) | (1 << (SparqlParser.DOUBLE_NEGATIVE - 64)) | (1 << (SparqlParser.STRING_LITERAL1 - 64)) | (1 << (SparqlParser.STRING_LITERAL2 - 64)) | (1 << (SparqlParser.NIL - 64)) | (1 << (SparqlParser.ANON - 64)))) != 0):
                    self.state = 380
                    self.constructTriples()




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


    class TriplesSameSubjectContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def varOrTerm(self):
            return self.getTypedRuleContext(SparqlParser.VarOrTermContext,0)


        def propertyListNotEmpty(self):
            return self.getTypedRuleContext(SparqlParser.PropertyListNotEmptyContext,0)


        def triplesNode(self):
            return self.getTypedRuleContext(SparqlParser.TriplesNodeContext,0)


        def propertyList(self):
            return self.getTypedRuleContext(SparqlParser.PropertyListContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_triplesSameSubject

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

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




    def triplesSameSubject(self):

        localctx = SparqlParser.TriplesSameSubjectContext(self, self._ctx, self.state)
        self.enterRule(localctx, 66, self.RULE_triplesSameSubject)
        try:
            self.state = 391
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.T__58, SparqlParser.T__59, SparqlParser.IRI_REF, SparqlParser.PNAME_NS, SparqlParser.PNAME_LN, SparqlParser.BLANK_NODE_LABEL, SparqlParser.VAR1, SparqlParser.VAR2, SparqlParser.INTEGER, SparqlParser.DECIMAL, SparqlParser.DOUBLE, SparqlParser.INTEGER_POSITIVE, SparqlParser.DECIMAL_POSITIVE, SparqlParser.DOUBLE_POSITIVE, SparqlParser.INTEGER_NEGATIVE, SparqlParser.DECIMAL_NEGATIVE, SparqlParser.DOUBLE_NEGATIVE, SparqlParser.STRING_LITERAL1, SparqlParser.STRING_LITERAL2, SparqlParser.NIL, SparqlParser.ANON]:
                self.enterOuterAlt(localctx, 1)
                self.state = 385
                self.varOrTerm()
                self.state = 386
                self.propertyListNotEmpty()
                pass
            elif token in [SparqlParser.T__6, SparqlParser.T__32]:
                self.enterOuterAlt(localctx, 2)
                self.state = 388
                self.triplesNode()
                self.state = 389
                self.propertyList()
                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 PropertyListNotEmptyContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def verb(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.VerbContext)
            else:
                return self.getTypedRuleContext(SparqlParser.VerbContext,i)


        def objectList(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.ObjectListContext)
            else:
                return self.getTypedRuleContext(SparqlParser.ObjectListContext,i)


        def getRuleIndex(self):
            return SparqlParser.RULE_propertyListNotEmpty

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

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




    def propertyListNotEmpty(self):

        localctx = SparqlParser.PropertyListNotEmptyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 68, self.RULE_propertyListNotEmpty)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 393
            self.verb()
            self.state = 394
            self.objectList()
            self.state = 403
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==SparqlParser.T__30:
                self.state = 395
                self.match(SparqlParser.T__30)
                self.state = 399
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if ((((_la - 32)) & ~0x3f) == 0 and ((1 << (_la - 32)) & ((1 << (SparqlParser.T__31 - 32)) | (1 << (SparqlParser.IRI_REF - 32)) | (1 << (SparqlParser.PNAME_NS - 32)) | (1 << (SparqlParser.PNAME_LN - 32)) | (1 << (SparqlParser.VAR1 - 32)) | (1 << (SparqlParser.VAR2 - 32)))) != 0):
                    self.state = 396
                    self.verb()
                    self.state = 397
                    self.objectList()


                self.state = 405
                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 PropertyListContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def propertyListNotEmpty(self):
            return self.getTypedRuleContext(SparqlParser.PropertyListNotEmptyContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_propertyList

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

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




    def propertyList(self):

        localctx = SparqlParser.PropertyListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 70, self.RULE_propertyList)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 407
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if ((((_la - 32)) & ~0x3f) == 0 and ((1 << (_la - 32)) & ((1 << (SparqlParser.T__31 - 32)) | (1 << (SparqlParser.IRI_REF - 32)) | (1 << (SparqlParser.PNAME_NS - 32)) | (1 << (SparqlParser.PNAME_LN - 32)) | (1 << (SparqlParser.VAR1 - 32)) | (1 << (SparqlParser.VAR2 - 32)))) != 0):
                self.state = 406
                self.propertyListNotEmpty()


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


    class ObjectListContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def object_(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.Object_Context)
            else:
                return self.getTypedRuleContext(SparqlParser.Object_Context,i)


        def getRuleIndex(self):
            return SparqlParser.RULE_objectList

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

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




    def objectList(self):

        localctx = SparqlParser.ObjectListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 72, self.RULE_objectList)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 409
            self.object_()
            self.state = 414
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==SparqlParser.T__29:
                self.state = 410
                self.match(SparqlParser.T__29)
                self.state = 411
                self.object_()
                self.state = 416
                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 Object_Context(ParserRuleContext):
        __slots__ = 'parser'

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

        def graphNode(self):
            return self.getTypedRuleContext(SparqlParser.GraphNodeContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_object_

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

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




    def object_(self):

        localctx = SparqlParser.Object_Context(self, self._ctx, self.state)
        self.enterRule(localctx, 74, self.RULE_object_)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 417
            self.graphNode()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class VerbContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def varOrIRIref(self):
            return self.getTypedRuleContext(SparqlParser.VarOrIRIrefContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_verb

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

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




    def verb(self):

        localctx = SparqlParser.VerbContext(self, self._ctx, self.state)
        self.enterRule(localctx, 76, self.RULE_verb)
        try:
            self.state = 421
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.IRI_REF, SparqlParser.PNAME_NS, SparqlParser.PNAME_LN, SparqlParser.VAR1, SparqlParser.VAR2]:
                self.enterOuterAlt(localctx, 1)
                self.state = 419
                self.varOrIRIref()
                pass
            elif token in [SparqlParser.T__31]:
                self.enterOuterAlt(localctx, 2)
                self.state = 420
                self.match(SparqlParser.T__31)
                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 TriplesNodeContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def collection(self):
            return self.getTypedRuleContext(SparqlParser.CollectionContext,0)


        def blankNodePropertyList(self):
            return self.getTypedRuleContext(SparqlParser.BlankNodePropertyListContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_triplesNode

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

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




    def triplesNode(self):

        localctx = SparqlParser.TriplesNodeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 78, self.RULE_triplesNode)
        try:
            self.state = 425
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.T__6]:
                self.enterOuterAlt(localctx, 1)
                self.state = 423
                self.collection()
                pass
            elif token in [SparqlParser.T__32]:
                self.enterOuterAlt(localctx, 2)
                self.state = 424
                self.blankNodePropertyList()
                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 BlankNodePropertyListContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def propertyListNotEmpty(self):
            return self.getTypedRuleContext(SparqlParser.PropertyListNotEmptyContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_blankNodePropertyList

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

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




    def blankNodePropertyList(self):

        localctx = SparqlParser.BlankNodePropertyListContext(self, self._ctx, self.state)
        self.enterRule(localctx, 80, self.RULE_blankNodePropertyList)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 427
            self.match(SparqlParser.T__32)
            self.state = 428
            self.propertyListNotEmpty()
            self.state = 429
            self.match(SparqlParser.T__33)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class CollectionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def graphNode(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.GraphNodeContext)
            else:
                return self.getTypedRuleContext(SparqlParser.GraphNodeContext,i)


        def getRuleIndex(self):
            return SparqlParser.RULE_collection

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

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




    def collection(self):

        localctx = SparqlParser.CollectionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 82, self.RULE_collection)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 431
            self.match(SparqlParser.T__6)
            self.state = 433 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 432
                self.graphNode()
                self.state = 435 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << SparqlParser.T__6) | (1 << SparqlParser.T__32) | (1 << SparqlParser.T__58) | (1 << SparqlParser.T__59) | (1 << SparqlParser.IRI_REF) | (1 << SparqlParser.PNAME_NS) | (1 << SparqlParser.PNAME_LN))) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & ((1 << (SparqlParser.BLANK_NODE_LABEL - 64)) | (1 << (SparqlParser.VAR1 - 64)) | (1 << (SparqlParser.VAR2 - 64)) | (1 << (SparqlParser.INTEGER - 64)) | (1 << (SparqlParser.DECIMAL - 64)) | (1 << (SparqlParser.DOUBLE - 64)) | (1 << (SparqlParser.INTEGER_POSITIVE - 64)) | (1 << (SparqlParser.DECIMAL_POSITIVE - 64)) | (1 << (SparqlParser.DOUBLE_POSITIVE - 64)) | (1 << (SparqlParser.INTEGER_NEGATIVE - 64)) | (1 << (SparqlParser.DECIMAL_NEGATIVE - 64)) | (1 << (SparqlParser.DOUBLE_NEGATIVE - 64)) | (1 << (SparqlParser.STRING_LITERAL1 - 64)) | (1 << (SparqlParser.STRING_LITERAL2 - 64)) | (1 << (SparqlParser.NIL - 64)) | (1 << (SparqlParser.ANON - 64)))) != 0)):
                    break

            self.state = 437
            self.match(SparqlParser.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 GraphNodeContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def varOrTerm(self):
            return self.getTypedRuleContext(SparqlParser.VarOrTermContext,0)


        def triplesNode(self):
            return self.getTypedRuleContext(SparqlParser.TriplesNodeContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_graphNode

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

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




    def graphNode(self):

        localctx = SparqlParser.GraphNodeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 84, self.RULE_graphNode)
        try:
            self.state = 441
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.T__58, SparqlParser.T__59, SparqlParser.IRI_REF, SparqlParser.PNAME_NS, SparqlParser.PNAME_LN, SparqlParser.BLANK_NODE_LABEL, SparqlParser.VAR1, SparqlParser.VAR2, SparqlParser.INTEGER, SparqlParser.DECIMAL, SparqlParser.DOUBLE, SparqlParser.INTEGER_POSITIVE, SparqlParser.DECIMAL_POSITIVE, SparqlParser.DOUBLE_POSITIVE, SparqlParser.INTEGER_NEGATIVE, SparqlParser.DECIMAL_NEGATIVE, SparqlParser.DOUBLE_NEGATIVE, SparqlParser.STRING_LITERAL1, SparqlParser.STRING_LITERAL2, SparqlParser.NIL, SparqlParser.ANON]:
                self.enterOuterAlt(localctx, 1)
                self.state = 439
                self.varOrTerm()
                pass
            elif token in [SparqlParser.T__6, SparqlParser.T__32]:
                self.enterOuterAlt(localctx, 2)
                self.state = 440
                self.triplesNode()
                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 VarOrTermContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def var_(self):
            return self.getTypedRuleContext(SparqlParser.Var_Context,0)


        def graphTerm(self):
            return self.getTypedRuleContext(SparqlParser.GraphTermContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_varOrTerm

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

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




    def varOrTerm(self):

        localctx = SparqlParser.VarOrTermContext(self, self._ctx, self.state)
        self.enterRule(localctx, 86, self.RULE_varOrTerm)
        try:
            self.state = 445
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.VAR1, SparqlParser.VAR2]:
                self.enterOuterAlt(localctx, 1)
                self.state = 443
                self.var_()
                pass
            elif token in [SparqlParser.T__58, SparqlParser.T__59, SparqlParser.IRI_REF, SparqlParser.PNAME_NS, SparqlParser.PNAME_LN, SparqlParser.BLANK_NODE_LABEL, SparqlParser.INTEGER, SparqlParser.DECIMAL, SparqlParser.DOUBLE, SparqlParser.INTEGER_POSITIVE, SparqlParser.DECIMAL_POSITIVE, SparqlParser.DOUBLE_POSITIVE, SparqlParser.INTEGER_NEGATIVE, SparqlParser.DECIMAL_NEGATIVE, SparqlParser.DOUBLE_NEGATIVE, SparqlParser.STRING_LITERAL1, SparqlParser.STRING_LITERAL2, SparqlParser.NIL, SparqlParser.ANON]:
                self.enterOuterAlt(localctx, 2)
                self.state = 444
                self.graphTerm()
                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 VarOrIRIrefContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def var_(self):
            return self.getTypedRuleContext(SparqlParser.Var_Context,0)


        def iriRef(self):
            return self.getTypedRuleContext(SparqlParser.IriRefContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_varOrIRIref

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

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




    def varOrIRIref(self):

        localctx = SparqlParser.VarOrIRIrefContext(self, self._ctx, self.state)
        self.enterRule(localctx, 88, self.RULE_varOrIRIref)
        try:
            self.state = 449
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.VAR1, SparqlParser.VAR2]:
                self.enterOuterAlt(localctx, 1)
                self.state = 447
                self.var_()
                pass
            elif token in [SparqlParser.IRI_REF, SparqlParser.PNAME_NS, SparqlParser.PNAME_LN]:
                self.enterOuterAlt(localctx, 2)
                self.state = 448
                self.iriRef()
                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 Var_Context(ParserRuleContext):
        __slots__ = 'parser'

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

        def VAR1(self):
            return self.getToken(SparqlParser.VAR1, 0)

        def VAR2(self):
            return self.getToken(SparqlParser.VAR2, 0)

        def getRuleIndex(self):
            return SparqlParser.RULE_var_

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

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




    def var_(self):

        localctx = SparqlParser.Var_Context(self, self._ctx, self.state)
        self.enterRule(localctx, 90, self.RULE_var_)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 451
            _la = self._input.LA(1)
            if not(_la==SparqlParser.VAR1 or _la==SparqlParser.VAR2):
                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 GraphTermContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def iriRef(self):
            return self.getTypedRuleContext(SparqlParser.IriRefContext,0)


        def rdfLiteral(self):
            return self.getTypedRuleContext(SparqlParser.RdfLiteralContext,0)


        def numericLiteral(self):
            return self.getTypedRuleContext(SparqlParser.NumericLiteralContext,0)


        def booleanLiteral(self):
            return self.getTypedRuleContext(SparqlParser.BooleanLiteralContext,0)


        def blankNode(self):
            return self.getTypedRuleContext(SparqlParser.BlankNodeContext,0)


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

        def getRuleIndex(self):
            return SparqlParser.RULE_graphTerm

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

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




    def graphTerm(self):

        localctx = SparqlParser.GraphTermContext(self, self._ctx, self.state)
        self.enterRule(localctx, 92, self.RULE_graphTerm)
        try:
            self.state = 459
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.IRI_REF, SparqlParser.PNAME_NS, SparqlParser.PNAME_LN]:
                self.enterOuterAlt(localctx, 1)
                self.state = 453
                self.iriRef()
                pass
            elif token in [SparqlParser.STRING_LITERAL1, SparqlParser.STRING_LITERAL2]:
                self.enterOuterAlt(localctx, 2)
                self.state = 454
                self.rdfLiteral()
                pass
            elif token in [SparqlParser.INTEGER, SparqlParser.DECIMAL, SparqlParser.DOUBLE, SparqlParser.INTEGER_POSITIVE, SparqlParser.DECIMAL_POSITIVE, SparqlParser.DOUBLE_POSITIVE, SparqlParser.INTEGER_NEGATIVE, SparqlParser.DECIMAL_NEGATIVE, SparqlParser.DOUBLE_NEGATIVE]:
                self.enterOuterAlt(localctx, 3)
                self.state = 455
                self.numericLiteral()
                pass
            elif token in [SparqlParser.T__58, SparqlParser.T__59]:
                self.enterOuterAlt(localctx, 4)
                self.state = 456
                self.booleanLiteral()
                pass
            elif token in [SparqlParser.BLANK_NODE_LABEL, SparqlParser.ANON]:
                self.enterOuterAlt(localctx, 5)
                self.state = 457
                self.blankNode()
                pass
            elif token in [SparqlParser.NIL]:
                self.enterOuterAlt(localctx, 6)
                self.state = 458
                self.match(SparqlParser.NIL)
                pass
            else:
                raise NoViableAltException(self)

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


    class ExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def conditionalOrExpression(self):
            return self.getTypedRuleContext(SparqlParser.ConditionalOrExpressionContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_expression

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

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




    def expression(self):

        localctx = SparqlParser.ExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 94, self.RULE_expression)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 461
            self.conditionalOrExpression()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ConditionalOrExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def conditionalAndExpression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.ConditionalAndExpressionContext)
            else:
                return self.getTypedRuleContext(SparqlParser.ConditionalAndExpressionContext,i)


        def getRuleIndex(self):
            return SparqlParser.RULE_conditionalOrExpression

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

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




    def conditionalOrExpression(self):

        localctx = SparqlParser.ConditionalOrExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 96, self.RULE_conditionalOrExpression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 463
            self.conditionalAndExpression()
            self.state = 468
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==SparqlParser.T__34:
                self.state = 464
                self.match(SparqlParser.T__34)
                self.state = 465
                self.conditionalAndExpression()
                self.state = 470
                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 ConditionalAndExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def valueLogical(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.ValueLogicalContext)
            else:
                return self.getTypedRuleContext(SparqlParser.ValueLogicalContext,i)


        def getRuleIndex(self):
            return SparqlParser.RULE_conditionalAndExpression

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

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




    def conditionalAndExpression(self):

        localctx = SparqlParser.ConditionalAndExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 98, self.RULE_conditionalAndExpression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 471
            self.valueLogical()
            self.state = 476
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==SparqlParser.T__35:
                self.state = 472
                self.match(SparqlParser.T__35)
                self.state = 473
                self.valueLogical()
                self.state = 478
                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 ValueLogicalContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def relationalExpression(self):
            return self.getTypedRuleContext(SparqlParser.RelationalExpressionContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_valueLogical

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

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




    def valueLogical(self):

        localctx = SparqlParser.ValueLogicalContext(self, self._ctx, self.state)
        self.enterRule(localctx, 100, self.RULE_valueLogical)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 479
            self.relationalExpression()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RelationalExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def numericExpression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.NumericExpressionContext)
            else:
                return self.getTypedRuleContext(SparqlParser.NumericExpressionContext,i)


        def getRuleIndex(self):
            return SparqlParser.RULE_relationalExpression

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

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




    def relationalExpression(self):

        localctx = SparqlParser.RelationalExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 102, self.RULE_relationalExpression)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 481
            self.numericExpression()
            self.state = 494
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.T__36]:
                self.state = 482
                self.match(SparqlParser.T__36)
                self.state = 483
                self.numericExpression()
                pass
            elif token in [SparqlParser.T__37]:
                self.state = 484
                self.match(SparqlParser.T__37)
                self.state = 485
                self.numericExpression()
                pass
            elif token in [SparqlParser.T__38]:
                self.state = 486
                self.match(SparqlParser.T__38)
                self.state = 487
                self.numericExpression()
                pass
            elif token in [SparqlParser.T__39]:
                self.state = 488
                self.match(SparqlParser.T__39)
                self.state = 489
                self.numericExpression()
                pass
            elif token in [SparqlParser.T__40]:
                self.state = 490
                self.match(SparqlParser.T__40)
                self.state = 491
                self.numericExpression()
                pass
            elif token in [SparqlParser.T__41]:
                self.state = 492
                self.match(SparqlParser.T__41)
                self.state = 493
                self.numericExpression()
                pass
            elif token in [SparqlParser.T__8, SparqlParser.T__29, SparqlParser.T__34, SparqlParser.T__35]:
                pass
            else:
                pass
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class NumericExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def additiveExpression(self):
            return self.getTypedRuleContext(SparqlParser.AdditiveExpressionContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_numericExpression

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

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




    def numericExpression(self):

        localctx = SparqlParser.NumericExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 104, self.RULE_numericExpression)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 496
            self.additiveExpression()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AdditiveExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def multiplicativeExpression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.MultiplicativeExpressionContext)
            else:
                return self.getTypedRuleContext(SparqlParser.MultiplicativeExpressionContext,i)


        def numericLiteralPositive(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.NumericLiteralPositiveContext)
            else:
                return self.getTypedRuleContext(SparqlParser.NumericLiteralPositiveContext,i)


        def numericLiteralNegative(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.NumericLiteralNegativeContext)
            else:
                return self.getTypedRuleContext(SparqlParser.NumericLiteralNegativeContext,i)


        def getRuleIndex(self):
            return SparqlParser.RULE_additiveExpression

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

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




    def additiveExpression(self):

        localctx = SparqlParser.AdditiveExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 106, self.RULE_additiveExpression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 498
            self.multiplicativeExpression()
            self.state = 507
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while ((((_la - 43)) & ~0x3f) == 0 and ((1 << (_la - 43)) & ((1 << (SparqlParser.T__42 - 43)) | (1 << (SparqlParser.T__43 - 43)) | (1 << (SparqlParser.INTEGER_POSITIVE - 43)) | (1 << (SparqlParser.DECIMAL_POSITIVE - 43)) | (1 << (SparqlParser.DOUBLE_POSITIVE - 43)) | (1 << (SparqlParser.INTEGER_NEGATIVE - 43)) | (1 << (SparqlParser.DECIMAL_NEGATIVE - 43)) | (1 << (SparqlParser.DOUBLE_NEGATIVE - 43)))) != 0):
                self.state = 505
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [SparqlParser.T__42]:
                    self.state = 499
                    self.match(SparqlParser.T__42)
                    self.state = 500
                    self.multiplicativeExpression()
                    pass
                elif token in [SparqlParser.T__43]:
                    self.state = 501
                    self.match(SparqlParser.T__43)
                    self.state = 502
                    self.multiplicativeExpression()
                    pass
                elif token in [SparqlParser.INTEGER_POSITIVE, SparqlParser.DECIMAL_POSITIVE, SparqlParser.DOUBLE_POSITIVE]:
                    self.state = 503
                    self.numericLiteralPositive()
                    pass
                elif token in [SparqlParser.INTEGER_NEGATIVE, SparqlParser.DECIMAL_NEGATIVE, SparqlParser.DOUBLE_NEGATIVE]:
                    self.state = 504
                    self.numericLiteralNegative()
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 509
                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 MultiplicativeExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def unaryExpression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(SparqlParser.UnaryExpressionContext)
            else:
                return self.getTypedRuleContext(SparqlParser.UnaryExpressionContext,i)


        def getRuleIndex(self):
            return SparqlParser.RULE_multiplicativeExpression

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

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




    def multiplicativeExpression(self):

        localctx = SparqlParser.MultiplicativeExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 108, self.RULE_multiplicativeExpression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 510
            self.unaryExpression()
            self.state = 517
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==SparqlParser.T__5 or _la==SparqlParser.T__44:
                self.state = 515
                self._errHandler.sync(self)
                token = self._input.LA(1)
                if token in [SparqlParser.T__5]:
                    self.state = 511
                    self.match(SparqlParser.T__5)
                    self.state = 512
                    self.unaryExpression()
                    pass
                elif token in [SparqlParser.T__44]:
                    self.state = 513
                    self.match(SparqlParser.T__44)
                    self.state = 514
                    self.unaryExpression()
                    pass
                else:
                    raise NoViableAltException(self)

                self.state = 519
                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 UnaryExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def primaryExpression(self):
            return self.getTypedRuleContext(SparqlParser.PrimaryExpressionContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_unaryExpression

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

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




    def unaryExpression(self):

        localctx = SparqlParser.UnaryExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 110, self.RULE_unaryExpression)
        try:
            self.state = 527
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.T__45]:
                self.enterOuterAlt(localctx, 1)
                self.state = 520
                self.match(SparqlParser.T__45)
                self.state = 521
                self.primaryExpression()
                pass
            elif token in [SparqlParser.T__42]:
                self.enterOuterAlt(localctx, 2)
                self.state = 522
                self.match(SparqlParser.T__42)
                self.state = 523
                self.primaryExpression()
                pass
            elif token in [SparqlParser.T__43]:
                self.enterOuterAlt(localctx, 3)
                self.state = 524
                self.match(SparqlParser.T__43)
                self.state = 525
                self.primaryExpression()
                pass
            elif token in [SparqlParser.T__6, SparqlParser.T__46, SparqlParser.T__47, SparqlParser.T__48, SparqlParser.T__49, SparqlParser.T__50, SparqlParser.T__51, SparqlParser.T__52, SparqlParser.T__53, SparqlParser.T__54, SparqlParser.T__55, SparqlParser.T__56, SparqlParser.T__58, SparqlParser.T__59, SparqlParser.IRI_REF, SparqlParser.PNAME_NS, SparqlParser.PNAME_LN, SparqlParser.VAR1, SparqlParser.VAR2, SparqlParser.INTEGER, SparqlParser.DECIMAL, SparqlParser.DOUBLE, SparqlParser.INTEGER_POSITIVE, SparqlParser.DECIMAL_POSITIVE, SparqlParser.DOUBLE_POSITIVE, SparqlParser.INTEGER_NEGATIVE, SparqlParser.DECIMAL_NEGATIVE, SparqlParser.DOUBLE_NEGATIVE, SparqlParser.STRING_LITERAL1, SparqlParser.STRING_LITERAL2]:
                self.enterOuterAlt(localctx, 4)
                self.state = 526
                self.primaryExpression()
                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 PrimaryExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def brackettedExpression(self):
            return self.getTypedRuleContext(SparqlParser.BrackettedExpressionContext,0)


        def builtInCall(self):
            return self.getTypedRuleContext(SparqlParser.BuiltInCallContext,0)


        def iriRefOrFunction(self):
            return self.getTypedRuleContext(SparqlParser.IriRefOrFunctionContext,0)


        def rdfLiteral(self):
            return self.getTypedRuleContext(SparqlParser.RdfLiteralContext,0)


        def numericLiteral(self):
            return self.getTypedRuleContext(SparqlParser.NumericLiteralContext,0)


        def booleanLiteral(self):
            return self.getTypedRuleContext(SparqlParser.BooleanLiteralContext,0)


        def var_(self):
            return self.getTypedRuleContext(SparqlParser.Var_Context,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_primaryExpression

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

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




    def primaryExpression(self):

        localctx = SparqlParser.PrimaryExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 112, self.RULE_primaryExpression)
        try:
            self.state = 536
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.T__6]:
                self.enterOuterAlt(localctx, 1)
                self.state = 529
                self.brackettedExpression()
                pass
            elif token in [SparqlParser.T__46, SparqlParser.T__47, SparqlParser.T__48, SparqlParser.T__49, SparqlParser.T__50, SparqlParser.T__51, SparqlParser.T__52, SparqlParser.T__53, SparqlParser.T__54, SparqlParser.T__55, SparqlParser.T__56]:
                self.enterOuterAlt(localctx, 2)
                self.state = 530
                self.builtInCall()
                pass
            elif token in [SparqlParser.IRI_REF, SparqlParser.PNAME_NS, SparqlParser.PNAME_LN]:
                self.enterOuterAlt(localctx, 3)
                self.state = 531
                self.iriRefOrFunction()
                pass
            elif token in [SparqlParser.STRING_LITERAL1, SparqlParser.STRING_LITERAL2]:
                self.enterOuterAlt(localctx, 4)
                self.state = 532
                self.rdfLiteral()
                pass
            elif token in [SparqlParser.INTEGER, SparqlParser.DECIMAL, SparqlParser.DOUBLE, SparqlParser.INTEGER_POSITIVE, SparqlParser.DECIMAL_POSITIVE, SparqlParser.DOUBLE_POSITIVE, SparqlParser.INTEGER_NEGATIVE, SparqlParser.DECIMAL_NEGATIVE, SparqlParser.DOUBLE_NEGATIVE]:
                self.enterOuterAlt(localctx, 5)
                self.state = 533
                self.numericLiteral()
                pass
            elif token in [SparqlParser.T__58, SparqlParser.T__59]:
                self.enterOuterAlt(localctx, 6)
                self.state = 534
                self.booleanLiteral()
                pass
            elif token in [SparqlParser.VAR1, SparqlParser.VAR2]:
                self.enterOuterAlt(localctx, 7)
                self.state = 535
                self.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 BrackettedExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


        def getRuleIndex(self):
            return SparqlParser.RULE_brackettedExpression

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

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




    def brackettedExpression(self):

        localctx = SparqlParser.BrackettedExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 114, self.RULE_brackettedExpression)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 538
            self.match(SparqlParser.T__6)
            self.state = 539
            self.expression()
            self.state = 540
            self.match(SparqlParser.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 BuiltInCallContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


        def var_(self):
            return self.getTypedRuleContext(SparqlParser.Var_Context,0)


        def regexExpression(self):
            return self.getTypedRuleContext(SparqlParser.RegexExpressionContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_builtInCall

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

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




    def builtInCall(self):

        localctx = SparqlParser.BuiltInCallContext(self, self._ctx, self.state)
        self.enterRule(localctx, 116, self.RULE_builtInCall)
        try:
            self.state = 597
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.T__46]:
                self.enterOuterAlt(localctx, 1)
                self.state = 542
                self.match(SparqlParser.T__46)
                self.state = 543
                self.match(SparqlParser.T__6)
                self.state = 544
                self.expression()
                self.state = 545
                self.match(SparqlParser.T__8)
                pass
            elif token in [SparqlParser.T__47]:
                self.enterOuterAlt(localctx, 2)
                self.state = 547
                self.match(SparqlParser.T__47)
                self.state = 548
                self.match(SparqlParser.T__6)
                self.state = 549
                self.expression()
                self.state = 550
                self.match(SparqlParser.T__8)
                pass
            elif token in [SparqlParser.T__48]:
                self.enterOuterAlt(localctx, 3)
                self.state = 552
                self.match(SparqlParser.T__48)
                self.state = 553
                self.match(SparqlParser.T__6)
                self.state = 554
                self.expression()
                self.state = 555
                self.match(SparqlParser.T__29)
                self.state = 556
                self.expression()
                self.state = 557
                self.match(SparqlParser.T__8)
                pass
            elif token in [SparqlParser.T__49]:
                self.enterOuterAlt(localctx, 4)
                self.state = 559
                self.match(SparqlParser.T__49)
                self.state = 560
                self.match(SparqlParser.T__6)
                self.state = 561
                self.expression()
                self.state = 562
                self.match(SparqlParser.T__8)
                pass
            elif token in [SparqlParser.T__50]:
                self.enterOuterAlt(localctx, 5)
                self.state = 564
                self.match(SparqlParser.T__50)
                self.state = 565
                self.match(SparqlParser.T__6)
                self.state = 566
                self.var_()
                self.state = 567
                self.match(SparqlParser.T__8)
                pass
            elif token in [SparqlParser.T__51]:
                self.enterOuterAlt(localctx, 6)
                self.state = 569
                self.match(SparqlParser.T__51)
                self.state = 570
                self.match(SparqlParser.T__6)
                self.state = 571
                self.expression()
                self.state = 572
                self.match(SparqlParser.T__29)
                self.state = 573
                self.expression()
                self.state = 574
                self.match(SparqlParser.T__8)
                pass
            elif token in [SparqlParser.T__52]:
                self.enterOuterAlt(localctx, 7)
                self.state = 576
                self.match(SparqlParser.T__52)
                self.state = 577
                self.match(SparqlParser.T__6)
                self.state = 578
                self.expression()
                self.state = 579
                self.match(SparqlParser.T__8)
                pass
            elif token in [SparqlParser.T__53]:
                self.enterOuterAlt(localctx, 8)
                self.state = 581
                self.match(SparqlParser.T__53)
                self.state = 582
                self.match(SparqlParser.T__6)
                self.state = 583
                self.expression()
                self.state = 584
                self.match(SparqlParser.T__8)
                pass
            elif token in [SparqlParser.T__54]:
                self.enterOuterAlt(localctx, 9)
                self.state = 586
                self.match(SparqlParser.T__54)
                self.state = 587
                self.match(SparqlParser.T__6)
                self.state = 588
                self.expression()
                self.state = 589
                self.match(SparqlParser.T__8)
                pass
            elif token in [SparqlParser.T__55]:
                self.enterOuterAlt(localctx, 10)
                self.state = 591
                self.match(SparqlParser.T__55)
                self.state = 592
                self.match(SparqlParser.T__6)
                self.state = 593
                self.expression()
                self.state = 594
                self.match(SparqlParser.T__8)
                pass
            elif token in [SparqlParser.T__56]:
                self.enterOuterAlt(localctx, 11)
                self.state = 596
                self.regexExpression()
                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 RegexExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


        def getRuleIndex(self):
            return SparqlParser.RULE_regexExpression

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

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




    def regexExpression(self):

        localctx = SparqlParser.RegexExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 118, self.RULE_regexExpression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 599
            self.match(SparqlParser.T__56)
            self.state = 600
            self.match(SparqlParser.T__6)
            self.state = 601
            self.expression()
            self.state = 602
            self.match(SparqlParser.T__29)
            self.state = 603
            self.expression()
            self.state = 606
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SparqlParser.T__29:
                self.state = 604
                self.match(SparqlParser.T__29)
                self.state = 605
                self.expression()


            self.state = 608
            self.match(SparqlParser.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 IriRefOrFunctionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def iriRef(self):
            return self.getTypedRuleContext(SparqlParser.IriRefContext,0)


        def argList(self):
            return self.getTypedRuleContext(SparqlParser.ArgListContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_iriRefOrFunction

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

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




    def iriRefOrFunction(self):

        localctx = SparqlParser.IriRefOrFunctionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 120, self.RULE_iriRefOrFunction)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 610
            self.iriRef()
            self.state = 612
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==SparqlParser.T__6 or _la==SparqlParser.NIL:
                self.state = 611
                self.argList()


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


    class RdfLiteralContext(ParserRuleContext):
        __slots__ = 'parser'

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

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


        def LANGTAG(self):
            return self.getToken(SparqlParser.LANGTAG, 0)

        def iriRef(self):
            return self.getTypedRuleContext(SparqlParser.IriRefContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_rdfLiteral

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

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




    def rdfLiteral(self):

        localctx = SparqlParser.RdfLiteralContext(self, self._ctx, self.state)
        self.enterRule(localctx, 122, self.RULE_rdfLiteral)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 614
            self.string()
            self.state = 618
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.LANGTAG]:
                self.state = 615
                self.match(SparqlParser.LANGTAG)
                pass
            elif token in [SparqlParser.T__57]:
                self.state = 616
                self.match(SparqlParser.T__57)
                self.state = 617
                self.iriRef()
                pass
            elif token in [SparqlParser.T__5, SparqlParser.T__6, SparqlParser.T__8, SparqlParser.T__22, SparqlParser.T__23, SparqlParser.T__24, SparqlParser.T__25, SparqlParser.T__26, SparqlParser.T__28, SparqlParser.T__29, SparqlParser.T__30, SparqlParser.T__31, SparqlParser.T__32, SparqlParser.T__33, SparqlParser.T__34, SparqlParser.T__35, SparqlParser.T__36, SparqlParser.T__37, SparqlParser.T__38, SparqlParser.T__39, SparqlParser.T__40, SparqlParser.T__41, SparqlParser.T__42, SparqlParser.T__43, SparqlParser.T__44, SparqlParser.T__58, SparqlParser.T__59, SparqlParser.IRI_REF, SparqlParser.PNAME_NS, SparqlParser.PNAME_LN, SparqlParser.BLANK_NODE_LABEL, SparqlParser.VAR1, SparqlParser.VAR2, SparqlParser.INTEGER, SparqlParser.DECIMAL, SparqlParser.DOUBLE, SparqlParser.INTEGER_POSITIVE, SparqlParser.DECIMAL_POSITIVE, SparqlParser.DOUBLE_POSITIVE, SparqlParser.INTEGER_NEGATIVE, SparqlParser.DECIMAL_NEGATIVE, SparqlParser.DOUBLE_NEGATIVE, SparqlParser.STRING_LITERAL1, SparqlParser.STRING_LITERAL2, SparqlParser.NIL, SparqlParser.ANON]:
                pass
            else:
                pass
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class NumericLiteralContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def numericLiteralUnsigned(self):
            return self.getTypedRuleContext(SparqlParser.NumericLiteralUnsignedContext,0)


        def numericLiteralPositive(self):
            return self.getTypedRuleContext(SparqlParser.NumericLiteralPositiveContext,0)


        def numericLiteralNegative(self):
            return self.getTypedRuleContext(SparqlParser.NumericLiteralNegativeContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_numericLiteral

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

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




    def numericLiteral(self):

        localctx = SparqlParser.NumericLiteralContext(self, self._ctx, self.state)
        self.enterRule(localctx, 124, self.RULE_numericLiteral)
        try:
            self.state = 623
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.INTEGER, SparqlParser.DECIMAL, SparqlParser.DOUBLE]:
                self.enterOuterAlt(localctx, 1)
                self.state = 620
                self.numericLiteralUnsigned()
                pass
            elif token in [SparqlParser.INTEGER_POSITIVE, SparqlParser.DECIMAL_POSITIVE, SparqlParser.DOUBLE_POSITIVE]:
                self.enterOuterAlt(localctx, 2)
                self.state = 621
                self.numericLiteralPositive()
                pass
            elif token in [SparqlParser.INTEGER_NEGATIVE, SparqlParser.DECIMAL_NEGATIVE, SparqlParser.DOUBLE_NEGATIVE]:
                self.enterOuterAlt(localctx, 3)
                self.state = 622
                self.numericLiteralNegative()
                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 NumericLiteralUnsignedContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def DECIMAL(self):
            return self.getToken(SparqlParser.DECIMAL, 0)

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

        def getRuleIndex(self):
            return SparqlParser.RULE_numericLiteralUnsigned

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

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




    def numericLiteralUnsigned(self):

        localctx = SparqlParser.NumericLiteralUnsignedContext(self, self._ctx, self.state)
        self.enterRule(localctx, 126, self.RULE_numericLiteralUnsigned)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 625
            _la = self._input.LA(1)
            if not(((((_la - 68)) & ~0x3f) == 0 and ((1 << (_la - 68)) & ((1 << (SparqlParser.INTEGER - 68)) | (1 << (SparqlParser.DECIMAL - 68)) | (1 << (SparqlParser.DOUBLE - 68)))) != 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 NumericLiteralPositiveContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def INTEGER_POSITIVE(self):
            return self.getToken(SparqlParser.INTEGER_POSITIVE, 0)

        def DECIMAL_POSITIVE(self):
            return self.getToken(SparqlParser.DECIMAL_POSITIVE, 0)

        def DOUBLE_POSITIVE(self):
            return self.getToken(SparqlParser.DOUBLE_POSITIVE, 0)

        def getRuleIndex(self):
            return SparqlParser.RULE_numericLiteralPositive

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

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




    def numericLiteralPositive(self):

        localctx = SparqlParser.NumericLiteralPositiveContext(self, self._ctx, self.state)
        self.enterRule(localctx, 128, self.RULE_numericLiteralPositive)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 627
            _la = self._input.LA(1)
            if not(((((_la - 71)) & ~0x3f) == 0 and ((1 << (_la - 71)) & ((1 << (SparqlParser.INTEGER_POSITIVE - 71)) | (1 << (SparqlParser.DECIMAL_POSITIVE - 71)) | (1 << (SparqlParser.DOUBLE_POSITIVE - 71)))) != 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 NumericLiteralNegativeContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def INTEGER_NEGATIVE(self):
            return self.getToken(SparqlParser.INTEGER_NEGATIVE, 0)

        def DECIMAL_NEGATIVE(self):
            return self.getToken(SparqlParser.DECIMAL_NEGATIVE, 0)

        def DOUBLE_NEGATIVE(self):
            return self.getToken(SparqlParser.DOUBLE_NEGATIVE, 0)

        def getRuleIndex(self):
            return SparqlParser.RULE_numericLiteralNegative

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

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




    def numericLiteralNegative(self):

        localctx = SparqlParser.NumericLiteralNegativeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 130, self.RULE_numericLiteralNegative)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 629
            _la = self._input.LA(1)
            if not(((((_la - 74)) & ~0x3f) == 0 and ((1 << (_la - 74)) & ((1 << (SparqlParser.INTEGER_NEGATIVE - 74)) | (1 << (SparqlParser.DECIMAL_NEGATIVE - 74)) | (1 << (SparqlParser.DOUBLE_NEGATIVE - 74)))) != 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 BooleanLiteralContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return SparqlParser.RULE_booleanLiteral

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

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




    def booleanLiteral(self):

        localctx = SparqlParser.BooleanLiteralContext(self, self._ctx, self.state)
        self.enterRule(localctx, 132, self.RULE_booleanLiteral)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 631
            _la = self._input.LA(1)
            if not(_la==SparqlParser.T__58 or _la==SparqlParser.T__59):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class StringContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def STRING_LITERAL1(self):
            return self.getToken(SparqlParser.STRING_LITERAL1, 0)

        def STRING_LITERAL2(self):
            return self.getToken(SparqlParser.STRING_LITERAL2, 0)

        def getRuleIndex(self):
            return SparqlParser.RULE_string

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

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




    def string(self):

        localctx = SparqlParser.StringContext(self, self._ctx, self.state)
        self.enterRule(localctx, 134, self.RULE_string)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 633
            _la = self._input.LA(1)
            if not(_la==SparqlParser.STRING_LITERAL1 or _la==SparqlParser.STRING_LITERAL2):
                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 IriRefContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def IRI_REF(self):
            return self.getToken(SparqlParser.IRI_REF, 0)

        def prefixedName(self):
            return self.getTypedRuleContext(SparqlParser.PrefixedNameContext,0)


        def getRuleIndex(self):
            return SparqlParser.RULE_iriRef

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

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




    def iriRef(self):

        localctx = SparqlParser.IriRefContext(self, self._ctx, self.state)
        self.enterRule(localctx, 136, self.RULE_iriRef)
        try:
            self.state = 637
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [SparqlParser.IRI_REF]:
                self.enterOuterAlt(localctx, 1)
                self.state = 635
                self.match(SparqlParser.IRI_REF)
                pass
            elif token in [SparqlParser.PNAME_NS, SparqlParser.PNAME_LN]:
                self.enterOuterAlt(localctx, 2)
                self.state = 636
                self.prefixedName()
                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 PrefixedNameContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def PNAME_LN(self):
            return self.getToken(SparqlParser.PNAME_LN, 0)

        def PNAME_NS(self):
            return self.getToken(SparqlParser.PNAME_NS, 0)

        def getRuleIndex(self):
            return SparqlParser.RULE_prefixedName

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

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




    def prefixedName(self):

        localctx = SparqlParser.PrefixedNameContext(self, self._ctx, self.state)
        self.enterRule(localctx, 138, self.RULE_prefixedName)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 639
            _la = self._input.LA(1)
            if not(_la==SparqlParser.PNAME_NS or _la==SparqlParser.PNAME_LN):
                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 BlankNodeContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def BLANK_NODE_LABEL(self):
            return self.getToken(SparqlParser.BLANK_NODE_LABEL, 0)

        def ANON(self):
            return self.getToken(SparqlParser.ANON, 0)

        def getRuleIndex(self):
            return SparqlParser.RULE_blankNode

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

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




    def blankNode(self):

        localctx = SparqlParser.BlankNodeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 140, self.RULE_blankNode)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 641
            _la = self._input.LA(1)
            if not(_la==SparqlParser.BLANK_NODE_LABEL or _la==SparqlParser.ANON):
                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





