# Generated from OCLs.g4 by ANTLR 4.13.1
# 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():
    return [
        4,1,82,949,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,
        6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,
        1,0,1,0,5,0,31,8,0,10,0,12,0,34,9,0,1,1,1,1,1,1,1,1,3,1,40,8,1,1,
        1,3,1,43,8,1,1,1,5,1,46,8,1,10,1,12,1,49,9,1,1,1,3,1,52,8,1,1,1,
        3,1,55,8,1,1,1,3,1,58,8,1,1,1,3,1,61,8,1,1,1,3,1,64,8,1,1,1,3,1,
        67,8,1,1,1,3,1,70,8,1,1,1,3,1,73,8,1,1,1,3,1,76,8,1,1,1,3,1,79,8,
        1,1,1,3,1,82,8,1,1,1,3,1,85,8,1,1,2,1,2,3,2,89,8,2,1,2,1,2,1,2,3,
        2,94,8,2,1,3,1,3,1,3,3,3,99,8,3,1,3,1,3,3,3,103,8,3,1,3,3,3,106,
        8,3,5,3,108,8,3,10,3,12,3,111,9,3,1,3,1,3,1,3,1,3,1,3,1,3,5,3,119,
        8,3,10,3,12,3,122,9,3,1,3,1,3,1,3,1,3,3,3,128,8,3,5,3,130,8,3,10,
        3,12,3,133,9,3,1,3,3,3,136,8,3,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,
        4,3,4,147,8,4,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,
        5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,3,5,169,8,5,1,6,1,6,1,7,3,7,174,8,
        7,1,7,1,7,3,7,178,8,7,1,7,1,7,3,7,182,8,7,1,7,1,7,1,7,1,7,1,7,1,
        7,1,7,1,7,1,7,1,7,1,7,5,7,195,8,7,10,7,12,7,198,9,7,1,7,1,7,1,7,
        1,7,1,7,1,7,3,7,206,8,7,1,7,1,7,1,7,5,7,211,8,7,10,7,12,7,214,9,
        7,1,7,1,7,1,7,1,7,1,7,1,7,3,7,222,8,7,1,7,1,7,1,7,5,7,227,8,7,10,
        7,12,7,230,9,7,1,7,1,7,1,7,1,7,1,7,1,7,3,7,238,8,7,1,7,3,7,241,8,
        7,1,7,1,7,5,7,245,8,7,10,7,12,7,248,9,7,1,7,1,7,1,7,1,7,1,7,3,7,
        255,8,7,1,7,5,7,258,8,7,10,7,12,7,261,9,7,1,7,3,7,264,8,7,1,7,1,
        7,5,7,268,8,7,10,7,12,7,271,9,7,1,7,1,7,1,7,1,7,1,7,3,7,278,8,7,
        1,7,5,7,281,8,7,10,7,12,7,284,9,7,1,7,3,7,287,8,7,1,7,1,7,5,7,291,
        8,7,10,7,12,7,294,9,7,1,7,1,7,1,7,1,7,1,7,3,7,301,8,7,1,7,5,7,304,
        8,7,10,7,12,7,307,9,7,1,7,3,7,310,8,7,1,7,1,7,1,7,1,7,1,7,3,7,317,
        8,7,1,7,5,7,320,8,7,10,7,12,7,323,9,7,1,7,3,7,326,8,7,1,7,1,7,1,
        7,1,7,1,7,3,7,333,8,7,1,7,5,7,336,8,7,10,7,12,7,339,9,7,1,7,3,7,
        342,8,7,1,7,5,7,345,8,7,10,7,12,7,348,9,7,1,7,1,7,5,7,352,8,7,10,
        7,12,7,355,9,7,1,7,5,7,358,8,7,10,7,12,7,361,9,7,1,7,3,7,364,8,7,
        1,7,1,7,3,7,368,8,7,1,7,3,7,371,8,7,5,7,373,8,7,10,7,12,7,376,9,
        7,1,7,5,7,379,8,7,10,7,12,7,382,9,7,1,7,5,7,385,8,7,10,7,12,7,388,
        9,7,1,7,3,7,391,8,7,1,7,3,7,394,8,7,1,7,5,7,397,8,7,10,7,12,7,400,
        9,7,1,7,1,7,5,7,404,8,7,10,7,12,7,407,9,7,1,7,5,7,410,8,7,10,7,12,
        7,413,9,7,1,7,3,7,416,8,7,1,7,1,7,3,7,420,8,7,1,7,3,7,423,8,7,5,
        7,425,8,7,10,7,12,7,428,9,7,1,7,5,7,431,8,7,10,7,12,7,434,9,7,1,
        7,5,7,437,8,7,10,7,12,7,440,9,7,1,7,3,7,443,8,7,1,7,3,7,446,8,7,
        1,7,1,7,4,7,450,8,7,11,7,12,7,451,1,7,1,7,4,7,456,8,7,11,7,12,7,
        457,1,7,3,7,461,8,7,1,7,3,7,464,8,7,1,7,5,7,467,8,7,10,7,12,7,470,
        9,7,1,7,1,7,1,7,3,7,475,8,7,1,7,1,7,3,7,479,8,7,1,7,3,7,482,8,7,
        5,7,484,8,7,10,7,12,7,487,9,7,1,7,1,7,5,7,491,8,7,10,7,12,7,494,
        9,7,1,7,3,7,497,8,7,1,7,3,7,500,8,7,1,7,5,7,503,8,7,10,7,12,7,506,
        9,7,1,7,1,7,5,7,510,8,7,10,7,12,7,513,9,7,1,7,5,7,516,8,7,10,7,12,
        7,519,9,7,1,7,3,7,522,8,7,1,7,1,7,3,7,526,8,7,1,7,3,7,529,8,7,5,
        7,531,8,7,10,7,12,7,534,9,7,1,7,5,7,537,8,7,10,7,12,7,540,9,7,1,
        7,5,7,543,8,7,10,7,12,7,546,9,7,1,7,3,7,549,8,7,1,7,1,7,3,7,553,
        8,7,1,7,5,7,556,8,7,10,7,12,7,559,9,7,1,7,1,7,5,7,563,8,7,10,7,12,
        7,566,9,7,1,7,5,7,569,8,7,10,7,12,7,572,9,7,1,7,3,7,575,8,7,1,7,
        1,7,3,7,579,8,7,1,7,3,7,582,8,7,5,7,584,8,7,10,7,12,7,587,9,7,1,
        7,5,7,590,8,7,10,7,12,7,593,9,7,1,7,5,7,596,8,7,10,7,12,7,599,9,
        7,1,7,3,7,602,8,7,1,7,3,7,605,8,7,1,7,5,7,608,8,7,10,7,12,7,611,
        9,7,1,7,1,7,5,7,615,8,7,10,7,12,7,618,9,7,1,7,5,7,621,8,7,10,7,12,
        7,624,9,7,1,7,3,7,627,8,7,1,7,1,7,3,7,631,8,7,1,7,3,7,634,8,7,5,
        7,636,8,7,10,7,12,7,639,9,7,1,7,5,7,642,8,7,10,7,12,7,645,9,7,1,
        7,5,7,648,8,7,10,7,12,7,651,9,7,1,7,3,7,654,8,7,1,7,1,7,1,7,4,7,
        659,8,7,11,7,12,7,660,1,7,3,7,664,8,7,1,7,1,7,3,7,668,8,7,1,7,3,
        7,671,8,7,5,7,673,8,7,10,7,12,7,676,9,7,1,7,4,7,679,8,7,11,7,12,
        7,680,1,7,3,7,684,8,7,1,7,1,7,1,7,1,7,4,7,690,8,7,11,7,12,7,691,
        1,7,3,7,695,8,7,1,7,1,7,1,7,1,7,3,7,701,8,7,1,7,1,7,3,7,705,8,7,
        1,7,3,7,708,8,7,5,7,710,8,7,10,7,12,7,713,9,7,1,7,4,7,716,8,7,11,
        7,12,7,717,1,7,3,7,721,8,7,1,7,3,7,724,8,7,1,7,1,7,1,7,1,7,1,7,3,
        7,731,8,7,1,7,3,7,734,8,7,4,7,736,8,7,11,7,12,7,737,1,7,1,7,1,7,
        1,7,3,7,744,8,7,1,7,3,7,747,8,7,1,7,1,7,1,7,1,7,1,7,3,7,754,8,7,
        1,7,1,7,1,7,1,7,1,7,4,7,761,8,7,11,7,12,7,762,1,7,3,7,766,8,7,1,
        7,1,7,1,7,1,7,1,7,3,7,773,8,7,1,7,1,7,1,7,1,7,1,7,3,7,780,8,7,1,
        7,1,7,1,7,1,7,1,7,1,7,3,7,788,8,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,
        7,1,7,5,7,799,8,7,10,7,12,7,802,9,7,1,7,3,7,805,8,7,1,7,1,7,5,7,
        809,8,7,10,7,12,7,812,9,7,1,7,3,7,815,8,7,1,7,3,7,818,8,7,1,7,1,
        7,4,7,822,8,7,11,7,12,7,823,1,7,3,7,827,8,7,1,7,1,7,5,7,831,8,7,
        10,7,12,7,834,9,7,1,7,5,7,837,8,7,10,7,12,7,840,9,7,1,7,1,7,3,7,
        844,8,7,1,7,3,7,847,8,7,1,7,1,7,3,7,851,8,7,1,7,1,7,1,7,1,7,3,7,
        857,8,7,1,7,3,7,860,8,7,1,7,1,7,3,7,864,8,7,1,7,1,7,3,7,868,8,7,
        1,7,1,7,1,7,3,7,873,8,7,1,7,1,7,3,7,877,8,7,1,7,3,7,880,8,7,1,7,
        1,7,3,7,884,8,7,1,8,1,8,1,8,5,8,889,8,8,10,8,12,8,892,9,8,1,8,3,
        8,895,8,8,1,8,1,8,5,8,899,8,8,10,8,12,8,902,9,8,1,8,1,8,1,8,1,8,
        5,8,908,8,8,10,8,12,8,911,9,8,1,8,3,8,914,8,8,1,9,1,9,1,9,1,10,1,
        10,1,11,1,11,3,11,923,8,11,1,11,1,11,3,11,927,8,11,1,11,3,11,930,
        8,11,1,11,3,11,933,8,11,3,11,935,8,11,1,12,1,12,1,12,1,12,1,12,1,
        12,1,12,1,12,3,12,945,8,12,1,13,1,13,1,13,0,0,14,0,2,4,6,8,10,12,
        14,16,18,20,22,24,26,0,7,3,0,3,4,68,70,76,76,1,0,2,4,1,0,33,34,1,
        0,6,9,2,0,35,35,46,46,4,0,23,23,33,34,36,40,46,51,2,0,72,72,78,80,
        1163,0,28,1,0,0,0,2,35,1,0,0,0,4,86,1,0,0,0,6,135,1,0,0,0,8,146,
        1,0,0,0,10,168,1,0,0,0,12,170,1,0,0,0,14,883,1,0,0,0,16,894,1,0,
        0,0,18,915,1,0,0,0,20,918,1,0,0,0,22,934,1,0,0,0,24,944,1,0,0,0,
        26,946,1,0,0,0,28,32,3,2,1,0,29,31,3,14,7,0,30,29,1,0,0,0,31,34,
        1,0,0,0,32,30,1,0,0,0,32,33,1,0,0,0,33,1,1,0,0,0,34,32,1,0,0,0,35,
        36,5,1,0,0,36,39,5,77,0,0,37,38,5,20,0,0,38,40,3,8,4,0,39,37,1,0,
        0,0,39,40,1,0,0,0,40,42,1,0,0,0,41,43,5,17,0,0,42,41,1,0,0,0,42,
        43,1,0,0,0,43,47,1,0,0,0,44,46,3,4,2,0,45,44,1,0,0,0,46,49,1,0,0,
        0,47,45,1,0,0,0,47,48,1,0,0,0,48,51,1,0,0,0,49,47,1,0,0,0,50,52,
        5,18,0,0,51,50,1,0,0,0,51,52,1,0,0,0,52,54,1,0,0,0,53,55,5,14,0,
        0,54,53,1,0,0,0,54,55,1,0,0,0,55,57,1,0,0,0,56,58,3,6,3,0,57,56,
        1,0,0,0,57,58,1,0,0,0,58,60,1,0,0,0,59,61,5,20,0,0,60,59,1,0,0,0,
        60,61,1,0,0,0,61,63,1,0,0,0,62,64,3,8,4,0,63,62,1,0,0,0,63,64,1,
        0,0,0,64,66,1,0,0,0,65,67,5,15,0,0,66,65,1,0,0,0,66,67,1,0,0,0,67,
        69,1,0,0,0,68,70,5,77,0,0,69,68,1,0,0,0,69,70,1,0,0,0,70,72,1,0,
        0,0,71,73,5,16,0,0,72,71,1,0,0,0,72,73,1,0,0,0,73,75,1,0,0,0,74,
        76,5,20,0,0,75,74,1,0,0,0,75,76,1,0,0,0,76,78,1,0,0,0,77,79,7,0,
        0,0,78,77,1,0,0,0,78,79,1,0,0,0,79,81,1,0,0,0,80,82,5,20,0,0,81,
        80,1,0,0,0,81,82,1,0,0,0,82,84,1,0,0,0,83,85,3,14,7,0,84,83,1,0,
        0,0,84,85,1,0,0,0,85,3,1,0,0,0,86,88,7,1,0,0,87,89,5,77,0,0,88,87,
        1,0,0,0,88,89,1,0,0,0,89,90,1,0,0,0,90,91,5,20,0,0,91,93,3,14,7,
        0,92,94,5,19,0,0,93,92,1,0,0,0,93,94,1,0,0,0,94,5,1,0,0,0,95,96,
        5,77,0,0,96,109,5,15,0,0,97,99,5,24,0,0,98,97,1,0,0,0,98,99,1,0,
        0,0,99,100,1,0,0,0,100,102,3,14,7,0,101,103,5,24,0,0,102,101,1,0,
        0,0,102,103,1,0,0,0,103,105,1,0,0,0,104,106,5,21,0,0,105,104,1,0,
        0,0,105,106,1,0,0,0,106,108,1,0,0,0,107,98,1,0,0,0,108,111,1,0,0,
        0,109,107,1,0,0,0,109,110,1,0,0,0,110,112,1,0,0,0,111,109,1,0,0,
        0,112,136,5,16,0,0,113,114,5,77,0,0,114,120,5,15,0,0,115,116,5,77,
        0,0,116,117,5,20,0,0,117,119,5,77,0,0,118,115,1,0,0,0,119,122,1,
        0,0,0,120,118,1,0,0,0,120,121,1,0,0,0,121,123,1,0,0,0,122,120,1,
        0,0,0,123,136,5,16,0,0,124,131,5,15,0,0,125,127,5,78,0,0,126,128,
        5,21,0,0,127,126,1,0,0,0,127,128,1,0,0,0,128,130,1,0,0,0,129,125,
        1,0,0,0,130,133,1,0,0,0,131,129,1,0,0,0,131,132,1,0,0,0,132,134,
        1,0,0,0,133,131,1,0,0,0,134,136,5,16,0,0,135,95,1,0,0,0,135,113,
        1,0,0,0,135,124,1,0,0,0,136,7,1,0,0,0,137,147,5,25,0,0,138,147,5,
        26,0,0,139,147,5,27,0,0,140,147,5,28,0,0,141,147,5,10,0,0,142,147,
        5,11,0,0,143,147,3,10,5,0,144,147,3,12,6,0,145,147,5,42,0,0,146,
        137,1,0,0,0,146,138,1,0,0,0,146,139,1,0,0,0,146,140,1,0,0,0,146,
        141,1,0,0,0,146,142,1,0,0,0,146,143,1,0,0,0,146,144,1,0,0,0,146,
        145,1,0,0,0,147,9,1,0,0,0,148,149,5,42,0,0,149,150,5,37,0,0,150,
        151,3,8,4,0,151,152,5,39,0,0,152,169,1,0,0,0,153,154,5,43,0,0,154,
        155,5,37,0,0,155,156,3,8,4,0,156,157,5,39,0,0,157,169,1,0,0,0,158,
        159,5,44,0,0,159,160,5,37,0,0,160,161,3,8,4,0,161,162,5,39,0,0,162,
        169,1,0,0,0,163,164,5,45,0,0,164,165,5,37,0,0,165,166,3,8,4,0,166,
        167,5,39,0,0,167,169,1,0,0,0,168,148,1,0,0,0,168,153,1,0,0,0,168,
        158,1,0,0,0,168,163,1,0,0,0,169,11,1,0,0,0,170,171,5,77,0,0,171,
        13,1,0,0,0,172,174,7,2,0,0,173,172,1,0,0,0,173,174,1,0,0,0,174,175,
        1,0,0,0,175,177,3,16,8,0,176,178,3,14,7,0,177,176,1,0,0,0,177,178,
        1,0,0,0,178,884,1,0,0,0,179,181,3,18,9,0,180,182,3,14,7,0,181,180,
        1,0,0,0,181,182,1,0,0,0,182,884,1,0,0,0,183,184,5,29,0,0,184,185,
        3,14,7,0,185,186,5,30,0,0,186,187,3,14,7,0,187,188,5,31,0,0,188,
        189,3,14,7,0,189,190,5,32,0,0,190,884,1,0,0,0,191,196,3,24,12,0,
        192,193,5,22,0,0,193,195,5,77,0,0,194,192,1,0,0,0,195,198,1,0,0,
        0,196,194,1,0,0,0,196,197,1,0,0,0,197,199,1,0,0,0,198,196,1,0,0,
        0,199,200,5,22,0,0,200,201,5,53,0,0,201,202,5,15,0,0,202,203,3,8,
        4,0,203,205,5,16,0,0,204,206,3,14,7,0,205,204,1,0,0,0,205,206,1,
        0,0,0,206,884,1,0,0,0,207,212,3,24,12,0,208,209,5,22,0,0,209,211,
        5,77,0,0,210,208,1,0,0,0,211,214,1,0,0,0,212,210,1,0,0,0,212,213,
        1,0,0,0,213,215,1,0,0,0,214,212,1,0,0,0,215,216,5,22,0,0,216,217,
        5,52,0,0,217,218,5,15,0,0,218,219,3,8,4,0,219,221,5,16,0,0,220,222,
        3,14,7,0,221,220,1,0,0,0,221,222,1,0,0,0,222,884,1,0,0,0,223,228,
        3,24,12,0,224,225,5,22,0,0,225,227,5,77,0,0,226,224,1,0,0,0,227,
        230,1,0,0,0,228,226,1,0,0,0,228,229,1,0,0,0,229,231,1,0,0,0,230,
        228,1,0,0,0,231,232,5,22,0,0,232,233,5,54,0,0,233,234,5,15,0,0,234,
        235,3,8,4,0,235,237,5,16,0,0,236,238,3,14,7,0,237,236,1,0,0,0,237,
        238,1,0,0,0,238,884,1,0,0,0,239,241,3,24,12,0,240,239,1,0,0,0,240,
        241,1,0,0,0,241,246,1,0,0,0,242,243,5,22,0,0,243,245,5,77,0,0,244,
        242,1,0,0,0,245,248,1,0,0,0,246,244,1,0,0,0,246,247,1,0,0,0,247,
        249,1,0,0,0,248,246,1,0,0,0,249,250,5,75,0,0,250,251,5,56,0,0,251,
        252,5,15,0,0,252,254,5,16,0,0,253,255,3,14,7,0,254,253,1,0,0,0,254,
        255,1,0,0,0,255,259,1,0,0,0,256,258,5,16,0,0,257,256,1,0,0,0,258,
        261,1,0,0,0,259,257,1,0,0,0,259,260,1,0,0,0,260,884,1,0,0,0,261,
        259,1,0,0,0,262,264,3,24,12,0,263,262,1,0,0,0,263,264,1,0,0,0,264,
        269,1,0,0,0,265,266,5,22,0,0,266,268,5,77,0,0,267,265,1,0,0,0,268,
        271,1,0,0,0,269,267,1,0,0,0,269,270,1,0,0,0,270,272,1,0,0,0,271,
        269,1,0,0,0,272,273,5,75,0,0,273,274,5,57,0,0,274,275,5,15,0,0,275,
        277,5,16,0,0,276,278,3,14,7,0,277,276,1,0,0,0,277,278,1,0,0,0,278,
        282,1,0,0,0,279,281,5,16,0,0,280,279,1,0,0,0,281,284,1,0,0,0,282,
        280,1,0,0,0,282,283,1,0,0,0,283,884,1,0,0,0,284,282,1,0,0,0,285,
        287,3,24,12,0,286,285,1,0,0,0,286,287,1,0,0,0,287,292,1,0,0,0,288,
        289,5,22,0,0,289,291,5,77,0,0,290,288,1,0,0,0,291,294,1,0,0,0,292,
        290,1,0,0,0,292,293,1,0,0,0,293,295,1,0,0,0,294,292,1,0,0,0,295,
        296,5,75,0,0,296,297,5,58,0,0,297,298,5,15,0,0,298,300,5,16,0,0,
        299,301,3,14,7,0,300,299,1,0,0,0,300,301,1,0,0,0,301,305,1,0,0,0,
        302,304,5,16,0,0,303,302,1,0,0,0,304,307,1,0,0,0,305,303,1,0,0,0,
        305,306,1,0,0,0,306,884,1,0,0,0,307,305,1,0,0,0,308,310,5,75,0,0,
        309,308,1,0,0,0,309,310,1,0,0,0,310,311,1,0,0,0,311,312,5,59,0,0,
        312,313,5,15,0,0,313,314,3,14,7,0,314,316,5,16,0,0,315,317,3,14,
        7,0,316,315,1,0,0,0,316,317,1,0,0,0,317,321,1,0,0,0,318,320,5,16,
        0,0,319,318,1,0,0,0,320,323,1,0,0,0,321,319,1,0,0,0,321,322,1,0,
        0,0,322,884,1,0,0,0,323,321,1,0,0,0,324,326,5,75,0,0,325,324,1,0,
        0,0,325,326,1,0,0,0,326,327,1,0,0,0,327,328,5,60,0,0,328,329,5,15,
        0,0,329,330,3,14,7,0,330,332,5,16,0,0,331,333,3,14,7,0,332,331,1,
        0,0,0,332,333,1,0,0,0,333,337,1,0,0,0,334,336,5,16,0,0,335,334,1,
        0,0,0,336,339,1,0,0,0,337,335,1,0,0,0,337,338,1,0,0,0,338,884,1,
        0,0,0,339,337,1,0,0,0,340,342,5,75,0,0,341,340,1,0,0,0,341,342,1,
        0,0,0,342,346,1,0,0,0,343,345,5,15,0,0,344,343,1,0,0,0,345,348,1,
        0,0,0,346,344,1,0,0,0,346,347,1,0,0,0,347,349,1,0,0,0,348,346,1,
        0,0,0,349,353,5,44,0,0,350,352,5,17,0,0,351,350,1,0,0,0,352,355,
        1,0,0,0,353,351,1,0,0,0,353,354,1,0,0,0,354,359,1,0,0,0,355,353,
        1,0,0,0,356,358,5,15,0,0,357,356,1,0,0,0,358,361,1,0,0,0,359,357,
        1,0,0,0,359,360,1,0,0,0,360,374,1,0,0,0,361,359,1,0,0,0,362,364,
        5,24,0,0,363,362,1,0,0,0,363,364,1,0,0,0,364,365,1,0,0,0,365,367,
        3,14,7,0,366,368,5,24,0,0,367,366,1,0,0,0,367,368,1,0,0,0,368,370,
        1,0,0,0,369,371,5,21,0,0,370,369,1,0,0,0,370,371,1,0,0,0,371,373,
        1,0,0,0,372,363,1,0,0,0,373,376,1,0,0,0,374,372,1,0,0,0,374,375,
        1,0,0,0,375,380,1,0,0,0,376,374,1,0,0,0,377,379,5,18,0,0,378,377,
        1,0,0,0,379,382,1,0,0,0,380,378,1,0,0,0,380,381,1,0,0,0,381,386,
        1,0,0,0,382,380,1,0,0,0,383,385,5,16,0,0,384,383,1,0,0,0,385,388,
        1,0,0,0,386,384,1,0,0,0,386,387,1,0,0,0,387,390,1,0,0,0,388,386,
        1,0,0,0,389,391,3,14,7,0,390,389,1,0,0,0,390,391,1,0,0,0,391,884,
        1,0,0,0,392,394,5,75,0,0,393,392,1,0,0,0,393,394,1,0,0,0,394,398,
        1,0,0,0,395,397,5,15,0,0,396,395,1,0,0,0,397,400,1,0,0,0,398,396,
        1,0,0,0,398,399,1,0,0,0,399,401,1,0,0,0,400,398,1,0,0,0,401,405,
        5,61,0,0,402,404,5,17,0,0,403,402,1,0,0,0,404,407,1,0,0,0,405,403,
        1,0,0,0,405,406,1,0,0,0,406,411,1,0,0,0,407,405,1,0,0,0,408,410,
        5,15,0,0,409,408,1,0,0,0,410,413,1,0,0,0,411,409,1,0,0,0,411,412,
        1,0,0,0,412,426,1,0,0,0,413,411,1,0,0,0,414,416,5,24,0,0,415,414,
        1,0,0,0,415,416,1,0,0,0,416,417,1,0,0,0,417,419,3,14,7,0,418,420,
        5,24,0,0,419,418,1,0,0,0,419,420,1,0,0,0,420,422,1,0,0,0,421,423,
        5,21,0,0,422,421,1,0,0,0,422,423,1,0,0,0,423,425,1,0,0,0,424,415,
        1,0,0,0,425,428,1,0,0,0,426,424,1,0,0,0,426,427,1,0,0,0,427,432,
        1,0,0,0,428,426,1,0,0,0,429,431,5,16,0,0,430,429,1,0,0,0,431,434,
        1,0,0,0,432,430,1,0,0,0,432,433,1,0,0,0,433,438,1,0,0,0,434,432,
        1,0,0,0,435,437,5,18,0,0,436,435,1,0,0,0,437,440,1,0,0,0,438,436,
        1,0,0,0,438,439,1,0,0,0,439,442,1,0,0,0,440,438,1,0,0,0,441,443,
        3,14,7,0,442,441,1,0,0,0,442,443,1,0,0,0,443,884,1,0,0,0,444,446,
        5,75,0,0,445,444,1,0,0,0,445,446,1,0,0,0,446,447,1,0,0,0,447,449,
        5,55,0,0,448,450,5,15,0,0,449,448,1,0,0,0,450,451,1,0,0,0,451,449,
        1,0,0,0,451,452,1,0,0,0,452,453,1,0,0,0,453,455,3,14,7,0,454,456,
        5,16,0,0,455,454,1,0,0,0,456,457,1,0,0,0,457,455,1,0,0,0,457,458,
        1,0,0,0,458,460,1,0,0,0,459,461,3,14,7,0,460,459,1,0,0,0,460,461,
        1,0,0,0,461,884,1,0,0,0,462,464,5,75,0,0,463,462,1,0,0,0,463,464,
        1,0,0,0,464,468,1,0,0,0,465,467,5,15,0,0,466,465,1,0,0,0,467,470,
        1,0,0,0,468,466,1,0,0,0,468,469,1,0,0,0,469,471,1,0,0,0,470,468,
        1,0,0,0,471,472,5,45,0,0,472,485,5,17,0,0,473,475,5,24,0,0,474,473,
        1,0,0,0,474,475,1,0,0,0,475,476,1,0,0,0,476,478,3,14,7,0,477,479,
        5,24,0,0,478,477,1,0,0,0,478,479,1,0,0,0,479,481,1,0,0,0,480,482,
        5,21,0,0,481,480,1,0,0,0,481,482,1,0,0,0,482,484,1,0,0,0,483,474,
        1,0,0,0,484,487,1,0,0,0,485,483,1,0,0,0,485,486,1,0,0,0,486,488,
        1,0,0,0,487,485,1,0,0,0,488,492,5,18,0,0,489,491,5,16,0,0,490,489,
        1,0,0,0,491,494,1,0,0,0,492,490,1,0,0,0,492,493,1,0,0,0,493,496,
        1,0,0,0,494,492,1,0,0,0,495,497,3,14,7,0,496,495,1,0,0,0,496,497,
        1,0,0,0,497,884,1,0,0,0,498,500,5,75,0,0,499,498,1,0,0,0,499,500,
        1,0,0,0,500,504,1,0,0,0,501,503,5,15,0,0,502,501,1,0,0,0,503,506,
        1,0,0,0,504,502,1,0,0,0,504,505,1,0,0,0,505,507,1,0,0,0,506,504,
        1,0,0,0,507,511,5,62,0,0,508,510,5,17,0,0,509,508,1,0,0,0,510,513,
        1,0,0,0,511,509,1,0,0,0,511,512,1,0,0,0,512,517,1,0,0,0,513,511,
        1,0,0,0,514,516,5,15,0,0,515,514,1,0,0,0,516,519,1,0,0,0,517,515,
        1,0,0,0,517,518,1,0,0,0,518,532,1,0,0,0,519,517,1,0,0,0,520,522,
        5,24,0,0,521,520,1,0,0,0,521,522,1,0,0,0,522,523,1,0,0,0,523,525,
        3,14,7,0,524,526,5,24,0,0,525,524,1,0,0,0,525,526,1,0,0,0,526,528,
        1,0,0,0,527,529,5,21,0,0,528,527,1,0,0,0,528,529,1,0,0,0,529,531,
        1,0,0,0,530,521,1,0,0,0,531,534,1,0,0,0,532,530,1,0,0,0,532,533,
        1,0,0,0,533,538,1,0,0,0,534,532,1,0,0,0,535,537,5,18,0,0,536,535,
        1,0,0,0,537,540,1,0,0,0,538,536,1,0,0,0,538,539,1,0,0,0,539,544,
        1,0,0,0,540,538,1,0,0,0,541,543,5,16,0,0,542,541,1,0,0,0,543,546,
        1,0,0,0,544,542,1,0,0,0,544,545,1,0,0,0,545,548,1,0,0,0,546,544,
        1,0,0,0,547,549,3,14,7,0,548,547,1,0,0,0,548,549,1,0,0,0,549,550,
        1,0,0,0,550,884,5,16,0,0,551,553,5,75,0,0,552,551,1,0,0,0,552,553,
        1,0,0,0,553,557,1,0,0,0,554,556,5,15,0,0,555,554,1,0,0,0,556,559,
        1,0,0,0,557,555,1,0,0,0,557,558,1,0,0,0,558,560,1,0,0,0,559,557,
        1,0,0,0,560,564,5,42,0,0,561,563,5,15,0,0,562,561,1,0,0,0,563,566,
        1,0,0,0,564,562,1,0,0,0,564,565,1,0,0,0,565,570,1,0,0,0,566,564,
        1,0,0,0,567,569,5,17,0,0,568,567,1,0,0,0,569,572,1,0,0,0,570,568,
        1,0,0,0,570,571,1,0,0,0,571,585,1,0,0,0,572,570,1,0,0,0,573,575,
        5,24,0,0,574,573,1,0,0,0,574,575,1,0,0,0,575,576,1,0,0,0,576,578,
        3,14,7,0,577,579,5,24,0,0,578,577,1,0,0,0,578,579,1,0,0,0,579,581,
        1,0,0,0,580,582,5,21,0,0,581,580,1,0,0,0,581,582,1,0,0,0,582,584,
        1,0,0,0,583,574,1,0,0,0,584,587,1,0,0,0,585,583,1,0,0,0,585,586,
        1,0,0,0,586,591,1,0,0,0,587,585,1,0,0,0,588,590,5,18,0,0,589,588,
        1,0,0,0,590,593,1,0,0,0,591,589,1,0,0,0,591,592,1,0,0,0,592,597,
        1,0,0,0,593,591,1,0,0,0,594,596,5,16,0,0,595,594,1,0,0,0,596,599,
        1,0,0,0,597,595,1,0,0,0,597,598,1,0,0,0,598,601,1,0,0,0,599,597,
        1,0,0,0,600,602,3,14,7,0,601,600,1,0,0,0,601,602,1,0,0,0,602,884,
        1,0,0,0,603,605,5,75,0,0,604,603,1,0,0,0,604,605,1,0,0,0,605,609,
        1,0,0,0,606,608,5,15,0,0,607,606,1,0,0,0,608,611,1,0,0,0,609,607,
        1,0,0,0,609,610,1,0,0,0,610,612,1,0,0,0,611,609,1,0,0,0,612,616,
        5,43,0,0,613,615,5,15,0,0,614,613,1,0,0,0,615,618,1,0,0,0,616,614,
        1,0,0,0,616,617,1,0,0,0,617,622,1,0,0,0,618,616,1,0,0,0,619,621,
        5,17,0,0,620,619,1,0,0,0,621,624,1,0,0,0,622,620,1,0,0,0,622,623,
        1,0,0,0,623,637,1,0,0,0,624,622,1,0,0,0,625,627,5,24,0,0,626,625,
        1,0,0,0,626,627,1,0,0,0,627,628,1,0,0,0,628,630,3,14,7,0,629,631,
        5,24,0,0,630,629,1,0,0,0,630,631,1,0,0,0,631,633,1,0,0,0,632,634,
        5,21,0,0,633,632,1,0,0,0,633,634,1,0,0,0,634,636,1,0,0,0,635,626,
        1,0,0,0,636,639,1,0,0,0,637,635,1,0,0,0,637,638,1,0,0,0,638,643,
        1,0,0,0,639,637,1,0,0,0,640,642,5,18,0,0,641,640,1,0,0,0,642,645,
        1,0,0,0,643,641,1,0,0,0,643,644,1,0,0,0,644,649,1,0,0,0,645,643,
        1,0,0,0,646,648,5,16,0,0,647,646,1,0,0,0,648,651,1,0,0,0,649,647,
        1,0,0,0,649,650,1,0,0,0,650,653,1,0,0,0,651,649,1,0,0,0,652,654,
        3,14,7,0,653,652,1,0,0,0,653,654,1,0,0,0,654,884,1,0,0,0,655,656,
        5,75,0,0,656,658,5,63,0,0,657,659,5,15,0,0,658,657,1,0,0,0,659,660,
        1,0,0,0,660,658,1,0,0,0,660,661,1,0,0,0,661,674,1,0,0,0,662,664,
        5,24,0,0,663,662,1,0,0,0,663,664,1,0,0,0,664,665,1,0,0,0,665,667,
        3,14,7,0,666,668,5,24,0,0,667,666,1,0,0,0,667,668,1,0,0,0,668,670,
        1,0,0,0,669,671,5,21,0,0,670,669,1,0,0,0,670,671,1,0,0,0,671,673,
        1,0,0,0,672,663,1,0,0,0,673,676,1,0,0,0,674,672,1,0,0,0,674,675,
        1,0,0,0,675,678,1,0,0,0,676,674,1,0,0,0,677,679,5,16,0,0,678,677,
        1,0,0,0,679,680,1,0,0,0,680,678,1,0,0,0,680,681,1,0,0,0,681,683,
        1,0,0,0,682,684,3,14,7,0,683,682,1,0,0,0,683,684,1,0,0,0,684,884,
        1,0,0,0,685,686,5,75,0,0,686,687,5,64,0,0,687,689,5,15,0,0,688,690,
        5,16,0,0,689,688,1,0,0,0,690,691,1,0,0,0,691,689,1,0,0,0,691,692,
        1,0,0,0,692,694,1,0,0,0,693,695,3,14,7,0,694,693,1,0,0,0,694,695,
        1,0,0,0,695,884,1,0,0,0,696,697,5,75,0,0,697,698,5,65,0,0,698,711,
        5,15,0,0,699,701,5,24,0,0,700,699,1,0,0,0,700,701,1,0,0,0,701,702,
        1,0,0,0,702,704,3,14,7,0,703,705,5,24,0,0,704,703,1,0,0,0,704,705,
        1,0,0,0,705,707,1,0,0,0,706,708,5,21,0,0,707,706,1,0,0,0,707,708,
        1,0,0,0,708,710,1,0,0,0,709,700,1,0,0,0,710,713,1,0,0,0,711,709,
        1,0,0,0,711,712,1,0,0,0,712,715,1,0,0,0,713,711,1,0,0,0,714,716,
        5,16,0,0,715,714,1,0,0,0,716,717,1,0,0,0,717,715,1,0,0,0,717,718,
        1,0,0,0,718,720,1,0,0,0,719,721,3,14,7,0,720,719,1,0,0,0,720,721,
        1,0,0,0,721,884,1,0,0,0,722,724,5,75,0,0,723,722,1,0,0,0,723,724,
        1,0,0,0,724,725,1,0,0,0,725,726,7,3,0,0,726,735,5,15,0,0,727,730,
        5,77,0,0,728,729,5,20,0,0,729,731,5,77,0,0,730,728,1,0,0,0,730,731,
        1,0,0,0,731,733,1,0,0,0,732,734,5,21,0,0,733,732,1,0,0,0,733,734,
        1,0,0,0,734,736,1,0,0,0,735,727,1,0,0,0,736,737,1,0,0,0,737,735,
        1,0,0,0,737,738,1,0,0,0,738,739,1,0,0,0,739,740,5,41,0,0,740,741,
        3,14,7,0,741,743,5,16,0,0,742,744,3,14,7,0,743,742,1,0,0,0,743,744,
        1,0,0,0,744,884,1,0,0,0,745,747,5,75,0,0,746,745,1,0,0,0,746,747,
        1,0,0,0,747,748,1,0,0,0,748,749,7,3,0,0,749,750,5,15,0,0,750,751,
        3,14,7,0,751,753,5,16,0,0,752,754,3,14,7,0,753,752,1,0,0,0,753,754,
        1,0,0,0,754,884,1,0,0,0,755,756,5,75,0,0,756,757,5,66,0,0,757,758,
        5,15,0,0,758,760,3,14,7,0,759,761,5,16,0,0,760,759,1,0,0,0,761,762,
        1,0,0,0,762,760,1,0,0,0,762,763,1,0,0,0,763,765,1,0,0,0,764,766,
        3,14,7,0,765,764,1,0,0,0,765,766,1,0,0,0,766,884,1,0,0,0,767,768,
        5,75,0,0,768,769,5,67,0,0,769,770,5,15,0,0,770,772,5,16,0,0,771,
        773,3,14,7,0,772,771,1,0,0,0,772,773,1,0,0,0,773,884,1,0,0,0,774,
        775,5,75,0,0,775,776,5,68,0,0,776,777,5,15,0,0,777,779,5,16,0,0,
        778,780,3,14,7,0,779,778,1,0,0,0,779,780,1,0,0,0,780,884,1,0,0,0,
        781,782,5,75,0,0,782,783,5,71,0,0,783,784,5,15,0,0,784,785,3,14,
        7,0,785,787,5,16,0,0,786,788,3,14,7,0,787,786,1,0,0,0,787,788,1,
        0,0,0,788,884,1,0,0,0,789,790,5,76,0,0,790,791,5,20,0,0,791,884,
        3,14,7,0,792,793,5,77,0,0,793,794,5,20,0,0,794,795,5,77,0,0,795,
        796,5,23,0,0,796,884,3,14,7,0,797,799,5,15,0,0,798,797,1,0,0,0,799,
        802,1,0,0,0,800,798,1,0,0,0,800,801,1,0,0,0,801,804,1,0,0,0,802,
        800,1,0,0,0,803,805,3,24,12,0,804,803,1,0,0,0,804,805,1,0,0,0,805,
        810,1,0,0,0,806,807,5,22,0,0,807,809,5,77,0,0,808,806,1,0,0,0,809,
        812,1,0,0,0,810,808,1,0,0,0,810,811,1,0,0,0,811,814,1,0,0,0,812,
        810,1,0,0,0,813,815,3,20,10,0,814,813,1,0,0,0,814,815,1,0,0,0,815,
        817,1,0,0,0,816,818,3,24,12,0,817,816,1,0,0,0,817,818,1,0,0,0,818,
        821,1,0,0,0,819,820,5,22,0,0,820,822,5,77,0,0,821,819,1,0,0,0,822,
        823,1,0,0,0,823,821,1,0,0,0,823,824,1,0,0,0,824,826,1,0,0,0,825,
        827,3,14,7,0,826,825,1,0,0,0,826,827,1,0,0,0,827,884,1,0,0,0,828,
        832,3,24,12,0,829,831,5,22,0,0,830,829,1,0,0,0,831,834,1,0,0,0,832,
        830,1,0,0,0,832,833,1,0,0,0,833,838,1,0,0,0,834,832,1,0,0,0,835,
        837,5,77,0,0,836,835,1,0,0,0,837,840,1,0,0,0,838,836,1,0,0,0,838,
        839,1,0,0,0,839,841,1,0,0,0,840,838,1,0,0,0,841,843,3,6,3,0,842,
        844,3,20,10,0,843,842,1,0,0,0,843,844,1,0,0,0,844,846,1,0,0,0,845,
        847,3,14,7,0,846,845,1,0,0,0,846,847,1,0,0,0,847,884,1,0,0,0,848,
        850,3,20,10,0,849,851,3,22,11,0,850,849,1,0,0,0,850,851,1,0,0,0,
        851,884,1,0,0,0,852,853,5,75,0,0,853,884,3,14,7,0,854,856,5,78,0,
        0,855,857,3,14,7,0,856,855,1,0,0,0,856,857,1,0,0,0,857,884,1,0,0,
        0,858,860,5,75,0,0,859,858,1,0,0,0,859,860,1,0,0,0,860,861,1,0,0,
        0,861,863,3,6,3,0,862,864,3,14,7,0,863,862,1,0,0,0,863,864,1,0,0,
        0,864,884,1,0,0,0,865,867,3,24,12,0,866,868,3,14,7,0,867,866,1,0,
        0,0,867,868,1,0,0,0,868,884,1,0,0,0,869,870,5,24,0,0,870,872,3,14,
        7,0,871,873,5,22,0,0,872,871,1,0,0,0,872,873,1,0,0,0,873,874,1,0,
        0,0,874,876,5,24,0,0,875,877,5,22,0,0,876,875,1,0,0,0,876,877,1,
        0,0,0,877,879,1,0,0,0,878,880,3,14,7,0,879,878,1,0,0,0,879,880,1,
        0,0,0,880,884,1,0,0,0,881,882,5,13,0,0,882,884,3,14,7,0,883,173,
        1,0,0,0,883,179,1,0,0,0,883,183,1,0,0,0,883,191,1,0,0,0,883,207,
        1,0,0,0,883,223,1,0,0,0,883,240,1,0,0,0,883,263,1,0,0,0,883,286,
        1,0,0,0,883,309,1,0,0,0,883,325,1,0,0,0,883,341,1,0,0,0,883,393,
        1,0,0,0,883,445,1,0,0,0,883,463,1,0,0,0,883,499,1,0,0,0,883,552,
        1,0,0,0,883,604,1,0,0,0,883,655,1,0,0,0,883,685,1,0,0,0,883,696,
        1,0,0,0,883,723,1,0,0,0,883,746,1,0,0,0,883,755,1,0,0,0,883,767,
        1,0,0,0,883,774,1,0,0,0,883,781,1,0,0,0,883,789,1,0,0,0,883,792,
        1,0,0,0,883,800,1,0,0,0,883,828,1,0,0,0,883,848,1,0,0,0,883,852,
        1,0,0,0,883,854,1,0,0,0,883,859,1,0,0,0,883,865,1,0,0,0,883,869,
        1,0,0,0,883,881,1,0,0,0,884,15,1,0,0,0,885,890,3,24,12,0,886,887,
        5,22,0,0,887,889,5,77,0,0,888,886,1,0,0,0,889,892,1,0,0,0,890,888,
        1,0,0,0,890,891,1,0,0,0,891,895,1,0,0,0,892,890,1,0,0,0,893,895,
        5,78,0,0,894,885,1,0,0,0,894,893,1,0,0,0,895,900,1,0,0,0,896,897,
        5,22,0,0,897,899,5,77,0,0,898,896,1,0,0,0,899,902,1,0,0,0,900,898,
        1,0,0,0,900,901,1,0,0,0,901,903,1,0,0,0,902,900,1,0,0,0,903,913,
        3,20,10,0,904,909,3,24,12,0,905,906,5,22,0,0,906,908,5,77,0,0,907,
        905,1,0,0,0,908,911,1,0,0,0,909,907,1,0,0,0,909,910,1,0,0,0,910,
        914,1,0,0,0,911,909,1,0,0,0,912,914,5,78,0,0,913,904,1,0,0,0,913,
        912,1,0,0,0,914,17,1,0,0,0,915,916,7,4,0,0,916,917,3,14,7,0,917,
        19,1,0,0,0,918,919,7,5,0,0,919,21,1,0,0,0,920,935,5,78,0,0,921,923,
        5,24,0,0,922,921,1,0,0,0,922,923,1,0,0,0,923,924,1,0,0,0,924,926,
        5,77,0,0,925,927,5,15,0,0,926,925,1,0,0,0,926,927,1,0,0,0,927,929,
        1,0,0,0,928,930,5,16,0,0,929,928,1,0,0,0,929,930,1,0,0,0,930,932,
        1,0,0,0,931,933,5,24,0,0,932,931,1,0,0,0,932,933,1,0,0,0,933,935,
        1,0,0,0,934,920,1,0,0,0,934,922,1,0,0,0,935,23,1,0,0,0,936,945,3,
        26,13,0,937,945,5,5,0,0,938,945,3,6,3,0,939,940,5,15,0,0,940,941,
        3,14,7,0,941,942,5,16,0,0,942,945,1,0,0,0,943,945,5,77,0,0,944,936,
        1,0,0,0,944,937,1,0,0,0,944,938,1,0,0,0,944,939,1,0,0,0,944,943,
        1,0,0,0,945,25,1,0,0,0,946,947,7,6,0,0,947,27,1,0,0,0,180,32,39,
        42,47,51,54,57,60,63,66,69,72,75,78,81,84,88,93,98,102,105,109,120,
        127,131,135,146,168,173,177,181,196,205,212,221,228,237,240,246,
        254,259,263,269,277,282,286,292,300,305,309,316,321,325,332,337,
        341,346,353,359,363,367,370,374,380,386,390,393,398,405,411,415,
        419,422,426,432,438,442,445,451,457,460,463,468,474,478,481,485,
        492,496,499,504,511,517,521,525,528,532,538,544,548,552,557,564,
        570,574,578,581,585,591,597,601,604,609,616,622,626,630,633,637,
        643,649,653,660,663,667,670,674,680,683,691,694,700,704,707,711,
        717,720,723,730,733,737,743,746,753,762,765,772,779,787,800,804,
        810,814,817,823,826,832,838,843,846,850,856,859,863,867,872,876,
        879,883,890,894,900,909,913,922,926,929,932,934,944
    ]

class OCLsParser ( Parser ):

    grammarFileName = "OCLs.g4"

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

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

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "'context'", "'inv'", "'pre'", "'post'", 
                     "'self'", "'forAll'", "'exists'", "'select'", "'collect'", 
                     "'OclAny'", "'OclVoid'", "<INVALID>", "'..'", "'::'", 
                     "'('", "')'", "'{'", "'}'", "';'", "':'", "','", "'.'", 
                     "'='", "'''", "'Boolean'", "'Integer'", "'Real'", "'String'", 
                     "'if'", "'then'", "'else'", "'endif'", "'and'", "'or'", 
                     "'not'", "'<>'", "'<'", "'<='", "'>'", "'>='", "'|'", 
                     "<INVALID>", "'Bag'", "'Sequence'", "'OrderedSet'", 
                     "'-'", "'+'", "'/'", "' '", "'xor'", "'implies'", "'oclAsType'", 
                     "'oclIsTypeOf'", "'oclIsKindOf'", "'allInstances'", 
                     "'isEmpty'", "'sum'", "'size'", "'includes'", "'excludes'", 
                     "'subSequence'", "'subOrderedSet'", "'prepend'", "'last'", 
                     "'append'", "'symmetricDifference'", "'first'", "'derive'", 
                     "'body'", "'init'", "'union'", "'null'", "'let'", "'in'", 
                     "<INVALID>", "'def'" ]

    symbolicNames = [ "<INVALID>", "CONTEXT", "INV", "PRE", "POST", "SELF", 
                      "FORALL", "EXISTS", "SELECT", "COLLECT", "OCLANY", 
                      "OCLVOID", "WS", "DoubleDots", "DoubleCOLON", "LPAREN", 
                      "RPAREN", "LBRACE", "RBRACE", "SEMI", "COLON", "COMMA", 
                      "DOT", "EQUAL", "SingleQuote", "BOOLEAN_TYPE", "INTEGER_TYPE", 
                      "REAL_TYPE", "STRING_TYPE", "IF", "THEN", "ELSE", 
                      "ENDIF", "AND", "OR", "NOT", "NOTEQUAL", "LT", "LE", 
                      "GT", "GE", "PIPE", "SET", "BAG", "SEQUENCE", "ORDEREDSET", 
                      "MINUS", "PLUS", "Divide", "EMPTYSTRING", "XOR", "IMPLIES", 
                      "OCLASTYPE", "OCLISTYPEOF", "OCLISKINDOF", "ALLINSTANCES", 
                      "ISEMPTY", "SUM", "SIZE", "INCLUDES", "EXCLUDES", 
                      "SUBSEQUENCE", "SUBORDEREDSET", "PREPEND", "LAST", 
                      "APPEND", "SYMMETRICDIFFERENCE", "FIRST", "DERIVE", 
                      "BODY", "Init", "UNION", "NULL", "LET", "IN", "Arrow", 
                      "Def", "ID", "NUMBER", "STRING_LITERAL", "BOOLEAN_LITERAL", 
                      "COMMENT", "LINE_COMMENT" ]

    RULE_oclFile = 0
    RULE_contextDeclaration = 1
    RULE_constraint = 2
    RULE_functionCall = 3
    RULE_type = 4
    RULE_collectionType = 5
    RULE_userDefinedType = 6
    RULE_expression = 7
    RULE_binaryExpression = 8
    RULE_unaryExpression = 9
    RULE_operator = 10
    RULE_numberORUserDefined = 11
    RULE_primaryExpression = 12
    RULE_literal = 13

    ruleNames =  [ "oclFile", "contextDeclaration", "constraint", "functionCall", 
                   "type", "collectionType", "userDefinedType", "expression", 
                   "binaryExpression", "unaryExpression", "operator", "numberORUserDefined", 
                   "primaryExpression", "literal" ]

    EOF = Token.EOF
    CONTEXT=1
    INV=2
    PRE=3
    POST=4
    SELF=5
    FORALL=6
    EXISTS=7
    SELECT=8
    COLLECT=9
    OCLANY=10
    OCLVOID=11
    WS=12
    DoubleDots=13
    DoubleCOLON=14
    LPAREN=15
    RPAREN=16
    LBRACE=17
    RBRACE=18
    SEMI=19
    COLON=20
    COMMA=21
    DOT=22
    EQUAL=23
    SingleQuote=24
    BOOLEAN_TYPE=25
    INTEGER_TYPE=26
    REAL_TYPE=27
    STRING_TYPE=28
    IF=29
    THEN=30
    ELSE=31
    ENDIF=32
    AND=33
    OR=34
    NOT=35
    NOTEQUAL=36
    LT=37
    LE=38
    GT=39
    GE=40
    PIPE=41
    SET=42
    BAG=43
    SEQUENCE=44
    ORDEREDSET=45
    MINUS=46
    PLUS=47
    Divide=48
    EMPTYSTRING=49
    XOR=50
    IMPLIES=51
    OCLASTYPE=52
    OCLISTYPEOF=53
    OCLISKINDOF=54
    ALLINSTANCES=55
    ISEMPTY=56
    SUM=57
    SIZE=58
    INCLUDES=59
    EXCLUDES=60
    SUBSEQUENCE=61
    SUBORDEREDSET=62
    PREPEND=63
    LAST=64
    APPEND=65
    SYMMETRICDIFFERENCE=66
    FIRST=67
    DERIVE=68
    BODY=69
    Init=70
    UNION=71
    NULL=72
    LET=73
    IN=74
    Arrow=75
    Def=76
    ID=77
    NUMBER=78
    STRING_LITERAL=79
    BOOLEAN_LITERAL=80
    COMMENT=81
    LINE_COMMENT=82

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




    class OclFileContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def contextDeclaration(self):
            return self.getTypedRuleContext(OCLsParser.ContextDeclarationContext,0)


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


        def getRuleIndex(self):
            return OCLsParser.RULE_oclFile

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

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




    def oclFile(self):

        localctx = OCLsParser.OclFileContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_oclFile)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 28
            self.contextDeclaration()
            self.state = 32
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while (((_la) & ~0x3f) == 0 and ((1 << _la) & 8687441474150769632) != 0) or ((((_la - 72)) & ~0x3f) == 0 and ((1 << (_la - 72)) & 505) != 0):
                self.state = 29
                self.expression()
                self.state = 34
                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 ContextDeclarationContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return OCLsParser.RULE_contextDeclaration

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



    class ContextExpContext(ContextDeclarationContext):

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

        def CONTEXT(self):
            return self.getToken(OCLsParser.CONTEXT, 0)
        def ID(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.ID)
            else:
                return self.getToken(OCLsParser.ID, i)
        def COLON(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.COLON)
            else:
                return self.getToken(OCLsParser.COLON, i)
        def type_(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.TypeContext)
            else:
                return self.getTypedRuleContext(OCLsParser.TypeContext,i)

        def LBRACE(self):
            return self.getToken(OCLsParser.LBRACE, 0)
        def constraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.ConstraintContext)
            else:
                return self.getTypedRuleContext(OCLsParser.ConstraintContext,i)

        def RBRACE(self):
            return self.getToken(OCLsParser.RBRACE, 0)
        def DoubleCOLON(self):
            return self.getToken(OCLsParser.DoubleCOLON, 0)
        def functionCall(self):
            return self.getTypedRuleContext(OCLsParser.FunctionCallContext,0)

        def LPAREN(self):
            return self.getToken(OCLsParser.LPAREN, 0)
        def RPAREN(self):
            return self.getToken(OCLsParser.RPAREN, 0)
        def expression(self):
            return self.getTypedRuleContext(OCLsParser.ExpressionContext,0)

        def DERIVE(self):
            return self.getToken(OCLsParser.DERIVE, 0)
        def BODY(self):
            return self.getToken(OCLsParser.BODY, 0)
        def Init(self):
            return self.getToken(OCLsParser.Init, 0)
        def PRE(self):
            return self.getToken(OCLsParser.PRE, 0)
        def POST(self):
            return self.getToken(OCLsParser.POST, 0)
        def Def(self):
            return self.getToken(OCLsParser.Def, 0)

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

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



    def contextDeclaration(self):

        localctx = OCLsParser.ContextDeclarationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_contextDeclaration)
        self._la = 0 # Token type
        try:
            localctx = OCLsParser.ContextExpContext(self, localctx)
            self.enterOuterAlt(localctx, 1)
            self.state = 35
            self.match(OCLsParser.CONTEXT)
            self.state = 36
            self.match(OCLsParser.ID)
            self.state = 39
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,1,self._ctx)
            if la_ == 1:
                self.state = 37
                self.match(OCLsParser.COLON)
                self.state = 38
                self.type_()


            self.state = 42
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==17:
                self.state = 41
                self.match(OCLsParser.LBRACE)


            self.state = 47
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,3,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 44
                    self.constraint() 
                self.state = 49
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,3,self._ctx)

            self.state = 51
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==18:
                self.state = 50
                self.match(OCLsParser.RBRACE)


            self.state = 54
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==14:
                self.state = 53
                self.match(OCLsParser.DoubleCOLON)


            self.state = 57
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,6,self._ctx)
            if la_ == 1:
                self.state = 56
                self.functionCall()


            self.state = 60
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,7,self._ctx)
            if la_ == 1:
                self.state = 59
                self.match(OCLsParser.COLON)


            self.state = 63
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,8,self._ctx)
            if la_ == 1:
                self.state = 62
                self.type_()


            self.state = 66
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,9,self._ctx)
            if la_ == 1:
                self.state = 65
                self.match(OCLsParser.LPAREN)


            self.state = 69
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,10,self._ctx)
            if la_ == 1:
                self.state = 68
                self.match(OCLsParser.ID)


            self.state = 72
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==16:
                self.state = 71
                self.match(OCLsParser.RPAREN)


            self.state = 75
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,12,self._ctx)
            if la_ == 1:
                self.state = 74
                self.match(OCLsParser.COLON)


            self.state = 78
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,13,self._ctx)
            if la_ == 1:
                self.state = 77
                _la = self._input.LA(1)
                if not(_la==3 or _la==4 or ((((_la - 68)) & ~0x3f) == 0 and ((1 << (_la - 68)) & 263) != 0)):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


            self.state = 81
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==20:
                self.state = 80
                self.match(OCLsParser.COLON)


            self.state = 84
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,15,self._ctx)
            if la_ == 1:
                self.state = 83
                self.expression()


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


    class ConstraintContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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


        def INV(self):
            return self.getToken(OCLsParser.INV, 0)

        def PRE(self):
            return self.getToken(OCLsParser.PRE, 0)

        def POST(self):
            return self.getToken(OCLsParser.POST, 0)

        def ID(self):
            return self.getToken(OCLsParser.ID, 0)

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

        def getRuleIndex(self):
            return OCLsParser.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 = OCLsParser.ConstraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_constraint)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 86
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 28) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 88
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==77:
                self.state = 87
                self.match(OCLsParser.ID)


            self.state = 90
            self.match(OCLsParser.COLON)
            self.state = 91
            self.expression()
            self.state = 93
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==19:
                self.state = 92
                self.match(OCLsParser.SEMI)


        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 ID(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.ID)
            else:
                return self.getToken(OCLsParser.ID, i)

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

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

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


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

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

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

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

        def getRuleIndex(self):
            return OCLsParser.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 = OCLsParser.FunctionCallContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_functionCall)
        self._la = 0 # Token type
        try:
            self.state = 135
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,25,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 95
                self.match(OCLsParser.ID)
                self.state = 96
                self.match(OCLsParser.LPAREN)
                self.state = 109
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & 8687441474150769632) != 0) or ((((_la - 72)) & ~0x3f) == 0 and ((1 << (_la - 72)) & 505) != 0):
                    self.state = 98
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,18,self._ctx)
                    if la_ == 1:
                        self.state = 97
                        self.match(OCLsParser.SingleQuote)


                    self.state = 100
                    self.expression()
                    self.state = 102
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,19,self._ctx)
                    if la_ == 1:
                        self.state = 101
                        self.match(OCLsParser.SingleQuote)


                    self.state = 105
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==21:
                        self.state = 104
                        self.match(OCLsParser.COMMA)


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

                self.state = 112
                self.match(OCLsParser.RPAREN)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 113
                self.match(OCLsParser.ID)
                self.state = 114
                self.match(OCLsParser.LPAREN)
                self.state = 120
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==77:
                    self.state = 115
                    self.match(OCLsParser.ID)
                    self.state = 116
                    self.match(OCLsParser.COLON)
                    self.state = 117
                    self.match(OCLsParser.ID)
                    self.state = 122
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 123
                self.match(OCLsParser.RPAREN)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 124
                self.match(OCLsParser.LPAREN)
                self.state = 131
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==78:
                    self.state = 125
                    self.match(OCLsParser.NUMBER)
                    self.state = 127
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==21:
                        self.state = 126
                        self.match(OCLsParser.COMMA)


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

                self.state = 134
                self.match(OCLsParser.RPAREN)
                pass


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


    class TypeContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def BOOLEAN_TYPE(self):
            return self.getToken(OCLsParser.BOOLEAN_TYPE, 0)

        def INTEGER_TYPE(self):
            return self.getToken(OCLsParser.INTEGER_TYPE, 0)

        def REAL_TYPE(self):
            return self.getToken(OCLsParser.REAL_TYPE, 0)

        def STRING_TYPE(self):
            return self.getToken(OCLsParser.STRING_TYPE, 0)

        def OCLANY(self):
            return self.getToken(OCLsParser.OCLANY, 0)

        def OCLVOID(self):
            return self.getToken(OCLsParser.OCLVOID, 0)

        def collectionType(self):
            return self.getTypedRuleContext(OCLsParser.CollectionTypeContext,0)


        def userDefinedType(self):
            return self.getTypedRuleContext(OCLsParser.UserDefinedTypeContext,0)


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

        def getRuleIndex(self):
            return OCLsParser.RULE_type

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

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




    def type_(self):

        localctx = OCLsParser.TypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_type)
        try:
            self.state = 146
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,26,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 137
                self.match(OCLsParser.BOOLEAN_TYPE)
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 138
                self.match(OCLsParser.INTEGER_TYPE)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 139
                self.match(OCLsParser.REAL_TYPE)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 140
                self.match(OCLsParser.STRING_TYPE)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 141
                self.match(OCLsParser.OCLANY)
                pass

            elif la_ == 6:
                self.enterOuterAlt(localctx, 6)
                self.state = 142
                self.match(OCLsParser.OCLVOID)
                pass

            elif la_ == 7:
                self.enterOuterAlt(localctx, 7)
                self.state = 143
                self.collectionType()
                pass

            elif la_ == 8:
                self.enterOuterAlt(localctx, 8)
                self.state = 144
                self.userDefinedType()
                pass

            elif la_ == 9:
                self.enterOuterAlt(localctx, 9)
                self.state = 145
                self.match(OCLsParser.SET)
                pass


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


    class CollectionTypeContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def type_(self):
            return self.getTypedRuleContext(OCLsParser.TypeContext,0)


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

        def BAG(self):
            return self.getToken(OCLsParser.BAG, 0)

        def SEQUENCE(self):
            return self.getToken(OCLsParser.SEQUENCE, 0)

        def ORDEREDSET(self):
            return self.getToken(OCLsParser.ORDEREDSET, 0)

        def getRuleIndex(self):
            return OCLsParser.RULE_collectionType

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

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




    def collectionType(self):

        localctx = OCLsParser.CollectionTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_collectionType)
        try:
            self.state = 168
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [42]:
                self.enterOuterAlt(localctx, 1)
                self.state = 148
                self.match(OCLsParser.SET)
                self.state = 149
                self.match(OCLsParser.LT)
                self.state = 150
                self.type_()
                self.state = 151
                self.match(OCLsParser.GT)
                pass
            elif token in [43]:
                self.enterOuterAlt(localctx, 2)
                self.state = 153
                self.match(OCLsParser.BAG)
                self.state = 154
                self.match(OCLsParser.LT)
                self.state = 155
                self.type_()
                self.state = 156
                self.match(OCLsParser.GT)
                pass
            elif token in [44]:
                self.enterOuterAlt(localctx, 3)
                self.state = 158
                self.match(OCLsParser.SEQUENCE)
                self.state = 159
                self.match(OCLsParser.LT)
                self.state = 160
                self.type_()
                self.state = 161
                self.match(OCLsParser.GT)
                pass
            elif token in [45]:
                self.enterOuterAlt(localctx, 4)
                self.state = 163
                self.match(OCLsParser.ORDEREDSET)
                self.state = 164
                self.match(OCLsParser.LT)
                self.state = 165
                self.type_()
                self.state = 166
                self.match(OCLsParser.GT)
                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 UserDefinedTypeContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def ID(self):
            return self.getToken(OCLsParser.ID, 0)

        def getRuleIndex(self):
            return OCLsParser.RULE_userDefinedType

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

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




    def userDefinedType(self):

        localctx = OCLsParser.UserDefinedTypeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_userDefinedType)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 170
            self.match(OCLsParser.ID)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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


        def getRuleIndex(self):
            return OCLsParser.RULE_expression

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



    class ArrowexpContext(ExpressionContext):

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

        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def expression(self):
            return self.getTypedRuleContext(OCLsParser.ExpressionContext,0)


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

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


    class COLLECTIONContext(ExpressionContext):

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

        def LPAREN(self):
            return self.getToken(OCLsParser.LPAREN, 0)
        def PIPE(self):
            return self.getToken(OCLsParser.PIPE, 0)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.ExpressionContext,i)

        def RPAREN(self):
            return self.getToken(OCLsParser.RPAREN, 0)
        def FORALL(self):
            return self.getToken(OCLsParser.FORALL, 0)
        def EXISTS(self):
            return self.getToken(OCLsParser.EXISTS, 0)
        def SELECT(self):
            return self.getToken(OCLsParser.SELECT, 0)
        def COLLECT(self):
            return self.getToken(OCLsParser.COLLECT, 0)
        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def ID(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.ID)
            else:
                return self.getToken(OCLsParser.ID, i)
        def COLON(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.COLON)
            else:
                return self.getToken(OCLsParser.COLON, i)
        def COMMA(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.COMMA)
            else:
                return self.getToken(OCLsParser.COMMA, i)

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

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


    class SETContext(ExpressionContext):

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

        def SET(self):
            return self.getToken(OCLsParser.SET, 0)
        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def LPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.LPAREN)
            else:
                return self.getToken(OCLsParser.LPAREN, i)
        def LBRACE(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.LBRACE)
            else:
                return self.getToken(OCLsParser.LBRACE, i)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.ExpressionContext,i)

        def RBRACE(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.RBRACE)
            else:
                return self.getToken(OCLsParser.RBRACE, i)
        def RPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.RPAREN)
            else:
                return self.getToken(OCLsParser.RPAREN, i)
        def SingleQuote(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.SingleQuote)
            else:
                return self.getToken(OCLsParser.SingleQuote, i)
        def COMMA(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.COMMA)
            else:
                return self.getToken(OCLsParser.COMMA, i)

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

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


    class DefIDAssignmentexpressionContext(ExpressionContext):

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

        def ID(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.ID)
            else:
                return self.getToken(OCLsParser.ID, i)
        def COLON(self):
            return self.getToken(OCLsParser.COLON, 0)
        def EQUAL(self):
            return self.getToken(OCLsParser.EQUAL, 0)
        def expression(self):
            return self.getTypedRuleContext(OCLsParser.ExpressionContext,0)


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

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


    class PredefinedfunctionCallContext(ExpressionContext):

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

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

        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def expression(self):
            return self.getTypedRuleContext(OCLsParser.ExpressionContext,0)


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

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


    class UnaryContext(ExpressionContext):

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

        def unaryExpression(self):
            return self.getTypedRuleContext(OCLsParser.UnaryExpressionContext,0)

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


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

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


    class INCLUDESContext(ExpressionContext):

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

        def INCLUDES(self):
            return self.getToken(OCLsParser.INCLUDES, 0)
        def LPAREN(self):
            return self.getToken(OCLsParser.LPAREN, 0)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.ExpressionContext,i)

        def RPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.RPAREN)
            else:
                return self.getToken(OCLsParser.RPAREN, i)
        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)

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

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


    class SUBORDEREDSETContext(ExpressionContext):

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

        def SUBORDEREDSET(self):
            return self.getToken(OCLsParser.SUBORDEREDSET, 0)
        def RPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.RPAREN)
            else:
                return self.getToken(OCLsParser.RPAREN, i)
        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def LPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.LPAREN)
            else:
                return self.getToken(OCLsParser.LPAREN, i)
        def LBRACE(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.LBRACE)
            else:
                return self.getToken(OCLsParser.LBRACE, i)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.ExpressionContext,i)

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

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

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


    class PrimaryExpContext(ExpressionContext):

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

        def LPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.LPAREN)
            else:
                return self.getToken(OCLsParser.LPAREN, i)
        def primaryExpression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.PrimaryExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.PrimaryExpressionContext,i)

        def DOT(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.DOT)
            else:
                return self.getToken(OCLsParser.DOT, i)
        def ID(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.ID)
            else:
                return self.getToken(OCLsParser.ID, i)
        def operator(self):
            return self.getTypedRuleContext(OCLsParser.OperatorContext,0)

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


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

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


    class OCLISKINDOFContext(ExpressionContext):

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

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

        def DOT(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.DOT)
            else:
                return self.getToken(OCLsParser.DOT, i)
        def OCLISKINDOF(self):
            return self.getToken(OCLsParser.OCLISKINDOF, 0)
        def LPAREN(self):
            return self.getToken(OCLsParser.LPAREN, 0)
        def type_(self):
            return self.getTypedRuleContext(OCLsParser.TypeContext,0)

        def RPAREN(self):
            return self.getToken(OCLsParser.RPAREN, 0)
        def ID(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.ID)
            else:
                return self.getToken(OCLsParser.ID, i)
        def expression(self):
            return self.getTypedRuleContext(OCLsParser.ExpressionContext,0)


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

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


    class NumberContext(ExpressionContext):

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

        def NUMBER(self):
            return self.getToken(OCLsParser.NUMBER, 0)
        def expression(self):
            return self.getTypedRuleContext(OCLsParser.ExpressionContext,0)


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

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


    class SYMMETRICDIFFERENCEContext(ExpressionContext):

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

        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def SYMMETRICDIFFERENCE(self):
            return self.getToken(OCLsParser.SYMMETRICDIFFERENCE, 0)
        def LPAREN(self):
            return self.getToken(OCLsParser.LPAREN, 0)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.ExpressionContext,i)

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

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

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


    class SEQUENCEContext(ExpressionContext):

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

        def SEQUENCE(self):
            return self.getToken(OCLsParser.SEQUENCE, 0)
        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def LPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.LPAREN)
            else:
                return self.getToken(OCLsParser.LPAREN, i)
        def LBRACE(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.LBRACE)
            else:
                return self.getToken(OCLsParser.LBRACE, i)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.ExpressionContext,i)

        def RBRACE(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.RBRACE)
            else:
                return self.getToken(OCLsParser.RBRACE, i)
        def RPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.RPAREN)
            else:
                return self.getToken(OCLsParser.RPAREN, i)
        def SingleQuote(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.SingleQuote)
            else:
                return self.getToken(OCLsParser.SingleQuote, i)
        def COMMA(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.COMMA)
            else:
                return self.getToken(OCLsParser.COMMA, i)

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

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


    class ORDEREDSETContext(ExpressionContext):

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

        def ORDEREDSET(self):
            return self.getToken(OCLsParser.ORDEREDSET, 0)
        def LBRACE(self):
            return self.getToken(OCLsParser.LBRACE, 0)
        def RBRACE(self):
            return self.getToken(OCLsParser.RBRACE, 0)
        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def LPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.LPAREN)
            else:
                return self.getToken(OCLsParser.LPAREN, i)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.ExpressionContext,i)

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

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

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


    class DoubleDotsContext(ExpressionContext):

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

        def DoubleDots(self):
            return self.getToken(OCLsParser.DoubleDots, 0)
        def expression(self):
            return self.getTypedRuleContext(OCLsParser.ExpressionContext,0)


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

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


    class EXCLUDESContext(ExpressionContext):

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

        def EXCLUDES(self):
            return self.getToken(OCLsParser.EXCLUDES, 0)
        def LPAREN(self):
            return self.getToken(OCLsParser.LPAREN, 0)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.ExpressionContext,i)

        def RPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.RPAREN)
            else:
                return self.getToken(OCLsParser.RPAREN, i)
        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)

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

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


    class DERIVEContext(ExpressionContext):

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

        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def DERIVE(self):
            return self.getToken(OCLsParser.DERIVE, 0)
        def LPAREN(self):
            return self.getToken(OCLsParser.LPAREN, 0)
        def RPAREN(self):
            return self.getToken(OCLsParser.RPAREN, 0)
        def expression(self):
            return self.getTypedRuleContext(OCLsParser.ExpressionContext,0)


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

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


    class IDContext(ExpressionContext):

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

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

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


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

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


    class ALLINSTANCESContext(ExpressionContext):

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

        def ALLINSTANCES(self):
            return self.getToken(OCLsParser.ALLINSTANCES, 0)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.ExpressionContext,i)

        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def LPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.LPAREN)
            else:
                return self.getToken(OCLsParser.LPAREN, i)
        def RPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.RPAREN)
            else:
                return self.getToken(OCLsParser.RPAREN, i)

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

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


    class IfContext(ExpressionContext):

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

        def IF(self):
            return self.getToken(OCLsParser.IF, 0)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.ExpressionContext,i)

        def THEN(self):
            return self.getToken(OCLsParser.THEN, 0)
        def ELSE(self):
            return self.getToken(OCLsParser.ELSE, 0)
        def ENDIF(self):
            return self.getToken(OCLsParser.ENDIF, 0)

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

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


    class OpContext(ExpressionContext):

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

        def operator(self):
            return self.getTypedRuleContext(OCLsParser.OperatorContext,0)

        def numberORUserDefined(self):
            return self.getTypedRuleContext(OCLsParser.NumberORUserDefinedContext,0)


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

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


    class SUBSEQUENCEContext(ExpressionContext):

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

        def SUBSEQUENCE(self):
            return self.getToken(OCLsParser.SUBSEQUENCE, 0)
        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def LPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.LPAREN)
            else:
                return self.getToken(OCLsParser.LPAREN, i)
        def LBRACE(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.LBRACE)
            else:
                return self.getToken(OCLsParser.LBRACE, i)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.ExpressionContext,i)

        def RPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.RPAREN)
            else:
                return self.getToken(OCLsParser.RPAREN, i)
        def RBRACE(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.RBRACE)
            else:
                return self.getToken(OCLsParser.RBRACE, i)
        def SingleQuote(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.SingleQuote)
            else:
                return self.getToken(OCLsParser.SingleQuote, i)
        def COMMA(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.COMMA)
            else:
                return self.getToken(OCLsParser.COMMA, i)

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

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


    class SIZEContext(ExpressionContext):

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

        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def SIZE(self):
            return self.getToken(OCLsParser.SIZE, 0)
        def LPAREN(self):
            return self.getToken(OCLsParser.LPAREN, 0)
        def RPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.RPAREN)
            else:
                return self.getToken(OCLsParser.RPAREN, i)
        def primaryExpression(self):
            return self.getTypedRuleContext(OCLsParser.PrimaryExpressionContext,0)

        def DOT(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.DOT)
            else:
                return self.getToken(OCLsParser.DOT, i)
        def ID(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.ID)
            else:
                return self.getToken(OCLsParser.ID, i)
        def expression(self):
            return self.getTypedRuleContext(OCLsParser.ExpressionContext,0)


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

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


    class SingleQuoteExpContext(ExpressionContext):

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

        def SingleQuote(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.SingleQuote)
            else:
                return self.getToken(OCLsParser.SingleQuote, i)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.ExpressionContext,i)

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

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

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


    class BAGContext(ExpressionContext):

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

        def BAG(self):
            return self.getToken(OCLsParser.BAG, 0)
        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def LPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.LPAREN)
            else:
                return self.getToken(OCLsParser.LPAREN, i)
        def LBRACE(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.LBRACE)
            else:
                return self.getToken(OCLsParser.LBRACE, i)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.ExpressionContext,i)

        def RBRACE(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.RBRACE)
            else:
                return self.getToken(OCLsParser.RBRACE, i)
        def RPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.RPAREN)
            else:
                return self.getToken(OCLsParser.RPAREN, i)
        def SingleQuote(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.SingleQuote)
            else:
                return self.getToken(OCLsParser.SingleQuote, i)
        def COMMA(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.COMMA)
            else:
                return self.getToken(OCLsParser.COMMA, i)

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

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


    class OCLISTYPEOFContext(ExpressionContext):

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

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

        def DOT(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.DOT)
            else:
                return self.getToken(OCLsParser.DOT, i)
        def OCLISTYPEOF(self):
            return self.getToken(OCLsParser.OCLISTYPEOF, 0)
        def LPAREN(self):
            return self.getToken(OCLsParser.LPAREN, 0)
        def type_(self):
            return self.getTypedRuleContext(OCLsParser.TypeContext,0)

        def RPAREN(self):
            return self.getToken(OCLsParser.RPAREN, 0)
        def ID(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.ID)
            else:
                return self.getToken(OCLsParser.ID, i)
        def expression(self):
            return self.getTypedRuleContext(OCLsParser.ExpressionContext,0)


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

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


    class SUMContext(ExpressionContext):

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

        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def SUM(self):
            return self.getToken(OCLsParser.SUM, 0)
        def LPAREN(self):
            return self.getToken(OCLsParser.LPAREN, 0)
        def RPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.RPAREN)
            else:
                return self.getToken(OCLsParser.RPAREN, i)
        def primaryExpression(self):
            return self.getTypedRuleContext(OCLsParser.PrimaryExpressionContext,0)

        def DOT(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.DOT)
            else:
                return self.getToken(OCLsParser.DOT, i)
        def ID(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.ID)
            else:
                return self.getToken(OCLsParser.ID, i)
        def expression(self):
            return self.getTypedRuleContext(OCLsParser.ExpressionContext,0)


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

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


    class FIRSTContext(ExpressionContext):

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

        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def FIRST(self):
            return self.getToken(OCLsParser.FIRST, 0)
        def LPAREN(self):
            return self.getToken(OCLsParser.LPAREN, 0)
        def RPAREN(self):
            return self.getToken(OCLsParser.RPAREN, 0)
        def expression(self):
            return self.getTypedRuleContext(OCLsParser.ExpressionContext,0)


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

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


    class APPENDContext(ExpressionContext):

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

        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def APPEND(self):
            return self.getToken(OCLsParser.APPEND, 0)
        def LPAREN(self):
            return self.getToken(OCLsParser.LPAREN, 0)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.ExpressionContext,i)

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

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

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


    class OCLASTYPEContext(ExpressionContext):

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

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

        def DOT(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.DOT)
            else:
                return self.getToken(OCLsParser.DOT, i)
        def OCLASTYPE(self):
            return self.getToken(OCLsParser.OCLASTYPE, 0)
        def LPAREN(self):
            return self.getToken(OCLsParser.LPAREN, 0)
        def type_(self):
            return self.getTypedRuleContext(OCLsParser.TypeContext,0)

        def RPAREN(self):
            return self.getToken(OCLsParser.RPAREN, 0)
        def ID(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.ID)
            else:
                return self.getToken(OCLsParser.ID, i)
        def expression(self):
            return self.getTypedRuleContext(OCLsParser.ExpressionContext,0)


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

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


    class CollectionExpressionVariableContext(ExpressionContext):

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

        def LPAREN(self):
            return self.getToken(OCLsParser.LPAREN, 0)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.ExpressionContext,i)

        def RPAREN(self):
            return self.getToken(OCLsParser.RPAREN, 0)
        def FORALL(self):
            return self.getToken(OCLsParser.FORALL, 0)
        def EXISTS(self):
            return self.getToken(OCLsParser.EXISTS, 0)
        def SELECT(self):
            return self.getToken(OCLsParser.SELECT, 0)
        def COLLECT(self):
            return self.getToken(OCLsParser.COLLECT, 0)
        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)

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

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


    class LASTContext(ExpressionContext):

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

        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def LAST(self):
            return self.getToken(OCLsParser.LAST, 0)
        def LPAREN(self):
            return self.getToken(OCLsParser.LPAREN, 0)
        def RPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.RPAREN)
            else:
                return self.getToken(OCLsParser.RPAREN, i)
        def expression(self):
            return self.getTypedRuleContext(OCLsParser.ExpressionContext,0)


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

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


    class BinaryContext(ExpressionContext):

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

        def binaryExpression(self):
            return self.getTypedRuleContext(OCLsParser.BinaryExpressionContext,0)

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

        def AND(self):
            return self.getToken(OCLsParser.AND, 0)
        def OR(self):
            return self.getToken(OCLsParser.OR, 0)

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

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


    class ISEMPTYContext(ExpressionContext):

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

        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def ISEMPTY(self):
            return self.getToken(OCLsParser.ISEMPTY, 0)
        def LPAREN(self):
            return self.getToken(OCLsParser.LPAREN, 0)
        def RPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.RPAREN)
            else:
                return self.getToken(OCLsParser.RPAREN, i)
        def primaryExpression(self):
            return self.getTypedRuleContext(OCLsParser.PrimaryExpressionContext,0)

        def DOT(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.DOT)
            else:
                return self.getToken(OCLsParser.DOT, i)
        def ID(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.ID)
            else:
                return self.getToken(OCLsParser.ID, i)
        def expression(self):
            return self.getTypedRuleContext(OCLsParser.ExpressionContext,0)


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

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


    class DefExpContext(ExpressionContext):

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

        def Def(self):
            return self.getToken(OCLsParser.Def, 0)
        def COLON(self):
            return self.getToken(OCLsParser.COLON, 0)
        def expression(self):
            return self.getTypedRuleContext(OCLsParser.ExpressionContext,0)


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

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


    class FuncCallContext(ExpressionContext):

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

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

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

        def DOT(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.DOT)
            else:
                return self.getToken(OCLsParser.DOT, i)
        def ID(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.ID)
            else:
                return self.getToken(OCLsParser.ID, i)
        def operator(self):
            return self.getTypedRuleContext(OCLsParser.OperatorContext,0)

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


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

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


    class UNIONContext(ExpressionContext):

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

        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def UNION(self):
            return self.getToken(OCLsParser.UNION, 0)
        def LPAREN(self):
            return self.getToken(OCLsParser.LPAREN, 0)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.ExpressionContext,i)

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

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

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


    class PREPENDContext(ExpressionContext):

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

        def Arrow(self):
            return self.getToken(OCLsParser.Arrow, 0)
        def PREPEND(self):
            return self.getToken(OCLsParser.PREPEND, 0)
        def LPAREN(self, i:int=None):
            if i is None:
                return self.getTokens(OCLsParser.LPAREN)
            else:
                return self.getToken(OCLsParser.LPAREN, i)
        def expression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.ExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.ExpressionContext,i)

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

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

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



    def expression(self):

        localctx = OCLsParser.ExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_expression)
        self._la = 0 # Token type
        try:
            self.state = 883
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,168,self._ctx)
            if la_ == 1:
                localctx = OCLsParser.BinaryContext(self, localctx)
                self.enterOuterAlt(localctx, 1)
                self.state = 173
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==33 or _la==34:
                    self.state = 172
                    _la = self._input.LA(1)
                    if not(_la==33 or _la==34):
                        self._errHandler.recoverInline(self)
                    else:
                        self._errHandler.reportMatch(self)
                        self.consume()


                self.state = 175
                self.binaryExpression()
                self.state = 177
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,29,self._ctx)
                if la_ == 1:
                    self.state = 176
                    self.expression()


                pass

            elif la_ == 2:
                localctx = OCLsParser.UnaryContext(self, localctx)
                self.enterOuterAlt(localctx, 2)
                self.state = 179
                self.unaryExpression()
                self.state = 181
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,30,self._ctx)
                if la_ == 1:
                    self.state = 180
                    self.expression()


                pass

            elif la_ == 3:
                localctx = OCLsParser.IfContext(self, localctx)
                self.enterOuterAlt(localctx, 3)
                self.state = 183
                self.match(OCLsParser.IF)
                self.state = 184
                self.expression()
                self.state = 185
                self.match(OCLsParser.THEN)
                self.state = 186
                self.expression()
                self.state = 187
                self.match(OCLsParser.ELSE)
                self.state = 188
                self.expression()
                self.state = 189
                self.match(OCLsParser.ENDIF)
                pass

            elif la_ == 4:
                localctx = OCLsParser.OCLISTYPEOFContext(self, localctx)
                self.enterOuterAlt(localctx, 4)
                self.state = 191
                self.primaryExpression()
                self.state = 196
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,31,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 192
                        self.match(OCLsParser.DOT)
                        self.state = 193
                        self.match(OCLsParser.ID) 
                    self.state = 198
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,31,self._ctx)

                self.state = 199
                self.match(OCLsParser.DOT)
                self.state = 200
                self.match(OCLsParser.OCLISTYPEOF)
                self.state = 201
                self.match(OCLsParser.LPAREN)
                self.state = 202
                self.type_()
                self.state = 203
                self.match(OCLsParser.RPAREN)
                self.state = 205
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,32,self._ctx)
                if la_ == 1:
                    self.state = 204
                    self.expression()


                pass

            elif la_ == 5:
                localctx = OCLsParser.OCLASTYPEContext(self, localctx)
                self.enterOuterAlt(localctx, 5)
                self.state = 207
                self.primaryExpression()
                self.state = 212
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,33,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 208
                        self.match(OCLsParser.DOT)
                        self.state = 209
                        self.match(OCLsParser.ID) 
                    self.state = 214
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,33,self._ctx)

                self.state = 215
                self.match(OCLsParser.DOT)
                self.state = 216
                self.match(OCLsParser.OCLASTYPE)
                self.state = 217
                self.match(OCLsParser.LPAREN)
                self.state = 218
                self.type_()
                self.state = 219
                self.match(OCLsParser.RPAREN)
                self.state = 221
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,34,self._ctx)
                if la_ == 1:
                    self.state = 220
                    self.expression()


                pass

            elif la_ == 6:
                localctx = OCLsParser.OCLISKINDOFContext(self, localctx)
                self.enterOuterAlt(localctx, 6)
                self.state = 223
                self.primaryExpression()
                self.state = 228
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,35,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 224
                        self.match(OCLsParser.DOT)
                        self.state = 225
                        self.match(OCLsParser.ID) 
                    self.state = 230
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,35,self._ctx)

                self.state = 231
                self.match(OCLsParser.DOT)
                self.state = 232
                self.match(OCLsParser.OCLISKINDOF)
                self.state = 233
                self.match(OCLsParser.LPAREN)
                self.state = 234
                self.type_()
                self.state = 235
                self.match(OCLsParser.RPAREN)
                self.state = 237
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,36,self._ctx)
                if la_ == 1:
                    self.state = 236
                    self.expression()


                pass

            elif la_ == 7:
                localctx = OCLsParser.ISEMPTYContext(self, localctx)
                self.enterOuterAlt(localctx, 7)
                self.state = 240
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==5 or _la==15 or ((((_la - 72)) & ~0x3f) == 0 and ((1 << (_la - 72)) & 481) != 0):
                    self.state = 239
                    self.primaryExpression()


                self.state = 246
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==22:
                    self.state = 242
                    self.match(OCLsParser.DOT)
                    self.state = 243
                    self.match(OCLsParser.ID)
                    self.state = 248
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 249
                self.match(OCLsParser.Arrow)
                self.state = 250
                self.match(OCLsParser.ISEMPTY)
                self.state = 251
                self.match(OCLsParser.LPAREN)
                self.state = 252
                self.match(OCLsParser.RPAREN)
                self.state = 254
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,39,self._ctx)
                if la_ == 1:
                    self.state = 253
                    self.expression()


                self.state = 259
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,40,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 256
                        self.match(OCLsParser.RPAREN) 
                    self.state = 261
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,40,self._ctx)

                pass

            elif la_ == 8:
                localctx = OCLsParser.SUMContext(self, localctx)
                self.enterOuterAlt(localctx, 8)
                self.state = 263
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==5 or _la==15 or ((((_la - 72)) & ~0x3f) == 0 and ((1 << (_la - 72)) & 481) != 0):
                    self.state = 262
                    self.primaryExpression()


                self.state = 269
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==22:
                    self.state = 265
                    self.match(OCLsParser.DOT)
                    self.state = 266
                    self.match(OCLsParser.ID)
                    self.state = 271
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 272
                self.match(OCLsParser.Arrow)
                self.state = 273
                self.match(OCLsParser.SUM)
                self.state = 274
                self.match(OCLsParser.LPAREN)
                self.state = 275
                self.match(OCLsParser.RPAREN)
                self.state = 277
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,43,self._ctx)
                if la_ == 1:
                    self.state = 276
                    self.expression()


                self.state = 282
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,44,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 279
                        self.match(OCLsParser.RPAREN) 
                    self.state = 284
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,44,self._ctx)

                pass

            elif la_ == 9:
                localctx = OCLsParser.SIZEContext(self, localctx)
                self.enterOuterAlt(localctx, 9)
                self.state = 286
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==5 or _la==15 or ((((_la - 72)) & ~0x3f) == 0 and ((1 << (_la - 72)) & 481) != 0):
                    self.state = 285
                    self.primaryExpression()


                self.state = 292
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==22:
                    self.state = 288
                    self.match(OCLsParser.DOT)
                    self.state = 289
                    self.match(OCLsParser.ID)
                    self.state = 294
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 295
                self.match(OCLsParser.Arrow)
                self.state = 296
                self.match(OCLsParser.SIZE)
                self.state = 297
                self.match(OCLsParser.LPAREN)
                self.state = 298
                self.match(OCLsParser.RPAREN)
                self.state = 300
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,47,self._ctx)
                if la_ == 1:
                    self.state = 299
                    self.expression()


                self.state = 305
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,48,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 302
                        self.match(OCLsParser.RPAREN) 
                    self.state = 307
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,48,self._ctx)

                pass

            elif la_ == 10:
                localctx = OCLsParser.INCLUDESContext(self, localctx)
                self.enterOuterAlt(localctx, 10)
                self.state = 309
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==75:
                    self.state = 308
                    self.match(OCLsParser.Arrow)


                self.state = 311
                self.match(OCLsParser.INCLUDES)
                self.state = 312
                self.match(OCLsParser.LPAREN)
                self.state = 313
                self.expression()
                self.state = 314
                self.match(OCLsParser.RPAREN)
                self.state = 316
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,50,self._ctx)
                if la_ == 1:
                    self.state = 315
                    self.expression()


                self.state = 321
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,51,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 318
                        self.match(OCLsParser.RPAREN) 
                    self.state = 323
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,51,self._ctx)

                pass

            elif la_ == 11:
                localctx = OCLsParser.EXCLUDESContext(self, localctx)
                self.enterOuterAlt(localctx, 11)
                self.state = 325
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==75:
                    self.state = 324
                    self.match(OCLsParser.Arrow)


                self.state = 327
                self.match(OCLsParser.EXCLUDES)
                self.state = 328
                self.match(OCLsParser.LPAREN)
                self.state = 329
                self.expression()
                self.state = 330
                self.match(OCLsParser.RPAREN)
                self.state = 332
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,53,self._ctx)
                if la_ == 1:
                    self.state = 331
                    self.expression()


                self.state = 337
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,54,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 334
                        self.match(OCLsParser.RPAREN) 
                    self.state = 339
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,54,self._ctx)

                pass

            elif la_ == 12:
                localctx = OCLsParser.SEQUENCEContext(self, localctx)
                self.enterOuterAlt(localctx, 12)
                self.state = 341
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==75:
                    self.state = 340
                    self.match(OCLsParser.Arrow)


                self.state = 346
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==15:
                    self.state = 343
                    self.match(OCLsParser.LPAREN)
                    self.state = 348
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 349
                self.match(OCLsParser.SEQUENCE)
                self.state = 353
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==17:
                    self.state = 350
                    self.match(OCLsParser.LBRACE)
                    self.state = 355
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 359
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,58,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 356
                        self.match(OCLsParser.LPAREN) 
                    self.state = 361
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,58,self._ctx)

                self.state = 374
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,62,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 363
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,59,self._ctx)
                        if la_ == 1:
                            self.state = 362
                            self.match(OCLsParser.SingleQuote)


                        self.state = 365
                        self.expression()
                        self.state = 367
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,60,self._ctx)
                        if la_ == 1:
                            self.state = 366
                            self.match(OCLsParser.SingleQuote)


                        self.state = 370
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,61,self._ctx)
                        if la_ == 1:
                            self.state = 369
                            self.match(OCLsParser.COMMA)

                 
                    self.state = 376
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,62,self._ctx)

                self.state = 380
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,63,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 377
                        self.match(OCLsParser.RBRACE) 
                    self.state = 382
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,63,self._ctx)

                self.state = 386
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,64,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 383
                        self.match(OCLsParser.RPAREN) 
                    self.state = 388
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,64,self._ctx)

                self.state = 390
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,65,self._ctx)
                if la_ == 1:
                    self.state = 389
                    self.expression()


                pass

            elif la_ == 13:
                localctx = OCLsParser.SUBSEQUENCEContext(self, localctx)
                self.enterOuterAlt(localctx, 13)
                self.state = 393
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==75:
                    self.state = 392
                    self.match(OCLsParser.Arrow)


                self.state = 398
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==15:
                    self.state = 395
                    self.match(OCLsParser.LPAREN)
                    self.state = 400
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 401
                self.match(OCLsParser.SUBSEQUENCE)
                self.state = 405
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==17:
                    self.state = 402
                    self.match(OCLsParser.LBRACE)
                    self.state = 407
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 411
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,69,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 408
                        self.match(OCLsParser.LPAREN) 
                    self.state = 413
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,69,self._ctx)

                self.state = 426
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,73,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 415
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,70,self._ctx)
                        if la_ == 1:
                            self.state = 414
                            self.match(OCLsParser.SingleQuote)


                        self.state = 417
                        self.expression()
                        self.state = 419
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,71,self._ctx)
                        if la_ == 1:
                            self.state = 418
                            self.match(OCLsParser.SingleQuote)


                        self.state = 422
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,72,self._ctx)
                        if la_ == 1:
                            self.state = 421
                            self.match(OCLsParser.COMMA)

                 
                    self.state = 428
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,73,self._ctx)

                self.state = 432
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,74,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 429
                        self.match(OCLsParser.RPAREN) 
                    self.state = 434
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,74,self._ctx)

                self.state = 438
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,75,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 435
                        self.match(OCLsParser.RBRACE) 
                    self.state = 440
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,75,self._ctx)

                self.state = 442
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,76,self._ctx)
                if la_ == 1:
                    self.state = 441
                    self.expression()


                pass

            elif la_ == 14:
                localctx = OCLsParser.ALLINSTANCESContext(self, localctx)
                self.enterOuterAlt(localctx, 14)
                self.state = 445
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==75:
                    self.state = 444
                    self.match(OCLsParser.Arrow)


                self.state = 447
                self.match(OCLsParser.ALLINSTANCES)
                self.state = 449 
                self._errHandler.sync(self)
                _alt = 1
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt == 1:
                        self.state = 448
                        self.match(OCLsParser.LPAREN)

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

                self.state = 453
                self.expression()
                self.state = 455 
                self._errHandler.sync(self)
                _alt = 1
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt == 1:
                        self.state = 454
                        self.match(OCLsParser.RPAREN)

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

                self.state = 460
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,80,self._ctx)
                if la_ == 1:
                    self.state = 459
                    self.expression()


                pass

            elif la_ == 15:
                localctx = OCLsParser.ORDEREDSETContext(self, localctx)
                self.enterOuterAlt(localctx, 15)
                self.state = 463
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==75:
                    self.state = 462
                    self.match(OCLsParser.Arrow)


                self.state = 468
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==15:
                    self.state = 465
                    self.match(OCLsParser.LPAREN)
                    self.state = 470
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 471
                self.match(OCLsParser.ORDEREDSET)
                self.state = 472
                self.match(OCLsParser.LBRACE)
                self.state = 485
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & 8687441474150769632) != 0) or ((((_la - 72)) & ~0x3f) == 0 and ((1 << (_la - 72)) & 505) != 0):
                    self.state = 474
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,83,self._ctx)
                    if la_ == 1:
                        self.state = 473
                        self.match(OCLsParser.SingleQuote)


                    self.state = 476
                    self.expression()
                    self.state = 478
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,84,self._ctx)
                    if la_ == 1:
                        self.state = 477
                        self.match(OCLsParser.SingleQuote)


                    self.state = 481
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==21:
                        self.state = 480
                        self.match(OCLsParser.COMMA)


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

                self.state = 488
                self.match(OCLsParser.RBRACE)
                self.state = 492
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,87,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 489
                        self.match(OCLsParser.RPAREN) 
                    self.state = 494
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,87,self._ctx)

                self.state = 496
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,88,self._ctx)
                if la_ == 1:
                    self.state = 495
                    self.expression()


                pass

            elif la_ == 16:
                localctx = OCLsParser.SUBORDEREDSETContext(self, localctx)
                self.enterOuterAlt(localctx, 16)
                self.state = 499
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==75:
                    self.state = 498
                    self.match(OCLsParser.Arrow)


                self.state = 504
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==15:
                    self.state = 501
                    self.match(OCLsParser.LPAREN)
                    self.state = 506
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 507
                self.match(OCLsParser.SUBORDEREDSET)
                self.state = 511
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==17:
                    self.state = 508
                    self.match(OCLsParser.LBRACE)
                    self.state = 513
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 517
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,92,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 514
                        self.match(OCLsParser.LPAREN) 
                    self.state = 519
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,92,self._ctx)

                self.state = 532
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,96,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 521
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,93,self._ctx)
                        if la_ == 1:
                            self.state = 520
                            self.match(OCLsParser.SingleQuote)


                        self.state = 523
                        self.expression()
                        self.state = 525
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,94,self._ctx)
                        if la_ == 1:
                            self.state = 524
                            self.match(OCLsParser.SingleQuote)


                        self.state = 528
                        self._errHandler.sync(self)
                        _la = self._input.LA(1)
                        if _la==21:
                            self.state = 527
                            self.match(OCLsParser.COMMA)

                 
                    self.state = 534
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,96,self._ctx)

                self.state = 538
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==18:
                    self.state = 535
                    self.match(OCLsParser.RBRACE)
                    self.state = 540
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 544
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,98,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 541
                        self.match(OCLsParser.RPAREN) 
                    self.state = 546
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,98,self._ctx)

                self.state = 548
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & 8687441474150769632) != 0) or ((((_la - 72)) & ~0x3f) == 0 and ((1 << (_la - 72)) & 505) != 0):
                    self.state = 547
                    self.expression()


                self.state = 550
                self.match(OCLsParser.RPAREN)
                pass

            elif la_ == 17:
                localctx = OCLsParser.SETContext(self, localctx)
                self.enterOuterAlt(localctx, 17)
                self.state = 552
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==75:
                    self.state = 551
                    self.match(OCLsParser.Arrow)


                self.state = 557
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==15:
                    self.state = 554
                    self.match(OCLsParser.LPAREN)
                    self.state = 559
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 560
                self.match(OCLsParser.SET)
                self.state = 564
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,102,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 561
                        self.match(OCLsParser.LPAREN) 
                    self.state = 566
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,102,self._ctx)

                self.state = 570
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==17:
                    self.state = 567
                    self.match(OCLsParser.LBRACE)
                    self.state = 572
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 585
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,107,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 574
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,104,self._ctx)
                        if la_ == 1:
                            self.state = 573
                            self.match(OCLsParser.SingleQuote)


                        self.state = 576
                        self.expression()
                        self.state = 578
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,105,self._ctx)
                        if la_ == 1:
                            self.state = 577
                            self.match(OCLsParser.SingleQuote)


                        self.state = 581
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,106,self._ctx)
                        if la_ == 1:
                            self.state = 580
                            self.match(OCLsParser.COMMA)

                 
                    self.state = 587
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,107,self._ctx)

                self.state = 591
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,108,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 588
                        self.match(OCLsParser.RBRACE) 
                    self.state = 593
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,108,self._ctx)

                self.state = 597
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,109,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 594
                        self.match(OCLsParser.RPAREN) 
                    self.state = 599
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,109,self._ctx)

                self.state = 601
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,110,self._ctx)
                if la_ == 1:
                    self.state = 600
                    self.expression()


                pass

            elif la_ == 18:
                localctx = OCLsParser.BAGContext(self, localctx)
                self.enterOuterAlt(localctx, 18)
                self.state = 604
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==75:
                    self.state = 603
                    self.match(OCLsParser.Arrow)


                self.state = 609
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==15:
                    self.state = 606
                    self.match(OCLsParser.LPAREN)
                    self.state = 611
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 612
                self.match(OCLsParser.BAG)
                self.state = 616
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,113,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 613
                        self.match(OCLsParser.LPAREN) 
                    self.state = 618
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,113,self._ctx)

                self.state = 622
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==17:
                    self.state = 619
                    self.match(OCLsParser.LBRACE)
                    self.state = 624
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 637
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,118,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 626
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,115,self._ctx)
                        if la_ == 1:
                            self.state = 625
                            self.match(OCLsParser.SingleQuote)


                        self.state = 628
                        self.expression()
                        self.state = 630
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,116,self._ctx)
                        if la_ == 1:
                            self.state = 629
                            self.match(OCLsParser.SingleQuote)


                        self.state = 633
                        self._errHandler.sync(self)
                        la_ = self._interp.adaptivePredict(self._input,117,self._ctx)
                        if la_ == 1:
                            self.state = 632
                            self.match(OCLsParser.COMMA)

                 
                    self.state = 639
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,118,self._ctx)

                self.state = 643
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,119,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 640
                        self.match(OCLsParser.RBRACE) 
                    self.state = 645
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,119,self._ctx)

                self.state = 649
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,120,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 646
                        self.match(OCLsParser.RPAREN) 
                    self.state = 651
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,120,self._ctx)

                self.state = 653
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,121,self._ctx)
                if la_ == 1:
                    self.state = 652
                    self.expression()


                pass

            elif la_ == 19:
                localctx = OCLsParser.PREPENDContext(self, localctx)
                self.enterOuterAlt(localctx, 19)
                self.state = 655
                self.match(OCLsParser.Arrow)
                self.state = 656
                self.match(OCLsParser.PREPEND)
                self.state = 658 
                self._errHandler.sync(self)
                _alt = 1
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt == 1:
                        self.state = 657
                        self.match(OCLsParser.LPAREN)

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

                self.state = 674
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & 8687441474150769632) != 0) or ((((_la - 72)) & ~0x3f) == 0 and ((1 << (_la - 72)) & 505) != 0):
                    self.state = 663
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,123,self._ctx)
                    if la_ == 1:
                        self.state = 662
                        self.match(OCLsParser.SingleQuote)


                    self.state = 665
                    self.expression()
                    self.state = 667
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,124,self._ctx)
                    if la_ == 1:
                        self.state = 666
                        self.match(OCLsParser.SingleQuote)


                    self.state = 670
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==21:
                        self.state = 669
                        self.match(OCLsParser.COMMA)


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

                self.state = 678 
                self._errHandler.sync(self)
                _alt = 1
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt == 1:
                        self.state = 677
                        self.match(OCLsParser.RPAREN)

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

                self.state = 683
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,128,self._ctx)
                if la_ == 1:
                    self.state = 682
                    self.expression()


                pass

            elif la_ == 20:
                localctx = OCLsParser.LASTContext(self, localctx)
                self.enterOuterAlt(localctx, 20)
                self.state = 685
                self.match(OCLsParser.Arrow)
                self.state = 686
                self.match(OCLsParser.LAST)
                self.state = 687
                self.match(OCLsParser.LPAREN)
                self.state = 689 
                self._errHandler.sync(self)
                _alt = 1
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt == 1:
                        self.state = 688
                        self.match(OCLsParser.RPAREN)

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

                self.state = 694
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,130,self._ctx)
                if la_ == 1:
                    self.state = 693
                    self.expression()


                pass

            elif la_ == 21:
                localctx = OCLsParser.APPENDContext(self, localctx)
                self.enterOuterAlt(localctx, 21)
                self.state = 696
                self.match(OCLsParser.Arrow)
                self.state = 697
                self.match(OCLsParser.APPEND)
                self.state = 698
                self.match(OCLsParser.LPAREN)
                self.state = 711
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while (((_la) & ~0x3f) == 0 and ((1 << _la) & 8687441474150769632) != 0) or ((((_la - 72)) & ~0x3f) == 0 and ((1 << (_la - 72)) & 505) != 0):
                    self.state = 700
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,131,self._ctx)
                    if la_ == 1:
                        self.state = 699
                        self.match(OCLsParser.SingleQuote)


                    self.state = 702
                    self.expression()
                    self.state = 704
                    self._errHandler.sync(self)
                    la_ = self._interp.adaptivePredict(self._input,132,self._ctx)
                    if la_ == 1:
                        self.state = 703
                        self.match(OCLsParser.SingleQuote)


                    self.state = 707
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==21:
                        self.state = 706
                        self.match(OCLsParser.COMMA)


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

                self.state = 715 
                self._errHandler.sync(self)
                _alt = 1
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt == 1:
                        self.state = 714
                        self.match(OCLsParser.RPAREN)

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

                self.state = 720
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,136,self._ctx)
                if la_ == 1:
                    self.state = 719
                    self.expression()


                pass

            elif la_ == 22:
                localctx = OCLsParser.COLLECTIONContext(self, localctx)
                self.enterOuterAlt(localctx, 22)
                self.state = 723
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==75:
                    self.state = 722
                    self.match(OCLsParser.Arrow)


                self.state = 725
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 960) != 0)):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 726
                self.match(OCLsParser.LPAREN)
                self.state = 735 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while True:
                    self.state = 727
                    self.match(OCLsParser.ID)
                    self.state = 730
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==20:
                        self.state = 728
                        self.match(OCLsParser.COLON)
                        self.state = 729
                        self.match(OCLsParser.ID)


                    self.state = 733
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if _la==21:
                        self.state = 732
                        self.match(OCLsParser.COMMA)


                    self.state = 737 
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if not (_la==77):
                        break

                self.state = 739
                self.match(OCLsParser.PIPE)
                self.state = 740
                self.expression()
                self.state = 741
                self.match(OCLsParser.RPAREN)
                self.state = 743
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,141,self._ctx)
                if la_ == 1:
                    self.state = 742
                    self.expression()


                pass

            elif la_ == 23:
                localctx = OCLsParser.CollectionExpressionVariableContext(self, localctx)
                self.enterOuterAlt(localctx, 23)
                self.state = 746
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==75:
                    self.state = 745
                    self.match(OCLsParser.Arrow)


                self.state = 748
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 960) != 0)):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 749
                self.match(OCLsParser.LPAREN)
                self.state = 750
                self.expression()
                self.state = 751
                self.match(OCLsParser.RPAREN)
                self.state = 753
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,143,self._ctx)
                if la_ == 1:
                    self.state = 752
                    self.expression()


                pass

            elif la_ == 24:
                localctx = OCLsParser.SYMMETRICDIFFERENCEContext(self, localctx)
                self.enterOuterAlt(localctx, 24)
                self.state = 755
                self.match(OCLsParser.Arrow)
                self.state = 756
                self.match(OCLsParser.SYMMETRICDIFFERENCE)
                self.state = 757
                self.match(OCLsParser.LPAREN)
                self.state = 758
                self.expression()
                self.state = 760 
                self._errHandler.sync(self)
                _alt = 1
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt == 1:
                        self.state = 759
                        self.match(OCLsParser.RPAREN)

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

                self.state = 765
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,145,self._ctx)
                if la_ == 1:
                    self.state = 764
                    self.expression()


                pass

            elif la_ == 25:
                localctx = OCLsParser.FIRSTContext(self, localctx)
                self.enterOuterAlt(localctx, 25)
                self.state = 767
                self.match(OCLsParser.Arrow)
                self.state = 768
                self.match(OCLsParser.FIRST)
                self.state = 769
                self.match(OCLsParser.LPAREN)
                self.state = 770
                self.match(OCLsParser.RPAREN)
                self.state = 772
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,146,self._ctx)
                if la_ == 1:
                    self.state = 771
                    self.expression()


                pass

            elif la_ == 26:
                localctx = OCLsParser.DERIVEContext(self, localctx)
                self.enterOuterAlt(localctx, 26)
                self.state = 774
                self.match(OCLsParser.Arrow)
                self.state = 775
                self.match(OCLsParser.DERIVE)
                self.state = 776
                self.match(OCLsParser.LPAREN)
                self.state = 777
                self.match(OCLsParser.RPAREN)
                self.state = 779
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,147,self._ctx)
                if la_ == 1:
                    self.state = 778
                    self.expression()


                pass

            elif la_ == 27:
                localctx = OCLsParser.UNIONContext(self, localctx)
                self.enterOuterAlt(localctx, 27)
                self.state = 781
                self.match(OCLsParser.Arrow)
                self.state = 782
                self.match(OCLsParser.UNION)
                self.state = 783
                self.match(OCLsParser.LPAREN)
                self.state = 784
                self.expression()
                self.state = 785
                self.match(OCLsParser.RPAREN)
                self.state = 787
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,148,self._ctx)
                if la_ == 1:
                    self.state = 786
                    self.expression()


                pass

            elif la_ == 28:
                localctx = OCLsParser.DefExpContext(self, localctx)
                self.enterOuterAlt(localctx, 28)
                self.state = 789
                self.match(OCLsParser.Def)
                self.state = 790
                self.match(OCLsParser.COLON)
                self.state = 791
                self.expression()
                pass

            elif la_ == 29:
                localctx = OCLsParser.DefIDAssignmentexpressionContext(self, localctx)
                self.enterOuterAlt(localctx, 29)
                self.state = 792
                self.match(OCLsParser.ID)
                self.state = 793
                self.match(OCLsParser.COLON)
                self.state = 794
                self.match(OCLsParser.ID)
                self.state = 795
                self.match(OCLsParser.EQUAL)
                self.state = 796
                self.expression()
                pass

            elif la_ == 30:
                localctx = OCLsParser.PrimaryExpContext(self, localctx)
                self.enterOuterAlt(localctx, 30)
                self.state = 800
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,149,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 797
                        self.match(OCLsParser.LPAREN) 
                    self.state = 802
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,149,self._ctx)

                self.state = 804
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,150,self._ctx)
                if la_ == 1:
                    self.state = 803
                    self.primaryExpression()


                self.state = 810
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,151,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 806
                        self.match(OCLsParser.DOT)
                        self.state = 807
                        self.match(OCLsParser.ID) 
                    self.state = 812
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,151,self._ctx)

                self.state = 814
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if (((_la) & ~0x3f) == 0 and ((1 << _la) & 4435386965164032) != 0):
                    self.state = 813
                    self.operator()


                self.state = 817
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==5 or _la==15 or ((((_la - 72)) & ~0x3f) == 0 and ((1 << (_la - 72)) & 481) != 0):
                    self.state = 816
                    self.primaryExpression()


                self.state = 821 
                self._errHandler.sync(self)
                _alt = 1
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt == 1:
                        self.state = 819
                        self.match(OCLsParser.DOT)
                        self.state = 820
                        self.match(OCLsParser.ID)

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

                self.state = 826
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,155,self._ctx)
                if la_ == 1:
                    self.state = 825
                    self.expression()


                pass

            elif la_ == 31:
                localctx = OCLsParser.FuncCallContext(self, localctx)
                self.enterOuterAlt(localctx, 31)
                self.state = 828
                self.primaryExpression()
                self.state = 832
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==22:
                    self.state = 829
                    self.match(OCLsParser.DOT)
                    self.state = 834
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 838
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,157,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 835
                        self.match(OCLsParser.ID) 
                    self.state = 840
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,157,self._ctx)

                self.state = 841
                self.functionCall()
                self.state = 843
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,158,self._ctx)
                if la_ == 1:
                    self.state = 842
                    self.operator()


                self.state = 846
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,159,self._ctx)
                if la_ == 1:
                    self.state = 845
                    self.expression()


                pass

            elif la_ == 32:
                localctx = OCLsParser.OpContext(self, localctx)
                self.enterOuterAlt(localctx, 32)
                self.state = 848
                self.operator()
                self.state = 850
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,160,self._ctx)
                if la_ == 1:
                    self.state = 849
                    self.numberORUserDefined()


                pass

            elif la_ == 33:
                localctx = OCLsParser.ArrowexpContext(self, localctx)
                self.enterOuterAlt(localctx, 33)
                self.state = 852
                self.match(OCLsParser.Arrow)
                self.state = 853
                self.expression()
                pass

            elif la_ == 34:
                localctx = OCLsParser.NumberContext(self, localctx)
                self.enterOuterAlt(localctx, 34)
                self.state = 854
                self.match(OCLsParser.NUMBER)
                self.state = 856
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,161,self._ctx)
                if la_ == 1:
                    self.state = 855
                    self.expression()


                pass

            elif la_ == 35:
                localctx = OCLsParser.PredefinedfunctionCallContext(self, localctx)
                self.enterOuterAlt(localctx, 35)
                self.state = 859
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==75:
                    self.state = 858
                    self.match(OCLsParser.Arrow)


                self.state = 861
                self.functionCall()
                self.state = 863
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,163,self._ctx)
                if la_ == 1:
                    self.state = 862
                    self.expression()


                pass

            elif la_ == 36:
                localctx = OCLsParser.IDContext(self, localctx)
                self.enterOuterAlt(localctx, 36)
                self.state = 865
                self.primaryExpression()
                self.state = 867
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,164,self._ctx)
                if la_ == 1:
                    self.state = 866
                    self.expression()


                pass

            elif la_ == 37:
                localctx = OCLsParser.SingleQuoteExpContext(self, localctx)
                self.enterOuterAlt(localctx, 37)
                self.state = 869
                self.match(OCLsParser.SingleQuote)
                self.state = 870
                self.expression()
                self.state = 872
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==22:
                    self.state = 871
                    self.match(OCLsParser.DOT)


                self.state = 874
                self.match(OCLsParser.SingleQuote)
                self.state = 876
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,166,self._ctx)
                if la_ == 1:
                    self.state = 875
                    self.match(OCLsParser.DOT)


                self.state = 879
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,167,self._ctx)
                if la_ == 1:
                    self.state = 878
                    self.expression()


                pass

            elif la_ == 38:
                localctx = OCLsParser.DoubleDotsContext(self, localctx)
                self.enterOuterAlt(localctx, 38)
                self.state = 881
                self.match(OCLsParser.DoubleDots)
                self.state = 882
                self.expression()
                pass


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


    class BinaryExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

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

        def operator(self):
            return self.getTypedRuleContext(OCLsParser.OperatorContext,0)


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

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

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

        def primaryExpression(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(OCLsParser.PrimaryExpressionContext)
            else:
                return self.getTypedRuleContext(OCLsParser.PrimaryExpressionContext,i)


        def getRuleIndex(self):
            return OCLsParser.RULE_binaryExpression

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

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




    def binaryExpression(self):

        localctx = OCLsParser.BinaryExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_binaryExpression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 894
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,170,self._ctx)
            if la_ == 1:
                self.state = 885
                self.primaryExpression()
                self.state = 890
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,169,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 886
                        self.match(OCLsParser.DOT)
                        self.state = 887
                        self.match(OCLsParser.ID) 
                    self.state = 892
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,169,self._ctx)

                pass

            elif la_ == 2:
                self.state = 893
                self.match(OCLsParser.NUMBER)
                pass


            self.state = 900
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==22:
                self.state = 896
                self.match(OCLsParser.DOT)
                self.state = 897
                self.match(OCLsParser.ID)
                self.state = 902
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 903
            self.operator()
            self.state = 913
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,173,self._ctx)
            if la_ == 1:
                self.state = 904
                self.primaryExpression()
                self.state = 909
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,172,self._ctx)
                while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                    if _alt==1:
                        self.state = 905
                        self.match(OCLsParser.DOT)
                        self.state = 906
                        self.match(OCLsParser.ID) 
                    self.state = 911
                    self._errHandler.sync(self)
                    _alt = self._interp.adaptivePredict(self._input,172,self._ctx)

                pass

            elif la_ == 2:
                self.state = 912
                self.match(OCLsParser.NUMBER)
                pass


        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 expression(self):
            return self.getTypedRuleContext(OCLsParser.ExpressionContext,0)


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

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

        def getRuleIndex(self):
            return OCLsParser.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 = OCLsParser.UnaryExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_unaryExpression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 915
            _la = self._input.LA(1)
            if not(_la==35 or _la==46):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
            self.state = 916
            self.expression()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class OperatorContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def NOTEQUAL(self):
            return self.getToken(OCLsParser.NOTEQUAL, 0)

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

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

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

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

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

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

        def EMPTYSTRING(self):
            return self.getToken(OCLsParser.EMPTYSTRING, 0)

        def Divide(self):
            return self.getToken(OCLsParser.Divide, 0)

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

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

        def XOR(self):
            return self.getToken(OCLsParser.XOR, 0)

        def IMPLIES(self):
            return self.getToken(OCLsParser.IMPLIES, 0)

        def getRuleIndex(self):
            return OCLsParser.RULE_operator

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

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




    def operator(self):

        localctx = OCLsParser.OperatorContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_operator)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 918
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 4435386965164032) != 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 NumberORUserDefinedContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

        def ID(self):
            return self.getToken(OCLsParser.ID, 0)

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

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

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

        def getRuleIndex(self):
            return OCLsParser.RULE_numberORUserDefined

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

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




    def numberORUserDefined(self):

        localctx = OCLsParser.NumberORUserDefinedContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_numberORUserDefined)
        self._la = 0 # Token type
        try:
            self.state = 934
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [78]:
                self.enterOuterAlt(localctx, 1)
                self.state = 920
                self.match(OCLsParser.NUMBER)
                pass
            elif token in [24, 77]:
                self.enterOuterAlt(localctx, 2)
                self.state = 922
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==24:
                    self.state = 921
                    self.match(OCLsParser.SingleQuote)


                self.state = 924
                self.match(OCLsParser.ID)
                self.state = 926
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,175,self._ctx)
                if la_ == 1:
                    self.state = 925
                    self.match(OCLsParser.LPAREN)


                self.state = 929
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,176,self._ctx)
                if la_ == 1:
                    self.state = 928
                    self.match(OCLsParser.RPAREN)


                self.state = 932
                self._errHandler.sync(self)
                la_ = self._interp.adaptivePredict(self._input,177,self._ctx)
                if la_ == 1:
                    self.state = 931
                    self.match(OCLsParser.SingleQuote)


                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 literal(self):
            return self.getTypedRuleContext(OCLsParser.LiteralContext,0)


        def SELF(self):
            return self.getToken(OCLsParser.SELF, 0)

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


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

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


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

        def ID(self):
            return self.getToken(OCLsParser.ID, 0)

        def getRuleIndex(self):
            return OCLsParser.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 = OCLsParser.PrimaryExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_primaryExpression)
        try:
            self.state = 944
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,179,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 936
                self.literal()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 937
                self.match(OCLsParser.SELF)
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 938
                self.functionCall()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 939
                self.match(OCLsParser.LPAREN)
                self.state = 940
                self.expression()
                self.state = 941
                self.match(OCLsParser.RPAREN)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 943
                self.match(OCLsParser.ID)
                pass


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


    class LiteralContext(ParserRuleContext):
        __slots__ = 'parser'

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

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

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

        def BOOLEAN_LITERAL(self):
            return self.getToken(OCLsParser.BOOLEAN_LITERAL, 0)

        def NULL(self):
            return self.getToken(OCLsParser.NULL, 0)

        def getRuleIndex(self):
            return OCLsParser.RULE_literal

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

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




    def literal(self):

        localctx = OCLsParser.LiteralContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_literal)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 946
            _la = self._input.LA(1)
            if not(((((_la - 72)) & ~0x3f) == 0 and ((1 << (_la - 72)) & 449) != 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





